Lxc create VM Error: exceeds specified volume size

Trying to create a VM from repository images
image downloaded and showing in lxc image ls:
Debian stretch amd64 (20220411_05:24) | x86_64 | VIRTUAL-MACHINE | 219.06MB
by using a profile

devices:
root:
path: /
pool: pl2
size: 4GB
type: disk

Error: Failed creating instance from image: Source image size (4294967296) exceeds specified volume size (4000000000)
Do I need to determine (and where to get the values) for each VM, what minimum root size?

Can you show full command you use to create the instance, along with the output of lxc storage show <pool> and lxc profile show <profile>

Apologies I see you have show the profile size already.

So the error is saying that the minimum size of disk to allow the image to be unpacked into is 4294967296 bytes which is 4GiB rather than 4GB.

So specifying the instance root disk to be 4GiB or larger should allow it to be unpacked.

Yes, if you are going to be specifying smaller disk sizes (<10GB), you can see them in lxc image show <fingerprint> I believe.

Thanks.
lxc image ls images:

alpine/edge (3 more)         | 8a35e5b959ba | yes    | Alpine edge amd64 (20220410_13:02)   | x86_64       | VIRTUAL-MACHINE | 92.13MB
debian/11 (7 more)               | 89c383144fcc | yes    | Debian bullseye amd64 (20220411_05:24)   | x86_64       | VIRTUAL-MACHINE | 283.81MB

There is no Idea about what minimum space the vm will require to create the zfs/pool2/virtual-machines/container.block
Anyway, setting a root size of anything below 4.1GB, throughs an error:
3GB root:
Error: Failed creating instance from image: Source image size (4294967296) exceeds specified volume size (4000000000)
4GB root:
Error: Failed creating instance from image: Source image size (4294967296) exceeds specified volume size (3000000000)

Is 429496729 bytes (4Gib) the magic minimum size?
I remember, previously been able to create alpine VM on 2GB root, which was fully sufficient.

There is no minimum size officially, but it just may be that distrobuilder is building them with a minimum size of 4GiB (@monstermunchkin any thoughts on this?)

But because its possible to make your own images too, and support other remotes, we can’t say for sure what the absolute minimum is.

You could for instance create an empty VM with a 2GiB disk size and then load an OS into it and then publish and that image would then have a 2GiB minimum size.

Ah yes thats right, the volatile.rootfs.size key I was thinking of is only created on the optimized pool storage volume DB record once it has been successfully unpacked the first time.

When just looking at lxc image ls or lxc image show there is currently no meta data that indicates the size of the uncompressed block image file contained within.

Perhaps you can open an issue about it Issues · lxc/lxd · GitHub

distrobuilder builds VMs with a default size of 4GB, but this can be changed in the image’s definition file.

1 Like

Is there a reason we don’t specify a minimal disk size if the OS can fit into it on a per-distro basis? This would allow us to create smaller VMs if the chosen image allowed it.