Specifying block mode and filesystem at container launch time

with the new block mode, is there a way to specify block mode and filesystem at launch? I don’t want all my containers to be in zvols (actually I dont yet know whether I want it, what would be disadvantages in having zfs in zvol as opposed to have it in dataset?)

this I can do
alex@alexsv:~$ lxc storage set default volume.zfs.block_mode=true
alex@alexsv:~$ lxc storage set default volume.block.filesystem=btrfs
alex@alexsv:~$ lxc launch ubuntu:22.04 int10125
Creating int10125
Starting int10125
alex@alexsv:~$ lxc storage unset default volume.block.filesystem
alex@alexsv:~$ lxc storage unset default volume.zfs.block_mode

can I do it just for this one container? If I do it this way, someone else creating containers at the same time might inadvertently create it in block mode while my defaults are set to block.

anyone? is it possible at all? wouldn’t it be a nice feature?

also it would be nice if one can somehow convert between zvol based to dataset based and the other way round.

Another interesting thing is: if I create a zvol based image and launch a container based on it, it will still be created with whatever is the default for the volume, so what is the point in distinguishing if the image is based on a zvol container if it is going to be ignored later?

cc @tomp @monstermunchkin

This is currently not possible, but it is on our roadmap for this coming 6 month cycle.

The appropriate cached image volume is used based on the current setting of the pool.
One does not create a zvol based image, but rather LXD will create a zvol cached image volume if creating an instance when using block mode. However if the current setting for the pool (or later the instance’s config) will not use block mode then a new cache image volume is created.

Thanks, I guess I’ll have to survive until then :wink: Is there some ticket or forum entry or something so that I canwatch to follow the progress?

We’re calling it “Instance volume configuration through disk device” internally, but there isn’t a github issue for that yet.