Is it possible to have a container seeing the available storage on a device equal to the size defined in the container definition instead of the full available storage of the pool the device belongs to?
In the following example I would like container guest to show Avail=10G instead of Avail=875G when issuing df -hT / in it.
user@host:~$ lxc storage list
+--------+--------+--------------+-------------+---------+
| NAME | DRIVER | SOURCE | DESCRIPTION | USED BY |
+--------+--------+--------------+-------------+---------+
| pool01 | btrfs | /media/lxdsp | | 7 |
+--------+--------+--------------+-------------+---------+
user@host:~$ df -hT /media/lxdsp/
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 btrfs 887G 9,9G 875G 2% /media/lxdsp
user@host:~$ lxc config device get guest root size
10GB
user@host:~$ lxc exec guest bash
root@guest:~# df -hT /
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 btrfs 887G 9.9G 875G 2% /
I know that the storage quota should be enforced in any case, but still I would like if this behaviour is at all possible, even if with other storage backends and/or configuration.
Hi @pmarini,
You can check the expanded configuration of the container like that, lxc config show guest --expanded and add / override the root disk size as well. lxc config device override quest root size=15GB
You can adjust the root disk size in your requirement, here is the document link. https://linuxcontainers.org/lxd/docs/master/storage/
Regards.