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

detach disks on instance delete #1068

Merged
merged 1 commit into from
May 16, 2022

Conversation

jmpesp
Copy link
Contributor

@jmpesp jmpesp commented May 13, 2022

lookup all disks attached to an instance during instance delete, and
detach them before the instance is been deleted.

fixes #1031

lookup all disks attached to an instance during instance delete, and
detach them before the instance is been deleted.

fixes oxidecomputer#1031
Copy link
Contributor

@plotnick plotnick left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for fixing this! I also verified that it works correctly in my full test environment.


// Detach all attached disks
let disks = self
.instance_list_disks(
Copy link
Contributor

@plotnick plotnick May 14, 2022

Choose a reason for hiding this comment

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

I think this may be subject to a race condition: disks could be attached between when they're listed and when they're detached, which would leave those new attachments wedged. Fixing that would require more invasive surgery, and I don't think it should block this PR from merging. It might be worth a TODO, though.

@jmpesp jmpesp merged commit e2c5d84 into oxidecomputer:main May 16, 2022
@jmpesp jmpesp deleted the detach_disks_on_instance_delete branch May 19, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting an instance should detach disks
2 participants