Unlikely as I just tried with a custom minimal install. Here is a procedure to create your own openstack image:
I am using KVM with virt-manager to create this machine called
rocky-minimal, since it will be a qcow2 image by default. I set the system to use
RHEL 8.2 as the template for the hardware, with a disk size of
Then we do a minimal install of Rocky. During install I created a user called “rocky”. On the disk, create a single standard partition for / using all the available size
10GiB and set the file system to ext4.
Reboot after install let’s update the system:
let’s install some needed packages for using this image with OpenStack, etc. This means that SSH keys and other things can be injected when an instance is being created, as well as allowing OpenStack to grow the image to an appropriate disk size for the instance being created. acpid is needed so that OpenStack can shutdown the instance:
dnf install acpid cloud-init cloud-utils-growpart
/etc/cloud/cloud.cfg and add the following:
- name: rocky
this user will be used in OpenStack for injecting an SSH key, and/or setting the password of the “rocky” user if you wish since this is also possible in OpenStack.
Reboot the server to use new installed kernel.
Remove old kernel and just leave the current one to save space. For mine on Rocky 8.4, I just did this:
dnf remove `rpm -qa | grep -i kernel | grep 305.3`
but in future that will vary from one version to the next. Then shutdown the server:
and let’s prep the image so that any MAC addresses, etc are removed - you use whatever name you called the VM in virt-manager (so in my example rocky-minimal):
virt-sysprep -d rocky-minimal
final step, compress the machine image:
qemu-img convert -c -O qcow2 rocky-minimal.qcow2 rocky-minimal-shrunk.qcow2
We can now see this based on what is looked like before:
-rw------- 1 root root 11G Jul 13 15:41 rocky-minimal.qcow2
-rw-r--r-- 1 root root 1.2G Jul 13 15:44 rocky-minimal-shrunk.qcow2
as you can see 1.2GB, so pretty much the same as the Rocky-8-GenericCloud image. If the install could be pruned down by checking the list of packages installed and removing unnecessary ones, in theory the image size could be reduced. I don’t see a 1.2GB image is being a major problem though.