VMware Cloud Community
pstoric
Enthusiast
Enthusiast

ESXi 6U1 APC UPS connect?

I have a small VM environment that consists of one ESXi 6.0 U1 host that's running on a Dell PE T320. Only two active VMs. One is the domain controller and the other is the IIS server. I have an APC Smart UPS1000XL that everything is plugged into for power but the USB cable is currently not going into anything. What would I need to install or setup that would allow me to plug the USB cable from the APC unit directly into the ESXi host so that I can configure it to shutdown everything gracefully in case of a power outage.

Reply
0 Kudos
10 Replies
Styvboard
Enthusiast
Enthusiast

Don't think this has been supported, migth be nowadays. I tried it once, to map USB to a virtual machine where UPS software runs but was advised not to do it that way, don't really remember why but it wasn't reliable for some reason.

Reply
0 Kudos
klapkaj
Enthusiast
Enthusiast

ESXi as self doesn't support UPS in any form (net/USB...)

There are 2 options how to do this:

  • Your APC must have SmartSlot and you need to grab Network Mgmt Card then you can:

    • Use Network Shutdown from Schneider (APC) and deploy the appliance - preinstalled you only need to configure the basic parameters
    • Deploy Network Shutdown into vMA Appliance

  • If your UPS doesn't have SmartSlot or you cannot buy the card because the budget is over you need to do these things
    •     Install OS or  use existing Windows VM (you can also install Linux machine and configure APC daemon) to do same things
    •     Use  Schneider Electrics PowerChute inside the VM 

OR

    generic (configurable in Power Options Control Panel - will need to Google little bit and  user some VBS script or something else  to monitor UPS though WMI interface because the UPS is presented to system as battery and there is no option to execute program)


    to get notified that UPS is shutting down

    •     Pass-thru the USB into the machine
    •     Make a script to inform ESXi from this VM that UPS is empty (tell them to shutdown), maybe SSH or through API or PowerCLI

        • When UPS will get depleted the VM must execute this script
        • Rememeber you must count with more time so start shutting the infrastructure at higher percentage of battery -  because it will need to hold the ESXi until it shuts down.
        • Have in all VMs VMware Tools installed and on the ESXi in VM Startup/Shutdown the options enabled and Guest Shutdown  set as shutdown option)

 

The easiest way is to use UPS with management card, better to plan it at design time.

I never have a need to use the USB passthrough in this way, but i think it can work.

!!! Remember: For Network Shutdown you will need to have paid version (at least Essentials) to have read/write access to APIs !!!

as stated here:

http://www.apc.com/site/support/us/en/faq/?page=content&country=ITB&lang=en&locale=en_IN&id=FA159705...

pstoric
Enthusiast
Enthusiast

Thanks for the details, I appreciate it. I am going to check that out next week when I am on site again. They don't have the SmartSlot so looks like I'll need to test with USB pass through. At least If I can get it communication with my windows server I can get email alerts at the very least.

Reply
0 Kudos
klapkaj
Enthusiast
Enthusiast

When you will get USB into VM then you can install PowerChute and set it to start command at shutting down then the only you need is

SSH enabled on the host

Automatic Startup/shutdown of VMs enabled

execute plink.exe (part of Putty)  -> for  SSH to host and issue "shutdown" command.

It's not systematic resolution but will work.

Reply
0 Kudos
pstoric
Enthusiast
Enthusiast

Will that plink.exe command gracefully shutdown the other VM or will it simply powerdown the host?

Reply
0 Kudos
klapkaj
Enthusiast
Enthusiast

plink is part of Putty it only allows you to SSH to host from command line and execute command

shutdown is an alias to internal ESXi script shutdown.sh which will trigger more actions but the first is to initalize Automatic shutdown of VMs which have Autostart configured (remember to set Guest Shutdown as an action otherwise the VM will be HARD powered off)

Reply
0 Kudos
pstoric
Enthusiast
Enthusiast

Ah ok that wouldn't work then as I have a Domain Controller and and IIS server on there so whichever I connect the UPS to via USB (it will be the DC) the other VM will still be in a powered on state on shutdown which I don't want.

Reply
0 Kudos
klapkaj
Enthusiast
Enthusiast

with plink you will only ssh to ESXi host

when you issue "shutdown" command to ESXi then ALL the VM on that host which have autostart/shutdown in ESXi configuration enabled will be shut down and gracefully (Guest Shutdown action in settings) Smiley Wink

Reply
0 Kudos
klapkaj
Enthusiast
Enthusiast

tested

Windows VM with PowerChute Business ed. UPS mapped into VM (VM had USB controller and UPS USB device mapped into it)

PowerChute configured to execute script

fox example:

plink -ssh -batch root@192.168.1.1  -pw "password goes here" "/sbin/shutdown.sh && /sbin/poweroff"



(plink.exe is a part of Putty)


works like a charm.

Reply
0 Kudos
pstoric
Enthusiast
Enthusiast

Thanks again for the help. I plan on putting this into place int ht upcoming weeks. My USB cable won't reach the ESXI host so I'm going to order one then I'll set this up

Reply
0 Kudos