-
Notifications
You must be signed in to change notification settings - Fork 896
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
govc: Handle powered-on VMs in vm.destroy #2532
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @embano1 . We could check the power state of the VM(s) and only power off those that are poweredOn
.
If we want the flag option, can we name it -off
(same as vm.power's flag) and default to true
?
Thx Doug, sounds like a reasonable change to me. |
Hello, |
@Petrapana just back from PTO and hope to finish this by EOW |
Closes: vmware#2529 Signed-off-by: Michael Gasch <mgasch@vmware.com>
@dougm made changes as per your comment, no additional flag needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @embano1
With PR vmware#2532 , vm.destroy was returning after the 1st VM was destroyed.
With PR vmware#2532 , vm.destroy was returning after the 1st VM was destroyed.
With PR vmware#2532 , vm.destroy was returning after the 1st VM was destroyed.
Description
govc vm.destroy
might throw error in vCenter UI/task log if the vm to be destroyed is already powered off. This non-breaking change checks the power state of a VM, and if it is powered on a power off attempt will be performed.Closes: #2529
Signed-off-by: Michael Gasch mgasch@vmware.com
Type of change
Please mark options that are relevant:
not work as expected)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. If applicable, please also list any relevant
details for your test configuration.
Test Configuration:
Checklist:
this project