Image cache manager.
The cache manager implements the specification at http://wiki.openstack.org/nova-image-cache-management.
Bases: nova.virt.imagecache.ImageCacheManager
Return a filename based on the SHA1 hash of a given image ID.
Image files stored in the _base directory that match this pattern are considered for cleanup by the image cache manager. The cache manager considers the file to be in use if it matches an instance’s image_ref, kernel_id or ramdisk_id property.
However, in grizzly-3 and before, only the image_ref property was considered. This means that it’s unsafe to store kernel and ramdisk images using this pattern until we’re sure that all compute nodes are running a cache manager newer than grizzly-3. For now, we require admins to confirm that by setting the remove_unused_kernels boolean but, at some point in the future, we’ll be safely able to assume this.
Construct a filename for storing additional information about a base image.
Returns a filename.
Test if a given path matches the pattern for info files.
Read the checksum.
Returns the checksum (as hex) or None.
Read information about an image.
Returns an empty dictionary if there is no info, just the field value if a field is requested, or the entire dictionary otherwise.
Write a checksum to disk for a file in _base.
Write information about an image.