Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic host volumes: monitor readiness from CLI #24528

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

tgross
Copy link
Member

@tgross tgross commented Nov 21, 2024

When creating a dynamic host volumes, set up an optional monitor that waits for the node to fingerprint the volume as healthy.

Ref: #24479


Example of use:

$ nomad volume create ./demo/hostvolume/host.volume.hcl
==> Created host volume test with ID 5d680e11-914b-baba-6567-debf2a763ef8
  ⠙ Monitoring volume "5d680e11" in progress...
    2024-11-21T12:15:53-05:00
    ID        = 5d680e11-914b-baba-6567-debf2a763ef8
    Name      = test
    Namespace = default
    Plugin ID = example-host-volume
    Node ID   = 3e4cb984-1903-d68a-59c8-6e3855b59642
    Node Pool = default
    Capacity  = 47 MiB
    State     = pending
    Host Path = /run/nomad/dev/alloc_mounts/5d680e11-914b-baba-6567-debf2a763ef8

@@ -94,7 +94,7 @@ case "$1" in
create_volume "$host_path" "$CAPACITY_MIN_BYTES"
# output what Nomad expects
bytes="$(stat --format='%s' "$host_path.ext4")"
printf '{"path": "%s", "bytes": %s}' "$host_path", "$bytes"
printf '{"path": "%s", "bytes": %s}' "$host_path" "$bytes"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a trailing , that was being left in the host path.

When creating a dynamic host volumes, set up an optional monitor that waits for
the node to fingerprint the volume as healthy.

Ref: #24479
Copy link
Contributor

@pkazmierczak pkazmierczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgross tgross merged commit 5ace43c into dynamic-host-volumes Nov 22, 2024
18 checks passed
@tgross tgross deleted the dhv-cli-monitoring branch November 22, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants