Hello every one, I had some trouble with the :destroy action:
Versions:
Version of Chef-Provisioning: 2.5.0
Version of Chef-Provisioning-vSphere: 2.0.6, and several previous versions
Platform Details
Version of vSphere/vCenter: Version 6.0.0 Build 2997665
Version of ESXi: 5.5
Scenario:
Trying to delete some virtual machines after a failed deployment. The VM where just cloned from a template and never powered on (that's an other problem), but the destroy action fails.
Steps to Reproduce:
Try to destroy a powered off VM that was deployed with chef provisioning
Expected Result:
The VM is destroyed
Actual Result:
The chef-client run fails.
The error I get:
RbVmomi::Fault: InvalidPowerState: The attempted operation cannot be performed in the current state (Powered off)
Seems that the gem is trying to power off the VM before deleting it, but doesn't rescue the RbVmomi error saying it's already off.
Possible resolution
Either catch the exception in the destroy action, or in the stop_vm function, or check that the VM is not off before trying to stop it.
Hello every one, I had some trouble with the :destroy action:
Versions:
Platform Details
Scenario:
Trying to delete some virtual machines after a failed deployment. The VM where just cloned from a template and never powered on (that's an other problem), but the destroy action fails.
Steps to Reproduce:
Try to destroy a powered off VM that was deployed with chef provisioning
Expected Result:
The VM is destroyed
Actual Result:
The chef-client run fails.
The error I get:
RbVmomi::Fault: InvalidPowerState: The attempted operation cannot be performed in the current state (Powered off)
Seems that the gem is trying to power off the VM before deleting it, but doesn't rescue the RbVmomi error saying it's already off.Possible resolution
Either catch the exception in the destroy action, or in the stop_vm function, or check that the VM is not off before trying to stop it.