Skip to main content

Remember to save your resource pool tree

One of the things that you could lose when you disable DRS for a cluster is your resource pool trees and the settings your resource pools (Memory/CPU reservations etc). Settings such as anti-affinity/affinity, DRS automation level are not included.

With so much automation taking place nowadays it is very easy to script something to enable or disable DRS via PowerCLI. A simple line like this 

To turn OFF DRS :
Get-Cluster -Name "cluster" | Set-Cluster -DrsEnabled:$false

To turn ON DRS :
Get-Cluster -Name "cluster" | Set-Cluster -DrsEnabled:$true

One thing I noticed with this PowerCLI command is that it does not give you an option to save/export your resource pool tree structure and settings. I have seen people asking in VMTN how to use script to export your settings to a CSV file and there are plenty of ways.

I am going to walk through how to backup and restore your resource pool tree via the HTML 5 client and assuming you have set up a cluster already and DRS is enabled
  • Log on vCenter via the html client
  • Highlight your cluster name and expand on it. With my example you can see that I have two host and two resource pools. I have one VM under Test Resource and a second resource pool called Test Resource 1. On the right-hand side of the window you will see the settings for your cluster. Select the Configure tab, under Services select vSphere DRS. You should now see if vSphere DRS is on or off. Now click on edit.

  • Your vSphere DRS switch should be shown as green highlighting that DRS is enabled. Click to flip the switch to turn it off which should be like below. Click OK

  • This is the important screen where is warns you about the removal of resource pool and asks you whether you like to save it or not. Remember to click Yes because by default this screen has the No button as default. (Hopefully VMware will change it). By default the file name is saved as cluster.snapshot in your default download location for your browser.

That’s it to save your resource pool tree and settings such as share, reservations and limits for CPU or Memory. Settings such as VM/Host rules, DRS Automation level are not part of the resource pool tree settings so won't be included. You would need to use other PowerCLI commands to extract those information.

The next few steps focuses on restoring those settings back to your cluster. As always there are some caveats around restore.

  1. vSphere DRS must be turned ON before you can restore
  2. You can only restore a snapshot to the same cluster that it was taken from
  3. No other resource pools are present in the cluster

Now on to the process of restore

  • Log on vCenter via the client
  • Highlight your cluster name and expand on it. With my example you can see that I have two host and the VM is at the root of the cluster. On the right-hand side of the window you will see the settings for your cluster. Select the Configure tab, under Services select vSphere DRS. You should now vSphere DRS is off.  Now click on edit.

  • Your vSphere DRS switch should be shown as grey highlighting that DRS is disabled. Click to flip the switch to turn it on which should be like below. Click OK

  • You should now see that DRS is turned back on. At the vSphere DRS configuration screen click on Restore Resource Pool Tree

  • Click on choose file

 Locate your cluster.snapshot file

  • On this screen once check that you have selected the correct file and then click OK

  • Now you should see that the Resource Tree is restored as with my example, my VM has now moved back to under Test Resource pool. All the CPU/Memory settings for the resource pools are also restored


Popular posts from this blog

Rolling back a version of ESXi

There is an option in VMware where after you have performed an major upgrade of ESXi you can roll back to your previous version. The benefit of this is that you would not need to reinstall your ESXi and its configuration if you had issues with the new software. I had to do this on one occassion in my lab where I upgraded from 6.5 to 6.7 and my VMs would not run because the CPU was not supported in 6.7. Please remember if you are using ISO method to upgrade ESXi please ensure you select "Upgrade ESXi, preserve VMFS datastore". Selecting "Install ESXi, preserve VMFS datastore" does not mean preserving datastore means retaining ESXi as it will still do a clean install of ESXi. This method does not work for vSphere 7.0 as there are changes to the partitions on the boot device. Below are the steps to roll back to a previous version which is quite straight forward. As always perform an backup of your host configuration before you upgrade or rollback ( KB2042141 ). I have

Configuring ESXi 6 host to send logs to Syslog Server

In my previous post I talked about configuring VMware Syslog server for Windows which is installed and enabled by default on installation of vCenter 6 for Windows. I will now describe the basic configuration that is required on an ESXi 6 host to be able to send logs out to a syslog server using my vCenter as the example. 1) Navigate to your ESXi host within vCenter. Go to "Manage" tab and select "Settings" followed by "Advanced System Settings". Look for the settings "" and highlight this settings. Click the pencil icon to edit the configuration for this setting. 2) You can now add the host name or ip address of your syslog server/s. You can enter just hostname or IP address, use udp://hostname:514 or ssl://hostname:1514 to be more specific on the port and protocol to be used. If you have multiple hosts then you use the comma (,) to separate each server i.e. udp://,udp:// 3)We n

Custom ESXi Image - ISO using PowerCLI

There comes a time when you have purchased a new hardware to run your ESXi software and discover that the installable base media provided by VMware does not include the drivers or the drivers are out of date. In the world of Windows (Plug and Play) it would discover the hardware and prompt you to provide the drivers so that Windows would install/update the drivers for the hardware. For ESXi if the drivers are not present during load time then the hardware will possibly not work. VMware uses VIB (vSphere Installation Bundle) as a way for vendors to distribute their drivers. To install these VIBs you can either use Update Manager or command line (esxcli). Now this is all good but it does mean you have to first install the base ESXi then use one of the steps above to install/update the drivers.   Some people might feel that it is OK to update the drivers using the above methods but what if it was the network card that was the new hardware and you needed new drivers. Without the net