In the past, there has always been a problem with setting up USB uninterruptible power supply to VMware ESXi servers. Here is the method of enabling a VMware ESXi 4.1 bare-metal server to communicate with an inexpensive serial or USB-only UPS system. |
Install a Guest Windows System
You will need to install a Windows virtual machine to run the power management software, and connect to the UPS system.
I have used APC Powerchute software on a Windows 2008 server with this installation method, and encountered no problems.
Most Windows OS guests with USB management software should work in the same way.
Enabling the USB Pass-through
Now that ESXi 4.1 has been released, it is possible to use a USB data cable on any UPS and communicate with Windows control software.
ESXi 4.1 has the ability to make a USB connection from the server hardware, directly through to a virtual machine hosted on the same server. |
This allows UPS monitoring software to run on a windows virtual machine on the server and talk to the UPS on the ESXi server USB hardware.
You will need to make sure the USB adapter is attached to only the power controller guest OS, to minimise other guest OS conflicts.
The management and attachment of the USB hardware is done in the virtual machine hardware configuration screen.
When adding USB hardware to the hardware of the virtual machine, a new option is now available for direct USB hardware access.
Enabling the SSH Service for Root Access
The next step is to enable the SSH service on the ESXi server, so a root remote console is present via SSH.
You will need physical access to the ESXi server, so you can login to its console as the root user.
Edit the configuration file for SSH with the following command:
nano /etc/ssh/sshd_config
Find the line that starts with PermitRootLogin and change the "no" to "yes".
Restart the sshd service with the command:
service sshd restart
The SSH service will now accept root logins to the console for running scripts.
Windows Guest Script File
On the Windows virtual machine running the Powerchute software, a small .bat file needs to be created, pointing to a free SSH client called Putty.
You can download Putty from their website. http://www.chiark.greenend.org.uk/~sgtatham/putty/
After getting Putty and setting up the .bat script, log into the same directory on the Windows guest.
You will be able to point your UPS control software directly to the shut-down script on the local host.
Windows .bat file:
-------------------------------------------------
putty "server-address" -l root -pw "password" -m Unix_Commands
------------------------------------------------- Unix_Commands file:
-------------------------------------------------
poweroff
exit
-------------------------------------------------Final Notes
This new feature for USB connections in ESXi 4.1 makes it very easy to implement UPS systems into the VMware environment. I have only tried this with Windows 2008, running APC Powerchute software and uninterruptible power supply with USB control. But I believe any configuration of Windows and power control software should work. |