Unable to delete VM - The requested operation could not be executed on vApp
Summary
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.”
Cause
When a standalone VM is undeployed during a Power Off operation its network is not undeployed.
The standalone VMs hidden vApp cannot be deleted until this network is undeployed.
Conditions
The standalone VM is already in a Powered Off state.
The standalone VM is connected to a network.
Solution
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.