Skip to end of metadata
Go to start of metadata

This is how I added support for partimage/partimage-ng to xCAT 2.x

Overview

The method I used was based on a suggestion by Egan Ford. I created an xCAT plugin to handle the imaging commands. That plugin sets the node to boot a stateless image and configures a certain postscript to run that handles the image capture/restore.

partimageng.pm xCAT plugin

First, I created an xCAT plugin to handle 2 nodeset commands for os type image: install and image. This allows you to set the os type for a node to image and then run one of

which will cause an image of the node to be captured or installed the next time the node is booted. The architecture for the node must always be set to x86 for this, but it will handle imaging/restoring both x86 and x86_64.

To use it, download it from our SVN repository and put it in lib/perl/xCAT_plugin under your XCATROOT directory.

partimageng.pm requires a kickstart template file to be installed in your XCATROOT as share/xcat/install/image/default.tmpl. It should contain a single line with these contents:

partimageng postscript

The partimageng.pm xCAT plugin configures the node to boot a stateless image and then to run the partimageng postscript. This postscript handles the image capture/restore. I did it all in a postscript to keep from having to rebuild the stateless image each time the capture/restore code needed to be modified. The postscript can handle both partimage and partimage-ng formats. I initially only supported partimage-ng, but then realized that presented a compatibility problem where all of our previous images would have to be converted. There is a flag in the script to set which of the two applications gets used to create images that can be manually modified or passed in as a kernel parameter (I haven't set up a way for the partimageng.pm plugin to pass that kernel parameter yet though). Also, it determines what drive to image/install based on some stuff in /dev and /proc. The device can be specified as a kernel parameter, but again, this hasn't been added to the xCAT plugin. Right now, it only works with /dev/sda, /dev/sdb, /dev/hda, or /dev/hdb.

Download it from our SVN repository and put it in your xCAT postscripts directory.

listener.py

This is a script I took from what was already part of xCAT that provides a way for xCAT's nodestat command to get the status of an install. I modified it to give the status of a partimage-ng or partimage install.

It needs to go in a directory I came up with to put the root image and required files. It is under your install path, for me, that is /install, so you need to put listener.py at /install/image/x86/installer_files

Also make sure to make listener.py executable:

stateless image

This is the harder part. The images I have were built for IBM HS20, HS21, and HS22 blades. If you have other hardware, you may be able to use an existing kernel you have and update the kernel modules in the images I created. If that doesn't work, you'll need to create your own images. Since I don't have any notes on how I created them, I'll wait until someone needs help doing that to figure it out again (send a message to the vcl-user list). The short answer is to look at the xCAT docs on building a stateless image for your hardware. These images default to using eth0 as the installation NIC. To use a different NIC, set 'installnic' in the noderes table to the desired NIC. The root image contains the partimage and partimage-ng binaries.

There are three parts:

Put vmlinuz and initrd.img at /tftpboot/xcat/image/x86.
Put rootimg.gz the same place you put the listener.py script (/install/image/x86/installer_files for me)

Configure xCAT

The installer image uses NFS to mount the image store. In the past, it mounted the management node. It has now been updated to be able to mount any NFS export available on the install network. Two additional items need to be added to the xCAT site table:

  • IMAGELIBSERVER - this is the hostname or IP of the NFS server
  • IMAGELIBINSTALLDIR - this is the directory being exported by the NFS server
  • No labels