Image cache class
Images that are stored in the cache folder will be stored in a folder whose name is the image ID. In the event that an image is discovered to be no longer used then a timestamp will be added to the image folder. The timestamp will be a folder - this is due to the fact that we can use the VMware API’s for creating and deleting of folders (it really simplifies things). The timestamp will contain the time, on the compute node, when the image was first seen to be unused. At each aging iteration we check if the image can be aged. This is done by comparing the current nova compute time to the time embedded in the timestamp. If the time exceeds the configured aging time then the parent folder, that is the image ID folder, will be deleted. That effectively ages the cached image. If an image is used then the timestamps will be deleted.
When accessing a timestamp we make use of locking. This ensure that aging will not delete an image during the spawn operation. When spawning the timestamp folder will be locked and the timestamps will be purged. This will ensure that a image is not deleted during the spawn.
Bases: nova.virt.imagecache.ImageCacheManager
Returns datastore path of folder containing the image.
Returns the timestamp folder.
The cache manager entry point.
This will invoke the cache manager. This will update the cache according to the defined cache management scheme. The information populated in the cached stats will be used for the cache management.