N1 Grid Service Provisioning System User's Guide and Release Notes for the OS Provisioning Plug-In 1.0

Chapter 6 Provisioning the Linux Operating Environment

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:

Kickstart Technology

The OS provisioning plug-in uses Linux kickstart technology.

Linux Provisioning Process Overview

  1. Set up the Linux image server.

  2. Create the Linux image or attach an existing image to the image server.

  3. Create a target host.

  4. Install the OS onto the target host.

Setting up the Linux Server

The Linux boot and install server includes the following software:

ProcedureHow to Copy Linux Files

Steps
  1. Create a directory to contain the Linux files.


    Note –

    To serve multiple distributions from the same server, create a separate directory for each distribution.


  2. 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
      
    
  3. 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
       
    
  4. Repeat Steps 2 and 3 for all the CD-ROM or ISO media in the distribution.

ProcedureHow to Set up NFS Access

The distribution should be accessible through NFS for each subnet served from this boot and install server.

Steps
  1. Edit the /etc/exports file and add lines similar to the following example:


    /export   10.42.42.*(ro)
  2. Enable NFS and start it.

    Use commands similar to the following, which apply to RedHat AS 3.0:


    #chkconfig nfs on
      #service nfs restart
    

ProcedureHow to Set up TFTP Access

The distribution should be accessible through NFS for each subnet served from this boot and install server.

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


    Note –

    This task uses /tftpboot as an example.


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


Example 6–1 Sample PXE Configuration File

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:


ProcedureHow to Create the Linux Image Server

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.

Before You Begin

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.

Steps
  1. In the Common Tasks section of the provisioning software page, select OS Provisioning.

  2. On the OS Provisioning Common Tasks page, click Create in the Linux Image Servers section.

  3. On the Plans Details page, click Run.

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

      1. Click Create Set.

      2. Type a name for the variables set.

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

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


        Caution – Caution –

        Do not modify the installPath variable.


      5. Save the variables set.

      6. Select the variables set that you just saved from the drop-down menu in the LinuxServer component row of the Plan Parameters table.

  5. Select the host on which to create the Linux image server.

  6. Click Run Plan (includes preflight).

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

Creating Linux Images and Profiles

ProcedureHow to Create a Linux Provisioning Profile (Browser Interface)

Before You Begin

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.

Steps
  1. In the Common Tasks section of the provisioning software page, select OS Provisioning.

  2. On the OS Provisioning Common Tasks page, click Create Profile in the Linux Images section.

  3. On the Plans Details page, click Run.

  4. Choose variables to use for this plan.

    • To use an existing variables set, select a name from the drop-down menu in the LinuxImage component row of the Plan Parameters table.

    • To create a new variables set, click Select from List in the LinuxImage component row of the Plan Parameters table.

      1. Click Create Set.

      2. Type a name for the variables set.

      3. Verify variables and change them, if needed.

      4. Save the variables set.

      5. Select the variables set that you just saved from the drop-down menu in the LinuxImage component row of the Plan Parameters table.

  5. On the Plan Details Run page, select the Linux image server on which to create the profile.


    Tip –

    The host name of the Linux image server ends in -linux.


  6. Click Run Plan (includes preflight).

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

ProcedureHow to Create a Linux Provisioning Profile (Command-Line Interface)

Steps
  1. 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"
    
  2. 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
    

Installing the OS on the Target Host

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

ProcedureHow to Install the OS on the Target Host

Steps
  1. In the Common Tasks section of the provisioning software page, select OS Provisioning.

  2. On the OS Provisioning Common Tasks page, click Provision OS in the Linux Images section.

  3. Navigate to the Linux folder that contains the provision component.

    For example, /com/sun/n1osp/autogen-bikickstart-linux/provision/LinuxRedHat3.0_x86

  4. Slect the component name.

  5. On the Component Details page, click the Run action next to the Provision_start:Install procedure.

  6. Select the target host on which to provision the operating system.


    Tip –

    The target host should have a host name that ends in -target.


  7. Click Run Plan (includes preflight).

ProcedureHow to Check OS Provisioning Status

Steps
  1. In the Common Tasks section of the provisioning software page, select OS Provisioning.

  2. On the OS Provisioning Common Tasks page, click Status in the OS Provisioning Administration Tasks section.

  3. On the Plans Details page, click Run.

  4. On the Plan Details Run page, select the target host on which you provisioned the operating system.

  5. Click Run Plan (includes preflight).

  6. Follow the Details links to view the status.