A multi-virtual machine migration method, device, equipment and medium
Patent Information
- Application Number
- CN202211581445.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-12-09
AI Technical Summary
而在每次资源调度时同时伴随着大量虚拟机的迁移,现有虚拟机迁移技术一般都是针对单个虚拟机迁移的优化和改进,忽略了多个虚拟机迁移场景下的优化,影响虚拟机的迁移效率
[0040]可见,本申请通过源物理节点中每个待迁移虚拟机对应的内存跟踪器确定各自所述待迁移虚拟机对应的已访问内存页面,并计算每个所述已访问内存页面中页面内容的第一哈希值;通过云管理平台基于所述第一哈希值计算不同所述待迁移虚拟机的内存数据之间的预设相似度;通过所述云管理平台比对所述预设相似度,并将所述预设相似度中最大的目标相似度对应的所述待迁移虚拟机的所述内存数据进行压缩得到压缩后数据;通过所述云管理平台将所述压缩后数据迁移至所述目标物理节点,然后从所述预设相似度中去除所述目标相似度,并跳转至所述将所述预设相似度中最大的目标相似度对应的所述待迁移虚拟机的所述内存数据进行压缩得到压缩后数据的步骤,直至所有所述待迁移虚拟机的所述内存数据完成迁移。由此可见,本申请每次都将相似度最大的待迁移虚拟机的内存数据进行压缩后迁移,增大压缩率,从而减少迁移的数据和迁移的次数,提高多虚拟机迁移的效率。
Smart Images

Figure CN116302307B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for migrating multiple virtual machines. Background Technology
[0002] Currently, cloud computing can provide enterprises with on-demand computing resources. Modern enterprise IT (Internet Technology) infrastructure is gradually migrating from traditional architectures to the cloud. Cloud computing, through virtualization technology, can fully utilize expensive hardware resources and isolate dependencies between hardware architecture and software systems, improving system security and increasing the utilization rate of computing resources. Virtual servers are easy to expand and create, allocating the necessary hardware infrastructure on demand according to customer needs, achieving rapid deployment of customer services, reducing time to market, and saving customer costs. With the development of information technology, the scale of cloud data centers is constantly increasing. The unreasonable utilization of resources has become an increasingly prominent problem in today's cloud data centers. Studies show that the average utilization rate of the CPU (central processing unit) of physical hosts in cloud data centers is only 15% to 20%. Incomplete resource utilization not only wastes resources but also energy. Furthermore, over-utilization of physical host resources in cloud data centers can lead to a decline in service quality and violate service level agreements (SLAs).
[0003] Virtualization provides cloud data centers with online virtual machine migration capabilities. Through virtual machine migration, dynamic resource scheduling can be achieved within the cloud data center, enabling rational resource integration. Dynamic resource scheduling minimizes the number of physical hosts in the cloud data center, achieving energy conservation and emission reduction, while also ensuring host service quality and reducing SLA violations. However, each resource scheduling process involves the migration of a large number of virtual machines. Existing virtual machine migration technologies generally optimize and improve the migration of individual virtual machines, neglecting optimization for multiple virtual machine migration scenarios, thus impacting migration efficiency.
[0004] In conclusion, improving the efficiency of multi-virtual machine migration is a problem that urgently needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for migrating multiple virtual machines, which can improve the efficiency of migrating multiple virtual machines. The specific solution is as follows:
[0006] Firstly, this application discloses a method for migrating multiple virtual machines, including:
[0007] The memory tracker corresponding to each virtual machine to be migrated in the source physical node is used to determine the accessed memory pages of each virtual machine to be migrated, and the first hash value of the page content in each accessed memory page is calculated.
[0008] The cloud management platform calculates a preset similarity between the memory data of different virtual machines to be migrated based on the first hash value;
[0009] The cloud management platform compares the preset similarity scores, and then compresses the memory data of the virtual machine to be migrated corresponding to the largest target similarity score in the preset similarity scores to obtain compressed data.
[0010] The compressed data is migrated to the target physical node through the cloud management platform. Then, the target similarity is removed from the preset similarity and the process jumps to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all the virtual machines to be migrated is migrated.
[0011] Optionally, the step of calculating a preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform includes:
[0012] The cloud management platform selects several second hash values from the first hash value corresponding to each of the virtual machines to be migrated;
[0013] The virtual machine memory data fingerprint corresponding to each virtual machine to be migrated is obtained by using the Bloom filter of the source physical node and calculating the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated based on several second hash values; the virtual machine memory data fingerprint represents the data characteristics of the memory data of the virtual machine to be migrated.
[0014] Based on the virtual machine memory data fingerprint, a preset similarity is calculated between the memory data of different virtual machines to be migrated within each source physical node.
[0015] Optionally, the step of using the Bloom filter of the source physical node and calculating the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated based on several second hash values includes:
[0016] Using several hash functions corresponding to the Bloom filter of the source physical node, calculate several third hash values corresponding to each second hash value of the virtual machine to be migrated;
[0017] By using the third hash values corresponding to all the second hash values of the virtual machine to be migrated, the vector bits of the Bloom filter are modified together to obtain the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated; the third hash value is a binary number.
[0018] Optionally, the step of calculating the preset similarity between the memory data of different virtual machines to be migrated within each source physical node based on the virtual machine memory data fingerprint includes:
[0019] Obtain the first zero count and the second zero count of the virtual machine memory data fingerprints corresponding to any two different virtual machines to be migrated;
[0020] Perform an AND operation on the virtual machine memory data fingerprints corresponding to any two different virtual machines to be migrated to obtain the post-operation fingerprint, and determine the third zero number of the post-operation fingerprint;
[0021] Based on the first zero count, the second zero count, and the third zero count, and using a preset formula, calculate the preset number of vector bits shared between the inserted Bloom filters corresponding to any two different virtual machines to be migrated.
[0022] Accordingly, the step of comparing the preset similarity scores through the cloud management platform and compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity score in the preset similarity scores to obtain compressed data includes:
[0023] The cloud management platform compares the preset number with the data of the virtual machine to be migrated, and then compresses the memory data of the virtual machine corresponding to the largest target number among the preset numbers to obtain compressed data.
[0024] Optionally, the preset formula is:
[0025]
[0026] Wherein, z1 is the first zero number, z2 is the second zero number, and z... 12 The third zero number is m, where m is the size of the Bloom filter after modifying the vector bits, and k is the number of hash functions.
[0027] Optionally, the multi-virtual machine migration method further includes:
[0028] When only one virtual machine to be migrated remains in the source physical node, the memory data of the virtual machine to be migrated is directly migrated to the target physical node.
[0029] Optionally, determining the accessed memory pages corresponding to each virtual machine to be migrated through the memory tracker corresponding to each virtual machine to be migrated in the source physical node includes:
[0030] The memory page bitmap of each virtual machine to be migrated is periodically detected by the memory tracker corresponding to each virtual machine to be migrated in the source physical node.
[0031] If the memory page bitmap is 1, then the corresponding memory page is determined to be an accessed memory page.
[0032] Secondly, this application discloses a multi-virtual machine migration apparatus, comprising:
[0033] The memory page determination module is used to determine the accessed memory pages corresponding to each virtual machine to be migrated by using the memory tracker corresponding to each virtual machine to be migrated in the source physical node.
[0034] The first hash value calculation module is used to calculate the first hash value of the page content in each of the accessed memory pages;
[0035] The similarity calculation module is used to calculate a preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform;
[0036] The data compression module is used to compare the preset similarity through the cloud management platform and compress the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data;
[0037] The data migration module is used to migrate the compressed data to the target physical node through the cloud management platform, then remove the target similarity from the preset similarity, and jump to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all the virtual machines to be migrated is migrated.
[0038] Thirdly, this application discloses an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the aforementioned disclosed multi-virtual machine migration method.
[0039] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed multi-virtual machine migration method.
[0040] As can be seen, this application determines the accessed memory pages corresponding to each virtual machine to be migrated in the source physical node through the memory tracker, and calculates the first hash value of the page content in each accessed memory page; calculates the preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform; compares the preset similarity through the cloud management platform, and compresses the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data; migrates the compressed data to the target physical node through the cloud management platform, then removes the target similarity from the preset similarity, and jumps to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all virtual machines to be migrated is migrated. Therefore, this application compresses the memory data of the virtual machine to be migrated with the highest similarity before migration each time, increasing the compression ratio, thereby reducing the amount of data to be migrated and the number of migrations, and improving the efficiency of multi-virtual machine migration. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 A flowchart of a multi-virtual machine migration method provided in this application;
[0043] Figure 2 A flowchart of a specific multi-virtual machine migration method provided in this application;
[0044] Figure 3 A schematic diagram of a Bloom filter provided in this application;
[0045] Figure 4 A schematic diagram of a multi-virtual machine migration model in cloud computing provided in this application;
[0046] Figure 5 This application provides a schematic diagram of the structure of a multi-virtual machine migration device;
[0047] Figure 6 This application provides a structural diagram of an electronic device. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] Currently, virtualization provides cloud data centers with online virtual machine migration capabilities. Virtual machine migration enables dynamic resource scheduling within the cloud data center, allowing for the rational integration of resources. This dynamic scheduling minimizes the number of physical hosts in the cloud data center, achieving energy conservation and emission reduction, while also ensuring host service quality and reducing SLA violations. However, each resource scheduling process involves the migration of a large number of virtual machines. Existing virtual machine migration technologies generally optimize and improve single virtual machine migrations, neglecting optimizations for multiple virtual machine migration scenarios, thus impacting migration efficiency.
[0050] To overcome the above problems, this application provides a multi-virtual machine migration scheme that can improve the efficiency of multi-virtual machine migration.
[0051] See Figure 1 As shown in the figure, this application discloses a method for migrating multiple virtual machines, the method comprising:
[0052] Step S11: Determine the accessed memory pages corresponding to each virtual machine to be migrated through the memory tracker corresponding to each virtual machine to be migrated in the source physical node, and calculate the first hash value of the page content in each accessed memory page.
[0053] In this embodiment of the application, determining the accessed memory page corresponding to each virtual machine to be migrated through the memory tracker corresponding to each virtual machine to be migrated in the source physical node includes: periodically detecting the memory page bitmap of each virtual machine to be migrated through the memory tracker corresponding to each virtual machine to be migrated in the source physical node; if the memory page bitmap is 1, then the corresponding memory page is determined as an accessed memory page.
[0054] It should be noted that the memory tracker is used to track the virtual machine's resident memory pages. This mechanism uses the Virtual Machine Monitor (VMM) to periodically check the virtual machine's memory page bitmap. Initially, all bits in the bitmap are set to 0. When the virtual machine accesses a memory page, it sets the corresponding bit in the memory page bitmap to 1. The VMM randomly selects a page and checks its corresponding access bitmap. If the bit is set, it adds the page's identifier to the trace and clears the bit. The identifier depends on the page's address space and its offset.
[0055] In this embodiment of the application, the memory tracker uses a hash algorithm to obtain and store the first hash value of the page content in each of the accessed memory pages.
[0056] Step S12: Calculate the preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform.
[0057] Step S13: Compare the preset similarity with the cloud management platform, and compress the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data.
[0058] Step S14: Migrate the compressed data to the target physical node through the cloud management platform, then remove the target similarity from the preset similarity, and jump to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all virtual machines to be migrated is migrated.
[0059] In this embodiment of the application, when only one virtual machine to be migrated remains in the source physical node, the memory data of the virtual machine to be migrated is directly migrated to the target physical node.
[0060] In this embodiment, if there are five virtual machines to be migrated: virtual machine 1, virtual machine 2, virtual machine 3, virtual machine 4, and virtual machine 5, and the similarity between virtual machine 1 and virtual machine 2 is 10, the similarity between virtual machine 3 and virtual machine 4 is 9, the similarity between virtual machine 1 and virtual machine 3 is 8, the similarity between virtual machine 1 and virtual machine 4 is 8, the similarity between virtual machine 1 and virtual machine 5 is 7, the similarity between virtual machine 2 and virtual machine 3 is 6, the similarity between virtual machine 2 and virtual machine 4 is 6, the similarity between virtual machine 2 and virtual machine 5 is 7, and the similarity between virtual machine 4 and virtual machine 5 is 6, then firstly, the memory data of virtual machine 1 and virtual machine 2 are compressed and sent to the target physical node; then, the memory data of virtual machine 3 and virtual machine 4 are compressed and sent to the target physical node; finally, the memory data of virtual machine 5 is sent to the target physical node.
[0061] As can be seen, this application determines the accessed memory pages corresponding to each virtual machine to be migrated in the source physical node through the memory tracker, and calculates the first hash value of the page content in each accessed memory page; calculates the preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform; compares the preset similarity through the cloud management platform, and compresses the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data; migrates the compressed data to the target physical node through the cloud management platform, then removes the target similarity from the preset similarity, and jumps to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all virtual machines to be migrated is migrated. Therefore, this application compresses the memory data of the virtual machine to be migrated with the highest similarity before migration each time, increasing the compression ratio, thereby reducing the amount of data to be migrated and the number of migrations, and improving the efficiency of multi-virtual machine migration.
[0062] See Figure 2 As shown in the figure, this application discloses a specific method for migrating multiple virtual machines, the method including:
[0063] Step S21: Determine the accessed memory pages corresponding to each virtual machine to be migrated through the memory tracker corresponding to each virtual machine to be migrated in the source physical node, and calculate the first hash value of the page content in each accessed memory page.
[0064] For a more detailed description of the process of step S21, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0065] Step S22: Select several second hash values from the first hash values corresponding to each virtual machine to be migrated through the cloud management platform; use the Bloom filter of the source physical node and calculate the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated based on the several second hash values corresponding to the virtual machine to be migrated, so as to obtain the virtual machine memory data fingerprint corresponding to each virtual machine to be migrated; the virtual machine memory data fingerprint represents the data characteristics of the memory data of the virtual machine to be migrated.
[0066] In this embodiment of the application, the step of using the Bloom filter of the source physical node and calculating the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated based on a plurality of second hash values corresponding to the virtual machine to be migrated includes: using a plurality of hash functions corresponding to the Bloom filter of the source physical node to calculate a plurality of third hash values corresponding to each second hash value of the virtual machine to be migrated; using the plurality of third hash values corresponding to all the second hash values of the virtual machine to be migrated to jointly modify the vector bits of the Bloom filter to obtain the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated; the third hash value is a binary number.
[0067] It should be noted that while brute-force comparison of the memory contents of two virtual machines can directly yield the similarity between the two sets of memory data, this will greatly increase the computational overhead of the CPU. To solve this problem, this application uses information recorded by a memory tracker to calculate the features of the virtual machine memory contents based on a Bloom filter. This application defines the feature as the fingerprint of the virtual machine memory data, which is the basis for comparing the similarity between two sets of virtual machine memory data.
[0068] It's important to note that a Bloom filter is actually a long binary vector and a series of random mapping functions, used for inserting and searching elements. A Bloom filter can be used to check if an element is in a set. It has a small storage space, so it doesn't consume too much storage resources, and adding and searching elements has low time complexity. Compared to brute force, the memory usage of the two virtual machines can be significantly reduced, thus reducing the algorithm's complexity.
[0069] It should be pointed out that, as Figure 3 The diagram illustrates a Bloom filter. A Bloom filter consists of m bit vectors and k hash functions, where k = 5. Initially, all bits of the vectors are set to zero. When inserting an element (key, the hash value of the virtual machine's resident memory page (second hash value)), multiple hash values are calculated using the k unbiased hash functions (e.g., hash1(key), hash2(key)). The array index is then obtained by taking the modulo of the array length, and the value at that index is set to 1. This invention uses a hash list generated by a memory tracker to construct the Bloom filter. Specifically, the hash values of memory pages recorded in the memory tracker are used as keys and inserted into the Bloom filter to obtain pointers to the virtual machine's memory data. It should be noted that each Bloom filter corresponds to a virtual machine to be migrated. If the same page appears in two different virtual machines, the corresponding keys will be inserted into two Bloom filters, and the two memory data fingerprints will have the same bit set.
[0070] Step S23: Calculate the preset similarity between the memory data of different virtual machines to be migrated within each source physical node based on the virtual machine memory data fingerprint.
[0071] In this embodiment of the application, the step of calculating the preset similarity between the memory data of different virtual machines to be migrated within each source physical node based on the virtual machine memory data fingerprint includes: obtaining the first zero count and the second zero count of the virtual machine memory data fingerprint corresponding to any two different virtual machines to be migrated; performing an AND operation on the virtual machine memory data fingerprint corresponding to any two different virtual machines to be migrated to obtain the fingerprint after the operation, and determining the third zero count of the fingerprint after the operation; and calculating the preset number of vector bits common between the inserted Bloom filters corresponding to any two different virtual machines to be migrated based on the first zero count, the second zero count, and the third zero count, and based on a preset formula.
[0072] It should be noted that the preset formula is:
[0073]
[0074] Wherein, z1 is the first zero number, z2 is the second zero number, and z... 12 The third zero number is m, where m is the size of the Bloom filter, and k is the number of hash functions.
[0075] It should be noted that the Bloom filters corresponding to different virtual machines to be migrated are of the same size, and the number of hash functions is the same.
[0076] It should be noted that performing a bitwise AND operation on two Bloom Filters directly can calculate the similarity between them, but it cannot quantitatively calculate the similarity. However, this application uses a preset formula to make a quantitative estimate, and the result is the number of identical keys. The key is the hash value (second hash value) of each resident memory page of the virtual machine.
[0077] Step S24: Compare the preset similarity with the cloud management platform, and compress the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data.
[0078] The step of comparing the preset similarity through the cloud management platform and compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data includes: comparing the preset number through the cloud management platform and compressing the memory data of the virtual machine to be migrated corresponding to the largest target number in the preset number to obtain compressed data.
[0079] Step S25: Migrate the compressed data to the target physical node through the cloud management platform, then remove the target similarity from the preset similarity, and jump to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all virtual machines to be migrated is migrated.
[0080] In summary, this application proposes a quantitative estimation of memory data similarity in multi-virtual machine migration scenarios. It utilizes memory similarity to merge, compress, and migrate virtual machine memory data with high similarity. Since the degree of data similarity increases significantly during compression, the amount of data and time spent migrating can be significantly reduced. This can greatly increase the efficiency of cloud resource scheduling and consolidation, thereby reducing SLA violations and effectively minimizing the additional resource overhead caused by migration.
[0081] As can be seen, the accessed memory pages corresponding to each virtual machine to be migrated are determined by the memory tracker corresponding to each virtual machine to be migrated in the source physical node, and a first hash value of the page content in each accessed memory page is calculated; several second hash values are selected from the first hash values corresponding to each virtual machine to be migrated by the cloud management platform; the virtual machine memory data fingerprint corresponding to each virtual machine to be migrated is calculated using the Bloom filter of the source physical node and based on the several second hash values corresponding to the virtual machines to be migrated, so as to obtain the virtual machine memory data fingerprint corresponding to each virtual machine to be migrated; the virtual machine memory data fingerprint represents the data characteristics of the memory data of the virtual machine to be migrated; based on the virtual The method involves calculating a preset similarity between the memory data of different virtual machines to be migrated within each source physical node using virtual machine memory fingerprinting. The preset similarity is then compared using the cloud management platform, and the memory data of the virtual machine to be migrated corresponding to the highest target similarity among the preset similarities is compressed to obtain compressed data. This compressed data is then migrated to the target physical node using the cloud management platform. Next, the target similarity is removed from the preset similarity, and the process returns to the step of compressing the memory data of the virtual machine to be migrated corresponding to the highest target similarity among the preset similarities to obtain compressed data. This process continues until the memory data of all virtual machines to be migrated has been migrated. Therefore, this application proposes a method for quantitatively evaluating similarity, and by compressing the memory data of the virtual machine to be migrated with the highest similarity each time before migration, the compression ratio is increased, thereby reducing the amount of data migrated and the number of migrations, and improving the efficiency of multi-virtual machine migration.
[0082] See Figure 4 The diagram illustrates a multi-virtual machine migration model in cloud computing. In the Virtual Machine Model (VMM), the memory tracker collects the resident memory pages of each virtual machine on the physical host and calculates their hash values. The cloud platform uses the data collected by the memory tracker to calculate the fingerprint of each virtual machine's memory data based on the memory data fingerprint calculation module. Then, the memory data similarity calculation module calculates the similarity between virtual machines based on the memory data fingerprint of each virtual machine. Based on the similarity between virtual machines, the migration compression module compresses the memory data of the virtual machine with the highest similarity before migration. The compressed data is then transmitted to the destination node via network data transmission.
[0083] In one specific embodiment, a prototype system can be built on an x86 server based on a Linux system and KVM (Keyboard Video Mouse). After the system is built, the specific steps are as follows: First, a memory tracker is implemented in the VMM on each physical node. The memory tracker periodically detects which memory pages the virtual machine accesses based on the memory access bitmap, thereby collecting the resident memory (accessed memory pages) during the virtual machine's operation. When collecting resident memory, the memory tracker records the identifier of each memory page and uses a hash algorithm to calculate its hash value (first hash value). The second step involves the memory fingerprint calculation module in the cloud management platform using information recorded by the memory tracker to calculate the memory fingerprint of the virtual machines to be migrated. Essentially, this generates a Bloom filter for each virtual machine, with the key of the inserted element being the hash value (second hash value) of each resident memory page of the virtual machine. The third step involves the memory data similarity calculation module of the cloud management platform calculating the similarity between the virtual machines to be migrated according to the aforementioned preset formula, and sequentially passing the virtual machine with the highest similarity to the compression migration module. The fourth step involves the compression migration module merging and compressing the memory data of the virtual machines to be migrated, and then performing data migration. This involves transmitting the compressed data to the target physical node over the network, where the data is decompressed and restored to its original state. Because there are many similar memory pages, this significantly increases the compression ratio, effectively reducing data transmission during migration and greatly reducing migration time.
[0084] In summary, this application proposes an efficient migration method for multiple virtual machines in cloud computing. Unlike existing virtual machine migration methods, this application comprehensively considers the similarity of memory data between virtual machines during migration, taking into account the scenario of simultaneous migration of multiple virtual machines. It compresses memory pages with high similarity between virtual machines before migration. Compressing highly similar data can significantly increase the compression ratio, thereby reducing the amount of data migrated and improving migration efficiency. Especially in cloud computing resource scheduling scenarios, each resource consolidation involves migrating a large number of virtual machines simultaneously. By grouping virtual machines with high memory data similarity together for compression before migration, this application significantly reduces the amount of data migrated while improving resource consolidation efficiency and minimizing the impact on virtual machine performance and SLA violations during migration.
[0085] See Figure 5 As shown in the figure, this application discloses a multi-virtual machine migration apparatus, including:
[0086] The memory page determination module 11 is used to determine the accessed memory pages corresponding to each virtual machine to be migrated by the memory tracker corresponding to each virtual machine to be migrated in the source physical node.
[0087] The first hash value calculation module 12 is used to calculate the first hash value of the page content in each of the accessed memory pages;
[0088] Similarity calculation module 13 is used to calculate a preset similarity between memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform;
[0089] Data compression module 14 is used to compare the preset similarity through the cloud management platform and compress the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data;
[0090] The data migration module 15 is used to migrate the compressed data to the target physical node through the cloud management platform, then remove the target similarity from the preset similarity, and jump to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all the virtual machines to be migrated is migrated.
[0091] For more detailed information on the working process of each of the above modules, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0092] As can be seen, this application determines the accessed memory pages corresponding to each virtual machine to be migrated in the source physical node through the memory tracker, and calculates the first hash value of the page content in each accessed memory page; calculates the preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform; compares the preset similarity through the cloud management platform, and compresses the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data; migrates the compressed data to the target physical node through the cloud management platform, then removes the target similarity from the preset similarity, and jumps to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all virtual machines to be migrated is migrated. Therefore, this application compresses the memory data of the virtual machine to be migrated with the highest similarity before migration each time, increasing the compression ratio, thereby reducing the amount of data migrated and improving the efficiency of multi-virtual machine migration.
[0093] Furthermore, embodiments of this application also provide an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0094] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, an input / output interface 24, a communication interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the multi-virtual machine migration method disclosed in any of the foregoing embodiments.
[0095] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 24 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0096] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The memory 22 can be a random access memory that can be used as running memory and a non-volatile memory used for external memory storage. The storage resources on it include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0097] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 on the source host and the computer program 222. The operating system 221 can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to perform the multi-virtual machine migration method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to perform other specific tasks.
[0098] In this embodiment, the input / output interface 24 may include, but is not limited to, a USB interface, a hard disk read interface, a serial interface, a voice input interface, a fingerprint input interface, etc.
[0099] Furthermore, embodiments of this application also disclose a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed multi-virtual machine migration method.
[0100] For the specific steps of this method, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0101] The computer-readable storage medium referred to herein includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, optical disks, or any other form of storage medium known in the art. The computer program, when executed by a processor, implements the aforementioned multi-virtual machine migration method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0102] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The apparatus disclosed in the embodiments is described simply because it corresponds to the multi-virtual machine migration method disclosed in the embodiments; relevant parts can be referred to the method section.
[0103] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0104] The steps of the algorithm described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0105] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0106] The present invention provides a detailed description of a multi-virtual machine migration method, apparatus, device, and medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for migrating multiple virtual machines, characterized in that, include: The memory tracker corresponding to each virtual machine to be migrated in the source physical node is used to determine the accessed memory pages of each virtual machine to be migrated, and the first hash value of the page content in each accessed memory page is calculated. The cloud management platform calculates a preset similarity between the memory data of different virtual machines to be migrated based on the first hash value; The cloud management platform compares the preset similarity scores, and then compresses the memory data of the virtual machine to be migrated corresponding to the largest target similarity score in the preset similarity scores to obtain compressed data. The compressed data is migrated to the target physical node through the cloud management platform. Then, the target similarity is removed from the preset similarity and the process jumps to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all virtual machines to be migrated is migrated. The step of calculating the preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform includes: selecting a plurality of second hash values from the first hash values corresponding to each virtual machine to be migrated through the cloud management platform; using the Bloom filter of the source physical node and calculating the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated based on the plurality of second hash values corresponding to the virtual machine to be migrated, so as to obtain the virtual machine memory data fingerprint corresponding to each virtual machine to be migrated; the virtual machine memory data fingerprint represents the data characteristics of the memory data of the virtual machine to be migrated; and calculating the preset similarity between the memory data of different virtual machines to be migrated within each source physical node based on the virtual machine memory data fingerprint. The step of using the Bloom filter of the source physical node and calculating the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated based on several second hash values includes: using several hash functions corresponding to the Bloom filter of the source physical node to calculate several third hash values corresponding to each second hash value of the virtual machine to be migrated; using the several third hash values corresponding to all the second hash values of the virtual machine to be migrated to jointly modify the vector bits of the Bloom filter to obtain the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated; the third hash value is a binary number; wherein, the Bloom filters corresponding to different virtual machines to be migrated have the same size, and the number of hash functions is the same; The step of calculating the preset similarity between the memory data of different virtual machines to be migrated within each source physical node based on the virtual machine memory data fingerprint includes: obtaining the first zero count and the second zero count of the virtual machine memory data fingerprint corresponding to any two different virtual machines to be migrated; performing an AND operation on the virtual machine memory data fingerprint corresponding to any two different virtual machines to be migrated to obtain the fingerprint after the operation, and determining the third zero count of the fingerprint after the operation; and calculating the preset number of vector bits common between the inserted Bloom filters corresponding to any two different virtual machines to be migrated based on the first zero count, the second zero count, and the third zero count, and based on a preset formula. Accordingly, the step of comparing the preset similarity through the cloud management platform and compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data includes: comparing the preset quantity through the cloud management platform and compressing the memory data of the virtual machine to be migrated corresponding to the largest target quantity in the preset quantity to obtain compressed data.
2. The multi-virtual machine migration method according to claim 1, characterized in that, The preset formula is: ; Among them, the For the first zero number, the For the second zero number, the For the third zero number, the To modify the size of the Bloom filter after adjusting the vector bits, the The number of hash functions.
3. The multi-virtual machine migration method according to claim 1, characterized in that, Also includes: When only one virtual machine to be migrated remains in the source physical node, the memory data of the virtual machine to be migrated is directly migrated to the target physical node.
4. The multi-virtual machine migration method according to any one of claims 1 to 3, characterized in that, The step of determining the accessed memory pages corresponding to each virtual machine to be migrated through the memory tracker corresponding to each virtual machine to be migrated in the source physical node includes: The memory page bitmap of each virtual machine to be migrated is periodically detected by the memory tracker corresponding to each virtual machine to be migrated in the source physical node. If the memory page bitmap is 1, then the corresponding memory page is determined to be an accessed memory page.
5. A multi-virtual machine migration device, characterized in that, include: The memory page determination module is used to determine the accessed memory pages corresponding to each virtual machine to be migrated by using the memory tracker corresponding to each virtual machine to be migrated in the source physical node. The first hash value calculation module is used to calculate the first hash value of the page content in each of the accessed memory pages; The similarity calculation module is used to calculate a preset similarity between the memory data of different virtual machines to be migrated based on the first hash value through the cloud management platform; The data compression module is used to compare the preset similarity through the cloud management platform and compress the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data; The data migration module is used to migrate the compressed data to the target physical node through the cloud management platform, then remove the target similarity from the preset similarity, and jump to the step of compressing the memory data of the virtual machine to be migrated corresponding to the largest target similarity in the preset similarity to obtain compressed data, until the memory data of all the virtual machines to be migrated is migrated. The similarity calculation module is specifically used to select several second hash values from the first hash values corresponding to each virtual machine to be migrated through the cloud management platform; and to calculate the virtual machine memory data fingerprint corresponding to each virtual machine to be migrated based on the Bloom filter of the source physical node and the several second hash values corresponding to the virtual machine to be migrated, so as to obtain the virtual machine memory data fingerprint corresponding to each virtual machine to be migrated. The virtual machine memory data fingerprint represents the data characteristics of the memory data of the virtual machine to be migrated; Based on the virtual machine memory data fingerprint, a preset similarity is calculated between the memory data of different virtual machines to be migrated within each source physical node; The similarity calculation module is further configured to use several hash functions corresponding to the Bloom filter of the source physical node to calculate several third hash values corresponding to each second hash value of the virtual machine to be migrated; and to use the several third hash values corresponding to all the second hash values of the virtual machine to be migrated to jointly modify the vector bits of the Bloom filter to obtain the virtual machine memory data fingerprint corresponding to the virtual machine to be migrated; the third hash value is a binary number; wherein, the Bloom filters corresponding to different virtual machines to be migrated have the same size, and the number of hash functions is the same; The similarity calculation module is further configured to obtain the first zero count and the second zero count of the virtual machine memory data fingerprints corresponding to any two different virtual machines to be migrated; perform an AND operation on the virtual machine memory data fingerprints corresponding to any two different virtual machines to be migrated to obtain the fingerprint after the operation, and determine the third zero count of the fingerprint after the operation; and calculate the preset number of vector bits common between the inserted Bloom filters corresponding to any two different virtual machines to be migrated based on the first zero count, the second zero count, and the third zero count, and based on a preset formula. Accordingly, the data compression module is specifically used to compare the preset number with the cloud management platform and compress the memory data of the virtual machine to be migrated corresponding to the largest target number among the preset numbers to obtain compressed data.
6. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the multi-virtual machine migration method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the multi-virtual machine migration method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Memory redundancy oriented virtual machine migration device and method
CN102103524A