{{:Design Warning}}
Currently with imgexport command, we get the following files in the tar file (bundle) by default for stateless.
And a manifest.xml file which looks like this:
<xcatimage>
<imagename>sles11-ppc64-netboot-compute-rscttest</imagename>
<kernel>/install/netboot/sles11/ppc64/compute-rscttest/kernel</kernel>
<osarch>ppc64</osarch>
<osvers>sles11</osvers>
<profile>compute-rscttest</profile>
<provmethod>netboot</provmethod>
<ramdisk>/install/netboot/sles11/ppc64/compute-rscttest/initrd.gz</ramdisk>
<rootimg>/install/netboot/sles11/ppc64/compute-rscttest/rootimg.gz</rootimg>
</xcatimage>
In addition, one can choose to add additional files by using the --extra <file:dest_dir> flag. For statefull case, the .tmpl file is included in the bundle file.
The following enhancements will be added:
Since the postscripts are not associated with the image, we can let user specify a node name in order to get the postscripts.
imgexport <img_name> [-p <nodename>]
The postscript names will be saved in the manifest.xml file. When import the image, user can specify a node name or a group name like this:
imgimport <bundle_file_name> [-p <nodelist>]
The postscripts will be entered into the postscripts table for the nodes specified. By postscripts, it means both postscripts and postbootscripts from the postscripts table.
We'll add the .pkglist, .otherpkgs.pkglist, .postinstall .synclist and .exlist files in the bundle by default. This way, user can run genimage again on the new xCAT mn if they choose to. These files will be copied to the same directories as the source when imgexport runs. And they will be entered into the osimage and linuximage table.
We also need to add more detailed imgage defs into the manifest.xml such as primary nic, additonal nics, kernel versions etc. imgexport command will create a row for the new image on osimage and linuximage tables.
The new manifest.xml file will look like this after the above 3 enhancements:
<xcatimage>
<exlist>/install/custom/netboot/sles/test.exlist</exlist>
<extra>
<dest>/install/postscripts</dest>
<src>/install/postscripts/test</src>
</extra>
<extra>
<dest>/tmp</dest>
<src>/install/netboot/sles11/ppc64/test1/rootimg/etc/fstab</src>
</extra>
<extra>
<dest>/tmp/test1</dest>
<src>/tmp/test1</src>
</extra>
<imagename>myimage</imagename>
<imagetype>linux</imagetype>
<kernel>/install/netboot/sles11/ppc64/test/kernel</kernel>
<netdrivers>e1000</netdrivers>
<osarch>ppc64</osarch>
<osname>Linux</osname>
<osvers>sles11</osvers>
<otherpkgdir>/install/post/otherpkgs/sles11/ppc64</otherpkgdir>
<otherpkglist>/install/custom/netboot/sles/test.otherpkgs.pkglist</otherpkglist>
<pkgdir>/install/sles11/ppc64</pkgdir>
<pkglist>/install/custom/netboot/sles/test.pkglist</pkglist>
<postinstall>/install/custom/netboot/sles/test.postinstall</postinstall>
<profile>test</profile>
<provmethod>netboot</provmethod>
<ramdisk>/install/netboot/sles11/ppc64/test/initrd.gz</ramdisk>
<rootimg>/install/netboot/sles11/ppc64/test/rootimg.gz</rootimg>
<rootimgdir>/install/netboot/sles11/ppc64/test</rootimgdir>
<synclists>/tmp/mysync.list</synclists>
<postscripts>syslog,remoteshell,syncfiles,mypostscript</postscripts>
<postbootscripts>otherpkgs,mypostscript2</postbootscripts>
</xcatimage>
This function is needed for the user who wants to create a image with a different profile on the same xCAT mn. They want to modify the new image for some other purpose. In this case, imgexport will work the same, imgimport will support the following option:
imgimport <bundle_file_name> --profile <new_profile_name>
The .pkglist, .otherpkgs.pkglist, .postinstall files will be copyed into /install/custom/netboot/<os> with the new profile name. A new image def will be created on the osimage and linuximage table with details. User make modifications and run
genimage <image_name>
to work on the new image. Question: do we have any files in the image that is profile related?
imgexport --extra s<rc_file_name:dest_dir>
The file specified will be saved in the bundle file by imgexport command. The the file will be copied to the dest_dir by the imgimport command. If dest_dir is omitted, the file will be copied to the same directory as the source.
For statelite, the litefile table settings for the image will be saved in a file called litefile.csv in the tabdump format by imgexport command. If the 'imgage' column is ALL or empty, it will be replaced with the image name in the file. When imgimport command is called, it will update the litefile table on the destination mn with the contents from litefile.csv.
For stateless, rootimg.gz is exported, however the files under /install/netboot/<os>/<arch>/<profile>/rootimg are not needed. The user can simply run nodeset command the deploy the node after importing the image without the files. This does not work for statelite. For statelite, since the root image directory is mounted on the nodes, we will have to export it. We'll compress all the files under /install/netboot/<os>/<arch>/<profile>/rootimg and stored them in a file called rootimgtree.gz. When importing, all the files will be extracted and be saved to /install/netboot/<os>/<arch>/<profile>/rootimg on the new mn.