LXD VM disk allocation strategy

I have been running a few benchmarks on LXD VM creation cycles and have noticed that it is possible to have multiple VMs created exceeding the maximum capacity of the storage pool (backed by ZFS), i.e. having say 10 VMs with 20GB of storage size on a storage pool of 100GB. Is it safe to assume that the disk allocation for VMs is dynamic or is there more to it?

As you’re using ZFS, each VM disk volume will be created as a snapshot of the original image volume.

In this way only the changes made to each VM disk volume will incur usage on the pool.

This is similar to using LVM thinpools as a storage pool driver.

1 Like