Hi,
I am trying to powerOff vApp using vCloud rest API.
When hit the vApp power Off URI (https://vcd_ip/api/vApp/vapp-vapp_key/power/action/powerOff)
vApp status become Partially Running and VM status become partially powered Off .
As we do same operation from vCD UI we get expected result ( vApp status - Stopped , VM status - powered Off ).
Am I doing anything wrong ??
Hi,
The both operations are different (and are easily confused since the names match):
- executing PowerOff from the UI is actually executing undeploy operation (powers off the VMs and releases the networking resources)
- executing PowerOff from the API is only powering off the VMs but the vApp is still deployed
If you want to achieve the same result from the API you have to execute /action/undeploy operation on the vApp.
Regards,
Todor Todorov
Todor is correct!
Make sure that you include in the body of your call to powerOff as well.
<UndeployVAppParams
xmlns=""http://www.vmware.com/vcloud/v1.5"">
<UndeployPowerAction>powerOff</UndeployPowerAction>
</UndeployVAppParams>
/api/vApp/{vAppId}/action/undeploy
This will return a task so make sure you check the task for completion.