Nova-nova base image ID generation algorithm

Source: Internet
Author: User
Tags sha1

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.