Recovering vCloud Director from disabled DRS on a vCenter Cluster

When you disable DRS on a vCenter cluster all resource pools in the cluster are deleted.  When vCloud is managing a vCenter cluster it creates various resource pools to store its VMs in, and if the vCenter resource pools are deleted, vCloud will be unable to manage its VMs.  In this article I’m going to how to recover from disabling DRS on a vCloud controlled vCenter cluster.   The best way to recover from this issue is to restore the vCenter & vCloud databases to the same point in time.  The problem with this is that you lose any information since the backups and may be left with VMs on the hosts that vCloud and vCenter don’t know about.  I believe that VMware also has a tool that can fix this issue so I’d call them as well.  This post is more informational and to reference if you’re all of of options.  Since we will be editing the vCloud database in this post, please make sure you back it up before proceeding.

vCloud / vCenter Configuration

I have a single org vDC named ‘admin-payg’.


Here is the view from vCenter.


Inspecting the databases

Now I’m going to query the vCenter and vCloud databases to show the current data.

vCenter is vc55a

vCloud is vcd55b

Let’s look at vCenter first.

Display vCenter’s resource pools

use vc55a select * from VPX_entity where TYPE_ID = 4

The id column contains the resource pool moref so the moref of the admin-payg resource pool is 302.  Keep this in mind.

Now we will look at vCloud’s database.

Display all org vDCs and their related vCenter resource pool

use vcd55b select namesub_rp_moref from org_prov_vdc

We see that the vCloud org vDC ‘admin-payg’ is mapped to a vCenter resource pool with a moref of 302.

Display the vCloud vApps, their vCloud org vDC and the moref of the underlying resource pool

use vcd55b select ,, org_prov_vdc.sub_rp_moref from vm_container, org_prov_vdc where vm_container.org_vdc_id =

We can see that our Linux-Minimal vApp is in the admin-payg org vDC and that org vDC’s resource pool.

Display org vDC resource pools and their morefs from the vrp_rp table

use vcd55b select name, sub_rp_moref from vrp, vrp_rp where vrp_rp.vrp_id =

Disabling DRS on the cluster



Starting with vCenter 5.1, you can now save resource pool trees.  See Retaining resource pools when disabling VMware DRS clusters for more info.

When we disable DRS, save the resource pool snapshot.


After DRS has been disabled you can see that there are no resource pools in the cluster.


If we try to power the vApp on in vCloud, we get:


Restoring the resource pool

Turn DRS back on and then perform the following:


Select the resource pool tree snapshot and upload it.

Inspecting the databases after the resource pool tree has been restored

use vc55a select * from VPX_entity where TYPE_ID = 4


Remember earlier that the ‘admin-payg’ resource pool had a moref of 302?  Now it’s 307 and vCloud will be confused by this.

Here are a few queries and their results.

use vc55a select * from VPX_entity where TYPE_ID = 4
use vcd55b select name, sub_rp_moref from org_prov_vdc
use vcd55b select name, sub_rp_moref from vrp, vrp_rp where vrp_rp.vrp_id =
use vcd55b select,, org_prov_vdc.sub_rp_moref from vm_container, org_prov_vdc where vm_container.org_vdc_id =
use vcd55b select name, sub_rp_moref from org_prov_vdc


 Getting vCloud back in sync with vCenter

From the queries above we can see that vCenter has our ‘admin-payg’ resource pool moref as 307 while vCloud still thinks it’s 302.  We need to update the following tables with the new moref of 307:


update vrp_rp set sub_rp_moref = ‘307’ where sub_rp_moref = ‘302’

update org_prov_vdc set sub_rp_moref = ‘307’ where sub_rp_moref = ‘302’

After these tables have been update vCloud will be able to manage the VMs in these resource pools.