WO2017008584A1 - Virtual machine starting method and device, and management node - Google Patents

Virtual machine starting method and device, and management node Download PDF

Info

Publication number
WO2017008584A1
WO2017008584A1 PCT/CN2016/083688 CN2016083688W WO2017008584A1 WO 2017008584 A1 WO2017008584 A1 WO 2017008584A1 CN 2016083688 W CN2016083688 W CN 2016083688W WO 2017008584 A1 WO2017008584 A1 WO 2017008584A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
affinity
mirror
image
data
Prior art date
Application number
PCT/CN2016/083688
Other languages
French (fr)
Chinese (zh)
Inventor
江滢
王志坤
张恒生
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017008584A1 publication Critical patent/WO2017008584A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt

Definitions

  • This document relates to but not limited to the field of communication, and in particular to a virtual machine startup method, device and management node.
  • Cloud computing is a computing model that uses the Internet to access shared resource pools anytime, anywhere, on demand, and conveniently. Key features of cloud computing include multi-tenancy, resource pooling, on-demand self-service, rapid resiliency and scalability, measurable services, and extensive network access.
  • Virtualization and related technologies are one of the main technologies for implementing these features. Cloud computing platforms need to flexibly deploy and build virtualized clusters of different sizes and types to meet different user needs and achieve flexible services.
  • a typical virtual machine deployment method is: the management node selects a host that meets the requirements in the cluster as a target host according to the deployment request and the constraint condition, and the target host copies the virtual machine image file from the virtual machine image template library to the local, and Start the virtual machine after the copy is complete.
  • the application is deployed in a local private cloud in a normal state.
  • the acquisition resource is greatly expanded by extending the application to the public cloud.
  • a large amount of virtual machine data needs to be transmitted through a network between relatively low-speed public and private clouds, which often takes hours or even days, which seriously affects the flexibility and agility of cloud computing.
  • the embodiment of the invention provides a virtual machine startup method, device and management node, which can be used to solve the related art, and the cloud computing puts forward higher requirements for the rapid deployment of large-scale and large-capacity virtual machines, and the virtual machine is deployed. The way is no longer enough to meet the demand.
  • a virtual machine startup method includes:
  • the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created;
  • the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the mirror affinity virtual machine of the source virtual machine is located, so that the host machine is the target host;
  • the management node copies the data of the source virtual machine image to the target host in combination with the existing data on the target host to restore the complete source virtual machine image data.
  • the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created, including:
  • the management node receives a create virtual machine request from a client, and registers an image with the mirror server;
  • the management node sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirror feature value database.
  • the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, a host where the mirror affinity virtual machine of the source virtual machine is located, to use the host machine as a target sink.
  • the host includes:
  • the management node acquires real-time resource usage information of each computing node, and filters out nodes with sufficient resources according to resource requirement information of the virtual machine;
  • the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis;
  • the management node determines the adjacency virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
  • the management node in combination with the existing data on the target host, copies the source virtual machine image data portion to the target host to restore the complete source virtual machine image data, including:
  • the management node sends a preparation virtual machine image request to the target host
  • the management node copies the source virtual machine image data portion to the target host in combination with the existing data on the target host, so that the target host combines the virtual machine image incremental data to be deployed to implement the virtual machine image. Local refactoring.
  • the mirroring server performs image affinity eigenvalue analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database, including:
  • I is set to i+1, and the n hash functions are repeated until all the data blocks are mapped to generate an image array of the image affinity value of the current virtual machine as the analysis result of the image affinity feature value, and Saving the analysis result in a mirrored feature value database;
  • i is initially 1, and m and n are positive integers greater than or equal to 1.
  • the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis. , including:
  • the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table;
  • the management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine;
  • the management node sends the source virtual machine and the virtual machine v image affinity analysis request to the mirror server to determine the affinity of the affinity source virtual machine and the virtual machine v by default, and the request parameter is the source virtual machine image uuid and The mirror uuid of the virtual machine v.
  • the determining, by the preset manner, the affinity of the affinity source virtual machine and the virtual machine v including:
  • the mirroring server extracts a mirrored OS attribute according to the stored virtual machine image description information to determine an affinity by using the mirrored OS attribute;
  • the source virtual machine image and the virtual machine v mirror affinity relationship value are searched from the mirrored feature value database, and directly in the case of the query. Read the value, and if not queried, read the mirror affinity bit array of the source virtual machine and the virtual machine v from the mirrored feature value database according to the mirror uuid to calculate the source virtual machine and the virtual machine.
  • Mirror affinity of v
  • the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
  • the management node in combination with the existing data on the target host, copying the source virtual machine image data portion to the target host, and copying the source virtual machine image data portion to the target host device includes:
  • the verification code information array of the affinity virtual machine image is transmitted to the mirror server, so that the source virtual machine image and the affinity virtual machine image are compared one by one according to the data block granularity;
  • the source virtual machine image is constructed with an array of meta information to transfer the affinity virtual machine block number and the source virtual machine image difference data set to the target host.
  • a virtual machine quick start device includes:
  • a sending module configured to send a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created
  • a determining module configured to determine, according to the virtual machine resource requirement and the virtual machine image affinity feature value, a host of the mirror affinity virtual machine of the source virtual machine, to use the host machine as the target host;
  • the backup module is configured to combine the data of the source virtual machine image with the existing data on the target host to copy the data of the source virtual machine to the target host to restore the complete source virtual machine image data.
  • the sending module includes:
  • a receiving unit configured to receive a create virtual machine request from a client, and register an image with the mirror server
  • the first sending unit is configured to send a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
  • the determining module includes:
  • the acquiring unit is configured to obtain real-time resource usage information of each computing node, and filter out nodes with sufficient resources according to resource requirement information of the virtual machine;
  • a second sending unit configured to send, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis
  • Determining a unit configured to determine to be deployed according to a node resource adequacy ratio and the mirror similarity Affinity virtual machines on nodes and nodes to be deployed.
  • the backup module includes:
  • a third sending unit configured to send a preparation virtual machine image request to the target host
  • a backup unit configured to combine the data of the source virtual machine image with the existing data on the target host, and copy the source virtual machine image data portion to the target host, so that the target host machine implements the virtual machine in combination with the virtual machine image incremental data to be deployed.
  • Mirror local refactoring configured to combine the data of the source virtual machine image with the existing data on the target host, and copy the source virtual machine image data portion to the target host, so that the target host machine implements the virtual machine in combination with the virtual machine image incremental data to be deployed.
  • the first sending unit sends a mirroring analysis request to the mirroring server, so that the mirroring server performs mirroring affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database, including:
  • the first sending unit sends a mirror analysis request to the mirror server, so that the mirror server constructs an m-bit image affinity feature value bit array, and sets all positions to 0; defines a set of hashes from 1 to n Function; decompose the virtual machine image data into a plurality of fixed length data blocks of length L; pass the i th data block successively through n hash functions to map into the image affinity feature value bit array; set i to i+1, repeating through n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, realizing the mirror affinity eigenvalue analysis process, and saving the analysis result in Mirroring the feature value database; where i is initially 1, and m and n are positive integers greater than or equal to 1.
  • the second sending unit sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the image according to the image affinity feature value analysis. Similarity, including:
  • the second sending unit sets a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that is impossible to exist; and sequentially selects a node from a resource-rich candidate node.
  • the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table; according to the uuid of the source virtual machine, Obtaining the source virtual machine image uuid from the virtual machine information table;
  • the source virtual machine and the virtual machine v image affinity analysis request are sent to the mirror server to determine the affinity of the affinity source virtual machine and the virtual machine v by default, and the request parameters are the source virtual machine image uuid and the virtual machine.
  • the mirror uuid of v is the mirror uuid of v.
  • the determining, by the second sending unit, the affinity of the affinity source virtual machine and the virtual machine v by a preset manner includes:
  • the second sending unit extracts, by using the mirror server, the mirroring OS attribute according to the stored virtual machine image description information, to determine the affinity by using the mirroring OS attribute;
  • the source virtual machine image and the virtual machine v mirror affinity relationship value are searched from the mirrored feature value database, and directly in the case of the query. Read the value, and if not queried, read the mirror affinity bit array of the source virtual machine and the virtual machine v from the mirrored feature value database according to the mirror uuid to calculate the source virtual machine and the virtual machine.
  • Mirror affinity of v
  • the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
  • the backup module combines the existing data on the target host to copy the source virtual machine image data portion to the target host to restore the complete source virtual machine image data, including:
  • the backup module sequentially decomposes the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, and generates two check codes for each block by using two check code algorithms;
  • the mirrored checksum information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by the data block granularity; the source virtual machine image is constructed with the meta information array to be the affinity virtual machine data block.
  • the number and source virtual machine image difference data set is transferred to the target host.
  • a management node includes: the above virtual machine boot device.
  • a computer readable storage medium storing computer executable instructions for performing the above method.
  • the solution provided by the embodiment of the present invention performs image affinity analysis on the virtual machine to be created, and obtains the target host of the mirror affinity virtual machine of the source virtual machine, according to the existing data on the target host. Copy the source virtual machine image data to the target host, reduce the number of remote data copies, quickly deploy and start the virtual machine, improve the deployment efficiency, and solve the related technology, the cloud computing for large-scale, large-capacity virtual machines Rapid deployment puts forward higher requirements, and the virtual machine deployment method can no longer meet the demand problem.
  • FIG. 1 is a flowchart of a method for starting a virtual machine in an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a virtual machine starting device according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a sending module in a virtual machine starting device according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a determining module in a virtual machine starting device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a backup module in a virtual machine starting device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a topology of a virtualized cluster in an alternative embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of implementing a virtual machine startup method in an optional embodiment of the present invention.
  • the embodiment of the invention provides a virtual machine startup method, device and management node. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
  • the embodiment of the invention provides a virtual machine startup method.
  • the process of the method is as shown in FIG. 1 and includes steps S102 to S106:
  • the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created.
  • the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the mirror affinity virtual machine of the source virtual machine is located, so that the host machine is the target host;
  • the management node combines the existing data on the target host to mirror the data part of the source virtual machine. Copy to the target host to restore the full source virtual machine image data, thus enabling a quick start of the virtual machine.
  • the method provided by the embodiment of the present invention performs image affinity analysis on the virtual machine to be created, obtains the target host of the mirror affinity virtual machine of the source virtual machine, and mirrors the source virtual machine according to the existing data on the target host.
  • the data is partially copied to the target host, which reduces the number of remote data copies, can quickly deploy and start the virtual machine, improves the deployment efficiency, and solves the related technology, the cloud computing provides a rapid deployment of large-scale, large-capacity virtual machines. With higher requirements, the existing virtual machine deployment method can no longer meet the demand problem.
  • the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created, including: the management node receives the create virtual machine request from the client, and registers the image with the mirror server.
  • the management node sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
  • the mirroring server performs image affinity eigenvalue analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database, including: constructing an m-bit image affinity feature value bit array, and All positions are 0; define a set of hash functions from 1 to n; decompose the virtual machine image data into multiple fixed length data blocks of length L; pass the i th data block successively through n hash functions to map to Mirror affinity feature value bit array; set i to i+1, repeat n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, as a mirror
  • the analysis result of the affinity feature value is saved in the mirrored feature value database; wherein i is initially 1, and m and n are positive integers greater than or equal to 1.
  • the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the virtual machine of the source virtual machine is located, and the host machine as the target host includes: The management node obtains the real-time resource usage information of each computing node, and filters out the nodes with sufficient resources according to the resource requirement information of the virtual machine; the management node sends the virtual machine mirroring affinity analysis of the virtual machine to be deployed and the candidate node to the mirror server.
  • the instructions are such that the mirror server determines the mirror similarity according to the image affinity feature value analysis; the management node determines the affinity virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
  • the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis.
  • the node v is selected from the resource-rich candidate nodes in sequence; the virtual machine on the node v is sequentially selected according to the pre-stored virtualized cluster node information table, and the virtual machine corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table.
  • the machine mirrors the uuid; the management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine; the management node sends the source virtual machine and the virtual machine v image affinity analysis request to the mirror server to pass the
  • the preset mode determines the affinity of the affinity source virtual machine and the virtual machine v.
  • the request parameters are the source virtual machine image uuid and the mirror uuid of the virtual machine v.
  • determining, by using a preset manner, the affinity source virtual machine and the virtual machine v image affinity including: the mirror server extracting the mirrored OS attribute according to the stored virtual machine image description information, to mirror the OS attribute.
  • the mirrored feature value database The image affinity bit arrays of the source virtual machine and the virtual machine v are respectively read to calculate the mirror affinity of the source virtual machine and the virtual machine v; whether the value of the mirror affinity relationship is greater than the current maximum value; In the case of a value, the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
  • the management node combines the data of the source virtual machine image with the data of the target host to copy the data of the source virtual machine to the target host to restore the complete source virtual machine image data, so as to implement the fast startup virtual machine, including:
  • the management node sends a request for preparing a virtual machine image to the target host; the management node copies the data of the source virtual machine image to the target host in combination with the existing data on the target host, so that the target host combines the virtual machine image to be deployed.
  • Incremental data enables local reconstruction of virtual machine images.
  • the management node combines the data of the source virtual machine with the existing data on the target host.
  • the partial copy to the target host to restore the complete source virtual machine image data, to achieve a quick start virtual machine includes:
  • the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, respectively generating two check codes by using two check code algorithms for each block of data; verifying the mirror of the affinity virtual machine
  • the code information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by data block granularity; the source virtual machine image is constructed to construct a meta information array to associate the affinity virtual machine data block number with the source virtual
  • the machine mirror differential data set is transferred to the target host.
  • the embodiment of the present invention further provides a virtual machine starting device.
  • the structure of the device is as shown in FIG. 2, and includes: a sending module 10, configured to send a mirroring analysis request to the mirror server, so that the mirror server analyzes the virtual machine to be created. a mirroring affinity feature value; the determining module 20 is coupled to the sending module 10, and configured to determine, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host machine of the mirror virtual affinity virtual machine of the source virtual machine, The host computer is used as the target host; the backup module 30 is coupled with the determining module 20, and is configured to combine the existing data on the target host to copy the source virtual machine image data portion to the target host to restore the complete source virtual machine image. Data to enable a quick start of the virtual machine.
  • the structure of the sending module 10 is as shown in FIG. 3, which may include: a receiving unit 101 configured to receive a request for creating a virtual machine from a client, and register an image with the mirror server; the first sending unit 102, and the receiving unit The 101 is coupled to send a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
  • the first sending unit 102 sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
  • the first sending unit sends a mirror analysis request to the mirror server, so that the mirror server constructs an m-bit image affinity feature value bit array, and sets all positions to 0; defines a set of hashes from 1 to n Function; decompose the virtual machine image data into a plurality of fixed length data blocks of length L; pass the i th data block successively through n hash functions to map into the image affinity feature value bit array; set i to i+1, repeating through n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, to achieve mirror affinity characteristics
  • the value analysis process saves the analysis result in the mirrored feature value database; where i is initially 1, and m and n are positive integers greater than or equal to 1.
  • the determining module 20 may include: an obtaining unit 201, configured to acquire real-time resource usage information of each computing node, and filter out a node with sufficient resources according to resource requirement information of the virtual machine;
  • the unit 202 is coupled to the obtaining unit 201, and configured to send, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis;
  • the determining unit 203 is coupled to the second sending unit 202 and configured to determine the affinity virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
  • the foregoing second sending unit 202 sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines according to the image affinity feature value analysis.
  • Mirror similarity including:
  • the second sending unit 202 sets a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that cannot exist; and sequentially selects a node v from the resource-qualified candidate nodes.
  • the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table; according to the uuid of the source virtual machine, The source virtual machine image uuid is obtained in the virtual machine information table; the source virtual machine and the virtual machine v image affinity analysis request are sent to the mirror server to determine the affinity source virtual machine and the virtual machine v mirror pro by a preset manner.
  • sexuality where the request parameter is the source virtual machine image uuid and the mirror uuid of the virtual machine v.
  • the determining, by the second sending unit, the affinity of the affinity source virtual machine and the virtual machine v by using a preset manner includes:
  • the second sending unit extracts the mirroring OS attribute according to the stored virtual machine image description information by the mirroring server to determine the affinity by mirroring the OS attribute; and the source virtual machine and the virtual machine v mirroring the OS anti-affinity In this case, directly returning to the first preset value; if the source virtual machine and the virtual machine v mirroring OS are not anti-affinity, the value of the affinity relationship between the source virtual machine image and the virtual machine v is obtained from the mirrored feature value database.
  • the backup module 30 may include: a third sending unit 301, configured to send a preparation virtual machine image request to the target host; and a backup unit 302 coupled with the third sending unit 301, and configured The data of the source virtual machine is copied to the target host, so that the target host combines the incremental data of the virtual machine image to be deployed to implement local reconstruction of the virtual machine image.
  • the backup module 30 combines the data of the source virtual machine image with the data on the target host to copy the source virtual machine image data to the target host to restore the complete source virtual machine image data, including:
  • the backup module sequentially decomposes the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, and generates two check codes for each block by using two check code algorithms;
  • the mirrored checksum information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by the data block granularity; the source virtual machine image is constructed with the meta information array to be the affinity virtual machine data block.
  • the number and source virtual machine image difference data set is transferred to the target host.
  • the embodiment of the invention further provides a management node, which comprises the above-mentioned virtual machine starting device.
  • a management node which comprises the above-mentioned virtual machine starting device.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing the above method.
  • the embodiment provides a method for starting a virtual machine.
  • the method determines the virtual machine image affinity feature value, and integrates the virtual machine resource requirements and constraints to determine the host of the mirror virtual affinity virtual machine of the source virtual machine.
  • the target host and then copy the source virtual machine image data part to the target host, and combine the existing data on the target host to locally restore the complete source virtual machine image data.
  • This embodiment speeds up virtual machine deployment and startup time, reduces bandwidth consumption during virtual machine deployment, and enhances the flexible expansion capability of the virtualized cluster.
  • FIG. 6 is a schematic diagram of a virtualized cluster topology.
  • the architecture of the virtualized cluster can be seen from the figure.
  • 7 is a schematic diagram of the architecture of the virtual machine startup method implementation.
  • the virtualization cluster of the embodiment includes a management server (management node), and the mirror server and at least one compute node (physical host) are connected through a network.
  • the computing node includes a hardware layer, a VMM (Virtual Machine Supervisory System) running on the hardware layer, and at least one VM (virtual machine) running on the host, such as VM1 and VM2 in FIG. 6;
  • the mirror server contains one or more mirrors, such as mirror 1 to mirror 4 in Figure 6.
  • the client, the host, and the mirror server are respectively connected to the management center (management node).
  • the user initiates a virtual machine request from the client of the management node.
  • the management node receives the instruction and sets the virtual machine state to pending.
  • the management node registers the image with the mirror server, and the mirror server performs image affinity eigenvalue analysis on the virtual machine image, and records the analysis result in the mirrored feature value database.
  • the management node obtains real-time resource usage information through each computing node, and filters out nodes with sufficient resources according to resource demand information such as CPU (central processing unit), MEM (memory), and disk space of the virtual machine.
  • resource demand information such as CPU (central processing unit), MEM (memory), and disk space of the virtual machine.
  • the management node sends a virtual machine image affinity analysis instruction to the virtual machine to be deployed to the mirror server one by one, and the mirror server calculates the mirror similarity according to the image affinity feature value analysis.
  • the management node issues a preparation virtual machine image request to the target host, and sets the virtual machine state to prolog.
  • the target host combines the virtual machine image incremental data to be deployed, and the virtual machine image is locally reconstructed to complete the virtual machine deployment; if there is no affinity virtual machine, the virtual machine image is completely transmitted to the target node.
  • the target host returns the virtual machine image preparation completion information to the management node.
  • the management node issues a virtual machine command to the target host, and the target host starts the virtual machine locally, and the virtual machine enters the booting state.
  • the virtual machine enters the running state, and the virtual machine completes the deployment and starts, and starts executing.
  • Business processing
  • the mirror server analyzes the affinity feature value based on the feature reduction of the mirror data, including the following process:
  • step (3) For the i-th data block (i is initially 1), the n hash functions defined by step (3) are successively mapped to the image affinity feature value bit array;
  • the image dimensionality reduction is completed, and the image is represented by an array of m-bit affinity feature value bits.
  • the more similar images have more common ones in their affinity feature value bit arrays. Since the hash function will collide, the similarity judgment will have a certain probability of error, and the larger the number m of the feature value bit array, the higher the accuracy of the similarity judgment, and of course the storage space consumption is larger.
  • the management node Before starting the virtual machine, the management node first obtains the real-time resource usage information from each computing node, and filters out the preliminary feasibility node according to the virtual machine's CPU, MEM, network bandwidth, and disk space resource requirement information. The management node sorts the preliminary feasibility nodes in descending order according to resource adequacy. For virtual machine j, the resource adequacy ratio of node i is defined as:
  • W cpu, j is the CPU weight of the virtual machine j
  • W mem, j is the weight of the MEM of the virtual machine j
  • W storage, j is the storage weight of the virtual machine j
  • the weight value can be based on the service type and resources of the virtual machine Demand adjustment, default is 1:1:1.
  • CPU i , MEM i , and Storage i are the CPU, MEM, and storage capacity remaining resource ratio of node i.
  • the management node finds the affinity virtual machine of the source virtual machine from the preliminary feasibility queue, as follows:
  • the management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine;
  • the management node sends a source virtual machine and virtual machine v image affinity analysis request to the mirror server, and the request parameters are the source virtual machine image uuid and the mirror uuid of the virtual machine v;
  • the mirror server extracts the mirror OS attribute according to the virtual machine image description information
  • Affinity can be defined in a variety of ways, and is illustrated here by way of example only.
  • )), dot(x,y) ⁇ x[i].y[i], Where dot(x, y) is equivalent to the number of bits in the array of two affinity feature bits at the same time;
  • the management node updates the maximum mirror affinity value, and records the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the hostid of the node n where it is located;
  • the mirror server returns ⁇ the maximum mirror affinity value to the management node, the corresponding virtual machine v, and the node where the virtual machine is located n>;
  • the maximum mirror affinity value obtained by the management node is not -1, that is, through the affinity relationship analysis, the mirror affinity virtual machine is found, and then the node in the request return value is determined as the target placement node, and the request return value is obtained.
  • the virtual machine in is the mirror affinity virtual machine of the source virtual machine on the target node. Otherwise, the source virtual machine and the virtual machines on all the candidate nodes are opposite each other, and the node with the highest resource adequacy is selected as the target placement node.
  • the affinity virtual machine mirror data is successively decomposed into a plurality of fixed length data blocks of length L.
  • Two checksum algorithms are generated for each block of data to generate two check codes (weak checksum, strong checksum);
  • Block_id Long Block number Weak_checksum String Weak checksum Strong_checksum String Strong checksum
  • step d) The source virtual machine image moves L bytes (i is updated to i+L), and step a) is repeated until the source virtual machine mirrors all the data blocks to complete the comparison;
  • step f) The source virtual machine image moves 1 byte (i is updated to i+1), and step a) is repeated until the source virtual machine mirrors all data blocks to complete the comparison.
  • the source virtual machine image is constructed to construct a meta information array, that is, the affinity virtual machine data block number and the source virtual machine image difference data set are transmitted to the target placement node; wherein the meta information data structure is as shown in Table 6.
  • the source virtual machine is built on the target placement node by:
  • the corresponding L-byte data block of the mirror affinity virtual machine is found according to the block id, and is added to the image in the local directory of the source virtual machine;
  • the source virtual machine full mirror is generated in the local directory of the source virtual machine.
  • the virtual machine image is completely transferred to the target placement node through the network.
  • the embodiments of the present invention have the following advantages: strong applicability, no need to modify the underlying kernel, and are applicable to virtualization technologies such as VMware ESX, KVM, and XEN; platform independence, applicable to operating systems such as windows and Linux, and completely the Guest OS As a black box, you do not need to modify the Guest OS.
  • virtualization technologies such as VMware ESX, KVM, and XEN
  • platform independence applicable to operating systems such as windows and Linux, and completely the Guest OS
  • you do not need to modify the Guest OS By analyzing the virtual machine image dimensionality reduction, you can accurately determine the mirror affinity virtual machine and select the corresponding node for deployment, avoiding redundant presets on multiple nodes, effectively improving storage. Space utilization rate.
  • the embodiment of the present invention has the following positive effects on the large-scale deployment of the cloud computing: by selecting the node where the virtual machine with the highest mirror affinity is deployed, reducing the number of remote data copies, rapidly deploying and starting the virtual machine, improving the deployment efficiency, and enhancing the cloud. Calculate the elastic expansion capability when the load changes dynamically; reduce the bandwidth consumption caused by data copy, and effectively reduce the communication cost of the hybrid cloud network.
  • the solution provided by the embodiment of the present invention performs image affinity analysis on the virtual machine to be created, obtains the target host of the mirror affinity virtual machine of the source virtual machine, and mirrors the source virtual machine according to the existing data on the target host.
  • the data is partially copied to the target host, which reduces the number of remote data copies, rapidly deploys and starts the virtual machine, improves the deployment efficiency, and solves the related technology.
  • the cloud computing proposes a rapid deployment of large-scale and large-capacity virtual machines. High requirements, virtual machine deployment methods can not meet the demand.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

A virtual machine starting method and device, and a management node, wherein the method comprises: a management node sending a mirror analysis request to a mirror server, so that the mirror server analyses a virtual machine mirror affinity feature value to be created; the management node determining, according to a virtual machine resource demand and the virtual machine mirror affinity feature value, a host machine where a mirror affinitive virtual machine of a source virtual machine is located, so as to take the host machine as a target host machine; and the management node partially copying source virtual machine mirror data to the target host machine by combining existing data on the target host machine, so as to recover complete source virtual machine mirror data.

Description

一种虚拟机启动方法、装置及管理节点Virtual machine startup method, device and management node 技术领域Technical field
本文涉及但不限于通讯领域,特别是涉及一种虚拟机启动方法、装置及管理节点。This document relates to but not limited to the field of communication, and in particular to a virtual machine startup method, device and management node.
背景技术Background technique
云计算是一种利用互联网实现随时随地、按需、便捷地访问共享资源池的计算模式。云计算的关键特性包括多租用、资源池化、按需自助、快速弹性和可扩展、可测量服务、广泛的网络接入。Cloud computing is a computing model that uses the Internet to access shared resource pools anytime, anywhere, on demand, and conveniently. Key features of cloud computing include multi-tenancy, resource pooling, on-demand self-service, rapid resiliency and scalability, measurable services, and extensive network access.
虚拟化及其相关技术是目前实现这些特征的主要技术之一。云计算平台需要通过灵活的部署和搭建不同规模与类型的虚拟化集群来应对各异的用户需求,从而实现其弹***。Virtualization and related technologies are one of the main technologies for implementing these features. Cloud computing platforms need to flexibly deploy and build virtualized clusters of different sizes and types to meet different user needs and achieve flexible services.
典型的虚拟机部署方法为,管理节点根据部署请求及约束条件在集群中选择一台满足需求的宿主机作为目标主机,目标主机将虚拟机镜像文件从虚拟机镜像模板库全量拷贝到本地,并在拷贝完成后启动虚拟机。A typical virtual machine deployment method is: the management node selects a host that meets the requirements in the cluster as a target host according to the deployment request and the constraint condition, and the target host copies the virtual machine image file from the virtual machine image template library to the local, and Start the virtual machine after the copy is complete.
上述虚拟机部署方法存在如下三个方面的局限性:The above virtual machine deployment methods have the following three limitations:
a)通常一个安装有操作***和多种应用业务软件的虚拟机模板映像的容量在几个甚至几十个GB以上,传输这种大尺寸的镜像文件往往需要很长的时间,降低了整体的部署效率;a) Usually, the capacity of a virtual machine template image with an operating system and multiple application business software installed is several or even several tens of GB. It takes a long time to transmit such a large-sized image file, which reduces the overall Deployment efficiency;
b)大尺寸镜像的传输,会导致较高的网络传输开销;b) The transmission of large size mirrors will result in higher network transmission overhead;
c)大多数虚拟机模板库依赖于集中式存储,其往往成为数据吞吐的瓶颈,而且其单点故障也会对平台的整体运行带来关键影响。c) Most virtual machine template libraries rely on centralized storage, which often becomes a bottleneck for data throughput, and its single point of failure can have a critical impact on the overall operation of the platform.
尤其在混合云模式中,在常规状态下应用部署在本地私有云,当周期性负载或突发负载来临时,通过将应用扩展到公有云,获取资源极大扩展。但是大量虚拟机数据需要通过相对低速的公私有云之间的网络进行传输,往往需要数小时甚至数天,严重影响了云计算的弹性与敏捷性。Especially in the hybrid cloud mode, the application is deployed in a local private cloud in a normal state. When a periodic load or a burst load comes, the acquisition resource is greatly expanded by extending the application to the public cloud. However, a large amount of virtual machine data needs to be transmitted through a network between relatively low-speed public and private clouds, which often takes hours or even days, which seriously affects the flexibility and agility of cloud computing.
综上,随着用户数量及业务增长的迅速增长,云计算对大规模、大容量 的虚拟机的快速部署提出了更高的要求,相关技术中的虚拟机部署方式已无法满足需求。In summary, with the rapid growth of the number of users and business growth, cloud computing for large-scale, large-capacity The rapid deployment of virtual machines puts forward higher requirements, and the virtual machine deployment methods in related technologies are no longer sufficient.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例提供了一种虚拟机启动方法、装置及管理节点,可以用以解决相关技术中,云计算对大规模、大容量的虚拟机的快速部署提出了更高的要求,虚拟机部署方式已无法满足需求的问题。The embodiment of the invention provides a virtual machine startup method, device and management node, which can be used to solve the related art, and the cloud computing puts forward higher requirements for the rapid deployment of large-scale and large-capacity virtual machines, and the virtual machine is deployed. The way is no longer enough to meet the demand.
本发明实施例采用如下技术方案。The embodiments of the present invention adopt the following technical solutions.
一种虚拟机启动方法,包括:A virtual machine startup method includes:
管理节点向镜像服务器发送镜像分析请求,以使得所述镜像服务器分析待创建虚拟机镜像亲和性特征值;The management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created;
所述管理节点根据虚拟机资源需求及所述虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所述所在宿主机作为目标宿主机;The management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the mirror affinity virtual machine of the source virtual machine is located, so that the host machine is the target host;
所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据。The management node copies the data of the source virtual machine image to the target host in combination with the existing data on the target host to restore the complete source virtual machine image data.
可选地,所述管理节点向镜像服务器发送镜像分析请求,以使得所述镜像服务器分析待创建虚拟机镜像亲和性特征值包括:Optionally, the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created, including:
所述管理节点接收来自客户端的创建虚拟机请求,并向所述镜像服务器注册镜像;The management node receives a create virtual machine request from a client, and registers an image with the mirror server;
所述管理节点向镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中。The management node sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirror feature value database.
可选地,所述管理节点根据虚拟机资源需求及所述虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所述所在宿主机作为目标宿主机包括: Optionally, the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, a host where the mirror affinity virtual machine of the source virtual machine is located, to use the host machine as a target sink. The host includes:
所述管理节点获取每个计算节点的实时资源使用信息,根据虚拟机的资源需求信息过滤出资源充足的节点;The management node acquires real-time resource usage information of each computing node, and filters out nodes with sufficient resources according to resource requirement information of the virtual machine;
所述管理节点向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度;And the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis;
所述管理节点根据节点资源充足率及所述镜像相似度,确定待部署节点及待部署节点上的亲和性虚拟机。The management node determines the adjacency virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
可选地,所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据包括:Optionally, the management node, in combination with the existing data on the target host, copies the source virtual machine image data portion to the target host to restore the complete source virtual machine image data, including:
所述管理节点向目标宿主机发出准备虚拟机镜像请求;The management node sends a preparation virtual machine image request to the target host;
所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到所述目标宿主机,以使所述目标宿主机结合待部署虚拟机镜像增量数据实现虚拟机镜像本地重构。The management node copies the source virtual machine image data portion to the target host in combination with the existing data on the target host, so that the target host combines the virtual machine image incremental data to be deployed to implement the virtual machine image. Local refactoring.
可选地,所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中,包括:Optionally, the mirroring server performs image affinity eigenvalue analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database, including:
构造一个m位的镜像亲和性特征值位数组,并将所有位置为0;Construct an m-bit image affinity feature value bit array and set all positions to 0;
定义一组从1至n的hash函数;Define a set of hash functions from 1 to n;
将虚拟机镜像数据分解为长度为L的多个定长数据块;Decomposing virtual machine image data into multiple fixed length data blocks of length L;
将第i个数据块逐次通过n个hash函数,以映射到镜像亲和性特征值位数组中;Passing the ith data block through n hash functions one by one to map to the image affinity feature value bit array;
将i设为i+1,重复通过n个hash函数,直到所有数据块都完成映射,以生成当前虚拟机的镜像亲和性特征值位数组,作为镜像亲和性特征值的分析结果,并将所述分析结果保存在镜像特征值数据库中;I is set to i+1, and the n hash functions are repeated until all the data blocks are mapped to generate an image array of the image affinity value of the current virtual machine as the analysis result of the image affinity feature value, and Saving the analysis result in a mirrored feature value database;
其中,i初始为1,m和n均为大于或等于1的正整数。Where i is initially 1, and m and n are positive integers greater than or equal to 1.
可选地,所述管理节点向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度,包括: Optionally, the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis. , including:
设置最大镜像亲和性数值为第一预设值,所述第一预设值为不可能存在的亲和性数值;Setting a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that is impossible to exist;
依次从资源充足的备选节点中选取节点v;Selecting a node v from the resource-rich candidate nodes in turn;
根据预存储的虚拟化集群节点信息表,依次选取节点v上的虚拟机,并从预存储的虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid;According to the pre-stored virtualized cluster node information table, the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table;
管理节点根据源虚拟机的uuid,从所述虚拟机信息表中查取到源虚拟机镜像uuid;The management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine;
管理节点向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,以通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid。The management node sends the source virtual machine and the virtual machine v image affinity analysis request to the mirror server to determine the affinity of the affinity source virtual machine and the virtual machine v by default, and the request parameter is the source virtual machine image uuid and The mirror uuid of the virtual machine v.
可选地,所述通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,包括:Optionally, the determining, by the preset manner, the affinity of the affinity source virtual machine and the virtual machine v, including:
所述镜像服务器根据与存储的虚拟机镜像描述信息提取镜像OS属性,以通过所述镜像OS属性确定亲和性;The mirroring server extracts a mirrored OS attribute according to the stored virtual machine image description information to determine an affinity by using the mirrored OS attribute;
在源虚拟机与虚拟机v镜像OS反亲和的情况下,直接返回所述第一预设值;Returning the first preset value directly when the source virtual machine and the virtual machine v mirroring the OS are in opposite affinity;
在源虚拟机与虚拟机v镜像OS不反亲和的情况下,从所述镜像特征值数据库中查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,并在查询到的情况下直接读取该数值,在没有查询到的情况下,根据镜像uuid,从所述镜像特征值数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组,以计算源虚拟机与虚拟机v的镜像亲和性;In the case that the source virtual machine and the virtual machine v mirroring OS are not anti-affinity, the source virtual machine image and the virtual machine v mirror affinity relationship value are searched from the mirrored feature value database, and directly in the case of the query. Read the value, and if not queried, read the mirror affinity bit array of the source virtual machine and the virtual machine v from the mirrored feature value database according to the mirror uuid to calculate the source virtual machine and the virtual machine. Mirror affinity of v;
判断镜像亲和性关系数值是否大于当前最大值;Determine whether the value of the mirror affinity relationship is greater than the current maximum value;
在大于当前最大值的情况下,更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点的宿主机地址。In the case of greater than the current maximum value, the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
可选地,所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机确将源虚拟机镜像数据部分拷贝到目标宿主机包括:Optionally, the management node, in combination with the existing data on the target host, copying the source virtual machine image data portion to the target host, and copying the source virtual machine image data portion to the target host device includes:
将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块,对每块 数据块用两种校验码算法分别生成两个校验码;Decompose the affinity virtual machine mirror data into multiple fixed length data blocks of length L, for each block The data block generates two check codes by using two check code algorithms respectively;
将亲和虚拟机镜像的校验码信息数组传给镜像服务器,以将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;The verification code information array of the affinity virtual machine image is transmitted to the mirror server, so that the source virtual machine image and the affinity virtual machine image are compared one by one according to the data block granularity;
将源虚拟机镜像构建元信息数组,以将亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标宿主机。The source virtual machine image is constructed with an array of meta information to transfer the affinity virtual machine block number and the source virtual machine image difference data set to the target host.
一种虚拟机快速启动装置,包括:A virtual machine quick start device includes:
发送模块,设置成向镜像服务器发送镜像分析请求,以使得所述镜像服务器分析待创建虚拟机镜像亲和性特征值;a sending module, configured to send a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created;
确定模块,设置成根据虚拟机资源需求及所述虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所述所在宿主机作为目标宿主机;a determining module, configured to determine, according to the virtual machine resource requirement and the virtual machine image affinity feature value, a host of the mirror affinity virtual machine of the source virtual machine, to use the host machine as the target host;
备份模块,设置成结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据。The backup module is configured to combine the data of the source virtual machine image with the existing data on the target host to copy the data of the source virtual machine to the target host to restore the complete source virtual machine image data.
可选地,所述发送模块包括:Optionally, the sending module includes:
接收单元,设置成接收来自客户端的创建虚拟机请求,并向所述镜像服务器注册镜像;a receiving unit, configured to receive a create virtual machine request from a client, and register an image with the mirror server;
第一发送单元,设置成向所述镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中。The first sending unit is configured to send a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
可选地,所述确定模块包括:Optionally, the determining module includes:
获取单元,设置成获取每个计算节点的实时资源使用信息,根据虚拟机的资源需求信息过滤出资源充足的节点;The acquiring unit is configured to obtain real-time resource usage information of each computing node, and filter out nodes with sufficient resources according to resource requirement information of the virtual machine;
第二发送单元,设置成向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度;a second sending unit, configured to send, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis;
确定单元,设置成根据节点资源充足率及所述镜像相似度,确定待部署 节点及待部署节点上的亲和性虚拟机。Determining a unit, configured to determine to be deployed according to a node resource adequacy ratio and the mirror similarity Affinity virtual machines on nodes and nodes to be deployed.
可选地,所述备份模块包括:Optionally, the backup module includes:
第三发送单元,设置成向目标宿主机发出准备虚拟机镜像请求;a third sending unit, configured to send a preparation virtual machine image request to the target host;
备份单元,设置成结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到所述目标宿主机,以使所述目标宿主机结合待部署虚拟机镜像增量数据实现虚拟机镜像本地重构。a backup unit, configured to combine the data of the source virtual machine image with the existing data on the target host, and copy the source virtual machine image data portion to the target host, so that the target host machine implements the virtual machine in combination with the virtual machine image incremental data to be deployed. Mirror local refactoring.
可选地,所述第一发送单元向镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中包括:Optionally, the first sending unit sends a mirroring analysis request to the mirroring server, so that the mirroring server performs mirroring affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database, including:
所述第一发送单元向镜像服务器发送镜像分析请求,以使得所述镜像服务器构造一个m位的镜像亲和性特征值位数组,并将所有位置为0;定义一组从1至n的hash函数;将虚拟机镜像数据分解为长度为L的多个定长数据块;将第i个数据块逐次通过n个hash函数,以映射到镜像亲和性特征值位数组中;将i设为i+1,重复通过n个hash函数,直到所有数据块都完成映射,以生成当前虚拟机的镜像亲和性特征值位数组,实现镜像亲和性特征值分析过程,并将分析结果保存在镜像特征值数据库中;其中,i初始为1,m和n均为大于或等于1的正整数。The first sending unit sends a mirror analysis request to the mirror server, so that the mirror server constructs an m-bit image affinity feature value bit array, and sets all positions to 0; defines a set of hashes from 1 to n Function; decompose the virtual machine image data into a plurality of fixed length data blocks of length L; pass the i th data block successively through n hash functions to map into the image affinity feature value bit array; set i to i+1, repeating through n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, realizing the mirror affinity eigenvalue analysis process, and saving the analysis result in Mirroring the feature value database; where i is initially 1, and m and n are positive integers greater than or equal to 1.
可选地,所述第二发送单元向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度,包括:Optionally, the second sending unit sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the image according to the image affinity feature value analysis. Similarity, including:
所述第二发送单元设置最大镜像亲和性数值为第一预设值,其中,所述第一预设值为不可能存在的亲和性数值;依次从资源充足的备选节点中选取节点v;根据预存储的虚拟化集群节点信息表,依次选取节点v上的虚拟机,并从预存储的虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid;根据源虚拟机的uuid,从所述虚拟机信息表中查取到源虚拟机镜像uuid;The second sending unit sets a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that is impossible to exist; and sequentially selects a node from a resource-rich candidate node. According to the pre-stored virtualized cluster node information table, the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table; according to the uuid of the source virtual machine, Obtaining the source virtual machine image uuid from the virtual machine information table;
向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,以通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid。 The source virtual machine and the virtual machine v image affinity analysis request are sent to the mirror server to determine the affinity of the affinity source virtual machine and the virtual machine v by default, and the request parameters are the source virtual machine image uuid and the virtual machine. The mirror uuid of v.
可选地,所述第二发送单元通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性包括:Optionally, the determining, by the second sending unit, the affinity of the affinity source virtual machine and the virtual machine v by a preset manner includes:
所述第二发送单元通过所述镜像服务器,根据与存储的虚拟机镜像描述信息提取镜像OS属性,以通过所述镜像OS属性确定亲和性;The second sending unit extracts, by using the mirror server, the mirroring OS attribute according to the stored virtual machine image description information, to determine the affinity by using the mirroring OS attribute;
在源虚拟机与虚拟机v镜像OS反亲和的情况下,直接返回所述第一预设值;Returning the first preset value directly when the source virtual machine and the virtual machine v mirroring the OS are in opposite affinity;
在源虚拟机与虚拟机v镜像OS不反亲和的情况下,从所述镜像特征值数据库中查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,并在查询到的情况下直接读取该数值,在没有查询到的情况下,根据镜像uuid,从所述镜像特征值数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组,以计算源虚拟机与虚拟机v的镜像亲和性;In the case that the source virtual machine and the virtual machine v mirroring OS are not anti-affinity, the source virtual machine image and the virtual machine v mirror affinity relationship value are searched from the mirrored feature value database, and directly in the case of the query. Read the value, and if not queried, read the mirror affinity bit array of the source virtual machine and the virtual machine v from the mirrored feature value database according to the mirror uuid to calculate the source virtual machine and the virtual machine. Mirror affinity of v;
判断镜像亲和性关系数值是否大于当前最大值;Determine whether the value of the mirror affinity relationship is greater than the current maximum value;
在大于当前最大值的情况下,更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点的宿主机地址。In the case of greater than the current maximum value, the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
可选地,所述备份模块结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据包括:Optionally, the backup module combines the existing data on the target host to copy the source virtual machine image data portion to the target host to restore the complete source virtual machine image data, including:
所述备份模块将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块,对每块数据块用两种校验码算法分别生成两个校验码;将亲和虚拟机镜像的校验码信息数组传给镜像服务器,以将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;将源虚拟机镜像构建元信息数组,以将亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标宿主机。The backup module sequentially decomposes the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, and generates two check codes for each block by using two check code algorithms; The mirrored checksum information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by the data block granularity; the source virtual machine image is constructed with the meta information array to be the affinity virtual machine data block. The number and source virtual machine image difference data set is transferred to the target host.
一种管理节点,包括:上述的虚拟机启动装置。A management node includes: the above virtual machine boot device.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述方法。A computer readable storage medium storing computer executable instructions for performing the above method.
本发明实施例提供的方案在待创建虚拟机上进行镜像亲和性分析,得到源虚拟机的镜像亲和性虚拟机的目标宿主机,根据目标宿主机上已有数据, 将源虚拟机镜像数据部分拷贝到目标宿主机,减少了远程数据拷贝数量,快速部署并启动虚拟机,提高了部署效率,解决了相关技术中,云计算对大规模、大容量的虚拟机的快速部署提出了更高的要求,虚拟机部署方式已无法满足需求的问题。The solution provided by the embodiment of the present invention performs image affinity analysis on the virtual machine to be created, and obtains the target host of the mirror affinity virtual machine of the source virtual machine, according to the existing data on the target host. Copy the source virtual machine image data to the target host, reduce the number of remote data copies, quickly deploy and start the virtual machine, improve the deployment efficiency, and solve the related technology, the cloud computing for large-scale, large-capacity virtual machines Rapid deployment puts forward higher requirements, and the virtual machine deployment method can no longer meet the demand problem.
在阅读并理解了附图和详细描述后,可以明白其它方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1是本发明实施例中虚拟机启动方法的流程图;1 is a flowchart of a method for starting a virtual machine in an embodiment of the present invention;
图2是本发明实施例中虚拟机启动装置的结构示意图;2 is a schematic structural diagram of a virtual machine starting device according to an embodiment of the present invention;
图3是本发明实施例中虚拟机启动装置中发送模块的结构示意图;3 is a schematic structural diagram of a sending module in a virtual machine starting device according to an embodiment of the present invention;
图4是本发明实施例中虚拟机启动装置中确定模块的结构示意图;4 is a schematic structural diagram of a determining module in a virtual machine starting device according to an embodiment of the present invention;
图5是本发明实施例中虚拟机启动装置中备份模块的结构示意图;5 is a schematic structural diagram of a backup module in a virtual machine starting device according to an embodiment of the present invention;
图6是本发明可选实施例中虚拟化集群拓扑示意图;6 is a schematic diagram of a topology of a virtualized cluster in an alternative embodiment of the present invention;
图7是本发明可选实施例中虚拟机启动方法实现的架构示意图。FIG. 7 is a schematic structural diagram of implementing a virtual machine startup method in an optional embodiment of the present invention.
本发明的实施方式Embodiments of the invention
本发明实施例提供了一种虚拟机启动方法、装置及管理节点。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiment of the invention provides a virtual machine startup method, device and management node. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
本发明实施例提供了一种虚拟机启动方法,该方法的流程如图1所示,包括步骤S102至S106:The embodiment of the invention provides a virtual machine startup method. The process of the method is as shown in FIG. 1 and includes steps S102 to S106:
S102,管理节点向镜像服务器发送镜像分析请求,以使得镜像服务器分析待创建虚拟机镜像亲和性特征值;S102. The management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created.
S104,管理节点根据虚拟机资源需求及虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所在宿主机作为目标宿主机;S104. The management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the mirror affinity virtual machine of the source virtual machine is located, so that the host machine is the target host;
S106,管理节点结合目标宿主机上已有数据,将源虚拟机镜像数据部分 拷贝到目标宿主机,以复原完整源虚拟机镜像数据,从而实现快速启动虚拟机。S106. The management node combines the existing data on the target host to mirror the data part of the source virtual machine. Copy to the target host to restore the full source virtual machine image data, thus enabling a quick start of the virtual machine.
本发明实施例提供的方法在待创建虚拟机上进行镜像亲和性分析,得到源虚拟机的镜像亲和性虚拟机的目标宿主机,根据目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,减少了远程数据拷贝数量,可以快速部署并启动虚拟机,提高了部署效率,解决了相关技术中,云计算对大规模、大容量的虚拟机的快速部署提出了更高的要求,现有的虚拟机部署方式已无法满足需求的问题。The method provided by the embodiment of the present invention performs image affinity analysis on the virtual machine to be created, obtains the target host of the mirror affinity virtual machine of the source virtual machine, and mirrors the source virtual machine according to the existing data on the target host. The data is partially copied to the target host, which reduces the number of remote data copies, can quickly deploy and start the virtual machine, improves the deployment efficiency, and solves the related technology, the cloud computing provides a rapid deployment of large-scale, large-capacity virtual machines. With higher requirements, the existing virtual machine deployment method can no longer meet the demand problem.
可选地,所述管理节点向镜像服务器发送镜像分析请求,以使得镜像服务器分析待创建虚拟机镜像亲和性特征值包括:管理节点接收来自客户端的创建虚拟机请求,并向镜像服务器注册镜像;管理节点向镜像服务器发送镜像分析请求,以使得镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中。Optionally, the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created, including: the management node receives the create virtual machine request from the client, and registers the image with the mirror server. The management node sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
可选地,所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中包括:构造一个m位的镜像亲和性特征值位数组,并将所有位置为0;定义一组从1至n的hash函数;将虚拟机镜像数据分解为长度为L的多个定长数据块;将第i个数据块逐次通过n个hash函数,以映射到镜像亲和性特征值位数组中;将i设为i+1,重复通过n个hash函数,直到所有数据块都完成映射,以生成当前虚拟机的镜像亲和性特征值位数组,作为镜像亲和性特征值的分析结果,并将所述分析结果保存在镜像特征值数据库中;其中,i初始为1,m和n均为大于或等于1的正整数。Optionally, the mirroring server performs image affinity eigenvalue analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database, including: constructing an m-bit image affinity feature value bit array, and All positions are 0; define a set of hash functions from 1 to n; decompose the virtual machine image data into multiple fixed length data blocks of length L; pass the i th data block successively through n hash functions to map to Mirror affinity feature value bit array; set i to i+1, repeat n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, as a mirror The analysis result of the affinity feature value is saved in the mirrored feature value database; wherein i is initially 1, and m and n are positive integers greater than or equal to 1.
可选地,所述管理节点根据虚拟机资源需求及虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所在宿主机作为目标宿主机包括:所述管理节点获取每个计算节点的实时资源使用信息,根据虚拟机的资源需求信息过滤出资源充足的节点;管理节点向镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得镜像服务器根据镜像亲和性特征值分析确定镜像相似度;管理节点根据节点资源充足率及镜像相似度,确定待部署节点及待部署节点上的亲和性虚拟机。 Optionally, the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the virtual machine of the source virtual machine is located, and the host machine as the target host includes: The management node obtains the real-time resource usage information of each computing node, and filters out the nodes with sufficient resources according to the resource requirement information of the virtual machine; the management node sends the virtual machine mirroring affinity analysis of the virtual machine to be deployed and the candidate node to the mirror server. The instructions are such that the mirror server determines the mirror similarity according to the image affinity feature value analysis; the management node determines the affinity virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
可选地,所述管理节点向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度,包括:Optionally, the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis. ,include:
设置最大镜像亲和性数值为第一预设值,所述第一预设值为不可能存在的亲和性数值(比如远大于或远小于经验数值、或者远远偏离可能的数值范围);依次从资源充足的备选节点中选取节点v;根据预存储的虚拟化集群节点信息表,依次选取节点v上的虚拟机,并从预存储的虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid;管理节点根据源虚拟机的uuid,从虚拟机信息表中查取到源虚拟机镜像uuid;管理节点向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,以通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid。Setting a maximum mirror affinity value to a first preset value, the first preset value being an affinity value that is impossible to exist (eg, being far greater than or far less than an empirical value, or far from a possible range of values); The node v is selected from the resource-rich candidate nodes in sequence; the virtual machine on the node v is sequentially selected according to the pre-stored virtualized cluster node information table, and the virtual machine corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table. The machine mirrors the uuid; the management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine; the management node sends the source virtual machine and the virtual machine v image affinity analysis request to the mirror server to pass the The preset mode determines the affinity of the affinity source virtual machine and the virtual machine v. The request parameters are the source virtual machine image uuid and the mirror uuid of the virtual machine v.
可选地,所述通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,包括::镜像服务器根据与存储的虚拟机镜像描述信息提取镜像OS属性,以通过镜像OS属性确定亲和性;在源虚拟机与虚拟机v镜像OS反亲和的情况下,直接返回第一预设值;在源虚拟机与虚拟机v镜像OS不反亲和的情况下,从镜像特征值数据库中查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,并在查询到的情况下直接读取该数值,在没有查询到的情况下,根据镜像uuid,从镜像特征值数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组,以计算源虚拟机与虚拟机v的镜像亲和性;判断镜像亲和性关系数值是否大于当前最大值;在大于当前最大值的情况下,更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点的宿主机地址。Optionally, determining, by using a preset manner, the affinity source virtual machine and the virtual machine v image affinity, including: the mirror server extracting the mirrored OS attribute according to the stored virtual machine image description information, to mirror the OS attribute. Determine the affinity; in the case that the source virtual machine and the virtual machine v mirror OS are in reverse affinity, directly return the first preset value; in the case that the source virtual machine and the virtual machine v mirror OS are not anti-affinity, the mirror image Find the value of the affinity relationship between the source virtual machine image and the virtual machine v image in the eigenvalue database, and directly read the value in the case of the query. If there is no query, according to the mirror uuid, the mirrored feature value database The image affinity bit arrays of the source virtual machine and the virtual machine v are respectively read to calculate the mirror affinity of the source virtual machine and the virtual machine v; whether the value of the mirror affinity relationship is greater than the current maximum value; In the case of a value, the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
可选地,所述管理节点结合目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据,实现快速启动虚拟机包括:Optionally, the management node combines the data of the source virtual machine image with the data of the target host to copy the data of the source virtual machine to the target host to restore the complete source virtual machine image data, so as to implement the fast startup virtual machine, including:
所述管理节点向目标宿主机发出准备虚拟机镜像请求;管理节点结合目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以使目标宿主机结合待部署虚拟机镜像增量数据实现虚拟机镜像本地重构。The management node sends a request for preparing a virtual machine image to the target host; the management node copies the data of the source virtual machine image to the target host in combination with the existing data on the target host, so that the target host combines the virtual machine image to be deployed. Incremental data enables local reconstruction of virtual machine images.
可选地,所述管理节点结合目标宿主机上已有数据,将源虚拟机镜像数 据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据,实现快速启动虚拟机包括:Optionally, the management node combines the data of the source virtual machine with the existing data on the target host. According to the partial copy to the target host, to restore the complete source virtual machine image data, to achieve a quick start virtual machine includes:
将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块,对每块数据块用两种校验码算法分别生成两个校验码;将亲和虚拟机镜像的校验码信息数组传给镜像服务器,以将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;将源虚拟机镜像构建元信息数组,以将亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标宿主机。Decomposing the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, respectively generating two check codes by using two check code algorithms for each block of data; verifying the mirror of the affinity virtual machine The code information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by data block granularity; the source virtual machine image is constructed to construct a meta information array to associate the affinity virtual machine data block number with the source virtual The machine mirror differential data set is transferred to the target host.
本发明实施例还提供了一种虚拟机启动装置,该装置的结构示意如图2所示,包括:发送模块10,设置成向镜像服务器发送镜像分析请求,以使得镜像服务器分析待创建虚拟机镜像亲和性特征值;确定模块20,与发送模块10耦合,设置成根据虚拟机资源需求及虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所在宿主机作为目标宿主机;备份模块30,与确定模块20耦合,设置成结合目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据,从而实现快速启动虚拟机。The embodiment of the present invention further provides a virtual machine starting device. The structure of the device is as shown in FIG. 2, and includes: a sending module 10, configured to send a mirroring analysis request to the mirror server, so that the mirror server analyzes the virtual machine to be created. a mirroring affinity feature value; the determining module 20 is coupled to the sending module 10, and configured to determine, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host machine of the mirror virtual affinity virtual machine of the source virtual machine, The host computer is used as the target host; the backup module 30 is coupled with the determining module 20, and is configured to combine the existing data on the target host to copy the source virtual machine image data portion to the target host to restore the complete source virtual machine image. Data to enable a quick start of the virtual machine.
可选地,发送模块10的结构如图3所示,其可以包括:接收单元101,设置成接收来自客户端的创建虚拟机请求,并向镜像服务器注册镜像;第一发送单元102,与接收单元101耦合,设置成向镜像服务器发送镜像分析请求,以使得镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中。Optionally, the structure of the sending module 10 is as shown in FIG. 3, which may include: a receiving unit 101 configured to receive a request for creating a virtual machine from a client, and register an image with the mirror server; the first sending unit 102, and the receiving unit The 101 is coupled to send a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
可选地,所述第一发送单元102向镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中包括:Optionally, the first sending unit 102 sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database. :
所述第一发送单元向镜像服务器发送镜像分析请求,以使得所述镜像服务器构造一个m位的镜像亲和性特征值位数组,并将所有位置为0;定义一组从1至n的hash函数;将虚拟机镜像数据分解为长度为L的多个定长数据块;将第i个数据块逐次通过n个hash函数,以映射到镜像亲和性特征值位数组中;将i设为i+1,重复通过n个hash函数,直到所有数据块都完成映射,以生成当前虚拟机的镜像亲和性特征值位数组,实现镜像亲和性特征 值分析过程,并将分析结果保存在镜像特征值数据库中;其中,i初始为1,m和n均为大于或等于1的正整数。The first sending unit sends a mirror analysis request to the mirror server, so that the mirror server constructs an m-bit image affinity feature value bit array, and sets all positions to 0; defines a set of hashes from 1 to n Function; decompose the virtual machine image data into a plurality of fixed length data blocks of length L; pass the i th data block successively through n hash functions to map into the image affinity feature value bit array; set i to i+1, repeating through n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, to achieve mirror affinity characteristics The value analysis process saves the analysis result in the mirrored feature value database; where i is initially 1, and m and n are positive integers greater than or equal to 1.
可选地,如图4所示,确定模块20可以包括:获取单元201,设置成获取每个计算节点的实时资源使用信息,根据虚拟机的资源需求信息过滤出资源充足的节点;第二发送单元202,与获取单元201耦合,设置成向镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得镜像服务器根据镜像亲和性特征值分析确定镜像相似度;确定单元203,与第二发送单元202耦合,设置成根据节点资源充足率及镜像相似度,确定待部署节点及待部署节点上的亲和性虚拟机。Optionally, as shown in FIG. 4, the determining module 20 may include: an obtaining unit 201, configured to acquire real-time resource usage information of each computing node, and filter out a node with sufficient resources according to resource requirement information of the virtual machine; The unit 202 is coupled to the obtaining unit 201, and configured to send, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis; The determining unit 203 is coupled to the second sending unit 202 and configured to determine the affinity virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
可选地,上述第二发送单元202向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使的所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度,包括:Optionally, the foregoing second sending unit 202 sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines according to the image affinity feature value analysis. Mirror similarity, including:
所述第二发送单元202设置最大镜像亲和性数值为第一预设值,其中,第一预设值为不可能存在的亲和性数值;依次从资源充足的备选节点中选取节点v;根据预存储的虚拟化集群节点信息表,依次选取节点v上的虚拟机,并从预存储的虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid;根据源虚拟机的uuid,从虚拟机信息表中查取到源虚拟机镜像uuid;向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,以通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,其中,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid。The second sending unit 202 sets a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that cannot exist; and sequentially selects a node v from the resource-qualified candidate nodes. According to the pre-stored virtualized cluster node information table, the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table; according to the uuid of the source virtual machine, The source virtual machine image uuid is obtained in the virtual machine information table; the source virtual machine and the virtual machine v image affinity analysis request are sent to the mirror server to determine the affinity source virtual machine and the virtual machine v mirror pro by a preset manner. Sexuality, where the request parameter is the source virtual machine image uuid and the mirror uuid of the virtual machine v.
可选地,所述第二发送单元通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性的包括:Optionally, the determining, by the second sending unit, the affinity of the affinity source virtual machine and the virtual machine v by using a preset manner includes:
所述第二发送单元通过所述镜像服务器,根据与存储的虚拟机镜像描述信息提取镜像OS属性,以通过镜像OS属性确定亲和性;在源虚拟机与虚拟机v镜像OS反亲和的情况下,直接返回第一预设值;在源虚拟机与虚拟机v镜像OS不反亲和的情况下,从镜像特征值数据库中查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,并在查询到的情况下直接读取该数值,在没有查询到的情况下,根据镜像uuid,从镜像特征值数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组,以计算源虚拟机与虚拟机v的镜像亲和 性;判断镜像亲和性关系数值是否大于当前最大值;在大于当前最大值的情况下,更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点的宿主机地址。The second sending unit extracts the mirroring OS attribute according to the stored virtual machine image description information by the mirroring server to determine the affinity by mirroring the OS attribute; and the source virtual machine and the virtual machine v mirroring the OS anti-affinity In this case, directly returning to the first preset value; if the source virtual machine and the virtual machine v mirroring OS are not anti-affinity, the value of the affinity relationship between the source virtual machine image and the virtual machine v is obtained from the mirrored feature value database. And directly read the value in the case of the query, in the case of no query, according to the mirror uuid, read the mirror affinity bit array of the source virtual machine and the virtual machine v respectively from the mirrored feature value database, Calculate the mirror affinity of the source virtual machine and virtual machine v Whether to determine whether the value of the mirror affinity relationship is greater than the current maximum value; if greater than the current maximum value, update the maximum mirror affinity value, and record the uuid of the virtual machine v corresponding to the maximum mirror affinity value and The host address of the node where it is located.
可选地,如图5所示,所述备份模块30可以包括:第三发送单元301,设置成向目标宿主机发出准备虚拟机镜像请求;备份单元302,与第三发送单元301耦合,设置成结合目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以使目标宿主机结合待部署虚拟机镜像增量数据实现虚拟机镜像本地重构。Optionally, as shown in FIG. 5, the backup module 30 may include: a third sending unit 301, configured to send a preparation virtual machine image request to the target host; and a backup unit 302 coupled with the third sending unit 301, and configured The data of the source virtual machine is copied to the target host, so that the target host combines the incremental data of the virtual machine image to be deployed to implement local reconstruction of the virtual machine image.
可选地,所述备份模块30结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据包括:Optionally, the backup module 30 combines the data of the source virtual machine image with the data on the target host to copy the source virtual machine image data to the target host to restore the complete source virtual machine image data, including:
所述备份模块将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块,对每块数据块用两种校验码算法分别生成两个校验码;将亲和虚拟机镜像的校验码信息数组传给镜像服务器,以将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;将源虚拟机镜像构建元信息数组,以将亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标宿主机。The backup module sequentially decomposes the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, and generates two check codes for each block by using two check code algorithms; The mirrored checksum information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by the data block granularity; the source virtual machine image is constructed with the meta information array to be the affinity virtual machine data block. The number and source virtual machine image difference data set is transferred to the target host.
本发明实施例还提供了一种管理节点,其包括上述的虚拟机启动装置。本领域技术人员根据上述记载,知晓如何将上述虚拟机启动装置集成设置在管理节点中,此处不再赘述。The embodiment of the invention further provides a management node, which comprises the above-mentioned virtual machine starting device. According to the above description, those skilled in the art know how to integrate the above-mentioned virtual machine starting device in the management node, and details are not described herein again.
本发明实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述方法。The embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing the above method.
实施示例1Implementation example 1
本实施示例提供一种虚拟机启动的方法,该方法通过分析虚拟机镜像亲和性特征值,并综合虚拟机资源需求及约束条件,确定源虚拟机的镜像亲和性虚拟机所在宿主机为目标宿主机,而后将源虚拟机镜像数据部分拷贝到目标宿主机,结合目标宿主机上已有数据,本地复原完整源虚拟机镜像数据。本实施示例加速虚拟机部署和启动时间的同时,降低虚拟机部署时带宽消耗,增强虚拟化集群的弹性扩展能力。The embodiment provides a method for starting a virtual machine. The method determines the virtual machine image affinity feature value, and integrates the virtual machine resource requirements and constraints to determine the host of the mirror virtual affinity virtual machine of the source virtual machine. The target host, and then copy the source virtual machine image data part to the target host, and combine the existing data on the target host to locally restore the complete source virtual machine image data. This embodiment speeds up virtual machine deployment and startup time, reduces bandwidth consumption during virtual machine deployment, and enhances the flexible expansion capability of the virtualized cluster.
图6为虚拟化集群拓扑示意图,从图中可以看出虚拟化集群的架构;图 7为虚拟机启动方法实现的架构示意图,如图6所示,本实施示例所述虚拟化集群包括管理服务器(管理节点),通过网络连接镜像服务器和至少一个计算节点(物理主机),所述计算节点包括硬件层、运行在所述硬件层之上的VMM(虚拟机监督***)、以及运行在所述宿主机之上的至少一个VM(虚拟机),比如图6中的VM1和VM2;镜像服务器中包含一个或多个镜像,比如图6中的镜像1~镜像4。如图7所示,客户端、宿主机以及镜像服务器分别和管理中心(管理节点)相连。Figure 6 is a schematic diagram of a virtualized cluster topology. The architecture of the virtualized cluster can be seen from the figure. 7 is a schematic diagram of the architecture of the virtual machine startup method implementation. As shown in FIG. 6, the virtualization cluster of the embodiment includes a management server (management node), and the mirror server and at least one compute node (physical host) are connected through a network. The computing node includes a hardware layer, a VMM (Virtual Machine Supervisory System) running on the hardware layer, and at least one VM (virtual machine) running on the host, such as VM1 and VM2 in FIG. 6; The mirror server contains one or more mirrors, such as mirror 1 to mirror 4 in Figure 6. As shown in FIG. 7, the client, the host, and the mirror server are respectively connected to the management center (management node).
所述方法概述过程如下:The method overview process is as follows:
(1)用户从管理节点的客户端发起创建虚拟机请求。(1) The user initiates a virtual machine request from the client of the management node.
(2)管理节点接收到指令,将虚拟机状态置为pending。(2) The management node receives the instruction and sets the virtual machine state to pending.
(3)管理节点向镜像服务器注册该镜像,镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果记录在镜像特征值数据库中。(3) The management node registers the image with the mirror server, and the mirror server performs image affinity eigenvalue analysis on the virtual machine image, and records the analysis result in the mirrored feature value database.
(4)管理节点通过每个计算节点获取实时资源使用信息,根据虚拟机的CPU(中央处理器)、MEM(存储器)、及磁盘空间等资源需求信息,过滤出资源充足的节点。(4) The management node obtains real-time resource usage information through each computing node, and filters out nodes with sufficient resources according to resource demand information such as CPU (central processing unit), MEM (memory), and disk space of the virtual machine.
(5)管理节点向镜像服务器逐一发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,镜像服务器根据镜像亲和性特征值分析计算镜像相似度。(5) The management node sends a virtual machine image affinity analysis instruction to the virtual machine to be deployed to the mirror server one by one, and the mirror server calculates the mirror similarity according to the image affinity feature value analysis.
(6)管理节点综合节点资源充足率及镜像相似度,确定待部署节点及待部署节点上的亲和性虚拟机。(6) Manage the node's comprehensive node resource adequacy ratio and mirror similarity, and determine the affinity virtual machine on the node to be deployed and the node to be deployed.
(7)管理节点向目标宿主机发出准备虚拟机镜像请求,并将虚拟机状态置为prolog。(7) The management node issues a preparation virtual machine image request to the target host, and sets the virtual machine state to prolog.
(8)目标宿主机结合待部署虚拟机镜像增量数据,虚拟机镜像本地重构,从而完成虚拟机部署;如果不存在亲和性虚拟机,则将虚拟机镜像全量传输至目标节点。目标宿主机向管理节点返回虚拟机镜像准备完毕信息。(8) The target host combines the virtual machine image incremental data to be deployed, and the virtual machine image is locally reconstructed to complete the virtual machine deployment; if there is no affinity virtual machine, the virtual machine image is completely transmitted to the target node. The target host returns the virtual machine image preparation completion information to the management node.
(9)管理节点向目标宿主机下达启动虚拟机指令,目标宿主机在本地启动虚拟机,虚拟机进入booting状态,当虚拟机启动完成则进入running状态,至此虚拟机完成部署并启动,开始执行业务处理。 (9) The management node issues a virtual machine command to the target host, and the target host starts the virtual machine locally, and the virtual machine enters the booting state. When the virtual machine starts, the virtual machine enters the running state, and the virtual machine completes the deployment and starts, and starts executing. Business processing.
实施示例2Implementation example 2
在虚拟机镜像进行注册时,镜像服务器基于镜像数据特征降维进行亲和性特征值分析,包括如下过程:When the virtual machine image is registered, the mirror server analyzes the affinity feature value based on the feature reduction of the mirror data, including the following process:
(1)构造一个m位的镜像亲和性特征值位数组;(1) construct an m-bit image affinity feature value bit array;
(2)将所有位置为0;(2) Set all positions to 0;
(3)定义一组hash函数:hash1,hash2,…,hashn;(3) define a set of hash functions: hash1, hash2, ..., hashn;
(4)将虚拟机镜像数据分解为长度为L(譬如4K)的多个定长数据块;(4) Decomposing the virtual machine image data into a plurality of fixed length data blocks of length L (for example, 4K);
(5)对于第i个数据块(i初始为1),逐次通过步骤(3)定义的n个hash函数,映射到镜像亲和性特征值位数组;(5) For the i-th data block (i is initially 1), the n hash functions defined by step (3) are successively mapped to the image affinity feature value bit array;
(6)将i设为i+1,重复步骤(5),直到所有数据块都完成向位数组的映射,生成当前虚拟机的镜像亲和性特征值位数组;(6) Set i to i+1, repeat step (5) until all the data blocks complete the mapping to the bit array, and generate an image array of the image affinity value of the current virtual machine;
(7)将此位数组记录在数据库的镜像亲和性表中。其中,镜像亲和性数据结构如表1所示。(7) Record this bit array in the mirror affinity table of the database. The image affinity data structure is shown in Table 1.
表1、镜像亲和性数据结构Table 1, mirror affinity data structure
Figure PCTCN2016083688-appb-000001
Figure PCTCN2016083688-appb-000001
通过以上过程完成镜像降维,镜像由m位亲和性特征值位数组表征。越相似的镜像在它们的亲和性特征值位数组中有更多共同的1。由于hash函数会发生碰撞,相似性判断会有一定概率发生错误,而特征值位数组位数m越大,则相似性判断精确度越高,当然存储空间消耗也越大。Through the above process, the image dimensionality reduction is completed, and the image is represented by an array of m-bit affinity feature value bits. The more similar images have more common ones in their affinity feature value bit arrays. Since the hash function will collide, the similarity judgment will have a certain probability of error, and the larger the number m of the feature value bit array, the higher the accuracy of the similarity judgment, and of course the storage space consumption is larger.
在启动虚拟机前,管理节点首先从每个计算节点获取实时资源使用信息,根据虚拟机的CPU、MEM、网络带宽、及磁盘空间等资源需求信息,过滤出初步可行性节点。管理节点对初步可行性节点按照资源充足度进行降序排序,对于虚拟机j,节点i的resource adequacy ratio(资源充足率)定义为: Before starting the virtual machine, the management node first obtains the real-time resource usage information from each computing node, and filters out the preliminary feasibility node according to the virtual machine's CPU, MEM, network bandwidth, and disk space resource requirement information. The management node sorts the preliminary feasibility nodes in descending order according to resource adequacy. For virtual machine j, the resource adequacy ratio of node i is defined as:
Rari,j=Wcpu,j*CPUi+Wmem,j*MEMi+Wstorage,j*Storagej Rar i,j =W cpu,j *CPU i +W mem,j *MEM i +W storage,j *Storage j
其中,Wcpu,j为虚拟机j的CPU权重,Wmem,j为虚拟机j的MEM的权重,Wstorage,j为虚拟机j的存储权重,权重值可根据虚拟机的业务类型及资源需求情况调整,默认为1:1:1。CPUi,MEMi,Storagei为节点i的CPU、MEM、存储容量剩余资源比。Where, W cpu, j is the CPU weight of the virtual machine j, W mem, j is the weight of the MEM of the virtual machine j, W storage, j is the storage weight of the virtual machine j, and the weight value can be based on the service type and resources of the virtual machine Demand adjustment, default is 1:1:1. CPU i , MEM i , and Storage i are the CPU, MEM, and storage capacity remaining resource ratio of node i.
管理节点从初步可行性队列中找出源虚拟机的亲和虚拟机,方法如下:The management node finds the affinity virtual machine of the source virtual machine from the preliminary feasibility queue, as follows:
(1)设置最大镜像亲和性数值为-1,目标放置节点为初步可行性队列首节点;(1) Set the maximum mirror affinity value to -1, and the target placement node is the first node of the preliminary feasibility queue;
(2)依次从资源充足备选节点集合中选取节点n;(2) sequentially selecting node n from a set of resource-sufficient alternative nodes;
(3)根据虚拟化集群节点信息表,依次选取节点n上的虚拟机,如虚拟机v;(3) according to the virtualized cluster node information table, sequentially select the virtual machine on the node n, such as the virtual machine v;
(4)从虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid;其中,虚拟化集群节点信息数据结构如表2所示,虚拟机信息数据结构如表3所示。(4) Obtain the virtual machine image uuid corresponding to the virtual machine v from the virtual machine information table; wherein the virtualized cluster node information data structure is as shown in Table 2, and the virtual machine information data structure is as shown in Table 3.
表2、虚拟化集群节点信息数据结构Table 2. Virtualized cluster node information data structure
Figure PCTCN2016083688-appb-000002
Figure PCTCN2016083688-appb-000002
Figure PCTCN2016083688-appb-000003
Figure PCTCN2016083688-appb-000003
表3、虚拟机信息数据结构Table 3, virtual machine information data structure
Figure PCTCN2016083688-appb-000004
Figure PCTCN2016083688-appb-000004
(5)管理节点根据源虚拟机的uuid,从虚拟机信息表中查取到源虚拟机镜像uuid;(5) The management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine;
(6)管理节点向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid;(6) The management node sends a source virtual machine and virtual machine v image affinity analysis request to the mirror server, and the request parameters are the source virtual machine image uuid and the mirror uuid of the virtual machine v;
(7)镜像服务器根据虚拟机镜像描述信息提取镜像OS属性;(7) The mirror server extracts the mirror OS attribute according to the virtual machine image description information;
(8)若源虚拟机与虚拟机v镜像OS反亲和(如待部署为Ubuntu镜像,备选节点上虚拟机为Redhat镜像),直接返回-1,跳至步骤(12);其中,镜像亲和性关系数据结构如表4所示。(8) If the source virtual machine is in anti-affinity with the virtual machine v mirroring OS (for example, the Ubuntu image to be deployed, the virtual machine on the candidate node is a Redhat image), directly return -1, and skip to step (12); The affinity relationship data structure is shown in Table 4.
表4、镜像亲和性关系数据结构 Table 4, image affinity relationship data structure
名称name 数据类型type of data 描述description
imageA_uuidimageA_uuid StringString 虚拟机镜像标识符Virtual machine image identifier
imageB_uuidimageB_uuid StringString 虚拟机镜像标识符Virtual machine image identifier
Affinity_valueAffinity_value doubleDouble 亲和性数值Affinity value
(9)如果亲和,则从镜像亲和性关系数据库,查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,若查询到,则直接读取,并返回请求跳至步骤(12);(9) If the affinity is obtained, the source virtual machine image and the virtual machine v image affinity relationship value are searched from the mirror affinity database, and if the query is obtained, the direct read is performed, and the request is returned to the step (12). ;
(10)如果没有查询到,则根据镜像uuid,从镜像亲和性数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组;(10) If not queried, the mirror affinity bit arrays of the source virtual machine and the virtual machine v are respectively read from the mirror affinity database according to the mirror uuid;
(11)计算源虚拟机与虚拟机v的镜像亲和性。(11) Calculate the mirror affinity of the source virtual machine and the virtual machine v.
亲和性可以采用多种方式进行定义,此处仅以一种方式举例说明。Affinity can be defined in a variety of ways, and is illustrated here by way of example only.
亲和性定义为:Cosine_Sim(x,y)=dot(x,y)/(sqrt(|x|.|y|)),dot(x,y)=Σx[i].y[i],其中dot(x,y)相当于两个亲和性特征位数组中同时为1的位数;|x|表示亲和性特征为数组为1的位数。Affinity is defined as: Cosine_Sim(x,y)=dot(x,y)/(sqrt(|x|.|y|)), dot(x,y)=Σx[i].y[i], Where dot(x, y) is equivalent to the number of bits in the array of two affinity feature bits at the same time; |x| indicates that the affinity feature is the number of bits in the array.
将<源虚拟机镜像uuid,虚拟机v镜像uuid,镜像亲和性关系数值>,记录到镜像亲和性关系数据库中,并返回请求;<Source virtual machine image uuid, virtual machine v image uuid, image affinity relationship value>, recorded in the image affinity relation database, and return the request;
(12)若镜像亲和性关系数值大于最大值,则管理节点更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点n的hostid;(12) If the value of the mirror affinity relationship is greater than the maximum value, the management node updates the maximum mirror affinity value, and records the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the hostid of the node n where it is located;
(13)转到步骤(3),重复步骤(3)~(12),直到节点n上所有虚拟机比对完成;(13) Go to step (3) and repeat steps (3) to (12) until all virtual machines on node n are compared.
(14)转到步骤(2),直到遍历完所有资源充足节点n;(14) Go to step (2) until all resource-sufficient nodes n have been traversed;
(15)镜像服务器向管理节点返回<最大镜像亲和性数值,对应的虚拟机v,虚拟机所在节点n>;(15) The mirror server returns <the maximum mirror affinity value to the management node, the corresponding virtual machine v, and the node where the virtual machine is located n>;
若管理节点获取到的最大镜像亲和性数值不为-1,即通过亲和性关系分析,找到了镜像亲和性虚拟机,则确定请求返回值中的节点为目标放置节点,请求返回值中的虚拟机为源虚拟机在目标节点上的镜像亲和性虚拟机。 否则,源虚拟机与所有备选节点上虚拟机均反亲和,选取资源充足度最高的节点为目标放置节点。If the maximum mirror affinity value obtained by the management node is not -1, that is, through the affinity relationship analysis, the mirror affinity virtual machine is found, and then the node in the request return value is determined as the target placement node, and the request return value is obtained. The virtual machine in is the mirror affinity virtual machine of the source virtual machine on the target node. Otherwise, the source virtual machine and the virtual machines on all the candidate nodes are opposite each other, and the node with the highest resource adequacy is selected as the target placement node.
对于镜像亲和虚拟机存在的情况,在目标放置节点上重构虚拟机镜像前,需生成源虚拟机镜像构建元信息,做法为:For the case where the mirrored affinity VM exists, you need to generate the source VM image build meta information before rebuilding the VM image on the target placement node.
(1)在目标放置节点上,将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块。对每块数据块用两种checksum算法分别生成两个校验码(弱checksum,强checksum);(1) On the target placement node, the affinity virtual machine mirror data is successively decomposed into a plurality of fixed length data blocks of length L. Two checksum algorithms are generated for each block of data to generate two check codes (weak checksum, strong checksum);
(2)将亲和虚拟机镜像的checksum信息数组传给镜像服务器;其中,Checksum信息数据结构如表5所示。(2) The checksum information array of the affinity virtual machine image is transmitted to the mirror server; wherein the Checksum information data structure is as shown in Table 5.
表5、Checksum信息数据结构Table 5, Checksum information data structure
名称name 数据类型type of data 描述description
Block_idBlock_id longLong 数据块编号Block number
Weak_checksumWeak_checksum StringString 弱checksumWeak checksum
Strong_checksumStrong_checksum StringString 强checksumStrong checksum
(3)将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;(3) The source virtual machine image and the affinity virtual machine image are compared one by one according to the data block granularity;
a)将源虚拟机镜像的第i至i+L-1字节数据(i初始为1)生成弱checksum和强checksum,与亲和虚拟机镜像每个数据块的弱checksum逐一比对;a) Generate weak checksum and strong checksum from the i-th to i+L-1 byte data of the source virtual machine image (i is initially 1), and compare with the weak checksum of each data block of the affinity virtual machine image;
b)若源虚拟机镜像的第i至i+L-1字节数据块与亲和虚拟机镜像的数据块b存在一致的弱checksum,则说明这两个数据块大致相同,进入c),否则进入e);b) If the i-th to i+L-1 byte data block of the source virtual machine image and the data block b of the affinity virtual machine image have a weak checksum, the two data blocks are substantially the same, and enter c). Otherwise enter e);
c)进一步与亲和虚拟机镜像数据块b进行强checksum比对;如果也一致,则说明两个数据块完全相同,记录亲和虚拟机的数据块编号b;否则进入e);c) further performing strong checksum comparison with the affinity virtual machine mirror data block b; if it is also consistent, it indicates that the two data blocks are identical, and the data block number b of the affinity virtual machine is recorded; otherwise, it enters e);
d)源虚拟机镜像移动L个字节(i更新为i+L),重复步骤a),直至源虚拟机镜像所有数据块完成比对;d) The source virtual machine image moves L bytes (i is updated to i+L), and step a) is repeated until the source virtual machine mirrors all the data blocks to complete the comparison;
e)若存在一致的弱checksum,但对应强checksum不一致,或者不存在一致的弱checksum,则记录差异数据,即源虚拟机的第i个字节; e) If there is a consistent weak checksum, but the corresponding strong checksum is inconsistent, or there is no consistent weak checksum, the difference data is recorded, that is, the ith byte of the source virtual machine;
f)源虚拟机镜像移动1个字节(i更新为i+1),重复步骤a),直至源虚拟机镜像所有数据块完成比对。f) The source virtual machine image moves 1 byte (i is updated to i+1), and step a) is repeated until the source virtual machine mirrors all data blocks to complete the comparison.
(4)将源虚拟机镜像构建元信息数组,即亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标放置节点;其中,元信息数据结构如表6所示。(4) The source virtual machine image is constructed to construct a meta information array, that is, the affinity virtual machine data block number and the source virtual machine image difference data set are transmitted to the target placement node; wherein the meta information data structure is as shown in Table 6.
表6、元信息数据结构Table 6, meta information data structure
Figure PCTCN2016083688-appb-000005
Figure PCTCN2016083688-appb-000005
对于镜像亲和虚拟机存在的情况,在生成镜像构建元信息后,则在目标放置节点构建源虚拟机,做法为:For the case where the mirror affinity virtual machine exists, after generating the mirror construction meta information, the source virtual machine is built on the target placement node by:
(1)在目标放置节点为源虚拟机创建本地目录;(1) Create a local directory for the source virtual machine at the target placement node;
(2)遍历源虚拟机镜像构建元信息数组;(2) traversing the source virtual machine image to build an array of meta information;
a)如果元信息为long,则根据block id找到镜像亲和虚拟机的相应L字节长的数据块,添加到源虚拟机本地目录下的镜像;a) If the meta information is long, the corresponding L-byte data block of the mirror affinity virtual machine is found according to the block id, and is added to the image in the local directory of the source virtual machine;
b)如果元信息为byte,则将对应内容直接append到源虚拟机本地目录下的镜像。b) If the meta information is byte, the corresponding content is directly append to the image in the local directory of the source virtual machine.
当元信息数组遍历完成,在源虚拟机本地目录下生成了源虚拟机全量镜像。对于镜像亲和虚拟机不存在的情况,将虚拟机镜像通过网络全量传输至目标放置节点。When the meta information array traversal is completed, the source virtual machine full mirror is generated in the local directory of the source virtual machine. For the case where the mirror affinity virtual machine does not exist, the virtual machine image is completely transferred to the target placement node through the network.
本发明实施例具有以下优点:适用性强,无需修改底层内核,对于VMware ESX、KVM、XEN等虚拟化技术均适用;平台无关性,对于windows、Linux等操作***均适用,且完全将Guest OS作为一个黑盒,无需修改Guest OS;通过对虚拟机镜像降维分析,准确判定镜像亲和性虚拟机,并选择对应节点进行部署,避免在多个节点上冗余预置,有效提升了存储空间利用效 率。The embodiments of the present invention have the following advantages: strong applicability, no need to modify the underlying kernel, and are applicable to virtualization technologies such as VMware ESX, KVM, and XEN; platform independence, applicable to operating systems such as windows and Linux, and completely the Guest OS As a black box, you do not need to modify the Guest OS. By analyzing the virtual machine image dimensionality reduction, you can accurately determine the mirror affinity virtual machine and select the corresponding node for deployment, avoiding redundant presets on multiple nodes, effectively improving storage. Space utilization rate.
本发明实施例对于云计算大规模部署带来以下积极效果:通过选择镜像亲和性最高的虚拟机所在节点进行部署,减少远程数据拷贝数量,快速部署并启动虚拟机;提高部署效率,增强云计算在负载动态变化时的弹性扩展能力;减少数据拷贝造成的带宽消耗,有效降低混合云网络通信成本。The embodiment of the present invention has the following positive effects on the large-scale deployment of the cloud computing: by selecting the node where the virtual machine with the highest mirror affinity is deployed, reducing the number of remote data copies, rapidly deploying and starting the virtual machine, improving the deployment efficiency, and enhancing the cloud. Calculate the elastic expansion capability when the load changes dynamically; reduce the bandwidth consumption caused by data copy, and effectively reduce the communication cost of the hybrid cloud network.
工业实用性Industrial applicability
本发明实施例提供的方案在待创建虚拟机上进行镜像亲和性分析,得到源虚拟机的镜像亲和性虚拟机的目标宿主机,根据目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,减少了远程数据拷贝数量,快速部署并启动虚拟机,提高了部署效率,解决了相关技术中,云计算对大规模、大容量的虚拟机的快速部署提出了更高的要求,虚拟机部署方式已无法满足需求的问题。 The solution provided by the embodiment of the present invention performs image affinity analysis on the virtual machine to be created, obtains the target host of the mirror affinity virtual machine of the source virtual machine, and mirrors the source virtual machine according to the existing data on the target host. The data is partially copied to the target host, which reduces the number of remote data copies, rapidly deploys and starts the virtual machine, improves the deployment efficiency, and solves the related technology. The cloud computing proposes a rapid deployment of large-scale and large-capacity virtual machines. High requirements, virtual machine deployment methods can not meet the demand.

Claims (17)

  1. 一种虚拟机启动方法,包括:A virtual machine startup method includes:
    管理节点向镜像服务器发送镜像分析请求,以使得所述镜像服务器分析待创建虚拟机镜像亲和性特征值;The management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created;
    所述管理节点根据虚拟机资源需求及所述虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所述所在宿主机作为目标宿主机;The management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host where the mirror affinity virtual machine of the source virtual machine is located, so that the host machine is the target host;
    所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据。The management node copies the data of the source virtual machine image to the target host in combination with the existing data on the target host to restore the complete source virtual machine image data.
  2. 如权利要求1所述的虚拟机启动方法,其中,所述管理节点向镜像服务器发送镜像分析请求,以使得所述镜像服务器分析待创建虚拟机镜像亲和性特征值包括:The virtual machine startup method of claim 1, wherein the management node sends a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created, including:
    所述管理节点接收来自客户端的创建虚拟机请求,并向所述镜像服务器注册镜像;The management node receives a create virtual machine request from a client, and registers an image with the mirror server;
    所述管理节点向镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中。The management node sends a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirror feature value database.
  3. 如权利要求2所述的虚拟机启动方法,其中,所述管理节点根据虚拟机资源需求及所述虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所述所在宿主机作为目标宿主机包括:The virtual machine startup method according to claim 2, wherein the management node determines, according to the virtual machine resource requirement and the virtual machine image affinity feature value, the host machine where the mirror affinity virtual machine of the source virtual machine is located, Taking the host machine as the target host includes:
    所述管理节点获取每个计算节点的实时资源使用信息,根据虚拟机的资源需求信息过滤出资源充足的节点;The management node acquires real-time resource usage information of each computing node, and filters out nodes with sufficient resources according to resource requirement information of the virtual machine;
    所述管理节点向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度;And the management node sends, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis;
    所述管理节点根据节点资源充足率及所述镜像相似度,确定待部署节点及待部署节点上的亲和性虚拟机。 The management node determines the adjacency virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
  4. 如权利要求3所述的虚拟机启动方法,其中,所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据包括:The virtual machine booting method according to claim 3, wherein the management node copies the source virtual machine mirror data portion to the target host in combination with the existing data on the target host to restore the complete source virtual machine mirror data. include:
    所述管理节点向目标宿主机发出准备虚拟机镜像请求;The management node sends a preparation virtual machine image request to the target host;
    所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到所述目标宿主机,以使所述目标宿主机结合待部署虚拟机镜像增量数据实现虚拟机镜像本地重构。The management node copies the source virtual machine image data portion to the target host in combination with the existing data on the target host, so that the target host combines the virtual machine image incremental data to be deployed to implement the virtual machine image. Local refactoring.
  5. 如权利要求2至4中任一项所述的虚拟机启动方法,其中,所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中,包括:The virtual machine startup method according to any one of claims 2 to 4, wherein the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirror feature value database, including :
    构造一个m位的镜像亲和性特征值位数组,并将所有位置为0;Construct an m-bit image affinity feature value bit array and set all positions to 0;
    定义一组从1至n的hash函数;Define a set of hash functions from 1 to n;
    将虚拟机镜像数据分解为长度为L的多个定长数据块;Decomposing virtual machine image data into multiple fixed length data blocks of length L;
    将第i个数据块逐次通过n个hash函数,以映射到镜像亲和性特征值位数组中;Passing the ith data block through n hash functions one by one to map to the image affinity feature value bit array;
    将i设为i+1,重复通过n个hash函数,直到所有数据块都完成映射,以生成当前虚拟机的镜像亲和性特征值位数组,作为镜像亲和性特征值的分析结果,并将所述分析结果保存在镜像特征值数据库中;I is set to i+1, and the n hash functions are repeated until all the data blocks are mapped to generate an image array of the image affinity value of the current virtual machine as the analysis result of the image affinity feature value, and Saving the analysis result in a mirrored feature value database;
    其中,i初始为1,m和n均为大于或等于1的正整数。Where i is initially 1, and m and n are positive integers greater than or equal to 1.
  6. 如权利要求5所述的虚拟机启动方法,其中,所述管理节点向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度,包括:The virtual machine startup method according to claim 5, wherein the management node issues, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server is mirrored according to the image. Affinity eigenvalue analysis determines image similarity, including:
    设置最大镜像亲和性数值为第一预设值,所述第一预设值为不可能存在的亲和性数值;Setting a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that is impossible to exist;
    依次从资源充足的备选节点中选取节点v;Selecting a node v from the resource-rich candidate nodes in turn;
    根据预存储的虚拟化集群节点信息表,依次选取节点v上的虚拟机,并从预存储的虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid; According to the pre-stored virtualized cluster node information table, the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table;
    管理节点根据源虚拟机的uuid,从所述虚拟机信息表中查取到源虚拟机镜像uuid;The management node retrieves the source virtual machine image uuid from the virtual machine information table according to the uuid of the source virtual machine;
    管理节点向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,以通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid。The management node sends the source virtual machine and the virtual machine v image affinity analysis request to the mirror server to determine the affinity of the affinity source virtual machine and the virtual machine v by default, and the request parameter is the source virtual machine image uuid and The mirror uuid of the virtual machine v.
  7. 如权利要求6所述的虚拟机快速启动方法,其中,所述通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,包括:The virtual machine quick start method according to claim 6, wherein the determining the affinity of the affinity source virtual machine and the virtual machine v by a preset manner comprises:
    所述镜像服务器根据与存储的虚拟机镜像描述信息提取镜像OS属性,以通过所述镜像OS属性确定亲和性;The mirroring server extracts a mirrored OS attribute according to the stored virtual machine image description information to determine an affinity by using the mirrored OS attribute;
    在源虚拟机与虚拟机v镜像OS反亲和的情况下,直接返回所述第一预设值;Returning the first preset value directly when the source virtual machine and the virtual machine v mirroring the OS are in opposite affinity;
    在源虚拟机与虚拟机v镜像OS不反亲和的情况下,从所述镜像特征值数据库中查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,并在查询到的情况下直接读取该数值,在没有查询到的情况下,根据镜像uuid,从所述镜像特征值数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组,以计算源虚拟机与虚拟机v的镜像亲和性;In the case that the source virtual machine and the virtual machine v mirroring OS are not anti-affinity, the source virtual machine image and the virtual machine v mirror affinity relationship value are searched from the mirrored feature value database, and directly in the case of the query. Read the value, and if not queried, read the mirror affinity bit array of the source virtual machine and the virtual machine v from the mirrored feature value database according to the mirror uuid to calculate the source virtual machine and the virtual machine. Mirror affinity of v;
    判断镜像亲和性关系数值是否大于当前最大值;Determine whether the value of the mirror affinity relationship is greater than the current maximum value;
    在大于当前最大值的情况下,更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点的宿主机地址。In the case of greater than the current maximum value, the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
  8. 如权利要求1至4中任一项所述的虚拟机快速启动方法,其中,所述管理节点结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机确将源虚拟机镜像数据部分拷贝到目标宿主机包括:The virtual machine quick start method according to any one of claims 1 to 4, wherein the management node combines the existing data on the target host to copy the source virtual machine image data portion to the target host. The copy of the source virtual machine image data to the target host includes:
    将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块,对每块数据块用两种校验码算法分别生成两个校验码;The affinity virtual machine image data is successively decomposed into a plurality of fixed length data blocks of length L, and two check code algorithms are respectively generated for each data block by using two check code algorithms;
    将亲和虚拟机镜像的校验码信息数组传给镜像服务器,以将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;The verification code information array of the affinity virtual machine image is transmitted to the mirror server, so that the source virtual machine image and the affinity virtual machine image are compared one by one according to the data block granularity;
    将源虚拟机镜像构建元信息数组,以将亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标宿主机。 The source virtual machine image is constructed with an array of meta information to transfer the affinity virtual machine block number and the source virtual machine image difference data set to the target host.
  9. 一种虚拟机快速启动装置,包括:A virtual machine quick start device includes:
    发送模块,设置成向镜像服务器发送镜像分析请求,以使得所述镜像服务器分析待创建虚拟机镜像亲和性特征值;a sending module, configured to send a mirror analysis request to the mirror server, so that the mirror server analyzes the virtual machine image affinity feature value to be created;
    确定模块,设置成根据虚拟机资源需求及所述虚拟机镜像亲和性特征值,确定源虚拟机的镜像亲和性虚拟机所在宿主机,以将所述所在宿主机作为目标宿主机;a determining module, configured to determine, according to the virtual machine resource requirement and the virtual machine image affinity feature value, a host of the mirror affinity virtual machine of the source virtual machine, to use the host machine as the target host;
    备份模块,设置成结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据。The backup module is configured to combine the data of the source virtual machine image with the existing data on the target host to copy the data of the source virtual machine to the target host to restore the complete source virtual machine image data.
  10. 如权利要求9所述的虚拟机快速启动装置,其中,所述发送模块包括:The virtual machine quick start device of claim 9, wherein the sending module comprises:
    接收单元,设置成接收来自客户端的创建虚拟机请求,并向所述镜像服务器注册镜像;a receiving unit, configured to receive a create virtual machine request from a client, and register an image with the mirror server;
    第一发送单元,设置成向所述镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中。The first sending unit is configured to send a mirror analysis request to the mirror server, so that the mirror server performs mirror image affinity feature value analysis on the virtual machine image, and saves the analysis result in the mirrored feature value database.
  11. 如权利要求10所述的虚拟机快速启动装置,其中,所述确定模块包括:The virtual machine quick start device of claim 10, wherein the determining module comprises:
    获取单元,设置成获取每个计算节点的实时资源使用信息,根据虚拟机的资源需求信息过滤出资源充足的节点;The acquiring unit is configured to obtain real-time resource usage information of each computing node, and filter out nodes with sufficient resources according to resource requirement information of the virtual machine;
    第二发送单元,设置成向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度;a second sending unit, configured to send, to the mirror server, a virtual machine image affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server determines the mirror similarity according to the image affinity feature value analysis;
    确定单元,设置成根据节点资源充足率及所述镜像相似度,确定待部署节点及待部署节点上的亲和性虚拟机。The determining unit is configured to determine the affinity virtual machine on the node to be deployed and the node to be deployed according to the node resource adequacy ratio and the mirror similarity.
  12. 如权利要求11所述的虚拟机快速启动装置,其中,所述备份模块包括:The virtual machine quick start device of claim 11, wherein the backup module comprises:
    第三发送单元,设置成向目标宿主机发出准备虚拟机镜像请求; a third sending unit, configured to send a preparation virtual machine image request to the target host;
    备份单元,设置成结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到所述目标宿主机,以使所述目标宿主机结合待部署虚拟机镜像增量数据实现虚拟机镜像本地重构。a backup unit, configured to combine the data of the source virtual machine image with the existing data on the target host, and copy the source virtual machine image data portion to the target host, so that the target host machine implements the virtual machine in combination with the virtual machine image incremental data to be deployed. Mirror local refactoring.
  13. 如权利要求10至12中任一项所述的虚拟机启动装置,其中,所述第一发送单元向镜像服务器发送镜像分析请求,以使得所述镜像服务器对虚拟机镜像进行镜像亲和性特征值分析,并将分析结果保存在镜像特征值数据库中包括:The virtual machine booting apparatus according to any one of claims 10 to 12, wherein the first transmitting unit sends a mirror analysis request to the mirror server to cause the mirror server to perform mirror image affinity on the virtual machine image Value analysis and saving the analysis results in the mirrored feature value database includes:
    所述第一发送单元向镜像服务器发送镜像分析请求,以使得所述镜像服务器构造一个m位的镜像亲和性特征值位数组,并将所有位置为0;定义一组从1至n的hash函数;将虚拟机镜像数据分解为长度为L的多个定长数据块;将第i个数据块逐次通过n个hash函数,以映射到镜像亲和性特征值位数组中;将i设为i+1,重复通过n个hash函数,直到所有数据块都完成映射,以生成当前虚拟机的镜像亲和性特征值位数组,实现镜像亲和性特征值分析过程,并将分析结果保存在镜像特征值数据库中;其中,i初始为1,m和n均为大于或等于1的正整数。The first sending unit sends a mirror analysis request to the mirror server, so that the mirror server constructs an m-bit image affinity feature value bit array, and sets all positions to 0; defines a set of hashes from 1 to n Function; decompose the virtual machine image data into a plurality of fixed length data blocks of length L; pass the i th data block successively through n hash functions to map into the image affinity feature value bit array; set i to i+1, repeating through n hash functions until all data blocks are mapped, to generate an array of mirror affinity eigenvalue bits of the current virtual machine, realizing the mirror affinity eigenvalue analysis process, and saving the analysis result in Mirroring the feature value database; where i is initially 1, and m and n are positive integers greater than or equal to 1.
  14. 如权利要求13所述的虚拟机启动装置,其中,所述第二发送单元向所述镜像服务器发出待部署虚拟机与备选节点上虚拟机镜像亲和性分析指令,以使得所述镜像服务器根据镜像亲和性特征值分析确定镜像相似度,包括:The virtual machine booting apparatus according to claim 13, wherein the second sending unit issues, to the mirror server, a virtual machine mirror affinity analysis instruction on the virtual machine to be deployed and the candidate node, so that the mirror server The image similarity is determined according to the image affinity feature value analysis, including:
    所述第二发送单元设置最大镜像亲和性数值为第一预设值,其中,所述第一预设值为不可能存在的亲和性数值;依次从资源充足的备选节点中选取节点v;根据预存储的虚拟化集群节点信息表,依次选取节点v上的虚拟机,并从预存储的虚拟机信息表中获取虚拟机v对应的虚拟机镜像uuid;根据源虚拟机的uuid,从所述虚拟机信息表中查取到源虚拟机镜像uuid;The second sending unit sets a maximum mirror affinity value to a first preset value, where the first preset value is an affinity value that is impossible to exist; and sequentially selects a node from a resource-rich candidate node. According to the pre-stored virtualized cluster node information table, the virtual machine on the node v is sequentially selected, and the virtual machine image uuid corresponding to the virtual machine v is obtained from the pre-stored virtual machine information table; according to the uuid of the source virtual machine, Obtaining the source virtual machine image uuid from the virtual machine information table;
    向镜像服务器发出源虚拟机及虚拟机v镜像亲和性分析请求,以通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性,请求参数为源虚拟机镜像uuid及虚拟机v的镜像uuid。The source virtual machine and the virtual machine v image affinity analysis request are sent to the mirror server to determine the affinity of the affinity source virtual machine and the virtual machine v by default, and the request parameters are the source virtual machine image uuid and the virtual machine. The mirror uuid of v.
  15. 如权利要求14所述的虚拟机启动装置,其中,所述第二发送单元通过预设方式确定亲和性源虚拟机及虚拟机v镜像亲和性包括: The virtual machine booting device of claim 14, wherein the second sending unit determines, by a preset manner, that the affinity source virtual machine and the virtual machine v mirror affinity include:
    所述第二发送单元通过所述镜像服务器,根据与存储的虚拟机镜像描述信息提取镜像OS属性,以通过所述镜像OS属性确定亲和性;The second sending unit extracts, by using the mirror server, the mirroring OS attribute according to the stored virtual machine image description information, to determine the affinity by using the mirroring OS attribute;
    在源虚拟机与虚拟机v镜像OS反亲和的情况下,直接返回所述第一预设值;Returning the first preset value directly when the source virtual machine and the virtual machine v mirroring the OS are in opposite affinity;
    在源虚拟机与虚拟机v镜像OS不反亲和的情况下,从所述镜像特征值数据库中查找源虚拟机镜像与虚拟机v镜像亲和性关系数值,并在查询到的情况下直接读取该数值,在没有查询到的情况下,根据镜像uuid,从所述镜像特征值数据库分别读取源虚拟机和虚拟机v的镜像亲和性位数组,以计算源虚拟机与虚拟机v的镜像亲和性;In the case that the source virtual machine and the virtual machine v mirroring OS are not anti-affinity, the source virtual machine image and the virtual machine v mirror affinity relationship value are searched from the mirrored feature value database, and directly in the case of the query. Read the value, and if not queried, read the mirror affinity bit array of the source virtual machine and the virtual machine v from the mirrored feature value database according to the mirror uuid to calculate the source virtual machine and the virtual machine. Mirror affinity of v;
    判断镜像亲和性关系数值是否大于当前最大值;Determine whether the value of the mirror affinity relationship is greater than the current maximum value;
    在大于当前最大值的情况下,更新最大镜像亲和性数值,并记录最大镜像亲和性数值所对应的虚拟机v的uuid及其所在节点的宿主机地址。In the case of greater than the current maximum value, the maximum mirror affinity value is updated, and the uuid of the virtual machine v corresponding to the maximum mirror affinity value and the host address of the node where it is located are recorded.
  16. 如权利要求9至12中任一项所述的虚拟机启动装置,其中,所述备份模块结合所述目标宿主机上已有数据,将源虚拟机镜像数据部分拷贝到目标宿主机,以复原完整源虚拟机镜像数据包括:The virtual machine booting apparatus according to any one of claims 9 to 12, wherein the backup module copies the source virtual machine mirror data portion to the target host to recover the existing data on the target host. The full source virtual machine image data includes:
    所述备份模块将亲和虚拟机镜像数据逐次分解为长度为L的多个定长数据块,对每块数据块用两种校验码算法分别生成两个校验码;将亲和虚拟机镜像的校验码信息数组传给镜像服务器,以将源虚拟机镜像与亲和虚拟机镜像按数据块粒度逐一比对;将源虚拟机镜像构建元信息数组,以将亲和虚拟机数据块编号与源虚拟机镜像差异数据集传输至目标宿主机。The backup module sequentially decomposes the affinity virtual machine mirror data into a plurality of fixed length data blocks of length L, and generates two check codes for each block by using two check code algorithms; The mirrored checksum information array is transmitted to the mirror server to compare the source virtual machine image with the affinity virtual machine image by the data block granularity; the source virtual machine image is constructed with the meta information array to be the affinity virtual machine data block. The number and source virtual machine image difference data set is transferred to the target host.
  17. 一种管理节点,包括:权利要求9至16中任一项所述的虚拟机启动装置。 A management node comprising: the virtual machine boot device of any one of claims 9 to 16.
PCT/CN2016/083688 2015-07-15 2016-05-27 Virtual machine starting method and device, and management node WO2017008584A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510415019.7 2015-07-15
CN201510415019.7A CN106339254B (en) 2015-07-15 2015-07-15 Method and device for quickly starting virtual machine and management node

Publications (1)

Publication Number Publication Date
WO2017008584A1 true WO2017008584A1 (en) 2017-01-19

Family

ID=57756809

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/083688 WO2017008584A1 (en) 2015-07-15 2016-05-27 Virtual machine starting method and device, and management node

Country Status (2)

Country Link
CN (1) CN106339254B (en)
WO (1) WO2017008584A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284169A (en) * 2018-09-10 2019-01-29 福建星瑞格软件有限公司 Big data platform process management method and computer equipment based on process virtual
CN111090491A (en) * 2019-07-03 2020-05-01 杭州海康威视***技术有限公司 Method and device for recovering task state of virtual machine and electronic equipment
CN111857944A (en) * 2019-04-30 2020-10-30 北京嘀嘀无限科技发展有限公司 Method, device, system and computer readable storage medium for virtual machine live migration
CN112000425A (en) * 2020-07-21 2020-11-27 北京北通云服科技有限公司 Image management system based on IDV mode
CN112398892A (en) * 2019-08-19 2021-02-23 浙江宇视科技有限公司 Service distribution method, device and equipment
CN113535670A (en) * 2021-07-13 2021-10-22 山东省计算中心(国家超级计算济南中心) Virtual resource mirror image storage system and implementation method thereof
CN114567496A (en) * 2022-03-03 2022-05-31 浪潮云信息技术股份公司 Method and system for verifying integrity of cloud server mirror image
CN114884905A (en) * 2022-04-18 2022-08-09 深信服科技股份有限公司 Flow mirroring method, device, equipment and computer storage medium
CN116192870A (en) * 2023-04-21 2023-05-30 中国科学技术大学 P2P (peer-to-peer) download mirroring method based on mirror-level metadata management and load perception

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582433B (en) * 2017-09-29 2022-02-01 腾讯科技(深圳)有限公司 Resource scheduling method and device, cloud computing system and storage medium
CN110071880B (en) * 2018-01-24 2021-06-18 北京金山云网络技术有限公司 Message forwarding method, forwarding device, server and storage medium
CN110147266B (en) * 2019-04-29 2024-03-15 腾讯科技(深圳)有限公司 Virtual machine starting method and device, storage medium and electronic device
CN110287004B (en) * 2019-07-05 2021-07-30 中国工商银行股份有限公司 Basic environment mirror image preheating method and device based on docker container technology
CN111371841B (en) * 2020-02-17 2023-04-07 平安科技(深圳)有限公司 Data monitoring method and device
CN114237830B (en) * 2022-02-24 2022-05-20 南京赛宁信息技术有限公司 Dispatching and physical machine capacity expansion method and system for quick start of virtual machine in target range
CN117033084B (en) * 2023-10-09 2024-01-19 武汉吧哒科技股份有限公司 Virtual machine backup method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067425A (en) * 2011-10-20 2013-04-24 ***通信集团公司 Creation method of virtual machine, management system of virtual machine and related equipment thereof
CN103577271A (en) * 2013-11-14 2014-02-12 浪潮(北京)电子信息产业有限公司 Cloud management platform, host machines and virtual machine resource deploying method and system
CN103595780A (en) * 2013-11-08 2014-02-19 中国人民解放军理工大学 Cloud computing resource scheduling method based on repeat removing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761566B (en) * 2011-04-26 2015-09-23 国际商业机器公司 The method and apparatus of migration virtual machine
US8983961B2 (en) * 2012-11-29 2015-03-17 International Business Machines Corporation High availability for cloud servers
CN103049334B (en) * 2012-12-14 2015-09-30 华为技术有限公司 A kind of method of task process and virtual machine
CN104679527B (en) * 2013-11-26 2017-12-01 ***股份有限公司 Virtual machine image upgraded in offline method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067425A (en) * 2011-10-20 2013-04-24 ***通信集团公司 Creation method of virtual machine, management system of virtual machine and related equipment thereof
CN103595780A (en) * 2013-11-08 2014-02-19 中国人民解放军理工大学 Cloud computing resource scheduling method based on repeat removing
CN103577271A (en) * 2013-11-14 2014-02-12 浪潮(北京)电子信息产业有限公司 Cloud management platform, host machines and virtual machine resource deploying method and system

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284169A (en) * 2018-09-10 2019-01-29 福建星瑞格软件有限公司 Big data platform process management method and computer equipment based on process virtual
CN109284169B (en) * 2018-09-10 2022-10-25 福建星瑞格软件有限公司 Big data platform process management method based on process virtualization and computer equipment
CN111857944A (en) * 2019-04-30 2020-10-30 北京嘀嘀无限科技发展有限公司 Method, device, system and computer readable storage medium for virtual machine live migration
CN111090491A (en) * 2019-07-03 2020-05-01 杭州海康威视***技术有限公司 Method and device for recovering task state of virtual machine and electronic equipment
CN111090491B (en) * 2019-07-03 2023-10-10 杭州海康威视***技术有限公司 Virtual machine task state recovery method and device and electronic equipment
CN112398892B (en) * 2019-08-19 2023-06-20 浙江宇视科技有限公司 Service distribution method, device and equipment
CN112398892A (en) * 2019-08-19 2021-02-23 浙江宇视科技有限公司 Service distribution method, device and equipment
CN112000425A (en) * 2020-07-21 2020-11-27 北京北通云服科技有限公司 Image management system based on IDV mode
CN113535670A (en) * 2021-07-13 2021-10-22 山东省计算中心(国家超级计算济南中心) Virtual resource mirror image storage system and implementation method thereof
CN114567496A (en) * 2022-03-03 2022-05-31 浪潮云信息技术股份公司 Method and system for verifying integrity of cloud server mirror image
CN114567496B (en) * 2022-03-03 2024-02-20 浪潮云信息技术股份公司 Method and system for checking integrity of cloud server mirror image
CN114884905A (en) * 2022-04-18 2022-08-09 深信服科技股份有限公司 Flow mirroring method, device, equipment and computer storage medium
CN114884905B (en) * 2022-04-18 2023-11-07 深信服科技股份有限公司 Traffic mirroring method, traffic mirroring device, traffic mirroring equipment and computer storage medium
CN116192870A (en) * 2023-04-21 2023-05-30 中国科学技术大学 P2P (peer-to-peer) download mirroring method based on mirror-level metadata management and load perception
CN116192870B (en) * 2023-04-21 2023-07-11 中国科学技术大学 P2P (peer-to-peer) download mirroring method based on mirror-level metadata management and load perception

Also Published As

Publication number Publication date
CN106339254A (en) 2017-01-18
CN106339254B (en) 2020-06-12

Similar Documents

Publication Publication Date Title
WO2017008584A1 (en) Virtual machine starting method and device, and management node
US11288286B2 (en) Storage system with data consistency checking in synchronous replication using active snapshot set
US11082206B2 (en) Layout-independent cryptographic stamp of a distributed dataset
US10146697B1 (en) NUMA-aware perfect hash algorithm
US9727273B1 (en) Scalable clusterwide de-duplication
US10871960B2 (en) Upgrading a storage controller operating system without rebooting a storage system
US11249834B2 (en) Storage system with coordinated recovery across multiple input-output journals of different types
US11030053B2 (en) Efficient disaster rollback across heterogeneous storage systems
CA2923068C (en) Method and system for metadata synchronization
US11314420B2 (en) Data replica control
US10366091B2 (en) Efficient image file loading and garbage collection
WO2017143844A1 (en) Data operation method and data management server
US20060095435A1 (en) Configuring and deploying portable application containers for improved utilization of server capacity
US20140156866A1 (en) Efficient Data Transmission Between Computing Devices
CN102693230B (en) For the file system of storage area network
EP4049130B1 (en) Updating a metadata structure for a firmware update
WO2018121025A1 (en) Method and system for comparing data of data table
WO2019153880A1 (en) Method for downloading mirror file in cluster, node, and query server
US20200249842A1 (en) Storage system indexed using persistent metadata structures
US9223517B1 (en) Scalable index store
CN106575296B (en) Dynamic N-dimensional cube for hosted analytics
US20160139957A1 (en) Method and system for scheduling virtual machines in integrated virtual machine clusters
US11386124B2 (en) Snapshot rollback for synchronous replication
CN112328697A (en) Data synchronization method based on big data
US10031668B2 (en) Determining status of a host operation without accessing the host in a shared storage environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16823731

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16823731

Country of ref document: EP

Kind code of ref document: A1