Automatic Volume Creation when Launching a Container for Storage Pools

Good morning,

Is it possible to create a Storage Pool that when launching a container, it creates a volume for that container under that pool? Like how the default profile/root device works. Mainly looking for a sanity check, as both source and path are required, so I do not think it is possible.

For instance, the default profile has the following under devices and creates volume named as the container

devices:
  root:
    path: /
    pool: default
    type: disk

However, when trying to emulate this for my prod_data

devices:
   data:
    path: /prod
    pool: prod_data
    type: disk

However when saving it, it gives the error
Config parsing error: Device validation failed for "configs": Disk entry is missing the required "source" or "path" property

But when adding the source field, every container is able to share that data from all containers.

Automatic per-instance custom volume creation isn’t something that is possible with LXD currently.

Instead you would need to create the instance (but dont start it yet), create the custom volume, and attach it as a disk device directly to the instance, then start it. Rather than adding a single disk device volume to the profile.