# Libvirt image cache

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 ? edit retag close merge delete ## 4 answers Sort by » oldest newest most voted 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/+q... 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).

more

Thanks Vish Ishaya, that solved my question.

more

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

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

more

I've made a small bash script to list images that could be removed : https://github.com/Razique/Bash-stuff/blob/master/SCR_5008_V00_NUAC-OPENSTACK-Nova-compute-images-prunning.sh (https://github.com/Razique/Bash-stuff...)

more

# Get to know Ask OpenStack

Resources for moderators