Good day
Hope everyone is well 
I have begun to look into using Cloud Config to make it a simpler process to push out new VMs
This is for Ubuntu 22.04, the only variables I'd want to input would be the hostname, a static IP, disk space and install specified packages
So far I managed to get the config template to install the VM with the custom hostname
I still have trouble getting the network config working and having the new VM make use of the entire assigned disk space. The new VM will only use the original template VM's disk space (10GBs) and not extend the volume with entered disk space value
My current network template:
#network:
version: 1
config:
- type: physical
name: eth0
subnets:
type: static
address: 129.232.201.212/26
gateway: 129.232.201.193
dns_nameservers:
- 8.8.8.8
- 1.1.1.1
Current user config
#cloud-config
hostname: TEST
growpart:
mode: 'on'
resize_rootfs: true
package_update: true
packages:
- htop
- whois
My process for creating the template:
- Install Ubuntu 22.04
- Install Guest tools
- apt update && sudo apt upgrade
- Reboot
- apt purge cloud-init cloud-initramfs-dyn-netconf cloud-initramfs-copymods -y
- rm -rf /etc/cloud/; rm -rf /var/lib/cloud/
- apt update && apt full-upgrade -y
- apt install cloud-initramfs-dyn-netconf cloud-initramfs-copymods cloud-initramfs-growroot -y
- cloud-init clean
Remove/Clear the following:
10.a rm /etc/cloud/cloud.cfg.d/99-installer.cfg
10.b rm /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
10.c rm /etc/netplan/00-installer-config.yaml
10.d rm -rf /tmp/* && rm -rf /var/tmp/*
10.e rm -f /etc/ssh/ssh_host_*
10.f truncate -s 0 /etc/hostname && truncate -s 0 /etc/machine-id
-
Edit cloud.cfg
Here I only commented out the default users, as the users I set won't need to change
-
apt autoremove && apt clean
-
cloud-init clean && cloud-init clean --logs
Shutdown and convert to template
I believe my error is the disk and network are not defined in cloud.cfg
Would anyone be able to assist with examples or suggest how to correctly define the volumes and network interface
I will happy to provide any additional information or logs
Thank you 