This is where a reproducer would be useful, here I’ve tried it myself:
Create LVM pool using XFS with maximum image unpack size of 1GiB.
lxc storage create lvm lvm volume.block.filesystem=xfs volume.size=1GiB
Launch a container without any root disk size override (will default to volume.size or what ever is in profile(s)).
We can see both images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7
and containers_c1
is 1GiB in size.
lxc launch images:ubuntu/jammy c1 -s lvm
sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LXDThinPool lmv twi-a-tz-- 29.93g 0.00 10.47
LXDThinPool lvm twi-aotz-- 29.93g 1.71 11.17
containers_c1 lvm Vwi-aotz-k 1.00g LXDThinPool images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 50.07
images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 lvm Vwi---tz-k 1.00g LXDThinPool
root vgubuntu -wi-ao---- 236.25g
swap_1 vgubuntu -wi-ao---- 976.00m
Launch another container with root disk size override.
We can see containers_c2
is 2GiB in size.
lxc launch images:ubuntu/jammy c2 -s lvm -d root,size=2GiB
sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LXDThinPool lmv twi-a-tz-- 29.93g 0.00 10.47
LXDThinPool lvm twi-aotz-- 29.93g 1.77 11.41
containers_c1 lvm Vwi-aotz-k 1.00g LXDThinPool images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 50.23
containers_c2 lvm Vwi-aotz-k 2.00g LXDThinPool images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 25.08
images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 lvm Vwi---tz-k 1.00g LXDThinPool
root vgubuntu -wi-ao---- 236.25g
swap_1 vgubuntu -wi-ao---- 976.00m
Modify default profile to set default root disk size for instances, and launch a new instance without an override. This time it should take the root disk size from the profile (over the volume.size of the pool).
We expect containers_c3
to be 3GiB.
lxc profile device set default root size=3GiB
lxc launch images:ubuntu/jammy c3 -s lvm
sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
LXDThinPool lmv twi-a-tz-- 29.93g 0.00 10.47
LXDThinPool lvm twi-aotz-- 29.93g 1.82 11.56
containers_c1 lvm Vwi-aotz-k 1.00g LXDThinPool images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 50.23
containers_c2 lvm Vwi-aotz-k 2.00g LXDThinPool images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 25.16
containers_c3 lvm Vwi-aotz-k 1.00g LXDThinPool images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 50.07
images_80fd87bb2e699ea0639ede30497300de1fa835ce7cd4f14fd81e690e3eb36eb7 lvm Vwi---tz-k 1.00g LXDThinPool
root vgubuntu -wi-ao---- 236.25g
swap_1 vgubuntu -wi-ao---- 976.00m
Oh wait, whats this, its 1GiB. Hrm this doesn’t look right, investigating…