Dear Spacewalk Team, as announced, this is the second part of the contribution we wanted to share with you. Actually it is again split in two sub-parts which are largely independent from one another and from the power management feature I wrote about yesterday - git commits are stacked over previous ones mostly for convenience reasons.
First is a little addition to the SSM provisioning page - basically extending functionality provided by the "Create Cobbler System Record" button in the Provisioning page to multiple systems. https://git.fedorahosted.org/cgit/spacewalk.git/log/?h=master-create-cobbler-record-ssm As a bonus, these commits will also make provisioning errors visible in the SSM status bubble (they were basically ignored before). Second is support to list bare-metal systems in Spacewalk and provision them. This is the basic workflow: - admin enables this feature from Spacewalk Configuration -> Bare-metal systems. This results in a new default Cobbler profile being created; - bare-metal system is powered on, and gets the default (hereinafter "bootstrap") image from Cobbler. This is a special, minimal OS that will boot, register the system with a special "bootstrap" activation key and shut the system down; - admin will happily see its system in the Systems list with a special icon and slightly different pages (basically, to hide a lot of actions which would not make sense). Bare-metal systems have a special entitlement which gets assigned with the bootstrap activation key only; - provisioning works as usual with Kickstart by creating Cobbler records (obviously scheduled provisioning is not supported). Admin can also use the new feature above to provision multiple bare-metal systems; - admin can also use the power management feature to power on his system and begin the kickstart process. Code to implement the above is available here: https://git.fedorahosted.org/cgit/spacewalk.git/log/?h=master-pxe-default-image That basically comprises the following: - handling of bootstrap activation keys and entitlements, database updates; - new acls and front-end code to hide portions of the UI that do not make sense for bare-metal systems; - a new button to enable or disable this feature; - correct handling of a few corner cases, like migrating a bare-metal system between organizations; - test code. You may notice a big missing piece: the bootstrap image itself! We created one for SUSE Manager using SLES, and one for Spacewalk based on openSUSE. It is available, together with its sources, here: https://build.opensuse.org/package/show/systemsmanagement:spacewalk:misc/pxe-default-image As we lack knowledge in Fedora and RHEL tools to build images, we used Kiwi and OBS to build it, as we are mostly familiar with those - others in the Spacewalk community are of course welcome to produce a Fedora or RHEL-based version. Minimal 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#Unattended_bare-metal_system_provisioning Some implementation details you might be interested in: - you can install a copy of the bootstrap image with the following commands. The last command is needed to allow Cobbler to read the image through SELinux: wget http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/misc/openSUSE_13.1/noarch/pxe-default-image-13.1-0.14.2.noarch.rpm rpm -i pxe-default-image-13.1-0.14.2.noarch.rpm chcon -R -v --type=cobbler_var_lib_t /srv/pxe-default-image - this feature needs a few new configuration options, particularly regarding the bootstrap image location (we kept it as a parameter to easily adapt to various distros). Copy those from rhn_java.conf or from the Troubleshooting section of the above user guide; - stored procedures have been updated to automatically add a large number of bootstrap entitlements to all organizations. That way system migrations between organizations are always possible; - enabling or disabling the feature also implicitly triggers a cobbler sync. On my standard Fedora 19 install, this caused a Cobbler exception: cobbler sync task started: 2013-12-04_105106_sync task started (id=Sync, time=Wed Dec 4 10:51:06 2013) running pre-sync triggers cleaning trees removing: /var/lib/tftpboot/grub/images copying bootloaders Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'Could not find files matching /usr/lib/syslinux/pxelinux.0' This can be fixed by installing the syslinux package: yum install syslinux BTW: in SUSE syslinux is a dependency of the cobbler package, I do not know why this is different in Fedora; - we are using a temporary icon for bootstrap systems at the moment. Cynthia will design some new icons we are currently missing, including one for bootstrap systems, and we will of course contribute it when it's ready. I prepared some screenshots for the impatient[1][2][3][4]! Again all comments are welcome, and feel free to bug me (moio in #spacewalk) if you run into any difficulty. Please also note that some design and implementation details were changed based on discussions on this mailing list when the feature was first presented[5]. Regards, Silvio PS. the SUSE Manager team would like to dedicate all efforts in this feature to the memory of Uwe Gansert, who began this as a hackweek project in 2012. We are proud of finally putting the finishing touches to his work. [1] http://tinyurl.com/qxetm2n [2] http://tinyurl.com/oz7bvk5 [3] http://tinyurl.com/px8rgzm [4] http://tinyurl.com/pnkrsm3 [5] http://thread.gmane.org/gmane.linux.redhat.spacewalk.devel/4073/focus=4090 -- Silvio Moioli SUSE LINUX Products GmbH Maxfeldstraße 5, 90409 Nürnberg Germany _______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel