Skip to content

host volumes: -force flag for delete #25902

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

Merged
merged 1 commit into from
May 21, 2025
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented May 20, 2025

When a node is garbage collected, we leave behind the dynamic host volume in the state store. We generally don't want to automatically garbage collect the volumes and risk data loss (see also #25903), but we should allow these to be removed via the API.

Fixes: #25762
Fixes: https://hashicorp.atlassian.net/browse/NMD-705
Ref: #25903

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

When a node is garbage collected, we leave behind the dynamic host volume in the
state store. We don't want to automatically garbage collect the volumes and risk
data loss, but we should allow these to be removed via the API.

Fixes: #25762
Fixes: https://hashicorp.atlassian.net/browse/NMD-705
@tgross tgross force-pushed the NMD705-host-volume-force-delete branch from 174cff2 to 9624d22 Compare May 20, 2025 14:30
@tgross tgross added this to the 1.10.x milestone May 20, 2025
tgross added a commit that referenced this pull request May 20, 2025
When a node is garbage collected, any dynamic host volumes on the node are
orphaned in the state store. We generally don't want to automatically collect
these volumes and risk data loss, and have provided a CLI flag to `-force`
remove them in #25902. But for clusters running on ephemeral cloud
instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add
excessive friction. Add a configuration knob to the client configuration to
remove host volumes from the state store on node GC.

Ref: #25902
Ref: #25762
Ref: https://hashicorp.atlassian.net/browse/NMD-705
tgross added a commit that referenced this pull request May 20, 2025
When a node is garbage collected, any dynamic host volumes on the node are
orphaned in the state store. We generally don't want to automatically collect
these volumes and risk data loss, and have provided a CLI flag to `-force`
remove them in #25902. But for clusters running on ephemeral cloud
instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add
excessive friction. Add a configuration knob to the client configuration to
remove host volumes from the state store on node GC.

Ref: #25902
Ref: #25762
Ref: https://hashicorp.atlassian.net/browse/NMD-705
tgross added a commit that referenced this pull request May 20, 2025
When a node is garbage collected, any dynamic host volumes on the node are
orphaned in the state store. We generally don't want to automatically collect
these volumes and risk data loss, and have provided a CLI flag to `-force`
remove them in #25902. But for clusters running on ephemeral cloud
instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add
excessive friction. Add a configuration knob to the client configuration to
remove host volumes from the state store on node GC.

Ref: #25902
Ref: #25762
Ref: https://hashicorp.atlassian.net/browse/NMD-705
@tgross tgross marked this pull request as ready for review May 20, 2025 15:01
@tgross tgross requested review from a team as code owners May 20, 2025 15:01
@tgross tgross requested review from gulducat and pkazmierczak May 20, 2025 15:01
Copy link
Contributor

@aimeeu aimeeu left a comment

Choose a reason for hiding this comment

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

Thanks for updating the docs!

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 41cf1b0 into main May 21, 2025
39 checks passed
@tgross tgross deleted the NMD705-host-volume-force-delete branch May 21, 2025 12:55
@aimeeu aimeeu added the theme/docs Documentation issues and enhancements label May 21, 2025
tgross added a commit that referenced this pull request May 21, 2025
When a node is garbage collected, any dynamic host volumes on the node are
orphaned in the state store. We generally don't want to automatically collect
these volumes and risk data loss, and have provided a CLI flag to `-force`
remove them in #25902. But for clusters running on ephemeral cloud
instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add
excessive friction. Add a configuration knob to the client configuration to
remove host volumes from the state store on node GC.

Ref: #25902
Ref: #25762
Ref: https://hashicorp.atlassian.net/browse/NMD-705
tgross added a commit that referenced this pull request May 27, 2025
When a node is garbage collected, any dynamic host volumes on the node are
orphaned in the state store. We generally don't want to automatically collect
these volumes and risk data loss, and have provided a CLI flag to `-force`
remove them in #25902. But for clusters running on ephemeral cloud
instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add
excessive friction. Add a configuration knob to the client configuration to
remove host volumes from the state store on node GC.

Ref: #25902
Ref: #25762
Ref: https://hashicorp.atlassian.net/browse/NMD-705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.10.x backport to 1.10.x release line theme/docs Documentation issues and enhancements theme/storage type/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to delete Dynamic Host Volumes from removed hosts
3 participants