This chapter explains how to use the OS provisioning plug-in to install the Linux operating system onto target hosts.
The chapter contains the following information:
The OS provisioning plug-in uses Linux kickstart technology.
Set up the Linux image server.
Create the Linux image or attach an existing image to the image server.
Create a target host.
Install the OS onto the target host.
The Linux boot and install server includes the following software:
Linux (tested with RedHat Advanced Server 3.0)
TFTP server
NFS server
N1 Grid SPS Remote Agent (RA) for Linux. For information, see How to Prepare a Physical Host in N1 Grid Service Provisioning System 5.0 System Administration Guide.
Create a directory to contain the Linux files.
To serve multiple distributions from the same server, create a separate directory for each distribution.
Mount the first CD-ROM or ISO image file.
Use a command similar to one of the following examples:
#mount /dev/cdrom by default, will mount on /mnt/cdrom, check /etc/fstab #mount /path-to-first-iso /mnt/loop assumes /mnt/loop exists |
Copy the content from the CD-ROM or ISO image file to the directory that you created in Step 1.
Use a command similar to one of the following examples:
#/bin/cp -avf /mnt/cdrom/* /export/RHEL3.0 #bin/cp -avf /mnt/loop/* /export/RHEL3.0 |
Repeat Steps 2 and 3 for all the CD-ROM or ISO media in the distribution.
The distribution should be accessible through NFS for each subnet served from this boot and install server.
Edit the /etc/exports file and add lines similar to the following example:
/export 10.42.42.*(ro) |
Enable NFS and start it.
Use commands similar to the following, which apply to RedHat AS 3.0:
#chkconfig nfs on #service nfs restart |
The distribution should be accessible through NFS for each subnet served from this boot and install server.
Look for the server_args parameter in the /etc/xinet.d/tftp file.
This defines the root directory used by the TFTP server. If the directory does not exist, create it.
This task uses /tftpboot as an example.
Enable TFTP and restart the xinetd daemon.
Use commands similar to the following example, which works on RedHat AS 3.0:
#chkconfig tftp on #service xinetd restart |
Copy or create the following directories under the TFTP root directory:
/tftpboot/pxelinux.0 – You can download the Linux PXE bootstrap file from http://syslinux.zytor.com/pxe.php.
/tftpboot/pxelinux.cfg/ – This directory contains the PXE configuration files. These files contain parameters specific to each hardware platform and Linux distribution.
/tftpboot/pxelinux.cfg/v20z-config – A specific directory for the V20z platform.
/tftpboot/vmlinuz – The installation kernel found under the distribution, in /images/pxeboot.
/tftpboot/initrd.img – The installation RAM disk found under the distribution, in /images/pxeboot.
The following example shows the PXE configuration file for a SunFire V20z system.
default el30 ks serial 0 9600 label el30 kernel vmlinuz append linksleep=30 ksdevice=eth0 console=tty0 console=ttyS1,9600 load_ramdisk=1 initrd=initrd.img network
Where:
The first line (default) indicates to use label el30 and do a Kickstart installation (passing ks to the kernel).
The third line (label) defines a label el30.
The fourth line (kernel) identifies the kernel to load. The path is relative to pxelinux.0.
The fifth line (append) contains a series of network configuration parameters. The append parameters should be all on the same line. The specific parameters shown here are as follows:
linksleep=30 tells the kernel to wait before determining that the system is not working. Some network interfaces require a long time to come up.
ksdevice=eth0 indicates to perform the installation through the eth0 interface. If this parameter us omitted, eth0 is assumed.
console=tty0 console=ttyS1,9600 specify console parameters to show the installation output on the console. The parameters vary depending on the target hardware platform.
The last line (load_ramdisk and initrd) indicate to use initrd.img for the RAM disk and to perform a network installation. The path for the RAM disk is relative to pxelinux.0
vmlinuz and initrd files only work with a specific version of a specific distribution. If using the server to provide multiple distributions, or multiple versions of a distribution, each vmlinuz and initrd pair must be uniquely identifiable. You can create the unique identifiers either by using separate directories or by renaming the files, as shown in the following example:
/tftpboot/pxelinux.0 /tftpboot/RHEL2.1/vmlinuz /tftpboot/RHEL2.1/initrd /tftpboot/RHEL3.0/vmlinuz /tftpboot/RHEL3.0/initrd or /tftpboot/pxelinux.0 /tftpboot/rhel2.1-vmlinuz /tftpboot/rhel2.1-initrd /tftpboot/rhel3.0-vmlinuz /tftpboot/rhel3.0-initrd |
You can create a Linux image server from the N1 Grid SPS browser interface or command-line interface. To create the server from the command line, type commands similar to the following:
# cr_cli -cmd cdb.vs.add -comp NM:/com/sun/n1osp/untyped/LinuxServer \ -name "linuxserver" -u admin -p admin -vars "boot_server_tftp_root_directory=/tftpboot" # cr_cli -cmd pe.p.run -u admin -p admin \ -PID NM:/com/sun/n1osp/untyped/LinuxServer-create \ -tar H:NM:bikickstart -comp + -vs linuxserver -pto 30 -nto 10 |
To create the server from the browser interface, follow these steps.
The kickstart file should be placed on the Linux boot and install server in an NFS exported directory so that the target hosts can locate it, for example, /export/kickstart.
In the Common Tasks section of the provisioning software page, select OS Provisioning.
On the OS Provisioning Common Tasks page, click Create in the Linux Image Servers section.
On the Plans Details page, click Run.
Choose variables to use for this plan.
To use an existing variables set, select a name from the drop-down menu in the LinuxServer component row of the Plan Parameters table.
To create a new variables set, click Select from List in the LinuxServer component row of the Plan Parameters table.
Click Create Set.
Type a name for the variables set.
If needed, change the boot_server_tftp_root_directory variable to the location where you want the Linux packages to be installed.
By default, the path is /tftpboot.
If needed, change the linuxHost variable to the location of the command-line interface.
By default, the virtual Linux host name is set to the host name of the target host with -linux appended.
Do not modify the installPath variable.
Save the variables set.
Select the variables set that you just saved from the drop-down menu in the LinuxServer component row of the Plan Parameters table.
Select the host on which to create the Linux image server.
Click Run Plan (includes preflight).
To verify that the image server is created successfully, click the Hosts link in the left side of the provisioning server window.
You should see the name of the virtual host appended with -linux. For example, if you installed on host bikickstart, the virtual host is bikickstart-linux.
Make sure the Linux image server exists and that the Linux operating system software is available to that server. For more information about creating the Linux image server, see Setting up the Linux Server.
In the Common Tasks section of the provisioning software page, select OS Provisioning.
On the OS Provisioning Common Tasks page, click Create Profile in the Linux Images section.
On the Plans Details page, click Run.
Choose variables to use for this plan.
On the Plan Details Run page, select the Linux image server on which to create the profile.
The host name of the Linux image server ends in -linux.
Click Run Plan (includes preflight).
To verify that the Linux profile is created to the Linux image server, click Components in the left pane of the N1 Grid SPS browser interface.
You should find a provision component in the folder /com/sun/n1osp/autogen-server-name-linux/provision/, where server-name is the Linux server name that you provided in the variable set. For example: /com/sun/n1osp/autogen-LinuxRedHat3.0_x86-linux/provision/.
To create a variable set for the LinuxImage component, type a command similar to the following example:
# cr_cli -cmd cdb.vs.add -comp NM:/com/sun/n1osp/untyped/LinuxImage \ -name "redhat3" -u admin -p admin -vars "osp_server=masterserver-osp;version=RedHat3.0; \ architecture=x86;installPath=Linux:[version]_:[architecture]; \ description=testlinux;min_disk_size=10GB;monitor_install=FALSE; \ boot_server_name=bikickstart;boot_server_subnet_address=10.42.42.0; \ boot_server_subnet_ip_address=10.42.42.3;kickstart_file=/export/el30.cfg;\ pxe_boot_file=linux-install/pxelinux.0;pxe_configuration_file=el30-console" |
To run the plan, type a command similar to the following example:
# cr_cli -cmd pe.p.run -u admin -p admin \ -PID NM:/com/sun/n1osp/untyped/LinuxImage-create-profile \ -tar H:NM:bikickstart-linux -comp + -vs redhat3 -pto 30 -nto 10 |
Profiles are used to provision OS Images to target Hosts. These Profiles are found in /com/sun/n1osp/autogen...provision folders. One new Profile is added to a provision folder each time a new OS Image is created (or attached).
In the Common Tasks section of the provisioning software page, select OS Provisioning.
On the OS Provisioning Common Tasks page, click Provision OS in the Linux Images section.
Navigate to the Linux folder that contains the provision component.
For example, /com/sun/n1osp/autogen-bikickstart-linux/provision/LinuxRedHat3.0_x86
Slect the component name.
On the Component Details page, click the Run action next to the Provision_start:Install procedure.
Select the target host on which to provision the operating system.
The target host should have a host name that ends in -target.
Click Run Plan (includes preflight).
In the Common Tasks section of the provisioning software page, select OS Provisioning.
On the OS Provisioning Common Tasks page, click Status in the OS Provisioning Administration Tasks section.
On the Plans Details page, click Run.
On the Plan Details Run page, select the target host on which you provisioned the operating system.
Click Run Plan (includes preflight).
Follow the Details links to view the status.