When I move a container from host1
to host2
the quota on the root device is not set correctly on host2
. Both hosts are identical running Ubuntu 20.04 LTS with lxd 4.0.4 using a zfs storage pool.
I move the container from host1
to host2
with the command:
lxc mv mycontainer host2:
The zfs filesystem used by mycontainer
on host2
has no quota set.
$ zfs get quota rpool/lxd/containers/mycontainer
NAME PROPERTY VALUE SOURCE
rpool/lxd/containers/mycontainer quota none default
I can restore the appropriate quota on host2
by running the following on host2
.
REQUIRED_SIZE=`lxc config device get mycontainer root size`
lxc config device set mycontainer root size 500GB
lxc config device set mycontainer root size $REQUIRED_SIZE
$ zfs get quota rpool/lxd/containers/mycontainer
NAME PROPERTY VALUE SOURCE
rpool/lxd/containers/mycontainer quota 3.73G default
So lxd knows what the quota should be, but it is not being set in zfs automatically. You have to set the quota to something different than its current value and then back to the correct value, otherwise the zfs quota does not update to the correct value.
The quota used to transfer correctly when I was using lxd 3.0.3 on Ubuntu 16.04 LTS on the two systems, but stopped working after upgrading. Is there a way to get the quota to automatically be set after moving a container?