Sun N1 Service Provisioning System User's Guide for OS Provisioning Plug-In 3.0

Chapter 6 Provisioning the RedHat Linux Operating Environment

This chapter explains how to use the OS provisioning plug-in to install the RedHat Linux operating system onto target hosts.

The chapter contains the following information:

RedHat Kickstart Technology

The OS provisioning plug-in uses RedHat Linux kickstart technology.

RedHat Linux Provisioning Process Overview

  1. Set up the RedHatLinux image server.

  2. Create the RedHat 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 RedHat Linux Server

The OS provisioning plug-in uses the features provided through the JumpStart Enterprise Toolkit (JET) technology in conjunction with the RedHat Linux Kickstart functionality to provision the RedHat Linux Operating System (OS). When you set up a RedHat Linux server, you create JET modules that run Kickstart operations to provision the OS. For more information about JET, see JumpStart Enterprise Toolkit (JET) Technology.

The RedHat Linux boot and install server includes the following software:

Preparing Your Network to Provision the RedHat Linux OS

Before you create the RedHat Linux image server, you need to perform the following tasks.

ProcedureHow to Set up TFTP Access

If you use JET to create your RedHat Linux image server, the TFTP service is automatically configured to support provisioning. You need to create or copy additional directories and files to the TFTP root directory on the boot and install server. The OS distribution should be accessible through NFS for each subnet served from this boot and install server.

Before You Begin

Be sure that the appropriate TFTP server software is installed on the boot and install server.

Steps
  1. Copy or create the following directories under the TFTP root directory:


    Note –

    This task uses /tftpboot as an example of the TFTP root directory.


  2. For RedHat Linux provisioning profiles that do not use JET, copy the following files to the TFTP root directory

    • vmlinuz – The installation kernel found under the distribution, in /images/pxeboot.

    • initrd.img – The installation RAM disk found under the distribution, in /images/pxeboot.

    If you want to support provisioning of multiple releases of the RedHat Linux OS, assign a unique name to this file, such as vmlinuz_3.0.

ProcedureHow to Copy the RedHat Linux Files

This procedure describes how to create RedHat Linux OS images by copying the files from the product media. You can locate these copies on a system that is running either the RedHat Linux OS or the Solaris OS. You can also place the physical product media in the CD-ROM drives of a system, and point to these CDs as the image source for your provisioning plans. You are not required to locate these copies on your RedHat Linux boot and install server.

If you locate these copies on a system that is not the boot and install server, the copies must meet the following criteria.

Follow these steps to create copies of the RedHat 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 -o loop /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.

Creating a RedHat Linux Image Server

After you copy the RedHat Linux images, you need to create the RedHat Linux image server in your N1 SPS environment. You must make the boot and install server an N1 SPS Remote Agent, and add the boot and install server as a Remote Agent to the Master Server.

ProcedureHow to Create the RedHat Linux Image Server (Browser Interface)

To create the server from the browser interface, follow these steps.

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 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 or the boot_server_tftp_root_directory variables.


      4. Save the variables set.

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

    • If you want to use another component's variable settings, click Import Set From Component.

      The Import Variable Settings window displays.

      1. If necessary, navigate to the Folder that contains the component with the variable settings you want to import.

      2. Select the component version.


        Note –

        Variable settings can vary between component versions. Ensure that the current components and the component from which you want to import variable settings share common variables. If the component from which you want to import variable settings does not share common variables with the component you want to use in your plan, the variable settings are not imported.


      3. Click Import Variable Settings.

        The variables settings are imported, and are displayed in the table.

      4. On the Plan Details Run page, select the variable settings that you imported from the Variable Settings drop-down list, then click Select.

    • If you want to use component variable settings that are stored in a file, follow these steps.

      1. In the Import Sets from File text field, enter the path to the variable settings file that you want to use.

        To browse through the file system to find the appropriate file, click the Browse button.

      2. Click Import.

        The variables settings are imported, and are displayed in the table.


        Note –

        If the file from which you want to import variable settings does not share common variables with the component you want to use in your plan, the variable set is not imported.


      3. On the Plan Details Run page, select the variable settings that you imported from the Variable Settings drop-down list, then click Select.

  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.

    These steps install the SUNWjet, JetRedHat, and JetSuse packages on the boot and install server. The SUNWjet package sets up the TFTP server and the NFS share for the JET base directory, /opt/SUNWjet by default.

Troubleshooting

If your OS provisioning server is located on the same physical host as the boot and install server, you must configure the interfaces on the system before your provision any target hosts. The OS provisioning server does not automatically configure the interfaces of the boot and install server.

ProcedureHow to Create the RedHat Linux Image Server (Command-Line Interface)

You can create a RedHat Linux image server from the N1 SPS browser interface or command-line interface.

Before You Begin

The kickstart file should be placed on the RedHat Linux boot and install server in an NFS exported directory so that the target hosts can locate it, for example, /export/kickstart.

Step

    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
    

    These commands install the SUNWjet, JetRedHat, and JetSuse packages on the boot and install server. The SUNWjet package sets up the TFTP server and the NFS share for the JET base directory, /opt/SUNWjet by default.

Troubleshooting

If your OS provisioning server is located on the same physical host as the boot and install server, you must configure the interfaces on the system before your provision any target hosts. The OS provisioning server does not automatically configure the interfaces of the boot and install server.

Creating RedHat Linux Images and Profiles

After you create your RedHat Linux image server, you need to create the provisioning images and profiles.

Creating RedHat Linux Images and Profiles With JET

The JumpStart Enterprise Toolkit (JET) is a set of utilities that simplifies the process of creating the profiles necessary to provision the RedHat Linux OS. Through the N1 SPS browser interface, you can generate the profile keywords and values that are required to perform an automated Kickstart installation of your target host.

If you prefer to not use JET, and create the profile values manually, you can create the RedHat Linux image and profile without using JET modules. See Creating Non-JET RedHat Linux Images and Profiles.

ProcedureHow to Create a RedHat Linux Provisioning Profile With JET (Browser Interface)

Before You Begin

Make sure the Linux image server exists and that the RedHat Linux operating system software is available to that server. For more information about creating the RedHat Linux image server, see Setting up the RedHat 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 RedHat 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.

        The following table describes the additional variables and their default values.

        Variable Name 

        Description 

        Default Value/Example 

        osp_server

        Virtual server representing the OS provisioning service 

        masterserver-osp (Default)

        version

        Version of Linux to be deployed by this component 

        3U4 (Example)

        architecture

        Architecture of the physical system, for example, x86 


        Note –

        This value is used to name the profile component and OS image. The value of this variable is not validated or enforced by the provisioning software.


        x86 (Default)

        installPath

        RedHat Linux image name to attach 

        Linux:[version]_:[architecture]

        For example: Linux_3U4_x86

        description

        Optional description for this profile 

        test linux (Example)

        min_disk_size

        Minimum disk space required to provision the RedHat Linux OS 

        10GB (Default)

        boot_server_name

        Name of RedHat Linux boot and install server 

        masterserver (Example)

        boot_server_subnet_address

        Subnet served by the boot and install server 

        10.10.31.0 (Example)

        boot_server_subnet_ip_address

        IP address of the boot and install server on the subnet 

        10.10.31.1 (Example)

        image_subnet_mask

        Netmask of the provisioning subnet 

        255.255.255.0 (Default)

        kickstart_file

        (Non-JET profiles only) 

        Absolute path of the Kickstart file ks.cfg on the boot server

        Do not specify a value for this variable for JET-generated profiles. 

        N/A 

        pxe_boot_file

        (Non-JET profiles only) 

        Relative path from the /tftpboot directory of the pxelinux.0 boot file on the boot server

        Do not specify a value for this variable for JET-generated profiles. 

        N/A 

        pxe_configuration_file

        (Non-JET profiles only) 

        Relative path from the pxelinux.cfg directory of the PXE Linux configuration file on boot server

        Do not specify a value for this variable for JET-generated profiles. 

        N/A 

        linux_component_folder

        Location of autogenerated Linux Provision component folder 

        /com/sun/n1osp/autogen-:[target(..):sys.hostName]-linux (Default)

        image_path

        (JET profiles only) 

        NFS path to the OS image. 

        Do not specify a value for this variable for non-JET profiles. 

        nfs://10.10.31.1/export/install/RHEL3 (Example)

        kernel

        (JET profiles only) 

        Relative path to the kernel in the OS image 

        Do not specify a value for this variable for non-JET profiles. 

        images/pxeboot/vmlinuz (Default)

        initrd

        (JET profiles only) 

        Relative path to initrd in the OS image

        Do not specify a value for this variable for non-JET profiles. 

        images/pxeboot/initrd.img (Default)

      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. If needed, change the Profile Name.

  7. If needed, change the Profile Description.

  8. Update the list of the JET modules to use.

    The JET product modules are located on the JET server in the directory /opt/SUNWjet/Products.

    By default, the plan variable JET Modules Name(s) lists two JET modules to include in the RedHat Linux profile component:

    base_config is the required JET module for basic RedHat Linux installation. All other /opt/SUNWjet/Products modules are optional. Adding a module name to this list adds the module installation function and configuration variables to the newly created RedHat Linux provisioning profile.

  9. Verify that the Use the Jet Modules Specified Above checkbox is selected.

  10. Click Run Plan (includes preflight).

  11. To verify that the Linux profile is created to the Linux image server, click Components in the left pane of the N1 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-Linux3U4_x86-linux/provision/.

ProcedureHow to Create a JET RedHat 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=test linux; \
    min_disk_size=10GB;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 \
    -f /tmp/redhat-profile
    

    Note the default N1 SPS user value you specified with the -u option. This user must exist after the OS installation for the N1 SPS Remote Agent software to start on the target host.

Creating Non-JET RedHat Linux Images and Profiles

If you prefer to manually create the RedHat Linux images and profiles, you can create the RedHat Linux image and profile without using JET modules. This section describes how to create non-JET RedHat Linux images and profiles.

If you prefer to use JET to generate your images and profiles, see Creating RedHat Linux Images and Profiles With JET.

ProcedureHow to Create a PXE Configuration File for RedHat Linux OS Provisioning

To deploy non-JET RedHat Linux images to your target hosts, you need to manually create a PXE configuration file. This file contains parameters specific to each hardware platform and RedHat Linux distribution.

Steps
  1. In a text editor, create a file with the following text.

    default el30 ks
    serial 0 9600
    label el30
    kernel vmlinuz
    append linksleep=30 ksdevice=eth0 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 must be all on one 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 is omitted, eth0 is assumed.

      console=ttyS1,9600 specify console parameters to show the installation output on the console. The parameters vary depending on the target hardware platform.

      load_ramdisk indicates to use initrd.img for the RAM disk. The path for the RAM disk is relative to pxelinux.0.

      network indicates to perform a network installation.

  2. Save this file to the pxelinux.cfg subdirectory of the TFTP root directory on the boot and install server.

    If you want to support provisioning of multiple releases of the RedHat Linux OS, assign a unique name to this file, such as rh30.cfg

ProcedureHow to Create a Non-JET RedHat Linux Provisioning Profile (Browser Interface)

Before You Begin

Make sure the Linux image server exists and that the RedHat Linux operating system software is available to that server. For more information about creating the RedHat Linux image server, see Setting up the RedHat Linux Server.

Create a PXE Linux configuration file, and locate this file in the pxelinux.cfg directory on the boot and install server. For an example of the PXE Linux configuration file, see How to Create a PXE Configuration File for RedHat Linux OS Provisioning.

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

        The following table describes the additional variables and their default values.

        Variable Name 

        Description 

        Default Value/Example 

        osp_server

        Virtual server representing the OS provisioning service 

        masterserver-osp (Default)

        version

        Version of Linux to be deployed by this component 

        3U4 (Example)

        architecture

        Architecture of the physical system, for example, x86 


        Note –

        This value is used to name the profile component and OS image. The value of this variable is not validated or enforced by the provisioning software.


        x86 (Default)

        installPath

        RedHat Linux image name to attach 

        Linux:[version]_:[architecture]

        For example: Linux_3U4_x86

        description

        Optional description for this profile 

        test linux (Example)

        min_disk_size

        Minimum disk space required to provision the RedHat Linux OS 

        10GB (Default)

        boot_server_name

        Name of RedHat Linux boot and install server 

        masterserver (Example)

        boot_server_subnet_address

        Subnet served by the boot and install server 

        10.10.31.0 (Example)

        boot_server_subnet_ip_address

        IP address of the boot and install server on the subnet 

        10.10.31.1 (Example)

        image_subnet_mask

        Netmask of the provisioning subnet 

        255.255.255.0 (Default)

        kickstart_file

        (Non-JET profiles only) 

        Absolute path of the Kickstart file ks.cfg on the boot server. This file must be accessible to the boot and install server.

        Do not specify a value for this variable for JET-generated profiles. 

        /tftpboot/v6x/as21.cfg (Example)

        pxe_boot_file

        (Non-JET profiles only) 

        Relative path from the /tftpboot directory of the pxelinux.0 boot file on the boot server

        Do not specify a value for this variable for JET-generated profiles. 

        v6x/pxelinux.0 (Example)

        pxe_configuration_file

        (Non-JET profiles only) 

        Relative path from the pxelinux.cfg directory of the PXE Linux configuration file on boot server

        Do not specify a value for this variable for JET-generated profiles. 

        as21-console (Example)

        linux_component_folder

        Location of autogenerated Linux Provision component folder 

        /com/sun/n1osp/autogen-:[target(..):sys.hostName]-linux (Default)

        image_path

        (JET profiles only) 

        NFS path to the OS image. 

        Do not specify a value for this variable for non-JET profiles. 

        N/A 

        kernel

        (JET profiles only) 

        Relative path to the kernel in the OS image 

        Do not specify a value for this variable for non-JET profiles. 

        N/A 

        initrd

        (JET profiles only) 

        Relative path to initrd in the OS image

        Do not specify a value for this variable for non-JET profiles. 

        N/A 

      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. Deselect the checkbox for Use the Jet Modules Specified Above.

  7. Click Run Plan (includes preflight).

  8. To verify that the Linux profile is created to the Linux image server, click Components in the left pane of the N1 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-Linux3U4_x86-linux/provision/.

ProcedureHow to Create a Non-JET RedHat 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=test linux;min_disk_size=10GB; \
    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 provide JET module information, create a file /tmp/redhat-profile that contains the following entries:

    standard-nojet
    Standard Linux
    base_config
    false

    Where:

    • The first line in the file corresponds to the Profile Name field in the plan variables section of the browser interface.

    • The second line in the file corresponds to the Profile Description field in the plan variables section of the browser interface.

    • The third line in the file corresponds to the JET Module Name field in the plan variables section of the browser interface.

    • The fourth line in the file corresponds to the Use the Jet Modules Specified Above checkbox in the plan variables section of the browser interface.

  3. 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
    -f /tmp/redhat-profile
    

    Note the default N1 SPS user value you specified with the -u option. This user must exist after the OS installation for the N1 SPS Remote Agent software to start on the target host.

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

Before You Begin

Ensure that the network interfaces on the boot and install server are properly configured.

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.

Deleting RedHat Linux Images and Profiles

You might want to periodically delete unused OS images and profiles from your N1 SPS environment.

ProcedureHow to Delete RedHat Linux OS Images

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

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

  3. On the Components Details page, select the checkbox for Uninstall: Delete.

  4. Click Run.

    The RedHat Linux OS image is removed from the N1 SPS environment. The image does not appear in the list of images in the View link for RedHat Linux Images section.


    Note –

    The RedHat Linux OS image is not removed from the boot and install server.


ProcedureHow to Delete RedHat Linux OS Profiles

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 RedHat Linux Images section.

  3. On the Components page, select the checkbox for the profile that you want to delete.

  4. Click Delete.