Capture_Linux_Image

How To Capture Image from the Running Diskful Linux Node

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.

Prepare one diskful Linux node

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.

Prepare the configuration files

Define the osimage object

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 ...

Customize the osimage

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*

Run imgcapture

The usage of imgcapture and examples

See man page imgcapture.

Generate stateless/statelite images

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.

Generate stateless images

Run packimage:

     packimage <osimagename>

For more info about packimage, please refer to the manpage of packimage.

Generate statelite images

Run liteimg:

     liteimg <osimagename>

For more info about liteimg, please refer to the manpage of liteimg.

Set the node status ready for network boot

Run nodeset to set the node status ready for network boot.

     nodeset node1 osimage=<osimagename>

Notes

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.


Related

Wiki: Build_and_Boot_Stateless_Images
Wiki: Using_Provmethod=install,netboot_or_statelite
Wiki: Using_Provmethod=osimagename
Wiki: XCAT_Linux_Statelite

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.