查看: 327|回复: 2

SystemImager HOWTO USB引导+BT传输

 关闭 [复制链接]

签到天数: 2090 天

连续签到: 2 天

[LV.Master]伴坛终老IIII

发表于 2009-5-9 17:33 | 显示全部楼层 |阅读模式
SystemImager HOWTO USB引导+BT传输



HOWTO Implement a simple BitTorrent and USB stick imaging scheme
From SystemImager
Jump to: navigation, search
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
[hide]
1 Setting Up the Image Server (IS) and Golden Client (GC)
2 Taking the Image
3 Configuring Image Deployment via BitTorrent
4 Creating the Autoinstall USB Stick
4.1 Selecting a kernel and initrd.img
4.2 Configuring Installation Parameters
4.2.1 Using local.cfg
4.2.2 Using Kernel Boot Parameters in syslinux.cfg
4.3 Running si_mkautoinstalldisk
5 Installing the Image





Setting Up the Image Server (IS) and Golden Client (GC)
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:

<IS>$ 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

<GC>$ 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

Taking the Image
<GC>$ si_prepareclient --server <IS hostname/ip> --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.

<IS>$ si_getimage --golden-client <GC hostname/ip> \\
--image <image name> \\
--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.

Configuring Image Deployment via BitTorrent
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=<image name>

We then started the systemimager-server-bittorrent daemon:

<IS>$ /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.

Creating the Autoinstall USB Stick
Selecting a kernel and initrd.img
In our particular case, we first tried the kernel and initrd.img generated using UYOK, which can be found in <GC>:/etc/systemimager/boot/ or <IS>:/var/lib/systemimager/images/<image name>/etc/systemimager/boot/. These worked well, but we found that the standard SystemImager kernel and initrd.img (located in <IS>:/usr/share/systemimager/boot/i386/standard/) worked just as well, and were much faster.

Configuring Installation Parameters
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.

Using local.cfg
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=<IS hostname/ip>
IMAGENAME=<image name>
BITTORRENT=y

In order to have it written to the USB stick, we would use the --config </path/to/local.cfg> option with si_mkautoinstalldisk (see below).

Using Kernel Boot Parameters in syslinux.cfg
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=<IS hostname/ip> IMAGENAME=<image name> 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&#39; floppy drive.

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

<IS>$ si_mkautoinstalldisk --device /dev/sde \\
--kernel </path/to/kernel> \\
--initrd </path/to/initrd.img> \\
--append \"<kernel boot parameters>\" \\
--config </path/to/local.cfg>

Installing the Image
Plug the USB stick into the client
Configure the client to boot from the USB stick
Boot the client; the kernel and initrd.img should load into memory
Remove the USB stick from the client (we don&#39;t want to boot to it again)
The image should install; the autoinstallation script to be used is determined by the image name
PCOS系统下载站:http://zhuangji.wang

签到天数: 2090 天

连续签到: 2 天

[LV.Master]伴坛终老IIII

 楼主| 发表于 2009-5-9 17:33 | 显示全部楼层

SystemImager HOWTO USB引导+BT传输

SystemImager HOWTO USB引导+BT传输



HOWTO Implement a simple BitTorrent and USB stick imaging scheme
From SystemImager
Jump to: navigation, search
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
[hide]
1 Setting Up the Image Server (IS) and Golden Client (GC)
2 Taking the Image
3 Configuring Image Deployment via BitTorrent
4 Creating the Autoinstall USB Stick
4.1 Selecting a kernel and initrd.img
4.2 Configuring Installation Parameters
4.2.1 Using local.cfg
4.2.2 Using Kernel Boot Parameters in syslinux.cfg
4.3 Running si_mkautoinstalldisk
5 Installing the Image





Setting Up the Image Server (IS) and Golden Client (GC)
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:

<IS>$ 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

<GC>$ 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

Taking the Image
<GC>$ si_prepareclient --server <IS hostname/ip> --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.

<IS>$ si_getimage --golden-client <GC hostname/ip> \\
--image <image name> \\
--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.

Configuring Image Deployment via BitTorrent
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=<image name>

We then started the systemimager-server-bittorrent daemon:

<IS>$ /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.

Creating the Autoinstall USB Stick
Selecting a kernel and initrd.img
In our particular case, we first tried the kernel and initrd.img generated using UYOK, which can be found in <GC>:/etc/systemimager/boot/ or <IS>:/var/lib/systemimager/images/<image name>/etc/systemimager/boot/. These worked well, but we found that the standard SystemImager kernel and initrd.img (located in <IS>:/usr/share/systemimager/boot/i386/standard/) worked just as well, and were much faster.

Configuring Installation Parameters
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.

Using local.cfg
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=<IS hostname/ip>
IMAGENAME=<image name>
BITTORRENT=y

In order to have it written to the USB stick, we would use the --config </path/to/local.cfg> option with si_mkautoinstalldisk (see below).

Using Kernel Boot Parameters in syslinux.cfg
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=<IS hostname/ip> IMAGENAME=<image name> 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&#39; floppy drive.

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

<IS>$ si_mkautoinstalldisk --device /dev/sde \\
--kernel </path/to/kernel> \\
--initrd </path/to/initrd.img> \\
--append \"<kernel boot parameters>\" \\
--config </path/to/local.cfg>

Installing the Image
Plug the USB stick into the client
Configure the client to boot from the USB stick
Boot the client; the kernel and initrd.img should load into memory
Remove the USB stick from the client (we don&#39;t want to boot to it again)
The image should install; the autoinstallation script to be used is determined by the image name
PCOS系统下载站:http://zhuangji.wang

签到天数: 2090 天

连续签到: 2 天

[LV.Master]伴坛终老IIII

 楼主| 发表于 2009-5-9 17:33 | 显示全部楼层

SystemImager HOWTO USB引导+BT传输

SystemImager HOWTO USB引导+BT传输



HOWTO Implement a simple BitTorrent and USB stick imaging scheme
From SystemImager
Jump to: navigation, search
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
[hide]
1 Setting Up the Image Server (IS) and Golden Client (GC)
2 Taking the Image
3 Configuring Image Deployment via BitTorrent
4 Creating the Autoinstall USB Stick
4.1 Selecting a kernel and initrd.img
4.2 Configuring Installation Parameters
4.2.1 Using local.cfg
4.2.2 Using Kernel Boot Parameters in syslinux.cfg
4.3 Running si_mkautoinstalldisk
5 Installing the Image





Setting Up the Image Server (IS) and Golden Client (GC)
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:

<IS>$ 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

<GC>$ 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

Taking the Image
<GC>$ si_prepareclient --server <IS hostname/ip> --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.

<IS>$ si_getimage --golden-client <GC hostname/ip> \\
--image <image name> \\
--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.

Configuring Image Deployment via BitTorrent
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=<image name>

We then started the systemimager-server-bittorrent daemon:

<IS>$ /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.

Creating the Autoinstall USB Stick
Selecting a kernel and initrd.img
In our particular case, we first tried the kernel and initrd.img generated using UYOK, which can be found in <GC>:/etc/systemimager/boot/ or <IS>:/var/lib/systemimager/images/<image name>/etc/systemimager/boot/. These worked well, but we found that the standard SystemImager kernel and initrd.img (located in <IS>:/usr/share/systemimager/boot/i386/standard/) worked just as well, and were much faster.

Configuring Installation Parameters
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.

Using local.cfg
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=<IS hostname/ip>
IMAGENAME=<image name>
BITTORRENT=y

In order to have it written to the USB stick, we would use the --config </path/to/local.cfg> option with si_mkautoinstalldisk (see below).

Using Kernel Boot Parameters in syslinux.cfg
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=<IS hostname/ip> IMAGENAME=<image name> 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&#39; floppy drive.

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

<IS>$ si_mkautoinstalldisk --device /dev/sde \\
--kernel </path/to/kernel> \\
--initrd </path/to/initrd.img> \\
--append \"<kernel boot parameters>\" \\
--config </path/to/local.cfg>

Installing the Image
Plug the USB stick into the client
Configure the client to boot from the USB stick
Boot the client; the kernel and initrd.img should load into memory
Remove the USB stick from the client (we don&#39;t want to boot to it again)
The image should install; the autoinstallation script to be used is determined by the image name
PCOS系统下载站:http://zhuangji.wang

本版积分规则