DRS recommendations are ignored when the virtual machine is powered on by scheduled task
book
Article ID: 310188
calendar_today
Updated On:
Products
VMware vCenter ServerVMware vSphere ESXi
Issue/Introduction
Symptoms:
DRS (Distributed Resource Scheduler) recommendations seem to be ignored.
The power on operation by scheduled task may fail, but if you directly power on the virtual machine through vSphere Client, it may succeed.
If DPM is enabled in your cluster, a standby ESX server does not wake up in response to a scheduled task, yet still responds to direct commands from vSphere Client.
Environment
VMware vCenter Server 4.0.x VMware vCenter Server 4.1.x VMware vSphere ESXi 5.1 VMware vSphere ESXi 5.0
Resolution
There are two different powerOn APIs:
vim.VirtualMachine.powerOn: This method is used by scheduled tasks to power on a virtual machine. This method may fail when used for DRS-facilitated power on tasks, because it cannot act on proposed DRS recommendations that would require powering on multiple virtual machines.
vim.Datacenter.powerOnVm: This method is invoked when you manually power on a virtual machine through the UI. This method succeeds for DRS-facilitated power on or vmotion tasks, because it is capable of acting on proposed DRS recommendations that affect multiple virtual machines. This includes performing a vMotion on other virtual m achines or powering on additional hosts in order to balance a load.
The first API is being used by scheduled tasks, and this is why powering on a virtual machine through a scheduled task seems to fail. Do not use scheduled tasks to power on virtual machines if you would like DRS to consider load-balancing operations. Instead, develop your own SDK client that uses the second API for power on operations.