Archive for December, 2011

Dell UPS & vSphere 5

Installed  a new vSphere 5 environment at a customer.
The customer had a Dell UPS and wanted to be able to shutdown everything after running 30 mins on battery.

I recon VMware should start to built some API’s for hardware suppliers to integrate this more easily.
Although the Dell Multi UPS management software has a plugin for VMware it only allows you to shutdown the hosts, or bring them into maintenace mode.
I haven’t found a way to shut down the virtual machines at the same time witht the plugin.

So I made a workaround.

Dell UPS Management software – vSphere 5

  1. Obtain the Dell Multi UPS Management Console (MUMC) software from
  2. The file is called DELL_MULTI-DEVICE_A00_R318771.exe
  3. I’ve installed the software on the vCenter server since it’s a dedicated physical server.
  4. Once installed, you can access it trough:
    or through the start menu by clicking on the dell mgmt software icon.
  5. The default login is admin/admin
  6. A quick scan is automatically performed

  1. In my case, 2 ups devices have been discovered as well as the management server.
  2. Then go to System
  3. Enable the shutdown module:
  4. Next, we will configure the shutdown module


Powersource = the UPS powering the management server
The rest speaks for itself.

I’ve created a shutdownvms.bat script that will bring down everything. (read below)

  1. Shutdownvms.bat
    This is the content of the batchfile, I’ve copied everything in the c:\scripts folder (including powershell.exe en vim.psc1)
    It is important to change the Powershell Executionpolicy otherwise the script won’t run
    Do this once by running “Set-Executionpolicy Bypass”  in a powershell prompt

# short log file creation
echo Shutdown of all VM’s and ESX hosts is launched at >> c:\scripts\alert.txt
echo %date% %time% >> c:\scripts\alert.txt
#Call the powershell script to shutdown everything
C:\scripts\powershell.exe -PSConsoleFile “C:\scripts\vim.psc1” “& “C:\Scripts\shutdownallvms.ps1” |Out-File C:\scripts\log.txt
# shutdown the server itself
shutdown.exe /s /t 10

  1. Shutdownallvms.ps1

Connect-VIServer IPADDRESS

# Get All the ESX Hosts

$ESXSRV = Get-VMHost

# For each of the VMs on the ESX hosts

Foreach ($VM in ($ESXSRV | Get-VM)){

# Shutdown the guest cleanly

$VM | Shutdown-VMGuest -Confirm:$false


# Set the amount of time to wait before assuming the remaining powered on guests are stuck

$waittime = 200 #Seconds

$Time = (Get-Date).TimeofDay

do {

# Wait for the VMs to be Shutdown cleanly

sleep 1.0

$timeleft = $waittime – ($Newtime.seconds)

$numvms = ($ESXSRV | Get-VM | Where { $_.PowerState -eq “poweredOn” }).Count

Write “Waiting for shutdown of $numvms VMs or until $timeleft seconds”

$Newtime = (Get-Date).TimeofDay – $Time

} until ((@($ESXSRV | Get-VM | Where { $_.PowerState -eq “poweredOn” }).Count) -eq 0 -or ($Newtime).Seconds -ge $waittime)

# Shutdown the ESX Hosts

$ESXSRV | Foreach {Get-View $_.ID} | Foreach {$_.ShutdownHost_Task($TRUE)}

Write-Host “Shutdown Complete”

I did not wrote this script myself, I got it from the communities forum @ vmware, but I can’t recall from who.

You can do a test from the management menu, but be warned,it WILL shutdown everything.

Hope this helps you out