Managing Images in BCM#
This section provides generic information for managing disk images in BCM, including instructions for cloning images, and for exporting and importing images.
Cloning images allows administators to schedule updates in a more controlled manner and is the recommended approach when applying larger changes. It provides administrators the option to implement rolling updates and to rollback changes in case of issues encountered during the update process.
Before making changes to images assigned to nodes in a production cluster, clone the existing image and modify the cloned version. After verifying the changes on a small group of nodes first, they can be rolled out to the entire cluster.
List Images#
Use the following command to list all images for the cluster with path and kernel versions:
$ cmsh -c "softwareimage;list"
Name (key) Path (key) Kernel version Nodes
--------------------------- ------------------------------------------- -------------------- -----
default-image /cm/images/default-image 6.8.0-51-generic-64k 0
default-image-ubuntu2404-x86_64 /cm/images/default-image-ubuntu2404-x86_64 6.8.0-51-generic 0
Cloning an Image#
The following instructions clone the default image default-image and assign it the new name my-image: The name could include a version or be amended with a feature name, system type, or version number.
Start the
cmshshell and enter thesoftwareimagelevel:% softwareimageClone the default image to a new image.
The example uses my-image for the new image name and default-image as the default image:
% clone default-image my-image
Commit the changes:
% commit --wait
Use
--waitto ensure the cloning process is complete before proceeding with a script or further commands.You can also wait for the “Provisioning completed” message before exiting cmsh.
[notice] mycluster:Provisioning completed: sent mycluster:/cm/images/default-image to mycluster:/cm/images/my-image, mode UPDATE, dry run = no
You can also combine these instructions into a single line:
$ cmsh -c "softwareimage; clone default-image my-image; commit"
.. code:: shell
[notice] headnode:Provisioning completed:...
To check the status of all tasks, including cloning images, use:
$ cmsh -c "task list"
Assign the new image to nodes or node categories as described in Assigning Images to Nodes and Post Installation Configurations.
Modifying Images#
After the image has been created or to make incremental changes to an existing image, enter the context of the image and apply updates, install additional software, or modify configurations. The commands are executed in the filesystem of the selected image mounted as the root directory.
Use
cm-chroot-sw-imageto change the root directory to the file system of the provided imagemy-image:$ cm-chroot-sw-image /cm/images/my-image
Modify the image, for example, upgrade the OS with the latest Ubuntu updates:
# apt update # apt upgrade
Exit the shell with
exitor Ctrl-d
You can also use rshell from the softwareimage configuration if you are already in an interactive shell:
Navigate to the image and use
rshellto enter the file system of the image (chroot):% softwareimage use my-image
% rshellModify the image, for example, upgrade the Ubuntu distribution with the latest updates:
# apt update # apt upgrade
Exit the shell with
exitor Ctrl+D.Commit the changes and exit:
% commit
Note
The rshell (chroot) commands mount the following directories into the software image:
mounted /cm/images/my-image/dev
mounted /cm/images/my-image/dev/pts
mounted /cm/images/my-image/proc
mounted /cm/images/my-image/sys
mounted /cm/images/my-image/run
mounted /cm/images/my-image/run/systemd/resolve/stub-resolv.conf
Note
Updating a system image might install a newer version of the Linux kernel. Refer to Post Installation Configurations for instructions on assigning a new kernel to the nodes.
Destroying Images#
Running commands inside the image …
Enter the
softwareimageconfiguration and remove the image my-image:% softwareimage remove my-image
Commit the changes:
% commit
Exporting Images#
Because images are stored as directories on the head node, you can archive the image and transfer it to another BCM installation or back it up for safekeeping.
Use the following command to create a compressed tarball of the image my-image:
$ tar czf my-image.tgz -C /cm/images/my-image
Importing Images#
The following command decompresses the provided image into /cm/images and registers it with BCM.
Note
The cm-create-image command below uses the option --no-cm-cuda-repo.
It instructs BCM to exclude the CUDA repository and is required when importing a BaseOS image,
which provides its own CUDA installation.
Download a valid image to the head node.
Use
cm-create-imageto create the new image image-name and import the content from a tar.gz archive: Entercto finalize the process when prompted:$ cm-create-image -a <import-image>.tar.gz -n <image-name> --no-cm-cuda-repo
Running validate base tar........................ [ OK ] Running sanity check............................. [ OK ] Running unpack base tar.......................... [ OK ] ******************** IMPORTANT **************************** Please confirm that the base distribution repositories for the software image are enabled. For instructions on how to enable repositories for your software image, please refer the administrator's manual. Image creation can be resumed in one of the following ways: ----------------------------------------------------------- 1. Enter 'e' to exit, and configure repositories. Then, restart program with the -d (--fromdir) option. cm-create-image -d /cm/images/dgxos-7.2-image -n dgxos-7.2-image 2. Open a new console, and configure repositories. Then enter 'c' on this console, to continue software image creation. *********************************************************** Continue(c)/Exit(e)? c Finalize base distribution....................... [ OK ] Copying cm repo files............................ [ OK ] Validating repo configuration.................... [ OK ] Installing distribution packages................. [ OK ] Finalizing image services........................ [ OK ] Installing CM packages........................... [ OK ] Finalizing cluster services...................... [ OK ] Copying cluster certificate to image............. [ OK ] Adding/Updating software image................... [ OK ]
Assign the new image to nodes or node categories as described in Assigning Images to Nodes and Post Installation Configurations.