LXD 4.2: error when attaching additional disk to VM

The syntax you’re using is to direct attach arbitrary block devices.

You shouldn’t use that with LXD custom storage volumes as those are formatted volumes managed by LXD which you should instead attach with something like:

lxc config device add INSTANCE SOME-NAME disk source=NAME pool=ceph-vault

If you need those to be raw block devices rather than filesystem mounts, then you should either wait for LXD 4.3 which will have support for block type custom volumes or you need to manually create an rbd volume outside of LXD and then attach it with the syntax you’re currently using.

That command doesn’t seem to have worked:

root@aa1-ceph-master-1:~# rbd create --size 256000 lxd-virtualvaultfs-01/testimage

ubuntu@aa1-cptef101-n1:~$ lxc --project <company>-staging2 config device add pod-890-1001-02 test disk source=testimage pool=ceph-vault
Device test added to pod-890-1001-02

and starting it:

ubuntu@aa1-cptef101-n1:~$ lxc start --project <company>-staging2 pod-890-1001-02
Error: Failed to start device "test": Failed mounting storage volume "testimage" of type "custom" on storage pool "ceph-vault": No such object
Try `lxc info --show-log pod-890-1001-02` for more info

How long will it be until 4.3 is ready?

So trying to make things clear:

Attaching a block storage

rbd create --size 25G POOL/VOL
lxc config device add NAME my-disk disk source=ceph:POOL/VOL ceph.user_name=USER ceph.cluster_name=CLUSTER

Attaching a filesystem storage

lxc storage volume create POOL VOLNAME size=25G
lxc config device add NAME my-disk disk source=VOLNAME pool=POOL

With 4.3, the former case will be replaced with:

lxc storage volume create POOL VOLNAME size=25G --type=block
lxc config device add NAME my-disk disk source=VOLNAME pool=POOL

1 Like

Thanks - any ideas when 4.3 will hit stable?

Release on Thursday and stable next Monday is the current plan.