Spread the love


My friend was running a cybercafe center. He has dozens of ESXi running 100 of VMs. He was using Dell Multi-UPS Management console to handle his small computer center. The very often power cut was ruining his business. He called up me to see there is a possible solution to handle graceful shutdown of VMs and then ESXi through the available tools and technique. This solution really helped us to handle the situation gracefully.

I just noted down the steps roughly and will not be late to share it with you:

1. Download the Dell Multi-UPS Management Console from http://www.dell.com/support/home/us/en/19/Drivers/DriversDetails?driverId=R318771

2. Execute DELL_MULTI-DEVICE_A00_R318771.exe and run the setup to install on Windows 2008 R2.

3. Once installed, try accessing it through:

4. The default credential for the MUMC login is admin/admin

5.A quick scan is automatically performed and you will get to see the overall power devices available.

6. Click on Settings > Systems and enable shutdown as shown below

7. Click on Shutdown option and configure as shown below

The above shown is a sample entry. Change it as per your required IPs.

In our case, that’s :

Power Source:

Load Segment: Master Output

Login/password: admin/admin

Shutdown timer : 180 sec

Shutdown duration: 120 sec

Type: Script

Location: C:\scripts/Ajeet.bat

8. Save the settings

9. Now let’s create a required scripts one by one for shutting down ESXi and VMs.

Script 1:

location: C:\scripts\Ajeet.bat

Start shutdownvms.bat

Script 2:

location: C:\scripts\shutdownvms.bat

———- Start——–

PowerShell.exe C:\Scripts\shutdownallvms.ps1


Script 3:


========= START =========

Add-Snappin “Vmware. Automation.Core”

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”

===== END ========

10. Now its time to test drive the scripts. Just try running those script manually and confirm if those works or not.

11. Now time to test drive with UPS System menu option. Click on Shutdown option of MUMC and Click on Test Shutdown. The Script should work and power-on VMs and ESXi gradually.

12. Try creating the power-off situation and let UPS perform this activity of running the scripts to shutdown ESXi and VMs.

It really went flawless saving couple of rupees for my friend. He treated me the next day for the overall efforts and we rocked the party too 🙂


Spread the love
Categories: Docker

Ajeet Raina

My name is Ajeet Singh Raina and I am an author of this blogging site. I am a Docker Captain, ARM Innovator & Docker Bangalore Community Leader. I bagged 2 special awards last year(2019): Firstly, “The Tip of Captain’s Hat Award” at Dockercon 2019, San Francisco, and secondly, “2019 Docker Community Award“. I run Collabnix Community Slack with over 5300+ audience . I have built popular GITHUB repositories like DockerLabs, KubeLabs, Kubetools, RedisPlanet Terraform etc. with the support of Collabnix Community. Currently working as Developer Relations Manager at Redis Labs where I help customers and community members adopt Redis. With over 12,000+ followers over LinkedIn & close to 5100+ twitter followers, I like sharing Docker and Kubernetes related content . You can follow me on Twitter(@ajeetsraina) & GitHub(@ajeetraina)

1 Comment

ajeetraina · 25th December 2014 at 1:08 pm

Thanks for referring this.
I have updated the correct working link for MUMC.
This blog has been referred from my old blog which I did some two years back. Will surely check on the built-in function.
Do share if you have anything new for our readers.


Leave a Reply

Your email address will not be published. Required fields are marked *

Join Collabnix SlackIt's 100% FREE!

Get chance to chat with 5500+ DevOps Engineers !