vCloud Error: Could not find object with moref “vm-xxx” and VC ID “xxx-xxx-xxx-xxx-xxx” in inventory category “VirtualMachine”
I experienced an issue with a user VM after power cycling our DataCenter this past weekend due to electrical work being done at our building. There were a few one-off issues, but one in particular took some digging to fix. Upon powering on of a vApp VM, vCloud threw the following error in the GUI:
Could not find object with moref “vm-62140” and VC ID “d04207f3-41ef-47be-bc3c-9d233dc167f6” in inventory category “VirtualMachine”
I found a post here that helped me a bit but didn’t have all the information I needed to fix the problem.
Resolution:
vCloud error: Could not find object with moref “vm-62140” and VC ID “d04207f3-41ef-47be-bc3c-9d233dc167f6” in inventory category “VirtualMachine”.
First, I had to figure out the current values that the VM was using in the DB by looking up the vm in the ‘vm’ table. Knowing the VM name from vCloud, I ran the following query:
select * from vm where name like '%AVSVR02-DGCTX%'
This resulted in the following:
Finding that the newly assigned ‘moref’ value was ‘vm-85352’, following Chris Greene’s post, I ran the following queries to update the ‘computevm’ and ‘networked_vm’ tables with the new vmmoref/moref value:
update computevm set vmmoref = 'vm-85352' where vmmoref = 'vm-62140' update networked_vm set moref = 'vm-85352' where moref = 'vm-62140'
Prior to updating, I ran the following to check that db had incorrect values:
select * from computevm where vmmoref = 'vm-62140' select * from networked_vm where moref = 'vm-62140'
[…] vCloud Error: Could not find object with moref “vm-xxx” and VC ID “xxx-xxx-xxx-xxx… […]