When Nova spawn instance, it create_image first, and here's the function that gets the base image.
Def get_cache_fname (Images, key): "" "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. "" " image_id = str (Images[key]) if (not conf.libvirt.remove_unused_kernels and # remove_unused_kernels Default value is true key in [' kernel_id ', ' ramdisk_id ')): Return image_id &nbSP;  ELSE:        RETURN HASHLIB.SHA1 (image_id). Hexdigest () # base image id generation
This article is from the "The-way-to-cloud" blog, make sure to keep this source http://iceyao.blog.51cto.com/9426658/1838284
Nova-nova base image ID generation algorithm