Question: How can I specify which LXD Storage Pool should be used to cache a virtual machine image?
When I add a Storage Pool to LXD, it creates a directory structure, including a ./images subdirectory. I would expect that I can tell LXD to store VM images into this custom Storage Pool, instead of the default Storage Pool.
However, I cannot find any mechanism to specify which Storage Pool should cache a VM image.
Repro Steps
Install LXD and init lxd init --auto
Create a new Storage Pool mkdir --parents /data/lxddata; lxc storage create mydir dir source=/data/lxddata
Launch LXD VM in custom Storage Pool lxc launch --vm --storage=mydir images:ubuntu/23.04 u01
VM image is cached under default Storage Pool, not/data/lxddata/images
Volume to use to store the image tarballs (syntax is POOL/VOLUME )
Wouldn’t I just specify the POOL, not a VOLUME? If I create a new POOL, then I don’t have any VOLUMES defined. When I download an image later on, wouldn’t that be considered a new VOLUME of type image?
No, the compressed image files themselves are downloaded, stored and periodically refreshed if there is a later one available. These files are used to create either optimized image volumes on a pool or directly to create instance volumes for storage pools that do not support optimized image volumes.
As such the compressed image files themselves are not related to a storage pool per-se.
However the storage.images_volume controls where these files are stored, if there isn’t enough space on the host’s root filesystem to store them.