Manual Setup of Operating System Images

This chapter contains the following sections:

Manual Setup of Linux and ESXi Operating System Images for PXE Installation

We recommend that you set up Linux and ESXi operating system (OS) images for Cisco UCS Director Baremetal Agent (Baremetal Agent) through a PXE boot request or orchestration workflow, as described in Adding and Configuring PXE Boot Requests and Orchestration Workflow Tasks for PXE Boot. However, if you prefer, you can set up these OS images manually.

Adding a Linux Operating System Image

Procedure
    Step 1   Create a directory for the operating system image in the /opt/cnsaroot/images directory of the Baremetal Agent VM.

    mkdir /opt/cnsaroot/images/image_name

    This directory is used to store the operating system image files required for PXE installation.

    Note   

    This directory name is included in the OS Type drop-down list in the Setup PXE Boot task. We recommend that you make the directory name descriptive enough that you can identify the operating system of the images within it. For example, we recommend that you name the directory RHEL6.2 or CentOS5.

    Step 2   Create a directory for the operating system image with the same name as the one that you created in Step 1 in the /opt/cnsaroot/templates directory of the Baremetal Agent VM.

    mkdir /opt/csnaroot/templates/new_image_name

    This directory is used to store the Kickstart and PXE configuration template files for the operating system image.

    Step 3   Copy the .iso file or files for the required operating system to the /tmp directory of the Baremetal Agent VM.
    Step 4   Mount the .iso file to the iso directory.

    mount –o loop /tmp/.iso_file /mnt/iso

    Step 5   Copy the entire contents of the .iso file to the /opt/cnsaroot/images/image_name directory that you created in Step 1.

    cp –R /mnt/iso/* /opt/cnsaroot/images/image_name

    Note   

    Make sure that you use the cp –R command to recursively copy the entire contents of the .iso file. This command copies the underlying directories and their contents also.

    Step 6   When the copy operation is complete, unmount the .iso file.

    umount /mnt/iso

    Step 7   If the operating system image consists of more than one .iso file, repeat Steps 5, 6, and 7 for each .iso file until the contents of all .iso files have been copied to the /opt/cnsaroot/images/image_name directory.
    Step 8   Create a ks.cfg file and a pxe.cfg file in the /opt/cnsaroot/templates/image_name directory that you created in Step 2.
     
    touch /opt/cnsaroot/templates/image_name/ks.cfg
    touch /opt/cnsaroot/templates/image_name/pxe.cfg
      
    Step 9   Add the required configuration information to the ks.cfg and pxe.cfg files.

    For sample ks.cfg and pxe.cfg files and more information about these files, see Sample Operating System Configuration Template Files.

    Step 10   Create a soft link in the /var/www/html directory for this operating system image.

    ln –s /opt/cnsaroot/images/image_name /var/www/html/

    Step 11   (Optional)If necessary, update the initrd.img and vmlinuz files for the operating system image as follows:
    1. Copy the initrd.img and vmlinuz files from the /opt/cnsaroot/images/image_name directory to the /opt/cnsaroot/ directory.
    2. Overwrite the current files in this location.
    Step 12   In Cisco UCS Director, verify that the operating system image is available from the OS Type drop-down list in the Setup PXE Boot task.

    Wait two minutes, or for whatever duration has been set for the Baremetal Agent synchronization frequency. By default, Baremetal Agent is synchronized with Cisco UCS Director every two minutes. You can change this frequency with the bma.sync.frequency property in service.properties.template file under /opt/infra in the Baremetal Agent VM.


    Adding a VMware vSphere ESXi Operating System Image

    Procedure
      Step 1   Create a directory for the operating system image data in the /opt/cnsaroot directory of the Baremetal Agent VM.

      mkdir /opt/cnsaroot/images

      This directory is used to store the operating system image files required for PXE installation.

      Note   

      This directory name is included in the OS Type drop-down list in the Setup PXE Boot task. We recommend that you make the directory name descriptive enough that you can identify the operating system of the images within it. For example, we recommend that you name the directory ESXi5.0-update1 or ESXi5.1.

      Step 2   Create a directory for the operating system image with the same name as the one that you created in Step 1 in the /opt/cnsaroot/templates directory of the Baremetal Agent VM.

      mkdir /opt/csnaroot/templates/new_image_name

      This directory is used to store the Kickstart and PXE configuration template files for the operating system image.

      Step 3   Copy the .iso file or files for the required operating system to the /tmp directory of the Baremetal Agent VM.
      Step 4   Mount the .iso file to the iso directory.

      mount –o loop /tmp/.iso_file /mnt/iso

      Step 5   Copy the entire contents of the .iso file to the /opt/cnsaroot/image_name directory that you created in Step 1.

      cp –R /mnt/iso/* /opt/cnsaroot/image_name

      Note   

      Make sure that you use the cp –R command to recursively copy the entire contents of the .iso file. This command copies the underlying directories and their contents also.

      Step 6   When the copy operation is complete, unmount the .iso file.

      umount /mnt/iso

      Step 7   If the operating system image consists of more than one .iso file, repeat Steps 5, 6, and 7 for each .iso file until the contents of all .iso files have been copied to the /opt/cnsaroot/image_name directory.
      Step 8   Create a ks.cfg file and a pxe.cfg file in the /opt/cnsaroot/templates/image_name directory that you created in Step 2.
       
      touch /opt/cnsaroot/templates/image_name/ks.cfg
      touch /opt/cnsaroot/templates/image_name/pxe.cfg
        
      Step 9   Add the required configuration information to the ks.cfg and pxe.cfg files.

      For sample ks.cfg and pxe.cfg files and more information about these files, see Sample Operating System Configuration Template Files.

      Step 10   Copy the boot.cfg file from the /opt/cnsaroot/image_name directory to the /opt/cnsaroot/templates/image_name directory.
       
      cd /opt/cnsaroot/templates/image_name/
      cp /opt/cnsaroot/image_name/boot.cfg ./
      
      Step 11   Edit the boot.cfg file in the /opt/cnsaroot/templates/image_name directory as follows:
      1. After the title= line, add a prefix=/image_name/ line.
      2. Append pxebooting ks=$PXE_KS_URL to the end of the kernelopt=runweasel line.
      3. Remove the leading / from all modules listed in the boot.cfg file.
      4. Save the edited file.
      Step 12   In Cisco UCS Director, verify that the operating system image is available from the OS Type drop-down list in the Setup PXE Boot task.

      Wait two minutes, or for whatever duration has been set for the Baremetal Agent synchronization frequency. By default, Baremetal Agent is synchronized with Cisco UCS Director every two minutes. You can change this frequency with the bma.sync.frequency property in service.properties.template file under /opt/infra in the Baremetal Agent VM.