Customise VM template with cloud-init on Promox
Promox is my favourite KVM backend virtualisation implementation for my home lab and test environment. Very easy to install and configure to start with compared to the full blonde KVM on Debian based or Red Hat based Linux distribution. It could have been easier these days since the Cockpit web admin interface has matured a lot with all virtualisation related add-on. But I have been using Promox as my preferred virtualisation platform for quite some times now so might as well stick to it rather than mucking around with Cockpit.
Following is the step-by-step guide on how to create a customised VM template with cloud-init on Promox. Ubuntu 22.04 LTS cloud image will be used as the base image for this activity. Note that the cloud image comes with cloud-init installed, and it is purposed to use with any cloud platform providers like AWS or Azure. But it can also be utilised for the virtualisation platforms like Promox or VMware ESXi.
Prerequisite
To customise the cloud image, the tool named "virt-customize" is used. Here is how to install the required package for "virt-customize". Note - the Promox repo must be disabled to install it if there is no proper subscription with Promox. $
apt update -y && apt install libguestfs-tools -y
Steps to prep the cloud image with cloud-init
SSH into the Promox's shell with root account
Download the Ubuntu 22.04 LTS cloud image \
Use the following 'virt-customize' commands to prep the downloaded cloud image.\
Now create a new VM instance by using the prep cloud image and configure as below. Note that do not startup the VM before converting it into VM template. \
As the VM template is ready, it is time to spin up the new VM instance based on the template and start it to check if the VM was configured properly. Then shutdown the VM and delete as following. \
Last updated