Our vCD 9.5.0.1 environment is still rather basic as far as customers are concerned, and all VMs are automatically discovered by adding them to the appropriate Org VDC resource pool in vCenter.
One import failed, with the error:
The operation could not be performed because the object is in an invalid state.
vCenter Server task (moref: task-5205193) failed in vCenter Server 'vcenter.razorblue.net.uk' (bfa93e99-ff0e-4ec7-86c2-60306f038e67).
- The operation is not allowed in the current state.
This is also the same error on the task in vCenter. I cleaned up the Discovered vApp by removing permissions from the VM for the vCD service account per Tom Fojta's blog and simply deleting the vApp, which appears to have left the VM in a somewhat stale state as far as vCD is concerned.
When running debug-auto-import in the cell-management-tool I am advised:
1) Virtual machine is already imported in vCD or is managed by vCD.
2) Virtual machine is not present in a vCD managed resource pool.
The second point only shows up when the VM is not a member of the resource pool, after I've manually moved it back to the cluster root. The first point remains whether it is part of the resource pool or not.
The vcloud-container-debug.log shows:
2019-03-12 15:33:32,335 | WARN | VC-bfa93e99-ff0e-4ec7-86c2-60306f038e67Listener (948) | ComputeFabricImpl | Resource-Pool change of VM [vcId=bfa93e99-ff0e-4ec7-86c2-60306f038e67, moref=vm-152522] from [vcId=bfa93e99-ff0e-4ec7-86c2-60306f038e67, moref=resgroup-86937] to [vcId=bfa93e99-ff0e-4ec7-86c2-60306f038e67, moref=resgroup-929496] in VC is not supported because the source and destination resource pools are not part of same elastic PVDC |
...however I'm not sure I actually want to make them part of the elastic PVDC, given resgroup-86937 is the "Resources" pool of the cluster and resgroup-929496 is the Org VDC pool
Can anybody advise how to clean up the VM from VCD, given it is currently not part of a vApp? Presumably I need to edit the database to remove references of the VM (which I can do comfortably, given instructions), but trying to piece together various blogs online relating to changing morefs etc is proving challenging!
Many thanks