I have an automation setup through which an LXD image is mirrored from my LXD Image server onto the VM and then the VM is automatically shut down until I need it for my work. And then I start the VM and then once my work is done, I delete the VM or shut down again.
But recently I observed that the LXD image is not there when I start the VM after a week or so.
I’m not sure how the image just vanishes as I have log of my automation setup and it confirms that the Image was successfully mirrored before shutting down the VM last time.
LXD logs also suggest that the image was not deleted automatically. Not sure what’s happening here.
Hi Stephan. Unfortunately I had deleted that VM that day itself before posting this thread. Otherwise I’d have captured this requested info.
I had created another VM that day and so far it has the Image available in it. It’s been 9 days. I usually see that the image vanishes if I restart the VM after 14-15 days.
If it repeats this time then I’ll follow up on this thread with the requested info. Thanks!
Ok, so it has the cached flag set which means that 10 days after its last use (see Last used in the timestamps section), the image will automatically be deleted by LXD.
So in the case of that other server you’re looking at, if no new instance is created from the image, it will be deleted on the 18th.
That’s usually not an issue since the image is just a cached entry so a new instance launched using the reference to your image server will just have LXD download the image again and keep it around for another 10 days unless it’s used again since.
My concern is that I don’t want the image to be deleted unless I want it to be deleted or updated. So if I set the cached flag to false then does it solve the issue?
I think setting it false would make the VM download the image every time from LXD Image server whenever there’s a new request.