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

Ability to kitchen destroy powered off VM #106

Open
martinmosegaard opened this issue Mar 24, 2017 · 0 comments
Open

Ability to kitchen destroy powered off VM #106

martinmosegaard opened this issue Mar 24, 2017 · 0 comments

Comments

@martinmosegaard
Copy link

martinmosegaard commented Mar 24, 2017

I ran a kitchen command to destroy a VM like so:

set KITCHEN_YAML=.kitchen.vsphere.yml && kitchen destroy

with an error message:

>>>>>>     Failed to complete #destroy action: [InvalidPowerState: 
The attempted operation cannot be performed in the current state (Powered off).] 
on name-of-the-vm

It seemed to fail trying to power off a VM that was already powered off (I am guessing, I don't have the logs). I am not sure why it happened. But in any case, if someone outside powered off the VM, it would be great if the script would just continue to destroy the VM in case it was already powered off.

Should be rather simple to fix: Before doing a power off operation, check if vm.summary.runtime.powerState is poweredOff.

I will be happy to take a look at some point.

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

No branches or pull requests

1 participant