Hyper-V Program Manager
People have asked me how you go about setting up a UPS (Uninterruptable Power Supply) with Hyper-V. This is much easier than it sounds. The first thing to understand is that when you shut down the physical computer, the virtual machines will be automatically put into a saved state. Virtual machines that were running when the server shuts down will be started automatically when the physical computer starts back up.
This all means that – for the most part – things “just work” when you connect a UPS and configure the management operating system like you would for a stand alone computer.
Depending on your environment – there are some configuration changes that you may want to make:
My personal UPS story:
You would not believe, but living in north Redmond the power quality around here is lousy. I often get strange power surges / flickers – and have to deal with half a dozen black-outs of one hour or more each year. Needless to say I have lost a bunch of hardware over the years as a result of this.
A while ago I went out and bought a nice beefy UPS to protect my Hyper-V server and all of my networking gear. To start with I just hooked up the power and confirmed that I could run for about 30 minutes before running out of power. I connected the USB monitoring cable, but did not setup any monitoring software, for a couple of reasons:
Recently, when I was performing some hardware maintenance on in my Hyper-V server I decided to go and have a look in the device manager to see what Windows thought about my UPS. Much to my surprise I saw that Windows had detected the presence of a UPS battery with no intervention from me:
Once I noticed this I decided to have a look around – and I discovered that Windows had enabled standard power support – and was acting like my server was essentially a really big clunky laptop. I had a battery icon in the task bar that accurately reflected the amount of charge in my battery, and when I disconnected power from the UPS – Windows immediately knew about it.
Next I opened the power policy settings and configured my system to get a low battery alert when the battery was at 75% charged, and to shut down when the battery reached 50% charged:
I have since tested this – and everything works perfectly – all with no need for anything other than the “in-box” capabilities of Windows Server 2008 R2. Neat!
Can Windows Server 2008 R2 detect a APC UPS connected over serial and have the same power control fuctions as USB? (or is that a special feature of USB?)
To connect UPS to a MS Windows workstation via USB, be sure taht UPS supports HID protocol. In this case windows automatically recocnize the UPS and you can find it in windows control panel. Miha, also Socomec UPS support HID (nt only APC!) but depends on the UPS model.
You say you've tested this - are you sure?
I've configured my server in the same way, albeit using the low battery action to shutdown the server. Whilst this works, it shuts down the Hyper-V server immediately, without first shutting down the running virtual machines. If I shutdown the server manually, it all works as expected.
Toby Groves -
Yup, it is working fine here. I do not know why you are seeing the behavior that you are seeing.
Another Method for handling APC UPS units is provided by an open source project APCUPSD. They support Windows, Linux and Mac systems. Just Bing or Google for APCUPSD at the Source Forge site you will find source and binary code for USB 3.0 USB 2.0 and USB 1.1. The main reason for my using their software is they provide remote monitoring via PHP script and maintain logs.
It has been very easy to do "forensics" on why a local or remote system went down. This has worked for my Linux and Windows systems.
I'm seeing the same behavior as Toby using a Dell PowerEdge 2900 server with a CyberPower LCD UPS. The UPS stays up and has plenty of power left, but the server shuts down way too soon when initiated by the critical battery action, resulting in a dirty shutdown for the VMs I'm running on the box with Hyper-V.
Anyone else seeing this or have a potential solution? I saw references to this behavior in 2008 and it was supposed to have been fixed in 2008 R2.
This is unbelievable IMHO: social.technet.microsoft.com/.../16e31644-fadb-4d05-9da0-0c0ba4e1ae1e
Just got an APC USB UPS... and (on Windows 2012 Server) I am also getting the "hard shutdown" behavior. There's power left, but the server shut down in a few seconds, not letting HyperV save states, etc...
I too am seeing this hard shutdown issue in Windows 2012. The server shuts down before completely shutting down the VM's
I know this is an old thread, but I want to add my 2 cents on here:
The APC software is pretty crappy in how you have to set up multiple components. I run the core stuff on Hyper-V and the management app stuff on the Windows Server Essentials 2012 R2 VM.
What I like about it is that it gives you voltage information for power events so you can see if your power is up to snuff. Often we get low-voltage conditions that cause power problems with clients in town, and I can see that with the software, whereas I can't with just Windows. So I find value in having access to that information and I don't think I'd give that up. Although I could use a USB cable for the UPS data and have Windows handle shut downs, I have a bit more faith that the software is more correctly judging the time needed to shutdown, so I opted to use a serial cable so that Windows power management doesn't interfere with the software telling it when it's time to shut down.