Thursday, May 22, 2014

Simple load testing for VMware ESX hosts

How to load test (CPU and Memory) an ESX host with just simple tool and few powercli commands?


  1. We need to have a bootable iso that automatically starts some kind of testing. In this case I decided to use memtest.iso (http://www.memtest.org/#downiso).You need to download the iso image.
  2. Using virtual center client, select the ESX host ,Browse local datastore and then upload the iso file.
  3. Now we need to deploy a VM. I decided to deploy in custom so that I don't have to select virtual disk and network card. This VM will be used to clone additional VMs. Lets name it "host1-vm-1"
  4. After creating the VM, attach memtest.iso from local datastore. You can power it on.


The below section use PowerCli to create clone multiple VMs.

  1. If you don't have it installed , install powercli from vmware.com site.
  2. Launch Powercli from desktop icon and then use "connect-viserver <VirtualCenter server name>
  3. Use the below command to create multiple VMs and power it on.

for ($i=2;$i -le 20;$i++){New-VM -Name host1-vm1-$i -VM (Get-VM host1-vm-1) -VMHost (Get-VMHost host1) -Datastore host1_local;start-vm -vm host-vm-$i -confirm:$false}

PS: assuming your host name is 'host1', first vm is vm1 and local datastore is 'host1_local'


Good Luck!