Ubuntu 22.04 Cloud-init disk size issue
-
Hi,
I have suddenly come across a issue that I am guessing has appeared with a recent change in Ubuntu that is now preventing growpart in the cloud-init to resize the disk when spun up from template.
I do recall a post on here that i have saved within my notes as a reminder that something will go wrong at some point. They has provided detailed instructions to get cloud-init working with Ubuntu and finished the post with the following:
"This post will no longer lead to a working cloud-init deployment within 3-6 months based on my previous experience"
"You have to examine the default file you get line by line and work towards the values above until the template works properly."
(@FOHDEESHA, Vates - Pro Support Team)I completed the following steps before converting to temaplate:
Install packages: cloud-init cloud-utils cloud-initramfs-growroot
Remove all or comment out from /etc/resolv.conf
Remove all but localhost from /etc/hostsRemove any datasource_list or datasource blocks, and replace them with these values in /etc/cloud/cloud.cfg
#XOA Cloud-init Data Source datasource_list: [ NoCloud, ConfigDrive ] datasource: ConfigDrive: dsmode: local NoCloud: fs_label: cidata
Add network handling in /etc/cloud/cloud.cfg
#XOA Network Handling manage_resolv_conf: true manage_etc_hosts: true preserve_hostname: false
Remove any of the old configs left by the Ubuntu install.
sudo rm -rf /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/90_dpkg.cfg /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
Clean up logs, history and remove any ssh keys.
sudo rm -rf /etc/ssh/ssh_host_* sudo cloud-init clean --logs sudo cat /dev/null > ~/.bash_history && history -c
Convert to template.
Cloud Config file is very basic, to try reduce the amount that could be going wrong to locate the isssue.
#cloud-config hostname: {name} fqdn: {name}.example.com growpart: mode: auto devices: ['/'] ignore_growroot_disabled: false packages: - nano - wget - unzip - tmux - cron package_update: true package_upgrade: true final_message: "Setup complete in $UPTIME seconds, please allow two minuets for DNS records to update!"
My template is build on a 16GB disk, as the point of VM creation I set the disk to 128GB.
running lsblk shows the 128GB is there.NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 1024M 0 rom xvda 202:0 0 128G 0 disk ├─xvda1 202:1 0 1M 0 part ├─xvda2 202:2 0 1.8G 0 part /boot └─xvda3 202:3 0 14.2G 0 part └─ubuntu--vg-ubuntu--lv 253:0 0 14.2G 0 lvm /
as you can see my / mount is still at the 14GB. Running vgdisplay and df -h both do not show the 128GB disk and has also preventing me from resizing.
--- Volume group --- VG Name ubuntu-vg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size <14.25 GiB PE Size 4.00 MiB Total PE 3647 Alloc PE / Size 3647 / <14.25 GiB Free PE / Size 0 / 0 VG UUID NZTIlD-5YHf-eUf1-xCzL-RMX7-BI72-HG200D
Filesystem Size Used Avail Use% Mounted on tmpfs 389M 744K 388M 1% /run /dev/mapper/ubuntu--vg-ubuntu--lv 14G 4.5G 8.9G 34% / tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 1.9G 0 1.9G 0% /run/qemu /dev/xvda2 1.7G 252M 1.4G 16% /boot tmpfs 389M 4.0K 389M 1% /run/user/1000
Has anyone come across this issue, i feel this is something new that has caused this with a update in Ubuntu as this has been working.
-
@jubin3 As this is totally unrelated to XOA and XCP-ng, you'll (hopefully) get a better response in the cloud-init community, as it's their project which has (once again) been broken by an OS update. I gave up chasing them some time ago, especially with brand new OS releases.
-
This post is deleted!