For custom volumes, they will normally be mounted when the container starts and unmounted when it stops, so the vmxxxxx custom volume should be mounted/unmounted based on that, same goes for the root volume of the container too, but nothing else should get unmounted.
Thank you for your response. When i used lxd version 3.15, no issues with the unmout. Storage volume was present when i stopped the container in lxd version 3.15. But in version 3.18, storage volume unmounted when i stopped the container.
Ah yeah, I think we changed that logic when @tomp rewrote the device handling logic.
It was an oversight that we kept the custom volumes mounted when no container was actively using them.
We have similar unmount logic for containers and so have since fixed that logic to also unmount the custom storage volumes on container shutdown.
So just like accessing a container, if you need a custom volume to be mounted when containers aren’t using it, you’ll need to manually run zfs mount.