Why not? I mean why isn't it possible? It is currently impossible to install the USB driver on x64 versions of windows, due to signing issues, but you only want to use the network client part, so I fail to see how that would be a problem. You'll just have to deal with everything from the command line.
Hyper-V Server 2008 R2 is just a Windows Server 2008 R2 Core install with all roles but Hyper-V server disabled, some helper scripts, and the odd funky behavior here and there. If you say it is not possible from a licencing point of view, we talked with MS at this one place where I work, and they explicitly told us that things like backup agents, extended hardware drivers (HP OpenView agents, etc) and somesuch were not considered "usage", and were perfectly fine.
In fact PowerChute Network Shutdown explicitly supports Hyper-V Server 2008 and Windows Server 2008 Core with Hyper-V role installs.
I don't have any Core installs available in my lab to try it, but I'm fairly confident it would work, apcupsd has very little windows-centric requirements, it is just a service, which should in theory work. If not, a bit of hacking could make it work.
If you report it does fail to work, I will setup a test vm with a Core install and give it a try, for kicks.
Currently when one of the two UPS dies, the doshutdown event is triggered, and executes the default script via apccontrol. The doshutdown script ignores the second UPS, as they are not event-connected, and proceed normally with the shutdown.
In order to have the doshutdown events somewhat connected, the two instances of apcupsd need a specifically customized configuration file. The difference will reside in the directory from which the events scripts have to be executed.
Main properties of first ups, in /etc/apcupsd/apcupsd.ups0.conf
SCRIPTDIR /etc/apcupsd/ups0
UPSNAME ups0
DEVICE /dev/ups0
PWRFAILDIR /etc/apcupsd/ups0
NOLOGINDIR /etc/apcupsd/ups0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.0.events
And for the ups1, in /etc/apcupsd/apcupsd.ups1.conf
SCRIPTDIR /etc/apcupsd/ups1
UPSNAME ups1
DEVICE /dev/ups1
PWRFAILDIR /etc/apcupsd/ups1
NOLOGINDIR /etc/apcupsd/ups1
NISPORT 3552
EVENTSFILE /var/log/apcupsd.1.events
Each scriptdir should get a copy of the default scripts.
We want to customize the doshutdown script, which will not directly shutdown the machine, but has to check if the other UPS is still on, or is in shutdown mode.
At the top of the doshutdown script, we could add something like
for ups0
if [ ! -f /tmp/ups1.is.down ]
then
touch /tmp/ups0.is.down
exit 99
fi
for ups1
if [ ! -f /tmp/ups0.is.down ]
then
touch /tmp/ups1.is.down
exit 99
fi
the status 99 has a special meaning, that tells apccontrol to stop the action in progress. The five lines check if the other UPS-down-file has been created ; if no, the down-file is created for the ups being down, and exits. If yes, meaning the other UPS is down, this one is getting down as well, thus the script should continue and shutdown the machine.
The files /tmp/usp[01].is.down
indicate if the ups[01] is currently down.
Important: the init.d start script of apcupsd should remove these files, if they have been created in a previous session:
rm -f /tmp/usp[01].is.down
Finally, the directories created above, /etc/apcupsd/ups[01] should be given access to the apcupsd user (or to whichever relevant user running the instances).
chown -R apcupsd /etc/apcupsd/ups[01]
Please have a look at the detailed documentation.
edit fixed the /tmp/ups[01].is.down
names, the .is
was missing.
Best Answer
As Chopper3 writes, more expensive UPS' can have an option to attach networked shutdown software (for an additional cost).
For a free-of-charge implementation of networked power management you want APC UPS Daemon, apcupsd. Basically you install a manager instance of apcupsd on the PC that has the USB signalling cable attached, and install apcupsd clients on other PCs attached to the UPS power. The apcupsd instances use the LAN to communicate.
Apcupsd comes in both Unix and Windows versions, and the Windows versions have existed for quite some time, so I'd expect them to be stable enough. I don't know how easy it is to set up and configure on Windows. Take a look at it, and if you don't like it, there is always the option to buy a more capable UPS...
Remember, with networked UPS management the network switch needs to be on UPS power for the management software to work when power is out... :-)