How to bloc type volume attach to vm

Hi. everyone.

I have a simple question.
I make block type volume and try to attach to vm. but failed.

Tell me how to attach block type volume to vm.

-# lxc storage volume attach sdcard data01 zfs03 …

Thank you.

Hmm, that should work, would have been nice to provide the error :wink:

You can also try to just add it directly to the instance with lxc config device add VM DEVNAME disk pool=POOL source=VOL

You likely need to provide an empty target directory argument as ‘’ as LXD doesn’t support mounting block volumes inside the guest currently.

@stgraber and @tomp Thank you Sir.

I recognized it as a disk in the vm and tested the basics of lvm, and it works. In the past, I used to test by assigning a lun from the NAS and passing it to a vm, but it seems to work well and it is very good.

Ah… I have one more question.

When creating a block type volume, the unit of size seems to be bits.
Can you tell me how to the size in giga or mega?

Thanks again for the technical support.



Thank you very much.^^