How ti set zfs comperssion when creating new lxd conainer

Hello all,

I use ZFS as storage backend for LXD containers.

By default all containers inherit compression from parent zfs dataset.
I can change it it manually per container after container creation.

Is it possible to set zfs compression for container during creation of this container? As parameter or environment variable or someway else.

No but it also wouldn’t do you much good anyway as the container creation itself doesn’t write anything to disk, it just clones an image.

So you can do lxc init ubuntu:18.04 blah, then modify the config of containers/blah and will never have written anything prior to the compression change.