When we are in section to simulate feature Distribute Resource Scheduler (DRS) in our vSphere lab, traditional way to force Virtual Machine (VM) doing full load of it’s vCPU is open application as many you can. Especially an application to encode video or even game. I think it’s quiet difficult to do and also really take time if we have to set in every VM that we have.

But wait, there is another way which is more easy to do, yeah all just we need is only a script!

This script contain command that makes a VM totally throttled and used of all performance within it. Here is the ingredient:

Dim goal

Dim before

Dim x

Dim y

Dim i

goal = 2181818

Do While True

before = Timer

For i = 0 to goal

x = 0.000001

y = sin(x)

y = y + 0.00001

Next

y = y + 0.01

Loop

/code

Write command above into notepad and save as VBS file (I give it name vCPUbusy.vbs). Copy that file to your VM (Windows based only) and run it. Immediately you’ll see on task manager load processor increasing as significant.

Normal/idle VM.

vCPUBusy

After run vCPUbusy.vbs suddenly load cpu increasing to 100%

vCPUBusy2

I suggest don’t run it for long use because it’s really depleted your cpu resource and also implicitly increase your cpu temperature. So, if DRS has working, let’s terminated the script. To terminate, just move to processes tab and find ‘wscript.exe’.

vCPUBusy3

Click End Process and you back into normal condition. Ciao..