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

allow disk update on previously created VM #64

Closed
treywelsh opened this issue Oct 9, 2020 · 1 comment
Closed

allow disk update on previously created VM #64

treywelsh opened this issue Oct 9, 2020 · 1 comment
Assignees
Milestone

Comments

@treywelsh
Copy link
Collaborator

treywelsh commented Oct 9, 2020

Allow to attach/detach disks to a running/poweroff VM.

The implementation take the decision based on the comparison of the image_id argument between the new disks configured, and the disks in the terraform state.

Operations are done in this order:

  1. If an image_id is found in the state, but not in the new config, it's considered as attached, thus, the disk will be detached based on the disk_id attribute (which is the disk number)
  2. If an image_id is find in the new config, but not in state, this image ID will be attached

Between each operations, wait on the state to be back on Running/poweroff again, and check disk presence (attach method is async)

These are the states from which it's possible to call attach/detach actions.
So, by the way I updated and refactored the method to wait on VM state, and for consistency, the method to wait on image state.

PR: #59

Feel free to drop a comment if you see some problem with this behavior

@treywelsh
Copy link
Collaborator Author

PR #59 merged.

Side note: later work related to issue #71 may conflict with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants