1. Home
  2. How do I add a QCOW image as a software image?

How do I add a QCOW image as a software image?

A software image is a directory on the head node that is being used to provision compute nodes. It contains a full Linux filesystem.

In order to create a new software image from a QCOW image, we must first mount the QCOW and copy the contents. This can be done as follows.

First we install libguestfs on the head node (which is running Rocky Linux in the example below) and start libvirtd:

yum install libguestfs-tools libguestfs
systemctl start libvirtd

We then mount the QCOW image and copy the contents. Make sure that the QCOW image is readable by the qemu user.

guestmount -a /tmp/image.qcow -i --ro /mnt
mkdir /cm/images/my-new-image
cp -a /mnt/* /cm/images/my-new-image/
umount /mnt

You can now turn it into a software image:

cm-create-image -d /cm/images/my-new-image --minimal --skipdist -n nvmesh -g public

Depending on how the package repositories have been configured inside of the image, this may need some tinkering to be able to install all relevant packages. See documentation on cm-create-image and cm-image for more details.

Updated on May 9, 2023

Leave a Comment