When trying to delete a VM you could encounter the following error message:
[ ------------------ ] The requested operation could not be executed on vApp "vApp-Name". Stop the vApp and try again.
As described by VMware:
“When a standalone VM is undeployed during a Power Off operation its network is not undeployed in Cloud Director 10.2.2.
The standalone VMs hidden vApp cannot be deleted until this network is undeployed.“
The standalone VM is already in a Powered Off state.
The standalone VM is connected to a network.
To workaround 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:
From the Tenant UI of Cloud Director navigate to the Datacenters > Compute > Virtual Machines view and locate the affected standalone VM.
Click Actions menu for the affected VM and select Convert to vApp.
Complete the instructions to save the standalone VM as a vApp.
Locate the newly created vApp in the Datacenters > Compute > vApps view.
Power Off the vApp to completely undeploy it and then Delete the vApp to remove both it and the VM within.