VMware Distributed Resource Scheduler

 

 

 

How to Create a DRS Cluster
The following steps will show you how to create a VMware Distributed Resource Scheduler cluster and verify that it appears in the inventory.

  1. GO to Home > Inventory > Hosts and Clusters.
  2. Right-click the Training datacenter and select New Cluster.
  3. Do the following when the New Cluster wizard appears:
    1. Type Lab Cluster. (Name)
    2. Select Turn On VMware DRS. (Cluster Features)
    3. Click Manual. (Automation Level)
    4. Drag the slider all the way up to the right to Aggressive. (Migration threshold)
    5. Leave the default. (Power Management)
    6. Leave the default. (VMware EVC)
    7. Leave the default. (Virtual Machine SwapFile Location)
    8. Verify the information for accuracy and click Finish. (Ready to Complete)
  4. Verify that the cluster appears in the Hosts and Clusters inventory view.

 

 

 

 

How to Populate the DRS Cluster
The following steps will show you how add your ESXi host to the DRS cluster and view information about the ESXi hosts in the cluster.

  1. Go to Home > Inventory > Hosts and Clusters.
  2. Drag your ESXi host into the DRS cluster. The Add Host wizard appears.
  3. In the Choose the Destination Resource Pool pane, select put all of this host’s virtual machines in the cluster’s root resource pool and click Next.
  4. In the Ready to Complete page, click Finish.
  5. In the inventory, expand Lab Cluster.
  6. Select Lab Cluster in the inventory and click the Summary tab.
  7. View the general information and DRS information.
  8. Verify that you have two ESXi hosts in your DRS cluster.

 

 

 

How to Verify Proper DRS Cluster Functionality
The following steps will show you how to verify that the DRS cluster is functioning properly.

  1. Go to Home > Inventory > VMs and Templates.
  2. Apply the DRS recommendation when a virtual machine is powered on:
    1. Verify that your virtual machine is powered off. If it is not, shut it down.
    2. Right-click your virtual machine and select power > Power On. With DRS running in manual mode, when a virtual machine is powered on DRS will recommend a host on which to place the virtual machine.
    3. When prompted with a host recommendation, select the check box for the lowered-numbered ESXi host and click Power on.
  3. Generate CPU activity in your virtual machines:
    1. Open a console to your virtual machine and log in as Administrator with virtual machine Administrator user name and password.
    2. Run the cpubusy.vbs script by right-clicking the script on the desktop and selecting Open with Command Prompt. Let the script run continuously.
  4. Go to Home > Inventory > Hosts and Clusters.
  5. Select Lab Cluster in the inventory and click Summary tab.
  6. View the VMware DRS panel.
  7. Click the View Resource Distribution Chart link. This chart displays the CPU or memory use per host. Point to each colored square. You see information on how much of the entitles resource (CPU or memory) each virtual machine is using.
  8. Close the DRS tab.
  9. Click the Run DRS link in the upper-right corner to refresh the view. It normally takes 3-5 minutes to see migration recommendations.

 

 

 

 

How to Apply DRS Recommendations
The following steps will show you how to apply the DRS recommendations.

  1. In the DRS tab, read the reasons why the recommendations were made.
  2. When at least two recommendations appear, click Apply Recommendations.
  3. Monitor the migrations in the Recent Tasks pane and wait for each virtual machine migration to complete.
  4. Click the Virtual machines tab.
  5. Sort the virtual machines by ESXi host on which they reside. To do this, click the Host column heading. Identify the virtual machines that each ESXi host is running.
  6. Click the Summary tab. View the VMware DRS panel. Is your load balanced or imbalanced? (Allow approximately 5 minutes for DRS to evaluate the state of the cluster.)
  7. Click the View Resource Distribution Chart link to confirm load distribution.
  8. Close the chart window.
  9. Stop each instance of the cpubust.vbs script in each virtual machine by pressing Ctrl+C in each cpubusy window.
  10. Close all virtual machine consoles.

 

 

 

 

How to Create, Test, and Disable Affinity Rules
The following steps will show you how to create rules that force virtual machines to be placed on the same ESXi host.

  1. Verify that each virtual machine that you own is running on a different ESXi host. If the virtual machines that you own are running on a different ESXi host, choose one to migrate to the other ESXi host in the cluster before you go to Step 2. If you have one virtual machine on each ESXi host in the cluster, no action necessary.
  2. Right-click Lab Cluster in the inventory and select Edit Settings. The Lab Cluster Settings dialog box appears.
  3. In the left pane, select VMware DRS > Rules and click Add.
  4. Enter the following values in the Rule dialog box. Close the Lab Cluster Settings dialog box when you are done.
    1. Type Colocate <name> VMs. (Name)
    2. Select Keep Virtual Machines Together. (Type)
    3. Click Add. IN the Virtual Machines dialog box, select the check box next to each of the virtual machines that you own. Click OK. (Virtual Machines)
  5. In the Rule dialog box, click OK.
  6. Click OK to close the Lab Cluster Settings dialog box.
  7. Click the Lab Cluster DRS tab. If the view is not Recommendations, click Recommendations. Wait for a DRS recommendation to appear for your virtual machine.
  8. Click Apply Recommendations and monitor the Recent Tasks pane as the recommendation is applied. The virtual machines associated with your affinity rule will be migrated to one of the two hosts in the DRS cluster.
  9. Click the Virtual Machines tab.
  10. Click the Host column heading to sort the virtual machines by ESXi host on which they reside. The virtual machines that you own should be running on the same EXi host.
  11. Right-click Lab Cluster in the inventory and select Edit Settings.
  12. In the left pane, select VMware DRS > Rules.
  13. Deselect the affinity rule that you created to disable it.
    To delete an affinity rule, you select the rule and click Remove.

 

 

 

 

How to Create, Test, and Disable Anti-affinity Rules
The following steps will show you how to create rules that force the separation of virtual machines onto different ESXi hosts.

  1. On the VMware DRS > Rules page, click Add.
  2. Do the following when the Rule dialog box appears:
    1. Type Separate <name> VMs. (Name)
    2. Select Separate Virtual Machines. (Type)
    3. Click Add. In the Virtual Machines dialog box, select the check box next to each of the virtual machines that you want. Click OK. (Virtual Machines)
  3. In the Rule dialog box, click OK.
  4. Click OK to close the Lab Cluster Settings dialog box.
  5. Click the Lab Cluster DRS tab. The default view should be Recommendations. If it is not, click the Recommendations button.
  6. Click the RUN DRS link to make DRS evaluate the state of the cluster and make recommendations. A recommendation to separate your virtual machines should appear. If not, check the rules that you created to verify accuracy of inputs in step 2.
  7. Click Apply Recommendations.
  8. Monitor Recent Tasks pane as recommendations are applied. The virtual machines with anti-affinity rules applied to them will be migrated to another ESXi host in the cluster.
  9. Click the Virtual Machines tab.
  10. Click the Host column heading to sort virtual machines by ESXi host on which they reside. Your virtual machines should be running on different ESXi hosts.
  11. Right-click Lab Cluster in the inventory and select Edit Settings:
  12. In left pane, select VMware DRS > Rules.
  13. Deselect the anti-affinity rule that you created to disable it. Click OK.
  14. Press Ctrl+C in each cpubusy window to stop the cpubusy.vbs script on your virtual machine.
  15. Close virtual machine console.