分类: LINUX
2009-05-06 18:15:13
Summary
We describe the process of using SystemImager 3.7.6 to image 20 identical machines to be used as data depots. Our setup uses a USB stick as autoinstall media and the BitTorrent transport for image deployment. We assume basic knowledge of the workings of SystemImager, and place emphasis on the generation autoinstall media. See the wiki page on BitTorrent for a more detailed explanation of the use of that transport.
Contents[]
|
In this particular example, we use machines made by supermicro which have Intel Xeon processors, 2GB RAM, and four 250GB SCSI hard drives. The hardware is only relevant in that it is fully supported by the standard SystemImager kernel. For hardware that is not supported, one solution is the UYOK functionality, which is discussed in this document.
Our server hardware happens to be the same as the clients, but this need not be the case. We began by performing a base install of CentOS 4.4 on both the IS and the GC. Once dependences were resolved by installing packages perl-AppConfig perl-XML-Simple perl-XML-Parse perl-XML-Parser (and bittorrent on the IS), we installed System Configurator and SystemImager rpms:
$ rpm -Uvh systemconfigurator-2.2.2-1.noarch.rpm \ systemimager-common-3.7.6-1.noarch.rpm \ systemimager-server-3.7.6-1.noarch.rpm \ systemimager-i386boot-standard-3.7.6-1.noarch.rpm \ systemimager-bittorrent-3.7.6-1.noarch.rpm $ rpm -Uvh systemconfigurator-2.2.2-1.noarch.rpm \ systemimager-common-3.7.6-1.noarch.rpm \ systemimager-client-3.7.6-1.noarch.rpm \ systemimager-i386initrd_template-3.7.6-1.noarch.rpm
$ si_prepareclient --server --my-modules --yes
This will start the rsync daemon on the golden client and generate a kernel and initrd.img using the UYOK mechanism, where only the currently loaded modules are included.
$ si_getimage --golden-client \ --image \ --ip-assignment DHCP \ --post-install reboot
Because we will be booting from USB stick rather than over the network, we will not need to configure the IS as a boot server. Thus, we may decline the offer to run the si_addclients tool.
For our simple deployment, we only needed to edit a single line in /etc/systemimager/bittorrent.conf. We added the name of the image to the list of images distributed via BitTorrent:
BT_IMAGES=
We then started the systemimager-server-bittorrent daemon:
$ /etc/init.d/systemimager-server-bittorrent start
By default, BitTorrent images are compressed for transport (this is determined by the option BT_COMPRESS=y). Thus the image will be compressed before the daemon is started.
In our particular case, we first tried the kernel and initrd.img generated using UYOK, which can be found in
The clients must know the address of the IS and which autoinstall script to use (and thus which image to install). They must also be told to use the BitTorrent transport. Since all of our clients will be using the same image and will be configured to receive ip addresses and hostnames via DHCP, we will be able to use the same installation parameters for all of them.
The mapping between clients and images can be defined on the IS, which can be accomplished in an automated fashion by using the si_addclients tool. In our case, we will be configuring the clients to request a particular image by using the IMAGE_NAME installation parameter, so that our setup can be configured to work in any DHCP environment so long as the IMAGESERVER installation parameter is properly set.
The local.cfg file maybe used for local configuration of installation parameters. It can be supplied to a client either on a floppy disk or on the USB stick itself. In our case, it might contain the following:
IMAGESERVER=IMAGENAME= BITTORRENT=y
In order to have it written to the USB stick, we would use the --config option with si_mkautoinstalldisk (see below).
Because all of our clients will receive the same configuration, we may skip the use of local.cfg all together, and use kernel boot parameters exclusively An example usage of the --append option is as follows.
--append "IMAGESERVER=IMAGENAME= BITTORRENT=y SKIP_LOCAL_CFG=y"
These options will be written By skipping the local configuration, we save the time required to search for local.cfg in the clients' floppy drive.
A USB stick is plugged into the image server and recognized as /dev/sde (by issuing dmesg). The following command formats the USB stick to act as the autoinstall media for our clients.
$ si_mkautoinstalldisk --device /dev/sde \ --kernel \ --initrd \ --append " " \ --config