Import an NCN Image to IMS

This page documents an automated tool which takes a set of Non-Compute Node (NCN) kernel, initrd, and SquashFS artifact files, uploads them into the Simple Storage Service (S3), and registers them as an image in the Image Management Service (IMS).

For the more general (and more manual) procedure for how to register images in IMS, see Import an External Image to IMS. In addition to providing a more detailed explanation of the various subtasks being carried out, that procedure also covers such variations as:

Prerequisites

  • CSM is fully installed, configured, and healthy.
    • The Image Management Service (IMS) is healthy.
    • The Simple Storage Service (S3) is healthy.
    • The NCN Certificate Authority (CA) public key has been properly installed into the CA cache for this system.
    • These may be validated by performing the following health checks:
  • The Cray CLI is configured.
  • The CSM documentation RPM must be installed on the node where the procedure is being run. See Check for Latest Documentation.
  • Image artifact files are available on the system where the procedure is being run.
    • A SquashFS image root file, a kernel file, and an initrd file are required.

Limitations

  • The commands in this procedure must be run as the root user.

Procedure

This procedure may be run on any master or worker NCN.

1. Set helper variables

Set variables for all of the image artifact files: IMS_ROOTFS_FILENAME, IMS_INITRD_FILENAME, and IMS_KERNEL_FILENAME.

  1. (ncn-mw#) Set the IMS_ROOTFS_FILENAME variable to the path and file name of the SquashFS image root file.

    For example:

    IMS_ROOTFS_FILENAME=my_ncn_artifacts/sles_15_image.squashfs
    
  2. (ncn-mw#) Set the IMS_INITRD_FILENAME variable to the path and file name of the initrd file.

    For example:

    IMS_INITRD_FILENAME=my_ncn_artifacts/initrd
    
  3. (ncn-mw#) Set the IMS_KERNEL_FILENAME variable to the file name of the kernel file.

    For example:

    IMS_KERNEL_FILENAME=my_ncn_artifacts/kernel
    
  4. (ncn-mw#) Set the IMS_IMAGE_NAME variable to a name for the new image in IMS.

    This is just a label for the image in IMS – it does not need to correspond to an actual artifact or file.

    For example:

    IMS_IMAGE_NAME=rootfs-k8s-customized-version-2
    

2. Upload artifacts and create IMS image record

  1. (ncn-mw#) Set the path to the IMS image upload script.

    NCN_IMS_IMAGE_UPLOAD_SCRIPT=$(rpm -ql docs-csm | grep ncn-ims-image-upload[.]sh)
    echo "${NCN_IMS_IMAGE_UPLOAD_SCRIPT}"
    
  2. (ncn-mw#) Register the new NCN image in IMS.

    NEW_NCN_IMS_ID=$( "$NCN_IMS_IMAGE_UPLOAD_SCRIPT}" --no-cpc \
                          -i "${IMS_INITRD_FILENAME}" \
                          -k "${IMS_KERNEL_FILENAME}" \
                          -s "${IMS_ROOTFS_FILENAME}" \
                          -n "${IMS_IMAGE_NAME}" )
    echo "${NEW_NCN_IMS_ID}"
    

    The IMS ID (in UUID format) of the new NCN image should be shown.