Creating a Storage Pool Per Container?

I’ve been reviewing the documentation about storage limits and trying to figure out the best way to apply strict limits to storage for the containers that LXD will be running on my host. I’m wondering if it’s feasible to create a new pool for every container I create and assign the pool to the container at launch/create time, using the -s flag? My understanding is that if I use a ZFS pool, I can configure its size.

In a situation where there may be scores of containers on a host, are there any reasons I should prefer to use multiple containers per pool? And if so, what is the best way to ensure that I can control the amount of disk space used?

Using a ZFS pool with volume.zfs.use_refquota set to true and whatever size limit set on the container’s root device through the size property will get you the behavior you’d like without needing multiple pools.

Creating a large number of pools would waste space, memory and may create slow downs once you reach a pretty high number as the kernel is usually not optimized for dealing with hundreds of block devices or zpools.

Great to know. Thank you!