ESXi

Aus Doku-Wiki
Zur Navigation springenZur Suche springen

ESXi und USV

Re: ESXi and UPS?

1.) connect your upc's usb cable to the esxi host
2.) in your vi-client add 2 devices to the vm that should control the upc, first an usb controller, secondly an usb device (and choose your upc)
3.) install the upc's software on you vm, the software should now be able to communicate with your upc
4.) download plink.exe and place it where your upc software can use it 
5.) in the same folder create a shutdown_vms.bat with this content: plink.exe -l root -pw youresxirootpassword youresxihostnameorip ./shutdownvms.sh &
6.) in the same folder create a shutdownvms.sh with this content:

#!/bin/sh 

vim-cmd vmsvc/getallvms  | cut -d' ' -f1 | tail -n +2 | xargs -r -n1 vim-cmd vmsvc/power.shutdown
sleep 180
vim-cmd vmsvc/getallvms  | cut -d' ' -f1 | tail -n +2 | xargs -r -n1 vim-cmd vmsvc/power.off
 
./shutdown.sh 

7.) tell the upc software to start the shutdown_vms.bat in case of emergency


hth, Berndt