spacewalkproject/spacewalk — pull request #15 by SilvioMoioli (2014-03-14 13:49:22+00:00)
Title: Master power management ssm

This an implementation of power management - powering on, off or rebooting one or multiple systems directly from Spacewalk. As simple as that:

![single system power management](https://f.cloud.github.com/assets/250541/2421214/19e4f114-ab7f-11e3-9037-d153628ead00.jpg)

System Set Manager is suppoted as well:

![ssm power management](https://f.cloud.github.com/assets/250541/2421226/2fab6546-ab7f-11e3-8a19-2d289a2a07e1.png)

It relies on [existing functionality in Cobbler](https://github.com/cobbler/cobbler/wiki/Power-management), which in current versions ultimately delegates power management protocol implementation to [fence agents](https://git.fedorahosted.org/cgit/fence-agents.git/tree/fence/agents). It will use whatever protocol the installed Cobbler instance supports.

End-user documentation for SUSE Manager, which is mostly relevant for Spacewalk as well, can be found here:

http://wiki.novell.com/index.php/SUSE_Manager/NewFeatures2.1#Power_Management

Some implementation details:
- since there is no way to ask Cobbler which protocols it supports, you should add a "java.power_management.types = protocol1, protocol2 ..." variable to your configuration files (see rhn_java.conf). Currently supported Cobbler protocols are named after fence agents;
- obviously, you also need to install matching fence-agent packages for the feature to work, and have access to hardware that supports those protocols. At the moment we tested IPMI only;
- since Cobbler does not allow system records without a profile or an image, we added a little hack to allow power management for systems without a kickstart profile. Basically, when a user tries to do a power management operation on a system, its Cobbler record is checked - if it does not exist, a new one is created, pointing to a dummy image. Possible alternatives we evaluated and ultimately discarded were:
- to restrict the use of this feature to systems with kickstart profiles;
- to have Cobbler handle system records without profiles nor images (requires patching Cobbler in non-trivial way);
- not to use Cobbler at all, reimplementing power management in Spacewalk (having Cobbler and Cobbler integration already in place it didn't sound like a good idea architecturally).
- the SSM part uses the existing "System Set Manager -> Status" page to show results power management actions on multiple systems. To have some user-facing feedback in case of errors, we added a "note" column to rhnOperationServer and the corresponding JSP list - that could be used elsewhere, too.

Note: this branch was first proposed for merging in May 2013 and has not been rebased or adapted for last changes in master. Please provide some initial feedback - if the feature is basically OK to merge we will rebase it, move migration scripts, update JSPs to latest conventions etc.