Failed launching an instance (VM) with LVM+XFS backend (disk too small) - LXD 5.0.2

It appears that a 100MiB volume is created when launching the instance (see ‘lvs’ output below), but XFS requires a minimum of 300MiB.

When is launched against a “dir” backend storage, it is created and the VM disk size is by default ~3.7GB.

~# lxc launch remote_image_server:vm-alpine-312-base vm1pat -p lvm -p vl101 --vm --target h-341 --config security.secureboot=false --device root,size=10GiB
Creating vm1pat
Error: Failed instance creation: Failed creating instance from image: Error creating LVM logical volume: Error making filesystem on LVM logical volume: Failed to run: mkfs.xfs /dev/vg0/images_8b468517eb8779bf7b84b0579fc8bc632ee4e20d1c3b0eaf8bdc38f5f0d8f6a8: exit status 1 (mkfs.xfs: small data volume, ignoring data volume stripe unit 512 and stripe width 1024
Filesystem must be larger than 300MB.
Usage: mkfs.xfs
/* blocksize */		[-b size=num]
/* config file */	[-c options=xxx]
/* metadata */		[-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,
			    inobtcount=0|1,bigtime=0|1]
/* data subvol */	[-d agcount=n,agsize=n,file,name=xxx,size=num,
			    (sunit=value,swidth=value|su=num,sw=num|noalign),
			    sectsize=num
/* force overwrite */	[-f]
/* inode size */	[-i perblock=n|size=num,maxpct=n,attr=0|1|2,
			    projid32bit=0|1,sparse=0|1,nrext64=0|1]
/* no discard */	[-K]
/* log subvol */	[-l agnum=n,internal,size=num,logdev=xxx,version=n
			    sunit=value|su=num,sectsize=num,lazy-count=0|1]
/* label */		[-L label (maximum 12 characters)]
/* naming */		[-n size=num,version=2|ci,ftype=0|1]
/* no-op info only */	[-N]
/* prototype file */	[-p fname]
/* quiet */		[-q]
/* realtime subvol */	[-r extsize=num,size=num,rtdev=xxx]
/* sectorsize */	[-s size=num]
/* version */		[-V]
			devicename
<devicename> is required unless -d name=xxx is given.
<num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB),
      xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB).
<value> is xxx (512 byte blocks).)

This is the output of ‘lvs’ during the the launch process, before it terminates with the error above:

~# lvs | grep images
  images_8b468517eb8779bf7b84b0579fc8bc632ee4e20d1c3b0eaf8bdc38f5f0d8f6a8       vg0 Vwi-a-tz--  100.00m LXDThinPool                          0.00                                   
  images_8b468517eb8779bf7b84b0579fc8bc632ee4e20d1c3b0eaf8bdc38f5f0d8f6a8.block vg0 Vwi-a-tz-k  800.00g LXDThinPool                          0.00 

The output of lvs suggests you’re using an lvm storage pool, but you say you’re using dir storage pool. So i’m a bit confused :slight_smile:

Also, im not where the XFS part is coming in, where is this defined in your config?

Sorry for being not clear. I believe I said that with dir storage backend everything is fine and the VM is created, while with LVM+XFS it throws the error above. The storage LVM is configured as follow:

config:
  lvm.use_thinpool: "true"
  lvm.vg.force_reuse: "true"
  volume.block.filesystem: xfs
  volume.size: 800GiB

It doesn’t look like a problem of my custom image. Using the official images, I get the same error:

~# lxc launch images:alpine/3.16 vm1-pat -p lvm -p vl101 --vm --target h-341 --config security.secureboot=false
Creating vm1-pat
Error: Failed instance creation: Failed creating instance from image: Error creating LVM logical volume: Error making filesystem on LVM logical volume: Failed to run: mkfs.xfs /dev/vg0/images_f6502b6332e150a46727e7772b786d30f9556dc32cda2e25d9139cc86f602118: exit status 1 (mkfs.xfs: small data volume, ignoring data volume stripe unit 512 and stripe width 1024
Filesystem must be larger than 300MB.

Similar issue with some more details:

https://github.com/lxc/incus/issues/498

We will look into it.

Should be fixed when this is merged and backported: https://github.com/canonical/lxd/pull/12907