Unknown
state in the VCD UI.Standalone VMs in VCD have an automatically generated hidden vApp which is not visible in the VCD UI.
When a Standalone VM is powered off the hidden vApp should also be automatically powered off.
In some scenarios it is possible that the standalone VM will enter a powered off state but the hidden vApp stays powered on.
This will block the delete operation and generate the error above asking for the vApp to be powered off first.
To resolve this issue, the affected standalone VM can be converted to a vApp so that it can be completely undeployed and deleted.
Example steps would be as follows:
Unknown
" state.https://<vcd_address>/tenant/<org_name>/vdc/<orgvdc_id>/vm/vm-########-####-####-####-########01ab/general
vm-########-####-####-####-########01ab
GET https://<vcd_address>/api/vApp/vm-########-####-####-####-########01ab
Request Headers:Accept: application/*+xml;version=<vcd_api_version>
Authorization: Bearer <vcd_auth_token>
<Link rel="up" href="https://<vcd_address>/api/vApp/vapp-########-####-####-####-########23cd" type="application/vnd.vmware.vcloud.vApp+xml"/>
https://<vcd_address>/api/vApp/vapp-########-####-####-####-########23cd
GET https://<vcd_address>/api/vApp/vapp-########-####-####-####-########23cd
Request Headers:Accept: application/*+xml;version=<vcd_api_version>
Authorization: Bearer <vcd_auth_token>
POST https://<vcd_address>/api/vApp/vapp-########-####-####-####-########23cd/power/action/powerOff
Accept: application/*+xml;version=<vcd_api_version>
Authorization: Bearer <vcd_auth_token>
Content-Type:application/*+xml
<root:UndeployVAppParams xmlns:root="http://www.vmware.com/vcloud/v1.5">
<root:UndeployPowerAction>powerOff</root:UndeployPowerAction>
</root:UndeployVAppParams>