Adding Non-Windows OS Images

This chapter contains the following sections:

Adding a Non-Windows OS Image in Bare Metal Agent

This procedure creates a Non-Windows OS image template in Bare Metal Agent. You must add the OS image template before you can request a PXE boot for the OS image.


Note


You cannot use this procedure to create supported Windows operating systems images. For more information about how to set up Windows OS images, see Adding Windows OS Images.


Before You Begin

You must have all resources and requirements in place for each operating system image that you want to install through a Bare Metal Agent PXE boot request.


    Step 1   Copy the OS image(s) to one of the following locations:
    • An appropriate location in the Bare Metal Agent directory structure
    • An NFS mount point that you have added to Bare Metal Agent
    Step 2   Navigate to /opt/infra and run isoExtractor.sh.

    Example:

    The following sample isoExtractor.sh file shows a scenario for an OS image in the Bare Metal Agent directory structure. The image path field contains the location of the VMware image in the /opt/image/ folder.

    If you have added an NFS mount point, the image path field would contain the location of the image in the /mnt/external folder. For example, if you want to create a CentOS image that is located in a CentOS folder in an NFS mount point, the image path field would contain /mnt/external/CentOS/image.iso.

    root@localhost infra]# pwd
    /opt/infra
    root@localhost infra]# ./isoExtractor.sh
         Please select the OS Type
    
            1)  ESXi 4.1
            2)  ESXi 5.0
            3)  ESXi 5.1
            4)  ESXi 5.5
            5)  ESXi 6.0
            6)  ESXi 5.5 VSAN
            7)  ESXi 6.0 VSAN
            8)  CentOS or RHEL [Pre 7.0]
            9)  CentOS 7.x or RHEL 7.x
            10)  SUSE Linux
            11)  Other
    
    
           SELECT> 4
         Image path : /opt/image/VMWare-VMvisor-Installer-5.5.0-1111111.x86_64.iso
         
         OS catalog name : BMA-184-ESXi5.5
    Input file being used: /opt/images/VMware-VMvisor-Installer-5.5.0-1111111.x86_64.iso
    OS catalog name being used: BMA-184-ESXi5.5
    Mounting the image....
    Preparing the image....
    Creating catalog directory /opt/cnsaroot/templates/BMA-184-ESXi5.5
    Creating configuration files for ESXi 5.5 ...
    Copied the image and created the configuration files...
    is /opt/cnsaroot/images/
    BMA-184-ESXi5.5 centos60-small
    is /opt/cnsaroot/templates/
    BMA-184-ESXi5.5 CentOS60 Win2k12R2x64 Win2k12x64 Win2k8R2x64 
    is /opt/cnsaroot/templates/BMA-184-ESXi5.5
    boot.cfg ks.cfg pxe.cfg
    [root@localhost infra]#
    
    
    Step 3   When prompted, choose the image category and provide the image location and catalog name.
    Step 4   After the script execution is completed, navigate to /opt/cnsaroot/images/catalogname and confirm that the image is available in that location.
    Step 5   Navigate to /opt/cnsaroot/templates/catalogname and confirm that the PXE configuration templates are available in that location.
    Step 6   To verify that the OS image is created, do the following:
    1. In Cisco UCS Director, choose Physical > Compute.
    2. In the left pane, navigate to the pod that contains the Bare Metal Agent.
    3. In the right pane, click the PXE Boot Requests tab.
    4. Click Add PXE Boot Request and verify that the OS image is included in the OS Type drop-down list.

    Manually Adding a Linux OS Image in Bare Metal Agent


      Step 1   Create a directory for the operating system image in the /opt/cnsaroot/images directory of the Bare Metal 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 Bare Metal 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 Bare Metal 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 Bare Metal Agent synchronization frequency. By default, Bare Metal 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 Bare Metal Agent VM.


      Manually Adding a VMware vSphere ESXi OS Image in Bare Metal Agent


        Step 1   Create a directory for the operating system image data in the /opt/cnsaroot directory of the Bare Metal 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 Bare Metal 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 Bare Metal 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 Bare Metal Agent synchronization frequency. By default, Bare Metal 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 Bare Metal Agent VM.