Migration Mode Decision Method, Device, Equipment and Medium for Virtual Machine Live Migration

By flexibly selecting the migration mode according to the memory increment rate and network stability, the problem of long downtime in virtual machine hot migration is solved, and a more efficient migration process is achieved.

CN116069450BActive Publication Date: 2025-07-25JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310200937.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-07-25
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively shorten the total time and migration downtime of virtual machines without affecting user services, especially in the case of large amount of memory changes or unstable networks, and the migration efficiency and success rate are low.

Method used

By judging the incremental rate of the memory to be migrated and the stability of the migrated network, the virtual machine migration is carried out using the post-copy method or pre-copy method. The post-copy method is used when the memory increment rate is greater than the threshold and the network is stable. The pre-copy method is used when the memory increment rate is not greater than the threshold or the network is unstable, and the shared storage migration and memory compression of the virtual disk are carried out when necessary.

Benefits of technology

It effectively shortens the total time and migration downtime of virtual machine hot migration, improves migration efficiency and success rate, and reduces the risk of degraded virtual machine performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069450B_ABST
    Figure CN116069450B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for making a decision on a migration mode of virtual machine live migration, which relates to the technical field of virtual machines, and includes: determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is greater than a preset memory increment rate threshold, and judging whether the migration network is stable based on a preset network judgment method; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, then migrate the memory to be migrated from the source host to the destination host by the post-copy method; if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, then migrate the memory to be migrated from the source host to the destination host by the pre-copy method. In the present application, the migration mode of the virtual machine is flexibly set according to the memory increment rate and the migration network, shortening the total live migration time and the migration downtime, and improving the migration efficiency and the migration success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of virtual machines, and particularly to a method, apparatus, device and medium for making a decision on a migration mode of virtual machine live migration. Background Art

[0002] Virtual machine live migration is a key technology in the field of virtualization. It usually migrates a running virtual machine from a source physical machine to a target physical machine without affecting the user's business or the user's perception, and can achieve dynamic resource balance or maintain the host machine without interrupting the business. Among them, the total live migration time and the virtual machine downtime (at a certain moment, the virtual machine is paused and does not process virtual machine service requests, also known as downtime, usually about dozens or hundreds of milliseconds) are two very important indicators in the live migration process. How to reduce the total live migration time and the virtual machine downtime is a very important issue in virtual machine live migration.

[0003] To solve the above problems, many methods and means have been proposed in the field of virtualization. For example: compressing the first memory page block of the virtual machine to be sent. This method is applicable to scenarios where the memory increment change is not large, and can shorten the total migration time through a compression algorithm, but is not applicable to virtual machine services with high memory pressure. When the virtual machine memory changes greatly, iteratively migrating each page of memory may not converge, resulting in a longer total migration time and migration downtime. For example: training an intelligent model in advance, and then inputting various parameters into the intelligent model according to different scenarios to determine the live migration method with the shortest time. This method requires two prerequisites: 1. Classifying the target virtual machine, such as computing-intensive, IO-intensive, etc.; 2. Performing inference training on the model in advance to obtain an intelligent model. Based on this, this method is often not flexible enough in practical applications. Because some virtual machine services may be computing-intensive from 9 am to 12 pm; IO-intensive from 12 pm to 4 pm. It is difficult to define in advance which type the virtual machine belongs to, and it is also impossible to determine the intelligent model in advance.

[0004] Therefore, how to shorten the total live migration time and migration downtime, improve the migration efficiency and migration success rate is an urgent problem to be solved in this field. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a method, apparatus, device and medium for making a decision on a migration mode of virtual machine live migration, which can shorten the total live migration time and migration downtime, improve the migration efficiency and migration success rate, and the specific solutions are as follows:

[0006] In a first aspect, the present application discloses a method for making a decision on a migration mode of virtual machine live migration, including:

[0007] Determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated;

[0008] Judge whether the memory increment rate is greater than a preset memory increment rate threshold, and judge whether the migration network is stable based on a preset network judgment method;

[0009] If the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, then migrate the memory to be migrated from the source host to the destination host by the post-copy method;

[0010] If the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, then migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

[0011] Optionally, before determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated, it further includes:

[0012] Judge whether the virtual disk to be migrated in the virtual machine to be migrated is stored locally; the virtual machine to be migrated includes the virtual disk to be migrated and the memory to be migrated;

[0013] If the virtual disk to be migrated is stored locally, then migrate the virtual disk to be migrated to the shared storage between the source host and the destination host, and then execute the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;

[0014] If the virtual disk to be migrated is not stored locally, then directly execute the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated.

[0015] Optionally, determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated includes:

[0016] During the process of writing memory in the virtual machine to be migrated, record the timestamp of writing memory and the memory offset queue;

[0017] Determine the memory increment rate of the memory to be migrated within a preset time according to the timestamp and the memory offset queue.

[0018] Optionally, migrating the memory to be migrated from the source host to the destination host by the pre-copy method includes:

[0019] Calculate the compression time-consuming and the transmission time saved by compression when compressing the memory to be migrated;

[0020] Based on the compression time consumption and the transmission time saved by compression, determine whether to directly migrate the memory to be migrated from the source host to the destination host through the pre-copy method.

[0021] Optionally, the determining whether to directly migrate the memory to be migrated from the source host to the destination host through the pre-copy method based on the compression time consumption and the transmission time saved by compression includes:

[0022] If the compression time consumption is not less than the transmission time saved by compression, directly migrate the memory to be migrated from the source host to the destination host through the pre-copy method.

[0023] Optionally, the determining whether to directly migrate the memory to be migrated from the source host to the destination host through the pre-copy method based on the compression time consumption and the transmission time saved by compression includes:

[0024] If the compression time consumption is less than the transmission time saved by compression, compress the memory to be migrated;

[0025] Migrate the compressed memory to be migrated from the source host to the destination host through the pre-copy method.

[0026] Optionally, the calculating the compression time consumption and the transmission time saved by compression when compressing the memory to be migrated includes:

[0027] Obtain the maximum bandwidth of the migration network;

[0028] Determine the original length of the memory to be migrated, and record the compression time consumption when compressing the memory to be migrated to the target length;

[0029] Determine the transmission time saved by compression according to the maximum bandwidth, the original length, and the target length.

[0030] In a second aspect, the present application discloses a migration mode decision device for virtual machine live migration, including:

[0031] A memory increment rate determination module, configured to determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated;

[0032] An increment rate and network judgment module, configured to judge whether the memory increment rate is greater than a preset memory increment rate threshold, and judge whether the migration network is stable based on a preset network judgment method;

[0033] A post-copy module, configured to, if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrate the memory to be migrated from the source host to the destination host through the post-copy method;

[0034] A pre-copy module, configured to, if the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, migrate the memory to be migrated from the source host to the destination host in a pre-copy manner.

[0035] In a third aspect, the present application discloses an electronic device, including:

[0036] A memory, configured to store a computer program;

[0037] A processor, configured to execute the computer program to implement the migration mode decision method for virtual machine live migration disclosed above.

[0038] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the migration mode decision method for virtual machine live migration disclosed above is implemented.

[0039] It can be seen that the present application proposes a migration mode decision method for virtual machine live migration, including: determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is greater than the preset memory increment rate threshold, and judging whether the migration network is stable based on a preset network judgment method; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from the source host to the destination host in a post-copy manner; if the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy manner. In summary, the present application flexibly sets the migration mode of the virtual machine to be migrated according to the relationship between the memory increment rate and the preset memory increment rate threshold, and according to the stability of the migration network. In this way, while ensuring the completion of live migration, the total live migration time and migration downtime are shortened, and the migration efficiency and migration success rate are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0041] Figure 1 It is a flowchart of a migration mode decision method for virtual machine live migration disclosed in the present application;

[0042] Figure 2 Schematic diagram of a migration mode decision system for virtual machine live migration disclosed in this application;

[0043] Figure 3 Flowchart of a specific method for making a migration mode decision for virtual machine live migration disclosed in this application;

[0044] Figure 4 Schematic diagram of the structure of a migration mode decision device for virtual machine live migration disclosed in this application;

[0045] Figure 5 Structure diagram of an electronic device disclosed in this application. Detailed implementation manners

[0046] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0047] In order to reduce the total live migration time and the virtual machine downtime, one of the prior arts compresses the first memory page block of the virtual machine to be sent. This method is applicable to scenarios where the memory increment change is not significant and can shorten the total migration time through a compression algorithm, but it is not applicable to virtual machine services with high memory pressure. Another prior art trains an intelligent model in advance and then inputs various parameters into the intelligent model according to different scenarios to determine the live migration method with the shortest time consumption. This method is difficult to define in advance what type of virtual machine this is and cannot determine the intelligent model in advance.

[0048] Therefore, the embodiments of this application propose a migration mode decision scheme for virtual machine live migration, which can ensure the completion of live migration while shortening the total live migration time and the migration downtime, and improving the migration efficiency and the migration success rate.

[0049] The embodiments of this application disclose a method for making a migration mode decision for virtual machine live migration. Refer to Figure 1 as shown, this method includes:

[0050] Step S11: Determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated.

[0051] In this embodiment, first, it is determined whether the virtual disk to be migrated in the virtual machine to be migrated is stored locally; the virtual machine to be migrated includes the virtual disk to be migrated and the memory to be migrated; if the virtual disk to be migrated is stored locally, the virtual disk to be migrated is migrated to the shared storage between the source host and the destination host, and then the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated is executed; if the virtual disk to be migrated is not stored locally, the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated is directly executed. It can be understood that if the virtual disk is stored locally, it cannot be accessed by the destination host. Therefore, it is necessary to perform hot migration of the virtual disk and memory to the destination host. In this application, the hot migration of the virtual machine is split into storage hot migration (virtual disk hot migration) and memory hot migration. Further, the virtual disk is migrated to the shared storage between the source host and the destination host. In this way, the total hot migration time and the migration downtime are shortened, and the memory pressure on the virtual machine caused by the long migration time is avoided, thereby avoiding the performance degradation of the virtual machine.

[0052] In this embodiment, determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated specifically includes: during the process of the virtual machine to be migrated writing to memory, recording the timestamp of writing to memory and the memory offset queue; determining the memory increment rate of the memory to be migrated within a preset time according to the timestamp and the memory offset queue.

[0053] Step S12: Determine whether the memory increment rate is greater than a preset memory increment rate threshold, and determine whether the migration network is stable based on a preset network determination method.

[0054] In this embodiment, it can be specifically determined whether the migration network is stable by determining whether the network traffic per unit time is stable within a preset range.

[0055] Step S13: If the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrate the memory to be migrated from the source host to the destination host by the post-copy method.

[0056] It should be noted that the post-copy method means that the virtual machine is first switched to the destination host, and then the memory to be migrated is iteratively copied from the source host to the destination host. During the process of migrating data, if the network is unstable, there will be a risk of downtime. Therefore, the post-copy needs to be performed when the network is stable. Moreover, if the memory increment rate is greater than the preset memory increment rate threshold, then the iterative migration of each page of memory may not converge all the time. Therefore, the pre-copy method is not suitable. In summary, if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, then the memory to be migrated is migrated from the source host to the destination host through the post-copy method.

[0057] Step S14: If the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, then the memory to be migrated is migrated from the source host to the destination host through the pre-copy method.

[0058] In this embodiment, if the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, then the memory to be migrated is migrated from the source host to the destination host through the pre-copy method.

[0059] In this embodiment, during the process of migrating the memory to be migrated from the source host to the destination host through the pre-copy method, specifically, the memory to be migrated can be compressed first, and the compressed memory to be migrated is migrated to the destination host. In this way, the total hot migration time and the migration downtime can be shortened, and the memory pressure on the virtual machine caused by the long migration time can be avoided, thereby avoiding the performance degradation of the virtual machine. However, when the compression time consumed when compressing the memory to be migrated is not less than the compression-saving transmission time, then the memory to be migrated is directly migrated from the source host to the destination host through the pre-copy method; when the compression time consumed is less than the compression-saving transmission time, the memory to be migrated is compressed, and the compressed memory to be migrated is migrated from the source host to the destination host through the pre-copy method.

[0060] It should be noted that when determining the compression-saving transmission time, first obtain the maximum bandwidth of the migration network; then determine the original length of the memory to be migrated, and record the compression time consumed when compressing the memory to be migrated to the target length; further, determine the compression-saving transmission time according to the maximum bandwidth, the original length, and the target length.

[0061] Figure 2 It is a schematic diagram of a migration mode decision system for virtual machine hot migration disclosed in this application. The system is divided into four modules and three devices, and the three modules are:

[0062] (1) Storage monitoring module: Determine whether the storage where the virtual machine to be migrated is located is local storage or shared storage; Provide it to the live migration intelligent decision-making module to decide whether to perform storage migration first;

[0063] (2) Network monitoring module: Monitor and calculate the migration network rate from the source host to the destination host, and provide it to the live migration intelligent decision-making module for judging the selection of the migration mode;

[0064] (3) Memory monitoring module: Calculate the rate of memory increment (write) within a unit time (configurable as 1 minute, 10 seconds, 1 second). This rate reflects the increment of virtual machine memory data within a unit time, and this rate value is provided to the live migration intelligent decision-making module for judging whether to perform live migration of the virtual machine memory in the Pre-copy or Post-copy mode;

[0065] Specifically, the calculation method of the rate of memory increment of the memory monitoring module of the source host is as follows: First, implant a hook function in the memory write module; Second, request the network monitoring module to obtain the maximum bandwidth of the migration network as W; Third, each time the virtual machine writes to memory, record the access timestamp and record the timestap (timestamp), offset (memory offset) queue in the Key-Value format; Then, when the live migration intelligent decision-making module sends a request to this module, input the unit time T, and count the total number of memory accesses M in the recent unit time from the above-recorded Key-Value queue inc , then the memory increment rate is M inc / T; Finally, the memory increment rate threshold can be set according to the actual situation, usually the total memory M of the virtual machine Total / The maximum bandwidth of the migration network is W × coefficient (adjustment coefficient);

[0066] (4) Compression budget module: Calculate the time saved by compression for transmission and the compression time consumption. These two times are provided to the live migration intelligent decision-making module for judging whether to adopt the memory compression mode;

[0067] Specifically, the calculation method of the time saved by compression for transmission and the compression time consumption of the compression budget module of the source host is as follows:

[0068] First, the compression budget module requests the network monitoring module to obtain the maximum bandwidth of the migration network as W;

[0069] Second, take out the original memory with a length of M from the memory of the virtual machine to be migrated, compress the memory data with the Zlib algorithm to obtain compressed data with a length of N, and the time consumption is T;

[0070] The compression time consumption is: T, and the time saved by compression for transmission is: (M - N) / W;

[0071] (5) Thermal migration intelligent decision-making module: Decide to adopt the thermal migration method based on the information collected from the storage monitoring module, memory monitoring module, and compression budget module. When the virtual disk of the virtual machine collected by the storage monitoring module is not located on the shared storage, storage migration is performed first; when the rate of updating the memory per unit time collected by the memory monitoring module exceeds the pre-set memory increment rate threshold, and the network monitored by the network monitoring module is relatively stable, then the memory migration is performed in the Post-copy mode, otherwise the Pre-copy mode is set; when the compression saving transmission time collected by the compression budget module is greater than the compression time consumption, the compress mode is adopted for memory thermal migration.

[0072] The three devices are: source host: the host where the virtual machine to be migrated is located before migration; destination host: the target host to which the virtual machine to be migrated will be migrated; shared storage and migration network: the storage area and network that can be used by both the source host and the destination host.

[0073] Figure 3 It is a flow chart of a specific migration mode decision method for virtual machine thermal migration disclosed in this application. Specifically,

[0074] 1. The thermal migration intelligent decision-making module collects through the storage monitoring module whether the virtual disk of the virtual machine is located on the shared storage. If the virtual disk is located on the shared storage, go to step 3;

[0075] 2. The thermal migration intelligent decision-making module sends a storage migration instruction to the source host to migrate the virtual disk of the virtual machine to be migrated to the shared storage first;

[0076] 3. The thermal migration intelligent decision-making module sends a request to the memory monitoring module of the source host to obtain the rate of memory increment and the memory increment rate threshold in the recent unit time. When the monitored memory increment rate is less than the memory increment rate threshold, go to step 6, otherwise go to step 4;

[0077] 4. The thermal migration intelligent decision-making module obtains through the network monitoring module whether the migration network is stable (whether the network traffic per unit time is stable within the set range). If it is, go to step 5. If not (the network is unstable), go to step 6;

[0078] 5. The thermal migration intelligent decision-making module gives a message warning of "if the migration fails, it cannot be rolled back", and then performs memory thermal migration in the Post-copy mode until the migration ends (or fails);

[0079] 6. Mark the virtual machine to be migrated as the Pro-copy mode, and then send a request to the compression budget module to obtain the compression saving transmission time and the compression time consumption;

[0080] 7. If the time saved by compression is greater than the time consumed by compression, perform migration in compress mode; otherwise, perform migration in direct transfer mode.

[0081] 8. The migration ends (or fails).

[0082] In summary, the present application utilizes a memory monitoring module, a storage monitoring module, a network monitoring module, and a compression budget module. According to the priority strategy, for different scenarios, it can decide the appropriate live migration method for the current virtual machine based on real-time environment information and virtual machine service load, avoid scenarios where virtual machine live migration cannot be completed, and reduce the total time of virtual machine live migration and virtual machine service downtime. In this way, the high availability of virtual machine live migration is enhanced, and the live migration process has less impact on virtual machine services.

[0083] It can be seen that the present application proposes a method for deciding the migration mode of virtual machine live migration, including: determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is greater than a preset memory increment rate threshold, and judging whether the migration network is stable based on a preset network judgment method; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, then migrate the memory to be migrated from the source host to the destination host by the post-copy method; if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, then migrate the memory to be migrated from the source host to the destination host by the pre-copy method. In summary, the present application flexibly sets the migration mode of the virtual machine to be migrated according to the relationship between the memory increment rate and the preset memory increment rate threshold, and according to the stability of the migration network. In this way, while ensuring the completion of live migration, the total time of live migration and migration downtime are shortened, and the migration efficiency and migration success rate are improved.

[0084] Correspondingly, the embodiment of the present application also discloses a device for deciding the migration mode of virtual machine live migration. Refer to Figure 4 as shown, the device includes:

[0085] A memory increment rate determination module 11, configured to determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated;

[0086] An increment rate and network judgment module 12, configured to judge whether the memory increment rate is greater than a preset memory increment rate threshold, and judge whether the migration network is stable based on a preset network judgment method;

[0087] A post-copy module 13, configured to, if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrate the memory to be migrated from the source host to the destination host by post-copy;

[0088] A pre-copy module 14, configured to, if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrate the memory to be migrated from the source host to the destination host by pre-copy.

[0089] Wherein, for the more specific working processes of the above modules, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.

[0090] It can be seen that the present application provides a method for making a decision on a migration mode for virtual machine live migration, including: determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is greater than a preset memory increment rate threshold, and judging whether the migration network is stable based on a preset network judgment method; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from the source host to the destination host by post-copy; if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host by pre-copy. In summary, the present application flexibly sets the migration mode of the virtual machine to be migrated according to the relationship between the memory increment rate and the preset memory increment rate threshold, and according to the stability of the migration network. In this way, while ensuring the completion of live migration, the total live migration time and migration downtime are shortened, and the migration efficiency and migration success rate are improved.

[0091] Further, an embodiment of the present application also provides an electronic device. Figure 5 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be considered as any limitation on the scope of use of the present application.

[0092] Figure 5 It is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. Wherein, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the following steps:

[0093] Determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated;

[0094] Determine whether the memory increment rate is greater than a preset memory increment rate threshold, and determine whether the migration network is stable based on a preset network determination method;

[0095] If the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, then migrate the memory to be migrated from the source host to the destination host by the post-copy method;

[0096] If the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, then migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

[0097] In some specific embodiments, the processor can further implement the following steps by executing the computer program stored in the memory:

[0098] Determine whether the virtual disk to be migrated in the virtual machine to be migrated is stored locally; the virtual machine to be migrated includes the virtual disk to be migrated and the memory to be migrated;

[0099] If the virtual disk to be migrated is stored locally, then migrate the virtual disk to be migrated to the shared storage between the source host and the destination host, and then execute the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;

[0100] If the virtual disk to be migrated is not stored locally, then directly execute the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated.

[0101] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0102] During the process of writing memory in the virtual machine to be migrated, record the timestamp of writing memory and the memory offset queue;

[0103] Determine the memory increment rate of the memory to be migrated within a preset time according to the timestamp and the memory offset queue.

[0104] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0105] Calculate the compression time-consuming and the transmission time saved by compression when compressing the memory to be migrated;

[0106] Based on the compression time-consuming and the transmission time saved by compression, determine whether to directly migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

[0107] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0108] If the compression time consumption is not less than the transmission time saved by compression, directly migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

[0109] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0110] If the compression time consumption is less than the transmission time saved by compression, compress the memory to be migrated;

[0111] Migrate the compressed memory to be migrated from the source host to the destination host by the pre-copy method.

[0112] In some specific embodiments, the processor can specifically implement the following steps by executing the computer program stored in the memory:

[0113] Obtain the maximum bandwidth of the migration network;

[0114] Determine the original length of the memory to be migrated, and record the compression time consumption when compressing the memory to be migrated to the target length;

[0115] Determine the transmission time saved by compression according to the maximum bandwidth, the original length, and the target length.

[0116] In addition, the electronic device 20 in this embodiment can specifically be an electronic computer.

[0117] In this embodiment, the power supply 26 is used to provide working 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 is any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed here; the input / output interface 24 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0118] In addition, as a carrier for storing resources, the memory 22 can be a read-only memory, a random access memory, a magnetic disk, an optical disk, etc. The resources stored thereon can include a computer program 221, and the storage method can be temporary storage or permanent storage. Among them, in addition to the computer program that can be used to complete the migration mode decision method for virtual machine live migration executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 221 can further include a computer program that can be used to complete other specific tasks.

[0119] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the migration mode decision method for virtual machine live migration disclosed above.

[0120] For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0121] The various embodiments in this application are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0122] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner 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 to exceed the scope of this application.

[0123] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0124] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0125] The above has introduced in detail a method, apparatus, device, and storage medium for making a decision on a migration mode of virtual machine live migration. Specific examples are used in this text to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A decision method for migration mode in virtual machine live migration, characterized in that Including: Determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated; Judge whether the memory increment rate is greater than a preset memory increment rate threshold, and judge whether the migration network is stable based on a preset network judgment method; If the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, then migrate the memory to be migrated from the source host to the destination host by the post-copy method; If the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, then migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

2. The decision method for the migration mode of virtual machine live migration according to claim 1, characterized in that Before determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated, it further includes: Judge whether the virtual disk to be migrated in the virtual machine to be migrated is stored locally; the virtual machine to be migrated includes the virtual disk to be migrated and the memory to be migrated; If the virtual disk to be migrated is stored locally, then migrate the virtual disk to be migrated to the shared storage between the source host and the destination host, and then execute the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated; If the virtual disk to be migrated is not stored locally, then directly execute the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated.

3. The method for making a decision on a migration mode of virtual machine live migration according to claim 1, wherein Determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated includes: During the process of the virtual machine to be migrated writing memory, record the timestamp of writing memory and the memory offset queue; Determine the memory increment rate of the memory to be migrated within a preset time according to the timestamp and the memory offset queue.

4. The method for making a decision on a migration mode of virtual machine live migration according to any one of claims 1 to 3, characterized in that, The method of migrating the memory to be migrated from the source host to the destination host by the pre-copy method includes: Calculate the compression time consumption and the transmission time saved by compression when compressing the memory to be migrated; Based on the compression time consumption and the transmission time saved by compression, judge whether to directly migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

5. The method for making a decision on a migration mode of virtual machine live migration according to claim 4, wherein Based on the compression time consumption and the transmission time saved by compression, judging whether to directly migrate the memory to be migrated from the source host to the destination host by the pre-copy method includes: If the compression time consumption is not less than the transmission time saved by compression, then directly migrate the memory to be migrated from the source host to the destination host by the pre-copy method.

6. The method for making a decision on a migration mode of virtual machine live migration according to claim 4, characterized in that Based on the compression time consumption and the transmission time saved by compression, judging whether to directly migrate the memory to be migrated from the source host to the destination host by the pre-copy method includes: If the compression time consumption is less than the transmission time saved by compression, then compress the memory to be migrated; Migrate the compressed memory to be migrated from the source host to the destination host by the pre-copy method.

7. The migration mode decision method for virtual machine live migration according to claim 4, characterized in that Calculating the compression time consumption and the transmission time saved by compression when compressing the memory to be migrated includes: Obtain the maximum bandwidth of the migration network; Determine the original length of the memory to be migrated, and record the compression time consumed when compressing the memory to be migrated to the target length; Determine the transmission time saved by compression according to the maximum bandwidth, the original length, and the target length.

8. A migration mode decision device for virtual machine live migration, characterized in that Comprising: A memory increment rate determination module, configured to determine the memory increment rate of the memory to be migrated in the virtual machine to be migrated; An increment rate and network judgment module, configured to judge whether the memory increment rate is greater than a preset memory increment rate threshold, and judge whether the migration network is stable based on a preset network judgment method; A post-copy module, configured to, if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrate the memory to be migrated from the source host to the destination host by a post-copy method; A pre-copy module, configured to, if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrate the memory to be migrated from the source host to the destination host by a pre-copy method.

9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the migration mode decision method for virtual machine live migration according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by a processor, the migration mode decision method for virtual machine live migration according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • On-line migration method, device and system of virtual machine

    CN106469085A

  • Virtual machine thermal migration system and thermal migration method thereof

    CN112379974A