xCAT provides the imgcapture command to capture an OS image from a running diskful Linux node, and prepares the rootimg directory, kernel and initial ramdisks for liteimg/packimage to generate the statelite/stateless rootimg.
This command is very helpful, especially when there's already one diskful Linux node in which all the necessary applications are installed and configured, or the user needs to migrate the diskful environment to the diskless environment (including statelite/stateless).
See man page imgcapture.
The following are the steps to capture image.
The diskful Linux node to be captured must be managed by the xCAT MN, and the remote shell between the xCAT MN and this node must be configured.
The image to be captured needs to be associated with one specific osimage object, you can use the existing osimage objects, or you can use the following command to create a new osimage <osimagename>
mkdef -t osimage -o <osimgname> attr1=val1 attr2=val2 ...
The pkglist, postinstall and exlist files are the major attributes could be customized for the osimage to be captured, they work the same as when genimage command is running. Refer to Deploying Stateless Nodes to see how to configure these files.
During imgcapture is running, the user might need to exlude some files/directories from the image to be captured.
xCAT provides the exlist configuration file, the user can add any files/directories into this file.
For example, there's one directory (/root/test/), which should be excluded from the image to be captured, the user can add the following line into the exlist file:
./root/test*
See man page imgcapture.
After the image (rootimg), kernel (kernel) and initial ramdisks (initrd-stateless.gz and initrd-statelite.gz)has been generated and put into $installroot/netboot/<osver>/<arch>/<profile>/, you can customize the image by running packimage/liteimg with the options you want.
Run packimage:
packimage <osimagename>
For more info about packimage, please refer to the manpage of packimage.
Run liteimg:
liteimg <osimagename>
For more info about liteimg, please refer to the manpage of liteimg.
Run nodeset to set the node status ready for network boot.
nodeset node1 osimage=<osimagename>
If the node is set to stateless or RAMdisk-based statelite status, before booting the node up, please make sure the node has enough memory capabilities. In order to boot up the LPAR with the redhat6/PPC64 Linux image, the node should have about 5120MB memory.
Wiki: Build_and_Boot_Stateless_Images
Wiki: Using_Provmethod=install,netboot_or_statelite
Wiki: Using_Provmethod=osimagename
Wiki: XCAT_Linux_Statelite