We're running a couple of Virtual servers in Hyper-V at a small office using Windows 2008 R2. We only have 1 physical host (and we aren't planning to change that any time soon). We're looking to move to Hyper-V Server 2012.

Currently we have a small UPS that keeps the server running for about 20 minutes and then sends a shutdown message to Windows 2008. The UPS Connects via USB. Windows 2008 recognises the UPS as a battery and there is also software from Eaton that we use to monitor the battery. When Windows shuts down it also shuts down the VM's properly.

We don't want the overhead of running a full version of Server 2012 just so we can have the UPS shut the server down, but we don't want Active Directory and Exchange to suddenly power off either.

Can we make Hyper-V Server 2012 shutdown the VM's gracefully when the UPS runs out of power?

  • 2
    I don't understand the question. You have a W2K8R2 Hyper-V server. You have a UPS connected to this server. During a power outage the UPS signals this server to shut down and this server initiates a shutdown of the VM's. Why wouldn't you just configure the W2K12 Hyper-V host the same way? – joeqwerty Jan 9 '13 at 5:22
  • We currently have Windows 2008 R2 Standard running the Hyper-V service. Looking to migrate to W2k12 Hyper-V Server (running Hyper-V on bare metal) and want to know if we can still do the same thing? – Greg Jan 9 '13 at 5:32
  • Check it - depends on the UPS but at the end nothing really was removed in this area. – TomTom Jan 9 '13 at 6:43
  • @TomTom I was hoping to avoid building the box just to check it and if it doesn't work then I need to rebuild it to a full version of Server 2012 – Greg Jan 11 '13 at 0:40
  • 1
    @joeqwerty he is planning (I THINK) on not using windows server 2012 which would be needed to accomplish what you are saying. I THINK he's is switch over to hyper-v server 2012. – tony roth Apr 5 '13 at 15:12

Hyper-V Server is, at least in these respects, the same as Windows Server installed as "Server Core," which is to say, without a graphical user interface. Whether or not your UPS monitoring stuff works in that environment will depend on whether the software from Eaton can run in an environment without a GUI, and whether you're comfortable configuring these things with command-line tools.

I would suggest calling Eaton to ask them.

  • Additionally you can install and uninstall the GUI in Server 2012 any time - so no need for reinstalling ... – user168121 Apr 5 '13 at 15:07
  • 1
    hyper-v server 2012 does not have this capability, windows server 2012 does. hyper-v server 2012 is free windows server 2012 is not. – tony roth Apr 5 '13 at 15:10
  • the difference between the two is quite significant in one regard, windows server can be switched between non gui to gui mode. But he does not want to use windows server 2012. – tony roth Apr 5 '13 at 15:14
  • I agree with your answer but isn't asking them to call eaton the same as just pointing users to an online support document which usually ends up with a bunch of down votes... As in it does not add anything to the conversation? – tony roth Apr 5 '13 at 16:25

The solution I ended up going with was to create a VBScript that runs on startup (using cscript and Task Scheduler).

The script:

set wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
set batteryColl = wmi.ExecQuery("select * from Win32_Battery")
set osColl = wmi.ExecQuery("select * from Win32_OperatingSystem")

while true
 for each battery in batteryColl
  if battery.batteryStatus = 1 and battery.EstimatedChargeRemaining <= 25 then
   for each os in osColl
    os.Win32Shutdown 5
  end if
 wscript.Sleep 15000


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.