This is incorrect.
Hmm, no I don’t think it is. Something peculiar is going on? Perhaps it’s the ordering of events which isn’t working as expected?
Consider:
lxc launch images:gentoo/openrc v2 -d root,size=10GiB
Creating v2
Starting v2
lxc exec v2 -- df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vg_fast/containers_v2 10G 2.0G 8.1G 20% /
So creating an image where the initial file system is sub 2GB, HAS allowed me to override the storage volume size, and create the instance
But consider this, where I zipped up a gentoo instance, previously running under linux-vservers, and followed the instructions here:
I think the tar file is slightly larger than the default root filesystem size, but much smaller than 10GB (specifics, the default filesystem size is 2.5GB, and I think the tar image is around 2.8GB)
lxc launch migrate-gitea v3 -s vg_fast -d root,size=10GiB
Creating v3
...spew of tar ... Cannot create ...: No space left on device
Can you advise if there is a way to create an initial server with a blank filesystem, grow it, then later on I can have the image installed? Note, a process which would be convenient for this current requirement (migrating VMs from another machine) is to be able to create a skeleton VM, rsync the data across, replacing the whole image?
Right now I have experimented with the following (I doubt it’s a supported suggestion)
- linux vserver image consists of root filesystem / and the main data directories mounted into various points, eg pretend its a mail server, the root fs is 1GB and the data dir is huge and mounted in at /home/vmail
- lxc launch images:randomimage migratedvm
- lxc storage volume create …
- filesystem is at /var/lib/lxd/storage-pools/vg_fast/containers/migratedvm/rootfs, so rsync complete filesystem into that, replacing the existing random image (can we avoid needing to create the image?)
- lxc storage volume attach vg_fast mail-data migratedvm /home/vmail
- Now do the same to rsync the data in (is there a supported way to access custom storage volumes from the host, without attaching them to a random instance?)
- now restart instance
Is there another way to create the initial instances? Assume a user moderately familiar with LVM and not looking for a supported lxc path here. This is strictly to get access to the raw partitions to preload initial data?
(Edit: Apologies for using the words “VM” in several places, probably including here. I’m coming from linux vservers and only intend to use container based virtualisation. However, I may have inadvertently used the wrong terminology. To be clear - no VMs anticipated in my future, only: LVM based containers, running XFS file system and linux)