[go: up one dir, main page]

CN111414239A - Virtual machine mirror image management method, system and medium based on kylin cloud computing platform - Google Patents

Virtual machine mirror image management method, system and medium based on kylin cloud computing platform Download PDF

Info

Publication number
CN111414239A
CN111414239A CN202010269446.XA CN202010269446A CN111414239A CN 111414239 A CN111414239 A CN 111414239A CN 202010269446 A CN202010269446 A CN 202010269446A CN 111414239 A CN111414239 A CN 111414239A
Authority
CN
China
Prior art keywords
virtual machine
image file
machine image
file
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010269446.XA
Other languages
Chinese (zh)
Other versions
CN111414239B (en
Inventor
张建锋
谭郁松
王晓川
李宝
谭霜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202010269446.XA priority Critical patent/CN111414239B/en
Publication of CN111414239A publication Critical patent/CN111414239A/en
Application granted granted Critical
Publication of CN111414239B publication Critical patent/CN111414239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a system and a medium for managing a virtual machine image based on an kylin cloud computing platform, wherein a server responds to a request of uploading a virtual machine image file by a user, and comprises the following steps: acquiring a mirror image fingerprint of a virtual machine mirror image file uploaded by a user, judging according to the mirror image fingerprint, if the virtual machine mirror image file is not stored in shared storage, storing the virtual machine mirror image file in the shared storage, and recording the reference of the user to the virtual machine mirror image file in metadata; if the virtual machine image file is already stored on the shared storage, the reference of the user to the virtual machine image file is directly added into the metadata without repeatedly storing the virtual machine image file. According to the invention, through calculation and comparison of the virtual machine mirror image fingerprints, the repetition rate of the virtual machine mirror image file is reduced, the efficiency of large-scale user scene virtual machine mirror image management is greatly improved, the space utilization rate of mirror image management can be improved, and the first starting efficiency of the virtual machine is improved.

Description

基于麒麟云计算平台的虚拟机镜像管理方法、系统及介质Virtual machine image management method, system and medium based on Kylin cloud computing platform

技术领域technical field

本发明涉及云计算领域内虚拟化资源管理技术,具体涉及一种基于麒麟云计算平台的虚拟机镜像管理方法、系统及介质。The invention relates to a virtualized resource management technology in the field of cloud computing, in particular to a virtual machine image management method, system and medium based on a Kylin cloud computing platform.

背景技术Background technique

目前随着云计算技术体系的日益成熟和完善,云计算技术已经在多个行业领域得到了广泛的应用。通过云计算技术可以实现数据中心基础设施的资源虚拟化,将应用、数据与物理资源在逻辑管理上相互分离,IT部门可以更加有效地、应变更加迅速地和更加灵活地提供和维护数据中心的服务,业务部门也可以更加专注于应用和数据的服务。总之,通过数据中心资源虚拟化可以为用户提供方便快捷的基础设施即服务(IaaS)能力,较传统资源管理模式相比,基础设施即服务具备如下优势:①提高资源利用率:通过虚拟化技术可以将共享存储资源共享给不同的用户进行使用,从而提高资源利用率;②提高可维护性:通过资源虚拟化提供的高可用、在线迁移等技术有助于在业务不中断前提下进行系统的更新维护,以及更加迅速地从意外断网事故中恢复。At present, with the increasingly mature and perfect cloud computing technology system, cloud computing technology has been widely used in many industries. Cloud computing technology can realize the resource virtualization of data center infrastructure, separate applications, data and physical resources in logical management, and IT departments can provide and maintain data center resources more effectively, quickly and flexibly. Services, business units can also focus more on application and data services. In a word, data center resource virtualization can provide users with convenient and fast infrastructure as a service (IaaS) capabilities. Compared with the traditional resource management model, infrastructure as a service has the following advantages: ① Improve resource utilization: through virtualization technology Shared storage resources can be shared to different users to improve resource utilization; ②Improve maintainability: The high availability, online migration and other technologies provided by resource virtualization help to carry out the system without interruption of business. Update maintenance, and recover from unexpected network outages more quickly.

在基础设施即服务模式下,云计算平台通过虚拟机向用户提供完整的操作系统和基础软件环境。用户可以通过向云计算平台上传自己制作的镜像来定制自己的虚拟计算环境。在此模式下,随着用户数量的增加对云计算中心现有的镜像管理模式提出了新的挑战:①极大地增加了云计算中心镜像存储压力;②降低了镜像复用带来的存储空间优化效率。Under the infrastructure-as-a-service model, cloud computing platforms provide users with a complete operating system and basic software environment through virtual machines. Users can customize their own virtual computing environment by uploading their own images to the cloud computing platform. In this mode, with the increase of the number of users, new challenges are brought to the existing image management mode of the cloud computing center: ① It greatly increases the image storage pressure of the cloud computing center; ② It reduces the storage space caused by image reuse. Optimize efficiency.

发明内容SUMMARY OF THE INVENTION

本发明要解决的技术问题:针对现有技术的上述问题,在现有基于KVM虚拟化管理平台的基础上提供一种基于麒麟云计算平台的虚拟机镜像管理方法、系统及介质,本发明通过对虚拟机镜像指纹的计算和对比,降低虚拟机镜像文件的重复率,极大地提高了大规模用户场景虚拟机镜像管理的效率,能够提高镜像管理的空间利用率、提高虚拟机首次启动效率。The technical problem to be solved by the present invention: in view of the above-mentioned problems of the prior art, on the basis of the existing KVM-based virtualization management platform, a method, system and medium for virtual machine image management based on the Kylin cloud computing platform are provided. The calculation and comparison of virtual machine image fingerprints reduces the repetition rate of virtual machine image files, greatly improves the efficiency of virtual machine image management in large-scale user scenarios, improves the space utilization of image management, and improves the efficiency of virtual machine first startup.

为了解决上述技术问题,本发明采用的技术方案为:In order to solve the above-mentioned technical problems, the technical scheme adopted in the present invention is:

一种基于麒麟云计算平台的虚拟机镜像管理方法,服务端响应用户上传虚拟机镜像文件请求的步骤包括:A method for managing a virtual machine image based on a Kylin cloud computing platform, wherein the steps of a server responding to a user request for uploading a virtual machine image file include:

1)获取用户上传的虚拟机镜像文件描述,该虚拟机镜像文件描述包括镜像所有者owner、镜像文件名称name、镜像指纹fingerID、镜像文件描述Description;1) Obtain the description of the virtual machine image file uploaded by the user. The description of the virtual machine image file includes the image owner, the image file name, the image fingerprint fingerID, and the image file description Description;

2)在服务端存储该虚拟机镜像文件描述;根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件,如果共享存储上尚未存储该虚拟机镜像文件,则在共享存储上存储该虚拟机镜像文件,并在该虚拟机镜像文件的元数据中记录用户对该虚拟机镜像文件的引用;如果共享存储上已经存储该虚拟机镜像文件,则直接在该虚拟机镜像文件的元数据中增加用户对该虚拟机镜像文件的引用而不重复存储该虚拟机镜像文件。2) Store the description of the virtual machine image file on the server; judge whether the virtual machine image file has been stored on the shared storage according to the image fingerprint fingerID comparison, and if the virtual machine image file has not been stored on the shared storage, then on the shared storage Store the virtual machine image file, and record the user's reference to the virtual machine image file in the metadata of the virtual machine image file; if the virtual machine image file has been stored on the shared storage, directly in the virtual machine image file A user's reference to the virtual machine image file is added to the metadata without repeatedly storing the virtual machine image file.

可选地,所述镜像指纹fingerID为根据虚拟机镜像文件的内容采用MD5、SHA1、CRC32三者中的一种算法计算得到或者两种以上算法组合计算得到。Optionally, the image fingerprint fingerID is calculated by using one of MD5, SHA1, and CRC32 algorithms according to the content of the virtual machine image file, or calculated by combining two or more algorithms.

可选地,步骤1)中用户上传的虚拟机镜像文件描述为的虚拟机镜像文件定义描述四元组。Optionally, the description of the virtual machine image file uploaded by the user in step 1) is a virtual machine image file definition description quadruple.

可选地,步骤2)中的元数据采用三元组进行描述,所述三元组包括镜像指纹fingerID、镜像文件引用数citeNumber、镜像文件具体存放位置url。Optionally, the metadata in step 2) is described by a triplet, and the triplet includes the image fingerprint fingerID, the citation number citeNumber of the image file, and the specific storage location url of the image file.

可选地,步骤2)中根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件具体是指:将用户上传的虚拟机镜像文件的镜像指纹fingerID分别与共享存储上存储的各个虚拟机镜像文件的元数据中的镜像指纹fingerID进行比较,如果存在匹配的镜像文件,则判定已经存储有该虚拟机镜像文件,否则判定尚未存储有该虚拟机镜像文件。Optionally, in step 2), according to the image fingerprint fingerID comparison, judging whether the virtual machine image file has been stored on the shared storage specifically refers to: the image fingerprint fingerID of the virtual machine image file uploaded by the user is separately stored on the shared storage. The image fingerprint fingerIDs in the metadata of each virtual machine image file are compared, and if there is a matching image file, it is determined that the virtual machine image file has been stored, otherwise it is determined that the virtual machine image file has not been stored.

可选地,步骤2)中记录用户对该虚拟机镜像文件的引用具体是指将该虚拟机镜像文件的元数据中的镜像文件引用数citeNumber设置为1;步骤2)中增加用户对该虚拟机镜像文件的引用具体是指将该虚拟机镜像文件的元数据中的镜像文件引用数citeNumber加1。Optionally, recording the citation of the user to the virtual machine image file in step 2) specifically refers to that the citation number citeNumber of the image file in the metadata of the virtual machine image file is set to 1; in step 2), adding the user to the virtual machine image file citeNumber is set to 1; The citation of the machine image file specifically refers to adding 1 to the citeNumber of the image file in the metadata of the virtual machine image file.

可选地,步骤2)之后还包括响应用户删除虚拟机镜像文件请求的步骤,详细步骤包括:Optionally, after step 2), it also includes a step of responding to a user request to delete the virtual machine image file, and the detailed steps include:

S1)获取待删除的虚拟机镜像文件的镜像指纹fingerID;S1) obtain the image fingerprint fingerID of the virtual machine image file to be deleted;

S2)根据镜像指纹fingerID获取共享存储上存储的待删除的虚拟机镜像文件的元数据;S2) obtain the metadata of the virtual machine image file to be deleted stored on the shared storage according to the image fingerprint fingerID;

S3)将待删除的虚拟机镜像文件的元数据中的镜像文件引用数citeNumber减1;S3) subtract 1 from the image file citation number citeNumber in the metadata of the virtual machine image file to be deleted;

S4)判断减1后的镜像文件引用数citeNumber是否为0,如果为0则在共享存储上删除待删除的虚拟机镜像文件。S4) Determine whether the citation number citeNumber of the image file after subtracting 1 is 0, and if it is 0, delete the virtual machine image file to be deleted on the shared storage.

可选地,步骤2)之后还包括根据虚拟机镜像文件创建虚拟机的步骤,且创建虚拟机后虚拟机在存储组织上的数据文件均采用虚拟机镜像文件加增量数据的方式进行存储,且所有虚拟机的在共享存储上存储的数据文件包括所有虚拟机共性内容、所有虚拟机的虚拟机镜像文件集合、所有虚拟机的增量数据集合;步骤2)中根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件具体是指:将用户上传的虚拟机镜像文件的镜像指纹fingerID分别与所有虚拟机的虚拟机镜像文件集合中的各个虚拟机镜像文件的元数据中的镜像指纹fingerID进行比较,如果存在匹配的镜像文件,则判定已经存储有该虚拟机镜像文件,否则判定尚未存储有该虚拟机镜像文件。Optionally, after step 2), also include the step of creating a virtual machine according to the virtual machine image file, and after creating the virtual machine, the data files of the virtual machine on the storage organization are all stored by the virtual machine image file plus the incremental data mode, And the data files stored on the shared storage of all virtual machines include all virtual machine common content, the virtual machine image file set of all virtual machines, the incremental data set of all virtual machines; step 2) according to the image fingerprint fingerID comparison judgment Whether the virtual machine image file has been stored on the shared storage specifically refers to: comparing the image fingerprint fingerID of the virtual machine image file uploaded by the user with the metadata of each virtual machine image file in the virtual machine image file set of all virtual machines. If there is a matching image file, it is determined that the virtual machine image file has been stored, otherwise it is determined that the virtual machine image file has not been stored.

此外,本发明还提供一种基于麒麟云计算平台的虚拟机镜像管理系统,包括计算机设备,该计算机设备被编程或配置以执行所述基于麒麟云计算平台的虚拟机镜像管理方法的步骤,或该计算机设备的存储器上存储有被编程或配置以执行所述基于麒麟云计算平台的虚拟机镜像管理方法的计算机程序。In addition, the present invention also provides a virtual machine image management system based on the Kylin cloud computing platform, including computer equipment, the computer equipment is programmed or configured to perform the steps of the virtual machine image management method based on the Kylin cloud computing platform, or A computer program programmed or configured to execute the virtual machine image management method based on the Kylin cloud computing platform is stored in the memory of the computer device.

此外,本发明还提供一种计算机可读存储介质,该计算机可读存储介质上存储有被编程或配置以执行所述基于麒麟云计算平台的虚拟机镜像管理方法的计算机程序。In addition, the present invention also provides a computer-readable storage medium on which a computer program programmed or configured to execute the method for managing virtual machine images based on the Kylin cloud computing platform is stored.

和现有技术相比,本发明具有下述优点:Compared with the prior art, the present invention has the following advantages:

1、提高镜像管理的空间利用率。用户上传的基础一般仅仅包括操作系统、基础办公软件等,在大规模用户场景下,具有很高的重复率。通过对虚拟机qcow2格式镜像的指纹计算和对比,可以避免用户上传重复镜像,避免造成数据中心带宽和存储资源的浪费。1. Improve the space utilization of image management. The basis for user uploads generally only includes operating systems, basic office software, etc., which has a high repetition rate in large-scale user scenarios. By calculating and comparing the fingerprints of virtual machine images in qcow2 format, users can avoid uploading duplicate images and avoid wasting data center bandwidth and storage resources.

2、提高虚拟机首次启动效率。在现有模式下,相同的虚拟机实例通过共享基础镜像提高启动效率和降低存错开销。如果某个镜像系统判定为首次启动,则需要向镜像管理共享存储发送镜像下载请求,不仅增加了带宽和镜像共享存储的压力,而且极大地影响了启动时间。通过本方法提供的功能,可以降低首次启动虚拟机场景下的镜像下载率,从而提高虚拟机首次启动效率。2. Improve the first startup efficiency of the virtual machine. In the existing mode, the same virtual machine instance shares the base image to improve startup efficiency and reduce error storage overhead. If a mirror system is determined to be started for the first time, a mirror download request needs to be sent to the mirror management shared storage, which not only increases the pressure on the bandwidth and mirror shared storage, but also greatly affects the startup time. With the functions provided by this method, the image download rate in the scenario of first booting the virtual machine can be reduced, thereby improving the first booting efficiency of the virtual machine.

附图说明Description of drawings

图1为本实施例方法响应用户上传虚拟机镜像文件请求的基本流程示意图。FIG. 1 is a schematic diagram of a basic flow of the method according to the present embodiment in response to a user request for uploading a virtual machine image file.

具体实施方式Detailed ways

如图1所示,本实施例基于麒麟云计算平台的虚拟机镜像管理方法中服务端响应用户上传虚拟机镜像文件请求的步骤包括:As shown in FIG. 1 , in the virtual machine image management method based on the Kylin cloud computing platform of the present embodiment, the step of the server responding to the user’s request for uploading a virtual machine image file includes:

1)获取用户上传的虚拟机镜像文件描述,该虚拟机镜像文件描述包括镜像所有者owner、镜像文件名称name、镜像指纹fingerID、镜像文件描述Description;1) Obtain the description of the virtual machine image file uploaded by the user. The description of the virtual machine image file includes the image owner, the image file name, the image fingerprint fingerID, and the image file description Description;

2)在服务端存储该虚拟机镜像文件描述;根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件,如果共享存储上尚未存储该虚拟机镜像文件,则在共享存储上存储该虚拟机镜像文件,并在该虚拟机镜像文件的元数据中记录用户对该虚拟机镜像文件的引用;如果共享存储上已经存储该虚拟机镜像文件,则直接在该虚拟机镜像文件的元数据中增加用户对该虚拟机镜像文件的引用而不重复存储该虚拟机镜像文件(这个引用就是建立该虚拟机描述文件和实际镜像之间的映射)。2) Store the description of the virtual machine image file on the server; judge whether the virtual machine image file has been stored on the shared storage according to the image fingerprint fingerID comparison, and if the virtual machine image file has not been stored on the shared storage, then on the shared storage Store the virtual machine image file, and record the user's reference to the virtual machine image file in the metadata of the virtual machine image file; if the virtual machine image file has been stored on the shared storage, directly in the virtual machine image file A user's reference to the virtual machine image file is added to the metadata without repeatedly storing the virtual machine image file (this reference is to establish a mapping between the virtual machine description file and the actual image).

镜像指纹fingerID是本实施例引入的重点特征,通过对镜像的内容的计算,生成的与镜像名称、描述符无关的镜像唯一标示符号。作为一种可选的实施方式,The fingerprint fingerprint fingerID of the image is a key feature introduced in this embodiment. Through the calculation of the content of the image, a unique identification symbol of the image that is independent of the image name and descriptor is generated. As an optional implementation,

本实施例中镜像指纹fingerID为根据虚拟机镜像文件的内容采用MD5算法计算得到,此外也可以根据需要采用SHA1或CRC32算法计算得到,或者还可以根据虚拟机镜像文件的内容采用MD5、SHA1、CRC32三者中的两种以上算法组合计算得到。通过上述方式,都可以提取出虚拟机镜像文件的唯一特征,以实现服务端虚拟机镜像文件的唯一性检测。In this embodiment, the fingerprint fingerID of the mirror image is calculated by using the MD5 algorithm according to the content of the virtual machine image file. In addition, it can be calculated by using the SHA1 or CRC32 algorithm as required, or MD5, SHA1, CRC32 can also be used according to the content of the virtual machine image file. It is calculated by combining two or more algorithms of the three. In the above manner, the unique feature of the virtual machine image file can be extracted, so as to realize the uniqueness detection of the server virtual machine image file.

本实施例中,步骤1)中用户上传的虚拟机镜像文件描述为的虚拟机镜像文件定义描述四元组。虚拟机镜像文件定义描述四元组包括镜像所有者owner、镜像文件名称name、镜像指纹fingerID、镜像文件描述Description。In this embodiment, the description of the virtual machine image file uploaded by the user in step 1) is a virtual machine image file definition description four-tuple. The virtual machine image file definition and description four-tuple includes image owner, image file name, image fingerprint fingerID, and image file description Description.

作为一种可选的实施方式,虚拟机镜像文件定义描述四元组的格式定义如下:As an optional implementation manner, the format of the virtual machine image file definition description quadruple is defined as follows:

<owner、name、fingerID、Description><owner, name, fingerID, Description>

其中,owner为该虚拟机镜像文件的镜像所有者(即由哪个用户上传的镜像,具体为系统获取的客户端用户ID),name为该虚拟机镜像文件的镜像文件名称(用户对该镜像的命名,比如Ubuntu 1804-XXX等),fingerID为该虚拟机镜像文件的镜像指纹(计算获取,为虚拟机镜像文件的唯一特征,不同的虚拟机镜像文件的镜像指纹fingerID不同),Description为该虚拟机镜像文件的描述,包括该镜像文件属性、镜像文件的内容信息等内容,便于用户了解该虚拟机镜像的内容。Among them, owner is the image owner of the virtual machine image file (that is, which user uploaded the image, specifically the client user ID obtained by the system), and name is the image file name of the virtual machine image file (the user Name, such as Ubuntu 1804-XXX, etc.), fingerID is the image fingerprint of the virtual machine image file (acquired by calculation, it is the unique feature of the virtual machine image file, different virtual machine image files have different image fingerprint fingerIDs), Description is the virtual machine image file. The description of the virtual machine image file, including the attributes of the image file, the content information of the image file, etc., is convenient for users to understand the content of the virtual machine image.

本实施例步骤2)中的元数据采用三元组进行描述,所述三元组包括镜像指纹fingerID、镜像文件引用数citeNumber、镜像文件具体存放位置url。The metadata in step 2) of this embodiment is described by a triplet, and the triplet includes the image fingerprint fingerID, the citation number citeNumber of the image file, and the specific storage location url of the image file.

作为一种可选的实施方式,该三元组的格式定义如下:As an optional implementation manner, the format of the triplet is defined as follows:

<fingerID、citeNumber、url><fingerID, citeNumber, url>

其中,fingerID为该虚拟机镜像文件的镜像指纹、citeNumber为该虚拟机镜像文件的引用数、url为该虚拟机镜像文件的具体存放位置。Wherein, fingerID is the image fingerprint of the virtual machine image file, citeNumber is the citation number of the virtual machine image file, and url is the specific storage location of the virtual machine image file.

本实施例步骤2)中根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件具体是指:将用户上传的虚拟机镜像文件的镜像指纹fingerID分别与共享存储上存储的各个虚拟机镜像文件的元数据中的镜像指纹fingerID进行比较,如果存在匹配的镜像文件,则判定已经存储有该虚拟机镜像文件,否则判定尚未存储有该虚拟机镜像文件。In step 2) of this embodiment, judging whether the virtual machine image file has been stored on the shared storage according to the comparison of the fingerprint fingerprint ID The image fingerprint fingerID in the metadata of the virtual machine image file is compared, and if there is a matching image file, it is determined that the virtual machine image file has been stored, otherwise it is determined that the virtual machine image file has not been stored.

本实施例步骤2)中记录用户对该虚拟机镜像文件的引用具体是指将该虚拟机镜像文件的元数据中的镜像文件引用数citeNumber设置为1;步骤2)中增加用户对该虚拟机镜像文件的引用具体是指将该虚拟机镜像文件的元数据中的镜像文件引用数citeNumber加1。Recording the user's reference to the virtual machine image file in step 2) in this embodiment specifically refers to setting the image file citation number citeNumber in the metadata of the virtual machine image file to 1; in step 2), adding the user to the virtual machine The citation of the image file specifically refers to adding 1 to the citeNumber of the image file in the metadata of the virtual machine image file.

本实施例步骤2)之后还包括响应用户删除虚拟机镜像文件请求的步骤,详细步骤包括:After step 2) of this embodiment, it also includes the step of responding to the request of the user to delete the virtual machine image file, and the detailed steps include:

S1)获取待删除的虚拟机镜像文件的镜像指纹fingerID;S1) obtain the image fingerprint fingerID of the virtual machine image file to be deleted;

S2)根据镜像指纹fingerID获取共享存储上存储的待删除的虚拟机镜像文件的元数据;S2) obtain the metadata of the virtual machine image file to be deleted stored on the shared storage according to the image fingerprint fingerID;

S3)将待删除的虚拟机镜像文件的元数据中的镜像文件引用数citeNumber减1;S3) subtract 1 from the image file citation number citeNumber in the metadata of the virtual machine image file to be deleted;

S4)判断减1后的镜像文件引用数citeNumber是否为0,如果为0则在共享存储上删除待删除的虚拟机镜像文件。S4) Determine whether the citation number citeNumber of the image file after subtracting 1 is 0, and if it is 0, delete the virtual machine image file to be deleted on the shared storage.

本实施例中服务端响应用户上传虚拟机镜像文件请求时,还包括云计算中心其过该用户存储该虚拟机镜像文件的虚拟机镜像文件定义描述四元组;因此响应用户删除虚拟机镜像文件请求还需要删除为该用户存储的该虚拟机镜像文件的虚拟机镜像文件定义描述四元组。In this embodiment, when the server responds to the user's request for uploading the virtual machine image file, it also includes the virtual machine image file definition and description quadruple of the cloud computing center where the user stores the virtual machine image file; therefore, the response to the user deletes the virtual machine image file. The request also needs to delete the virtual machine image file definition description quadruplet of the virtual machine image file stored for the user.

本实施例中,响应用户上传虚拟机镜像文件请求的服务端具体是指麒麟云计算平台的镜像管理中心,该镜像管理中心用于通过共享存储统一管理所有用户的虚拟机镜像文件。In this embodiment, the server that responds to the user's request to upload the virtual machine image file specifically refers to the image management center of the Kylin cloud computing platform, and the image management center is used to uniformly manage the virtual machine image files of all users through shared storage.

本实施例中步骤2)之后还包括根据虚拟机镜像文件创建虚拟机的步骤,作为一种可选的实施方式,创建虚拟机后虚拟机在存储组织上的数据文件均采用虚拟机镜像文件加增量数据的方式进行存储,且所有虚拟机的在共享存储上存储的数据文件包括所有虚拟机共性内容、所有虚拟机的虚拟机镜像文件集合、所有虚拟机的增量数据集合;步骤2)中根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件具体是指:将用户上传的虚拟机镜像文件的镜像指纹fingerID分别与所有虚拟机的虚拟机镜像文件集合中的各个虚拟机镜像文件的元数据中的镜像指纹fingerID进行比较,如果存在匹配的镜像文件,则判定已经存储有该虚拟机镜像文件,否则判定尚未存储有该虚拟机镜像文件。例如形式为:In this embodiment, after step 2), there is also a step of creating a virtual machine according to the virtual machine image file. As an optional implementation manner, after the virtual machine is created, the data files of the virtual machine on the storage organization are all added by the virtual machine image file. Incremental data is stored, and the data files of all virtual machines stored on the shared storage include the common content of all virtual machines, the virtual machine image file collection of all virtual machines, and the incremental data collection of all virtual machines; step 2) judging whether the virtual machine image file has been stored on the shared storage according to the image fingerprint fingerID comparison specifically refers to: comparing the image fingerprint fingerID of the virtual machine image file uploaded by the user with each of the virtual machine image file sets of all virtual machines. The image fingerprint fingerID in the metadata of the virtual machine image file is compared, and if there is a matching image file, it is determined that the virtual machine image file has been stored, otherwise it is determined that the virtual machine image file has not been stored. For example the form is:

{base{image_id1,image_id2,…image_idn},inst11,inst12,inst21,…,instnm}{base{image_id 1 ,image_id 2 ,…image_id n },inst 11 ,inst 12 ,inst 21 ,…,inst nm }

上式中,base表示所有虚拟机共性内容,{image_id1,image_id2,…,image_idn}表示所有虚拟机的虚拟机镜像文件集合,包含image_id1~image_idn一共n个虚拟机镜像文件;inst11,inst12,inst21,…,instnm表示所有虚拟机的增量数据集合,虚拟机的增量数据的名称与虚拟机实例的唯一标识符(instance_id)相同,一般而言一个10G大小的镜像创建出来的虚拟机增量部分文件大小仅有200M左右(会随着虚拟机使用过程中用户程序的增加而增加)。其中inst11,inst12分别表示以虚拟机镜像文件image_id1为基础的第1个和第2个虚拟机的增量数据,inst21表示以虚拟机镜像文件image_id2为基础的虚拟机的增量数据,instnm表示以虚拟机镜像文件image_idn为基础的第m个虚拟机的增量数据。因此每次在创建虚拟机时,首先会在所有虚拟机共性内容base中检测是否存在相同虚拟机镜像文件的虚拟机、或者在所有虚拟机的虚拟机镜像文件集合{image_id1,image_id2,…,image_idn}检测是否存在相同虚拟机镜像文件,如果存在只需要为此虚拟机创建独立的增量文件即可,否则需要将虚拟机镜像从镜像管理中心下载至共享存储之上,然后在所有虚拟机的虚拟机镜像文件集合中加入对应的虚拟机镜像文件,同时在所有虚拟机的增量数据集合中创建独立的增量数据。在通用的做法中,虚拟机创建后其数据文件均存储在共享存储上,为了提高存储空间利用率和虚拟机启动效率,虚拟机实例在存储组织上均采用增量式存储方式。上述方式有下述优点:其一、所有虚拟机共性内容、所有虚拟机的虚拟机镜像文件集合实现了共享,可以减少存储空间的占用;其二、也简化了创建虚拟机时的虚拟机镜像文件存在检测以及数据文件生成。In the above formula, base represents the common content of all virtual machines, {image_id 1 , image_id 2 ,..., image_id n } represents the virtual machine image file set of all virtual machines, including a total of n virtual machine image files from image_id 1 to image_id n ; inst 11 ,inst 12 ,inst 21 ,…,inst nm represents the incremental data set of all virtual machines. The name of the incremental data of the virtual machine is the same as the unique identifier (instance_id) of the virtual machine instance. Generally speaking, a 10G size The file size of the incremental part of the virtual machine created by the image is only about 200M (it will increase with the increase of user programs during the use of the virtual machine). where inst 11 and inst 12 respectively represent the incremental data of the first and second virtual machines based on the virtual machine image file image_id 1 , and inst 21 represents the incremental data of the virtual machine based on the virtual machine image file image_id 2 Data, inst nm represents the incremental data of the mth virtual machine based on the virtual machine image file image_id n . Therefore, every time a virtual machine is created, it will first detect whether there are virtual machines with the same virtual machine image file in the common content base of all virtual machines, or in the virtual machine image file set of all virtual machines {image_id 1 ,image_id 2 ,… , image_id n } to detect whether the same virtual machine image file exists, if there is, just create an independent incremental file for this virtual machine, otherwise you need to download the virtual machine image from the image management center to the shared storage, and then in all A corresponding virtual machine image file is added to the virtual machine image file set of the virtual machine, and independent incremental data is created in the incremental data set of all virtual machines. In a common practice, after the virtual machine is created, its data files are stored on the shared storage. In order to improve the storage space utilization and the efficiency of virtual machine startup, the virtual machine instance adopts the incremental storage method in the storage organization. The above method has the following advantages: First, the common content of all virtual machines and the virtual machine image file collection of all virtual machines are shared, which can reduce the occupation of storage space; second, it also simplifies the virtual machine image when creating a virtual machine. File existence detection and data file generation.

此外,本实施例还提供一种基于麒麟云计算平台的虚拟机镜像管理系统,包括计算机设备,该计算机设备被编程或配置以执行前述基于麒麟云计算平台的虚拟机镜像管理方法的步骤,或该计算机设备的存储器上存储有被编程或配置以执行前述基于麒麟云计算平台的虚拟机镜像管理方法的计算机程序。In addition, the present embodiment also provides a virtual machine image management system based on the Kylin cloud computing platform, including a computer device that is programmed or configured to execute the steps of the aforementioned method for managing virtual machine images based on the Kylin cloud computing platform, or A computer program programmed or configured to execute the aforementioned method for managing virtual machine images based on the Kylin cloud computing platform is stored in the memory of the computer device.

此外,本实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有被编程或配置以执行前述基于麒麟云计算平台的虚拟机镜像管理方法的计算机程序。In addition, this embodiment also provides a computer-readable storage medium, where a computer program programmed or configured to execute the aforementioned method for managing virtual machine images based on the Kylin cloud computing platform is stored thereon.

以上所述仅是本发明的优选实施方式,本发明的保护范围并不仅局限于上述实施例,凡属于本发明思路下的技术方案均属于本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理前提下的若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only the preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above-mentioned embodiments, and all technical solutions under the idea of the present invention belong to the protection scope of the present invention. It should be pointed out that for those skilled in the art, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims (10)

1.一种基于麒麟云计算平台的虚拟机镜像管理方法,其特征在于,服务端响应用户上传虚拟机镜像文件请求的步骤包括:1. a virtual machine image management method based on Kylin cloud computing platform, is characterized in that, the step that server responds to user uploading virtual machine image file request comprises: 1)获取用户上传的虚拟机镜像文件描述,该虚拟机镜像文件描述包括镜像所有者owner、镜像文件名称name、镜像指纹fingerID、镜像文件描述Description;1) Obtain the description of the virtual machine image file uploaded by the user. The description of the virtual machine image file includes the image owner, the image file name, the image fingerprint fingerID, and the image file description Description; 2)在服务端存储该虚拟机镜像文件描述;根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件,如果共享存储上尚未存储该虚拟机镜像文件,则在共享存储上存储该虚拟机镜像文件,并在该虚拟机镜像文件的元数据中记录用户对该虚拟机镜像文件的引用;如果共享存储上已经存储该虚拟机镜像文件,则直接在该虚拟机镜像文件的元数据中增加用户对该虚拟机镜像文件的引用而不重复存储该虚拟机镜像文件。2) Store the description of the virtual machine image file on the server; judge whether the virtual machine image file has been stored on the shared storage according to the image fingerprint fingerID comparison, and if the virtual machine image file has not been stored on the shared storage, then on the shared storage Store the virtual machine image file, and record the user's reference to the virtual machine image file in the metadata of the virtual machine image file; if the virtual machine image file has been stored on the shared storage, directly in the virtual machine image file A user's reference to the virtual machine image file is added to the metadata without repeatedly storing the virtual machine image file. 2.根据权利要求1所述的基于麒麟云计算平台的虚拟机镜像管理方法,其特征在于,所述镜像指纹fingerID为根据虚拟机镜像文件的内容采用MD5、SHA1、CRC32三者中的一种算法计算得到或者两种以上算法组合计算得到。2. the virtual machine image management method based on Kylin cloud computing platform according to claim 1, is characterized in that, described image fingerprint fingerID is to adopt a kind of in MD5, SHA1, CRC32 according to the content of virtual machine image file Algorithm calculation or a combination of two or more algorithms. 3.根据权利要求1所述的基于麒麟云计算平台的虚拟机镜像管理方法,其特征在于,步骤1)中用户上传的虚拟机镜像文件描述为的虚拟机镜像文件定义描述四元组。3. The virtual machine image management method based on Kylin cloud computing platform according to claim 1, is characterized in that, in step 1), the virtual machine image file that the user uploads is described as the virtual machine image file definition description quadruple. 4.根据权利要求1所述的基于麒麟云计算平台的虚拟机镜像管理方法,其特征在于,步骤2)中的元数据采用三元组进行描述,所述三元组包括镜像指纹fingerID、镜像文件引用数citeNumber、镜像文件具体存放位置url。4. the virtual machine image management method based on kylin cloud computing platform according to claim 1, is characterized in that, the metadata in step 2) adopts triplet to describe, and described triplet comprises image fingerprint fingerID, image The number of file citations citeNumber, the specific storage location url of the mirror file. 5.根据权利要求4所述的基于麒麟云计算平台的虚拟机镜像管理方法,其特征在于,步骤2)中根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件具体是指:将用户上传的虚拟机镜像文件的镜像指纹fingerID分别与共享存储上存储的各个虚拟机镜像文件的元数据中的镜像指纹fingerID进行比较,如果存在匹配的镜像文件,则判定已经存储有该虚拟机镜像文件,否则判定尚未存储有该虚拟机镜像文件。5. the virtual machine image management method based on kylin cloud computing platform according to claim 4, is characterized in that, in step 2), according to image fingerprint fingerID comparison judges whether on shared storage has been stored with this virtual machine image file specifically is. Refers to: compare the image fingerprint fingerID of the virtual machine image file uploaded by the user with the image fingerprint fingerID in the metadata of each virtual machine image file stored on the shared storage. If there is a matching image file, it is determined that the image file has been stored. The virtual machine image file, otherwise it is determined that the virtual machine image file has not been stored. 6.根据权利要求4所述的基于麒麟云计算平台的虚拟机镜像管理方法,其特征在于,步骤2)中记录用户对该虚拟机镜像文件的引用具体是指将该虚拟机镜像文件的元数据中的镜像文件引用数citeNumber设置为1;步骤2)中增加用户对该虚拟机镜像文件的引用具体是指将该虚拟机镜像文件的元数据中的镜像文件引用数citeNumber加1。6. the virtual machine image management method based on Kylin cloud computing platform according to claim 4, is characterized in that, in step 2), record user's reference to this virtual machine image file specifically refers to the element of this virtual machine image file. The citation number citeNumber of the mirror file in the data is set to 1; in step 2), adding a user's reference to the virtual machine mirror file specifically refers to adding 1 to the mirror file citation number citeNumber in the metadata of the virtual machine mirror file. 7.根据权利要求4所述的基于麒麟云计算平台的虚拟机镜像管理方法,步骤2)之后还包括响应用户删除虚拟机镜像文件请求的步骤,详细步骤包括:7. the virtual machine image management method based on Kylin cloud computing platform according to claim 4, also comprises the step of responding to user delete virtual machine image file request after step 2), and detailed steps comprise: S1)获取待删除的虚拟机镜像文件的镜像指纹fingerID;S1) obtain the image fingerprint fingerID of the virtual machine image file to be deleted; S2)根据镜像指纹fingerID获取共享存储上存储的待删除的虚拟机镜像文件的元数据;S2) obtain the metadata of the virtual machine image file to be deleted stored on the shared storage according to the image fingerprint fingerID; S3)将待删除的虚拟机镜像文件的元数据中的镜像文件引用数citeNumber减1;S3) subtract 1 from the image file citation number citeNumber in the metadata of the virtual machine image file to be deleted; S4)判断减1后的镜像文件引用数citeNumber是否为0,如果为0则在共享存储上删除待删除的虚拟机镜像文件。S4) Determine whether the citation number citeNumber of the image file after subtracting 1 is 0, and if it is 0, delete the virtual machine image file to be deleted on the shared storage. 8.根据权利要求1所述的基于麒麟云计算平台的虚拟机镜像管理方法,步骤2)之后还包括根据虚拟机镜像文件创建虚拟机的步骤,且创建虚拟机后虚拟机在存储组织上的数据文件均采用虚拟机镜像文件加增量数据的方式进行存储,且所有虚拟机的在共享存储上存储的数据文件包括所有虚拟机共性内容、所有虚拟机的虚拟机镜像文件集合、所有虚拟机的增量数据集合;步骤2)中根据镜像指纹fingerID比对判断共享存储上是否已经存储有该虚拟机镜像文件具体是指:将用户上传的虚拟机镜像文件的镜像指纹fingerID分别与所有虚拟机的虚拟机镜像文件集合中的各个虚拟机镜像文件的元数据中的镜像指纹fingerID进行比较,如果存在匹配的镜像文件,则判定已经存储有该虚拟机镜像文件,否则判定尚未存储有该虚拟机镜像文件。8. the virtual machine image management method based on Kylin cloud computing platform according to claim 1, also comprises the step of creating virtual machine according to virtual machine image file after step 2), and after creating virtual machine, virtual machine on storage organization. The data files are stored in the form of virtual machine image files and incremental data, and the data files of all virtual machines stored on the shared storage include the common content of all virtual machines, the collection of virtual machine image files of all virtual machines, and the data files of all virtual machines. The incremental data set; step 2) according to the mirror fingerprint fingerID comparison to determine whether the virtual machine mirror file has been stored on the shared storage specifically refers to: the mirror fingerprint fingerID of the virtual machine mirror file uploaded by the user is respectively with all virtual machines Compare the image fingerprint fingerID in the metadata of each virtual machine image file in the set of virtual machine image files. If there is a matching image file, it is determined that the virtual machine image file has been stored, otherwise it is determined that the virtual machine has not been stored. image file. 9.一种基于麒麟云计算平台的虚拟机镜像管理系统,包括计算机设备,其特征在于,该计算机设备被编程或配置以执行权利要求1~8中任意一项所述基于麒麟云计算平台的虚拟机镜像管理方法的步骤,或该计算机设备的存储器上存储有被编程或配置以执行权利要求1~8中任意一项所述基于麒麟云计算平台的虚拟机镜像管理方法的计算机程序。9. A virtual machine image management system based on the Kylin cloud computing platform, comprising computer equipment, characterized in that the computer equipment is programmed or configured to execute the Kylin cloud computing platform-based system according to any one of claims 1 to 8. The steps of the virtual machine image management method, or a computer program programmed or configured to execute the Kylin cloud computing platform-based virtual machine image management method according to any one of claims 1 to 8 is stored in the memory of the computer device. 10.一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有被编程或配置以执行权利要求1~8中任意一项所述基于麒麟云计算平台的虚拟机镜像管理方法的计算机程序。10. A computer-readable storage medium, wherein the computer-readable storage medium is programmed or configured to execute the Kylin cloud computing platform-based virtual machine image management according to any one of claims 1 to 8. A computer program of the method.
CN202010269446.XA 2020-04-08 2020-04-08 Virtual machine mirror image management method, system and medium based on kylin cloud computing platform Active CN111414239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010269446.XA CN111414239B (en) 2020-04-08 2020-04-08 Virtual machine mirror image management method, system and medium based on kylin cloud computing platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010269446.XA CN111414239B (en) 2020-04-08 2020-04-08 Virtual machine mirror image management method, system and medium based on kylin cloud computing platform

Publications (2)

Publication Number Publication Date
CN111414239A true CN111414239A (en) 2020-07-14
CN111414239B CN111414239B (en) 2023-01-31

Family

ID=71491774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010269446.XA Active CN111414239B (en) 2020-04-08 2020-04-08 Virtual machine mirror image management method, system and medium based on kylin cloud computing platform

Country Status (1)

Country Link
CN (1) CN111414239B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363795A (en) * 2020-10-13 2021-02-12 南京赛宁信息技术有限公司 Method and system for quickly starting virtual machine of network security practical training platform
CN113890881A (en) * 2021-10-13 2022-01-04 济南浪潮数据技术有限公司 Method, system, storage medium and equipment for quickly uploading mirror image of virtual machine
CN115061774A (en) * 2022-05-16 2022-09-16 中国人民解放军国防科技大学 Application image management and release method, system, device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942292A (en) * 2014-04-11 2014-07-23 华为技术有限公司 Virtual machine mirror image document processing method, device and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942292A (en) * 2014-04-11 2014-07-23 华为技术有限公司 Virtual machine mirror image document processing method, device and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363795A (en) * 2020-10-13 2021-02-12 南京赛宁信息技术有限公司 Method and system for quickly starting virtual machine of network security practical training platform
CN112363795B (en) * 2020-10-13 2021-11-26 南京赛宁信息技术有限公司 Method and system for quickly starting virtual machine of network security practical training platform
CN113890881A (en) * 2021-10-13 2022-01-04 济南浪潮数据技术有限公司 Method, system, storage medium and equipment for quickly uploading mirror image of virtual machine
CN115061774A (en) * 2022-05-16 2022-09-16 中国人民解放军国防科技大学 Application image management and release method, system, device and storage medium

Also Published As

Publication number Publication date
CN111414239B (en) 2023-01-31

Similar Documents

Publication Publication Date Title
US12197758B2 (en) Distributed object replication architecture
US11010240B2 (en) Tracking status and restarting distributed replication
US11327799B2 (en) Dynamic allocation of worker nodes for distributed replication
US11349915B2 (en) Distributed replication and deduplication of an object from a source site to a destination site
CN107590019B (en) A method and device for data storage
CN106339177A (en) Method and device for creating virtual machines
CN111414239B (en) Virtual machine mirror image management method, system and medium based on kylin cloud computing platform
CN114153647B (en) Rapid data verification method, device and system for cloud storage system
WO2021143351A1 (en) Distributed retrieval method, apparatus and system, computer device, and storage medium
CN108769123B (en) A data system and data processing method
CN111652685A (en) Information processing method, apparatus, computer equipment, and computer-readable storage medium
CN113986835A (en) Management method, device, equipment and storage medium for FastDFS distributed files
CN112286457A (en) Object deduplication method, apparatus, electronic device, and machine-readable storage medium
CN107070645A (en) Compare the method and system of the data of tables of data
CN107566470B (en) Method and device for managing virtual machine in cloud data system
CN105183799B (en) Method and client for rights management
CN113704176B (en) Document scanning methods, devices, electronic equipment and storage media
CN106203179A (en) A kind of completeness check system and method to file
CN110019057B (en) Request processing method and device
US20180060974A1 (en) Social networking relationships processing method, system, and storage medium
WO2021254214A1 (en) Migration method and apparatus for android application program
WO2022083267A1 (en) Data processing method, apparatus, computing node, and computer readable storage medium
CN114675776B (en) Resource storage method and device, storage medium and electronic device
CN106383664A (en) Data storage method and apparatus
CN111813501A (en) A data deletion method, device, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant