I’m new to lcx/lxd. I do not understand storage. Please help.
Currently I am using the “dir” backend, all is fine, except I see the available space from the entire drive, despite having the limit set in the profile.
root:
path: /
pool: data
size: 5GB
type: disk
where the “data” is “dir” backend storage (with this setup, from the container I see all the 2+ TB of space, instead of 5 GB).
On the server I have a hardware raid, I do not want additional safety with zfs or btrfs (btw, do these backends use a file or a physical partition/disk?). I would want something simple either a “dir” backend with a specific limit or something like a file on the filesystem for each container (I understand that loopback devices are not recommended). So what would be a better choice?
Then an option may be to enable project quotas on your ext4 filesystem. This will then allow for the size property on individual volumes to work and I believe may even lead to df properly reporting the quota in the guests.
If you however expect that any of the features above would be useful to you, then having a dedicated partition and using ZFS (ideally) or btrfs (alternatively, its quotas are a bit wonky) would be best.
I managed with ext4 for now. I put the usrquota,grpquota into fstab, but not the prjquota (also had to enable it with tune2fs). After rebooting and recreating the instance, I now see the correct disk size from the container. Maybe this should be mentioned in the documentation (prjquota option is needed on ext4 for “size” to work - if it is, my apologies, I didn’t see it).
A question about loop files, how does that work (I do not understand from the documentation), does lxc create one storage file for each instance, or do I have to create one manually and all instances will be stored there (on the same file)? Is this also the case with lvm/zfs/btrfs?