Close

Power ON vm issue on vCloud Director

In this article, I will guide you through the steps to resolve the power on vm issue on the vCloud Director

Symptoms:

Migration fails when it is carried out from cluster/resourcepool A to cluster/resourcepool B or vice versa .

Cause:

This issue is caused due to incorrect/stale resourcepool reference in the provider VDC table.

Resolution:

Warning: A backup of the Cloud Director database must be taken before attempting to make any changes to it directly. For appliance-based setup

SSH to the primary VCD cell, login as a root

connect to database ‘su – postgres’

Locate the VM ID in vCD or vCenter, and use the following command to check the deployment status of the VM.

run following command to

select
vvm.name,
cvm.id,
cvm.computehub_id,
vrp_rp.computehub_id,
cvm.vrp_id,
vrp_rp.vrp_id
from vapp_vm vvm
inner join computevm cvm on cvm.id = vvm.cvm_id
inner join vm_inv vmi on vmi.moref = cvm.vmmoref
inner join vrp_rp on vrp_rp.sub_rp_moref = vmi.resource_pool_moref
where cvm.computehub_id != vrp_rp.computehub_id or cvm.vrp_id !=vrp_rp.vrp_id;

The command will display all VMs with incorrect or stale resource pool references in the Provider VDC table.

Run the following command to resolve the issue properly.

select
'update computevm set vrp_id = ' || '''' || vrp_rp.vrp_id || '''' ||',computehub_id = ' || '''' || vrp_rp.computehub_id || '''' || ' where id = ' || '''' || cvm.id || '''' || ';'
from vapp_vm vvm
inner join computevm cvm on cvm.id = vvm.cvm_id
inner join vm_inv vmi on vmi.moref = cvm.vmmoref
inner join vrp_rp on vrp_rp.sub_rp_moref = vmi.resource_pool_moref
where cvm.computehub_id != vrp_rp.computehub_id or cvm.vrp_id !=vrp_rp.vrp_id;

copy and paste the output to update the value in the database.

once the value is updated you should be able to power on VM in the VCD again.

I hope this article has been informative. thank you for reading.