Libvirt image cache

Asked by Édouard Thuleau

How works the VM image cache with libvirt driver ?

I saw a directory '$instances_path/_base' where a copy of a new VM image are store. So when we start a new instance, if it's the first time its image is instantiated on this host, the image is copied and if it's not, nova-compute find a old copy and use it.

When the instance is destroy, the image copy isn't delete. So which process purge this directory ? When and why a local image copy is deleted on a host ?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Vish Ishaya
Solved:
Last query:
Last reply:
Revision history for this message
Best Vish Ishaya (vishvananda) said :
#1

The cached images are never purged. If space is a concern and lots of different images are being used, you will need to find images that aren't in use on the host and delete them via a cron script or some such.

Vish

On Jun 23, 2011, at 9:55 AM, Edouard Thuleau wrote:

> New question #162498 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/162498
>
> How works the VM image cache with libvirt driver ?
>
> I saw a directory '$instances_path/_base' where a copy of a new VM image are store. So when we start a new instance, if it's the first time its image is instantiated on this host, the image is copied and if it's not, nova-compute find a old copy and use it.
>
> When the instance is destroy, the image copy isn't delete. So which process purge this directory ? When and why a local image copy is deleted on a host ?
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Édouard Thuleau (ethuleau) said :
#2

Thanks Vish Ishaya, that solved my question.

Revision history for this message
Razique Mahroua (razique) said :
#3

Hi guys,
"you will need to find images that aren't in use"

how could we figure which images could be safely deleted ?
Thanks

Revision history for this message
Razique Mahroua (razique) said :
#4