Resource Pools: Create and Use Resource Pools on an ESXi Host

 

 

How to Create CPU Contention

The following steps will show you how to run the cpubusy.vbs script in each virtual machine to create a heavy CPU load, resulting in contention for CPU cycles.

  1. Go to the Home > Inventory > VMs and Templates.
  2. Open a console to virtual machines your virtual machines and log in as Admin.
  3. In each virtual machine, start three instances of the cpubusy.vbs script (on the virtual machine’s desktop) by right-clicking the script and selecting Open with Command Prompt.
    This script runs continuously. Allow it to run for a minute or two to stabilize. This script repeatedly does floating-point computations. It also displays how long it took to do the computation (wall-clock time).
    For example: I did three million sines in 2 seconds !
    Use the number of seconds reported as a performance estimate. You should find that the program runs at approximately the same rate in each virtual machine.
  4. In the inventory view, right-click the <name> virtual machine and select Edit Settings.
  5. In the virtual machine Properties dialog box, click the Resources tab.
  6. Click Advanced CPU.
  7. In the Scheduling Affinity pane, type 2 in the space provided. The virtual machine will run only on processor 2. Click OK.
    CAUTION: CPU affinity is used mainly to create CPU contention for training purposes. Use of this feature in a production environment is strongly discouraged.
  8. Repeat steps 5-8 to set the scheduling affinity for the other virtual machine. Force it to use the same processor as the first virtual machine (processor 2). Allow cpubusy.vbs to run for a minute or two.

 

 

 

 

How to Create a Resource Pool Named Fin-Test

The following steps will show you how to create a resource pool named Fin-Test.

  1. Go to Home > Inventory > Hosts and Clusters.
  2. Right-click your ESXi host and select New Resource Pool.
  3. Assign the resource pool the following properties:
    1. Type Fin-Test. (Name)
    2. Select Low from the drop-down menu. (CPU Resource Shares)
    3. Leave the defaults. (All other settings)
  4. Click OK.

 

 

 

 

How to Create a Resource Pool Named Fin-Prod

The following steps will show you how to create a resource pool named Fin-Prod.

  1. Go to Home > Inventory > Hosts and Clusters.
  2. Right-click your ESXi host in the inventory and select New Resource Pool.
  3. Assign the resource pool the following properties:
    1. Type Fin-Prod. (Name)
    2. Select High from the drop-down menu, (CPU Resource Shares)
    3. Leave the default. (All other settings)
  4. Click OK.

 

 

 

 

How to Verify Resource Pool Functionality

The following steps will show you how to verify that each resource pool provides the correct amount of CPU to each virtual machine when there is CPU contention.

    1. Select the Fin-Test in the inventory and click the Summary tab. View the CPU Resource Settings panel. Note the number of shares for this resource pool.
    2. Select the Fin-Prod and click Summary tab. View the Resource Settings panel. Note the number of shares for this resource pool.
    3. Drag the <name> to the Fin-prod resource pool.
    4. Drag the <name> to the Fin-Test resource pool.
    5. View the results of cpubusy.vbs in each virtual machine console.
    6. Change the CPU shares of the Fin-Test resource pool from Low to Normal. Leave CPU shares at High for the Fin-Prod resource pool.
    7. Let the scripts run for a few seconds and compare the performance of the script in each virtual machine. If there is contention for CPU, you should notice a difference in performance between the virtual machines.
    8. Change the CPU shares of the Fin-Prod resource pool from High to Normal.
    9. Stop the cpubusy.vbs script in each virtual machine. Press Ctrl+C in the cpubusy window.