A virtual machine live migration method, its device, and a virtual machine live migration system

By monitoring the dirty page rate and network bandwidth of virtual machine memory blocks in real time, dynamically adjusting the floating threshold, and migrating virtual machine memory blocks in stages, the problem of multiple migrations of hot spot memory during the virtual machine hot migration process is solved, and the migration speed and customer experience are improved.

CN116010034BActive Publication Date: 2025-07-04CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310077922.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-12
Publication Date
2025-07-04
Estimated Expiration
2043-01-12

AI Technical Summary

Technical Problem

During the hot migration of existing virtual machines, when sending virtual machine memory iteratively, hotspot memory blocks with high dirty page rates need to be migrated multiple times, resulting in too long migration time and affecting the customer experience.

Method used

By monitoring the dirty page rate and network bandwidth of the source virtual machine memory block in real time, dynamically adjust the floating threshold, mark the memory block with a dirty page rate smaller than the threshold as the first to be transferred table, and migrate it to the destination machine at the appropriate time. The memory block with a dirty page rate higher than the threshold is marked as the second to be transferred table, and migrate it in stages to reduce the migration frequency of hotspot memory.

Benefits of technology

It effectively reduces the frequency of high dirty page rate hotspot memory blocks in the iterative sending memory blocks in the virtual machine, shortens migration time, and improves migration speed and customer experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010034B_ABST
    Figure CN116010034B_ABST
Patent Text Reader

Abstract

The present invention provides a virtual machine live migration method, its device, and a virtual machine live migration system. The virtual machine live migration method dynamically adjusts a floating threshold by monitoring the dirty page rate and network bandwidth of each memory block in real time, marks the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transferred, marks the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transferred, and updates the first memory block table to be transferred and the second memory block table to be transferred in real time after the floating threshold is adjusted; during this process, the memory blocks in the first memory block table to be transferred are first transferred from the source physical machine to the destination physical machine, and then the memory blocks in the second memory block table to be transferred are transferred from the source physical machine to the destination physical machine. It reduces the frequency of repeatedly iteratively sending hot memory blocks with a high dirty page rate during the virtual machine iterative memory block sending stage, reduces the live migration time, and improves the live migration speed to enhance the customer experience.
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 in particular, to a virtual machine live migration method, an apparatus thereof, and a virtual machine live migration system. Background Art

[0002] As a basic technology of cloud computing systems, virtualization technology has been widely applied. Virtualization technology abstracts physical resources into software or hardware interfaces, providing an execution environment for virtual machine operating systems, so as to achieve the purpose of making full use of physical resources. The virtual machine live migration technology smoothly migrates from a source host to a destination host without interrupting services in the virtual machine, and is applied to scenarios such as system software and hardware upgrades, server cluster host load balancing, and energy saving.

[0003] In the existing live migration process, the main task is to migrate the memory of the virtual machine to be migrated from the source end to the destination end. During the iterative transmission of the virtual machine memory, the virtual machine to be migrated will also continuously access some memory, thus generating new dirty pages. If this memory has been sent to the destination end, these memories need to be migrated again. If a certain service in the virtual machine frequently accesses memory, a large amount of time will be consumed to migrate the hot memory multiple times during the iterative transmission of the virtual machine memory. Summary of the Invention

[0004] The present invention provides a virtual machine live migration method, an apparatus thereof, and a virtual machine live migration system, which reduce the frequency of repeatedly iteratively transmitting hot memory blocks with a high dirty page rate during the iterative transmission of memory blocks in a virtual machine.

[0005] In a first aspect, the present invention provides a virtual machine live migration method, which includes: real-time monitoring the dirty page rate of each memory block in a source virtual machine to be migrated, and the network bandwidth between the source physical machine and the destination physical machine; setting and dynamically adjusting a floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block; marking memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, and dynamically updating the first memory block table to be transmitted after dynamically adjusting the floating threshold; transmitting the memory blocks in the first memory block table to be transmitted from the source physical machine to the destination physical machine; marking memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and dynamically updating the second memory block table to be transmitted after dynamically adjusting the floating threshold; when there are no memory blocks in the first memory block table to be transmitted, transmitting the memory blocks in the second memory block table to be transmitted from the source physical machine to the destination physical machine.

[0006] In the above solution, by monitoring the dirty page rate of each memory block and the network bandwidth in the source virtual machine in real time, the floating threshold is dynamically adjusted. Memory blocks with a dirty page rate less than the floating threshold are marked to form the first memory block table to be transferred, and memory blocks with a dirty page rate greater than or equal to the floating threshold are marked to form the second memory block table to be transferred. After the floating threshold is adjusted, the first memory block table to be transferred and the second memory block table to be transferred are updated in real time. During this process, the memory blocks in the first memory block table to be transferred are first transferred from the source physical machine to the destination physical machine, and when there are no memory blocks in the first memory block table to be transferred, the memory blocks in the second memory block table to be transferred are transferred from the source physical machine to the destination physical machine. Compared with the prior art, the present application updates the floating threshold in real time and dynamically, divides it into the first memory block table to be transferred and the second memory block table to be transferred, first transfers the memory blocks in the first memory block table to be transferred that are currently not hot, and then transfers the memory blocks in the second memory block table to be transferred that are currently in the hot state. It can control the migration timing of hot memory, reduce the frequency of repeatedly iteratively sending hot memory blocks with a high dirty page rate during the virtual machine iterative memory block sending stage, reduce the hot migration time, and improve the hot migration speed to enhance the customer experience.

[0007] In a specific embodiment, according to the real-time monitored network bandwidth and the dirty page rate of each memory block, setting and dynamically adjusting the floating threshold includes: calculating the maximum data volume that can be transferred at one time according to the real-time monitored network bandwidth; setting and dynamically adjusting the floating threshold according to the maximum data volume and the dirty page rate of each memory block. It is convenient to accurately determine and adjust the size of the floating threshold in a quantitative manner.

[0008] In a specific embodiment, according to the real-time monitored network bandwidth and the dirty page rate of each memory block, setting and dynamically adjusting the floating threshold includes: calculating the bandwidth change rate of the network bandwidth according to the real-time monitored network bandwidth; determining whether the bandwidth change rate is greater than the bandwidth mutation threshold; if the bandwidth change rate is not greater than the bandwidth mutation threshold, keeping the floating threshold unchanged; if the bandwidth change rate is greater than the bandwidth mutation threshold, adjusting the floating threshold. When the bandwidth change rate of the network bandwidth is greater than the bandwidth mutation threshold, the mechanism for adjusting the floating threshold is started, which can optimize the mechanism for adjusting the floating threshold, so that when it is necessary to adjust the floating threshold, the floating threshold can be adjusted in time, improving the timeliness and accuracy of the floating threshold adjustment.

[0009] In a specific embodiment, setting and dynamically adjusting a floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block includes: calculating the change rate of the dirty page rate of each memory block according to the real-time monitored dirty page rate of each memory block; determining whether there is a memory block whose dirty page rate change rate is greater than the dirty page change rate mutation threshold; if there is no memory block whose dirty page rate change rate is greater than the dirty page change rate mutation threshold, keeping the floating threshold unchanged; if there is a memory block whose dirty page rate change rate is greater than the dirty page change rate mutation threshold, adjusting the floating threshold. As long as there is a memory block whose dirty page rate change rate is greater than the dirty page change rate mutation threshold, it indicates that this memory block may need to be moved between the first memory block table to be transmitted and the second memory block table to be transmitted. Thus, the floating threshold is adjusted in a timely manner, and the memory block whose dirty page rate change rate is greater than the dirty page change rate mutation threshold is moved between the first memory block table to be transmitted and the second memory block table to improve the timeliness and accuracy of the floating threshold adjustment.

[0010] In a specific embodiment, setting and dynamically adjusting a floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block includes: calculating the change rate of the dirty page rate of each memory block according to the real-time monitored dirty page rate of each memory block; counting the number of memory blocks whose dirty page rate change rate is greater than the dirty page change rate mutation threshold; determining whether the number of memory blocks is greater than the threshold number; if the number of memory blocks is not greater than the threshold number, keeping the floating threshold unchanged; if the number of memory blocks is greater than the threshold number, adjusting the floating threshold. Only when the number of memory blocks whose dirty page rate change rate is greater than the dirty page change rate mutation threshold is greater than the threshold number, the floating threshold is adjusted, reducing the number of times of adjusting the floating threshold.

[0011] In a specific embodiment, transferring the memory blocks in the first memory block table to be transmitted from the source physical machine to the destination physical machine includes: sorting the memory blocks in the first memory block table to be transmitted according to the dirty page rate size, and dynamically updating the sorting of the memory blocks in the first memory block table to be transmitted after dynamically adjusting the floating threshold; starting from the memory block with the lowest dirty page rate in the first memory block table to be transmitted, sequentially transferring the memory blocks in the first memory block to be transmitted from the source physical machine to the destination physical machine. When transferring the memory blocks in the first memory block table to be transmitted, still transfer the memory blocks with a lower dirty page rate first. Since the memory blocks with a lower dirty page rate in the first memory block table to be transmitted have a lower probability of being accessed by the source virtual machine for a write operation again compared with the memory blocks with a higher dirty page rate, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a lower probability of being moved from the first memory block table to be transmitted to the second memory block table compared with the memory blocks with a higher dirty page rate. Thus, it can further reduce the frequency of repeatedly transmitting the hot memory blocks with a high dirty page rate in the virtual machine iterative memory block sending stage.

[0012] In a specific embodiment, when there is no memory block in the first memory block table to be transmitted, transferring the memory blocks in the second memory block table to be transmitted from the source physical machine to the destination physical machine includes: sorting the memory blocks in the second memory block table to be transmitted according to the dirty page rate, and dynamically updating the sorting of the memory blocks in the second memory block table to be transmitted after dynamically adjusting the floating threshold; when there is no memory block in the first memory block table to be transmitted, starting from the memory block with the lowest dirty page rate in the second memory block table to be transmitted, sequentially transferring the memory blocks in the second memory block table to be transmitted from the source physical machine to the destination physical machine. When transferring the memory blocks in the second memory block table to be transmitted, the memory blocks with a lower dirty page rate are still transferred first. Since the memory blocks with a lower dirty page rate in the second memory block table to be transmitted have a lower probability of being accessed by the source virtual machine for a write operation compared to the memory blocks with a higher dirty page rate, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a higher probability of being moved from the second memory block table to be transmitted to the first memory block table compared to the memory blocks with a higher dirty page rate, thereby further reducing the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate in the virtual machine iterative memory block sending stage.

[0013] In a specific embodiment, the virtual machine live migration method further includes: real-time monitoring of the total data volume of the remaining memory blocks not transmitted in the source virtual machine; when the total data volume of the remaining memory blocks not transmitted is less than a preset threshold, merging the first memory block table to be transmitted and the second memory block table to be transmitted into a third memory block table to be transmitted; transferring the memory blocks in the third memory block table to be transmitted from the source physical machine to the destination physical machine. When the total data volume of the remaining memory blocks not transmitted is relatively low, it indicates that most of the memory blocks of the source virtual machine have been transmitted. Then, the update of the floating threshold, the first memory block table to be transmitted, and the second memory block table to be transmitted can be stopped, and the remaining memory blocks can be transferred to the destination physical machine together, dynamically balancing between the monitoring calculation amount and the migration efficiency, improving the live migration efficiency, and reducing the monitoring calculation amount at the same time.

[0014] Second aspect, the present invention also provides a virtual machine live migration device, which includes: a monitoring module, a threshold adjustment module, a first marking module, a migration module, and a second marking module. Among them, the monitoring module is used to monitor in real time the dirty page rate of each memory block in the source virtual machine to be migrated, as well as the network bandwidth between the source physical machine and the destination physical machine. The threshold adjustment module is used to set and dynamically adjust a floating threshold according to the network bandwidth and the dirty page rate of each memory block monitored in real time. The first marking module is used to mark the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, and dynamically update the first memory block table to be transmitted after dynamically adjusting the floating threshold. The migration module is used to transfer the memory blocks in the first memory block table to be transmitted from the source physical machine to the destination physical machine. The second marking module is used to mark the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and dynamically update the second memory block table to be transmitted after dynamically adjusting the floating threshold. The migration module is also used to transfer the memory blocks in the second memory block table to be transmitted from the source physical machine to the destination physical machine when there are no memory blocks in the first memory block table to be transmitted.

[0015] In the above solution, by monitoring in real time the dirty page rate of each memory block in the source virtual machine and the network bandwidth, dynamically adjusting the floating threshold, marking the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, marking the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and updating the first memory block table to be transmitted and the second memory block table to be transmitted in real time after adjusting the floating threshold; in this process, first transfer the memory blocks in the first memory block table to be transmitted from the source physical machine to the destination physical machine, and transfer the memory blocks in the second memory block table to be transmitted from the source physical machine to the destination physical machine when there are no memory blocks in the first memory block table to be transmitted. Compared with the prior art, the present application updates the floating threshold in real time dynamically, divides it into a first memory block table to be transmitted and a second memory block table to be transmitted, first transmits the memory blocks in the first memory block table to be transmitted that are currently not hot, and then transmits the memory blocks in the second memory block table to be transmitted that are currently in the hot state. It can control the migration timing of hot memory, reduce the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate in the virtual machine iterative memory block sending stage, reduce the live migration time, and improve the live migration speed to enhance the customer experience.

[0016] In a specific embodiment, the threshold adjustment module includes: a calculation module and a determination module. Among them, the calculation module is used to calculate the maximum data volume that can be transmitted at one time according to the network bandwidth monitored in real time; the determination module is used to set and dynamically adjust the floating threshold according to the maximum data volume and the dirty page rate of each memory block. It is convenient to accurately determine and adjust the size of the floating threshold in a quantitative manner.

[0017] In a specific embodiment, the threshold adjustment module includes: a calculation module, a judgment module, and a determination module. Among them, the calculation module is used to calculate the bandwidth change rate of the network bandwidth according to the real-time monitored network bandwidth. The judgment module is used to judge whether the bandwidth change rate is greater than the bandwidth mutation threshold. The determination module is used to keep the floating threshold unchanged when the bandwidth change rate is not greater than the bandwidth mutation threshold; the determination module is also used to adjust the floating threshold when the bandwidth change rate is greater than the bandwidth mutation threshold. When the bandwidth change rate of the network bandwidth is greater than the bandwidth mutation threshold, the mechanism for adjusting the floating threshold is started, which can optimize the mechanism for adjusting the floating threshold, so that when it is necessary to adjust the floating threshold, the floating threshold can be adjusted in time, improving the timeliness and accuracy of the floating threshold adjustment.

[0018] In a specific embodiment, the threshold adjustment module includes: a calculation module, a judgment module, and a determination module. Among them, the calculation module is used to calculate the dirty page rate change rate of each memory block according to the real-time monitored dirty page rate of each memory block. The judgment module is used to judge whether there is a dirty page rate change rate of a memory block that is greater than the dirty page change rate mutation threshold. The determination module is used to keep the floating threshold unchanged when the judgment result of the judgment module is that there is no dirty page rate change rate of a memory block that is greater than the dirty page change rate mutation threshold; the determination module is also used to adjust the floating threshold when the dirty page rate change rate of a memory block is greater than the dirty page change rate mutation threshold. As long as there is a dirty page rate change rate of a memory block that is greater than the dirty page change rate mutation threshold, it indicates that the memory block may need to be moved between the first memory block table to be transmitted and the second memory block table to be transmitted. Thus, the floating threshold is adjusted in time, and the memory block with a dirty page rate change rate greater than the dirty page change rate mutation threshold is moved between the first memory block table to be transmitted and the second memory block table to be transmitted, improving the timeliness and accuracy of the floating threshold adjustment.

[0019] In a specific embodiment, the threshold adjustment module includes: a calculation module, a statistics module, a judgment module, and a determination module. Among them, the calculation module is used to calculate the dirty page rate change rate of each memory block according to the real-time monitored dirty page rate of each memory block. The statistics module is used to count the number of memory blocks whose dirty page rate change rate is greater than the dirty page change rate mutation threshold. The judgment module is used to judge whether the number of memory blocks is greater than the threshold number. The determination module is used to keep the floating threshold unchanged when the number of memory blocks is not greater than the threshold number; the determination module is also used to adjust the floating threshold when the number of memory blocks is greater than the threshold number. Only when the number of memory blocks whose dirty page rate change rate is greater than the dirty page change rate mutation threshold is greater than the threshold number, the floating threshold is adjusted, reducing the number of times of adjusting the floating threshold.

[0020] In a specific embodiment, the migration module includes: a first sorting unit and a first migration unit. The first sorting unit is configured to sort the memory blocks in the first memory block table to be transferred according to the dirty page rate, and dynamically update the sorting of the memory blocks in the first memory block table to be transferred after dynamically adjusting the floating threshold. The first migration unit is configured to start from the memory block with the lowest dirty page rate in the first memory block table to be transferred, and sequentially transfer the memory blocks in the first memory block table to be transferred from the source physical machine to the destination physical machine. When transferring the memory blocks in the first memory block table to be transferred, the memory blocks with a lower dirty page rate are still transferred first. Since the memory blocks with a lower dirty page rate in the first memory block table to be transferred have a lower probability of being accessed by the source virtual machine for a write operation again compared to the memory blocks with a higher dirty page rate, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a lower probability of being moved from the first memory block table to be transferred to the second memory block table compared to the memory blocks with a higher dirty page rate, thereby further reducing the frequency of repeatedly transferring the hot memory blocks with a high dirty page rate during the virtual machine iterative memory block sending stage.

[0021] In a specific embodiment, the migration module further includes: a second sorting unit and a second migration unit. Among them, the second sorting unit is configured to sort the memory blocks in the second memory block table to be transferred according to the dirty page rate, and dynamically update the sorting of the memory blocks in the second memory block table to be transferred after dynamically adjusting the floating threshold. The second migration unit is configured to start from the memory block with the lowest dirty page rate in the second memory block table to be transferred when there are no memory blocks in the first memory block table to be transferred, and sequentially transfer the memory blocks in the second memory block table to be transferred from the source physical machine to the destination physical machine. When transferring the memory blocks in the second memory block table to be transferred, the memory blocks with a lower dirty page rate are still transferred first. Since the memory blocks with a lower dirty page rate in the second memory block table to be transferred have a lower probability of being accessed by the source virtual machine for a write operation again compared to the memory blocks with a higher dirty page rate, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a higher probability of being moved from the second memory block table to be transferred to the first memory block table compared to the memory blocks with a higher dirty page rate, thereby further reducing the frequency of repeatedly transferring the hot memory blocks with a high dirty page rate during the virtual machine iterative memory block sending stage.

[0022] In a specific embodiment, the monitoring module is further configured to monitor in real time the total data volume of the remaining memory blocks that have not been transferred in the source virtual machine. The virtual machine live migration device further includes a merging module, which is configured to merge the first memory block table to be transferred and the second memory block table to be transferred into a third memory block table to be transferred when the total data volume of the remaining memory blocks that have not been transferred is less than a preset threshold. The migration module is further configured to transfer the memory blocks in the third memory block table to be transferred from the source physical machine to the destination physical machine. When the total data volume of the remaining memory blocks that have not been transferred is relatively low, it indicates that most of the memory blocks of the source virtual machine have been transferred. Then, the update of the floating threshold, the first memory block table to be transferred, and the second memory block table to be transferred can be stopped, and the remaining memory blocks can be transferred to the destination physical machine together, dynamically balancing between the monitoring calculation amount and the migration efficiency, improving the live migration efficiency, and reducing the monitoring calculation amount at the same time.

[0023] In a third aspect, the present invention further provides a virtual machine live migration system, which includes: a source physical machine, a destination physical machine, and any one of the above virtual machine live migration devices, wherein a source virtual machine to be migrated is running on the source physical machine. Description of the Drawings

[0024] Figure 1 It is a flowchart of a virtual machine live migration method provided by an embodiment of the present invention;

[0025] Figure 2 It is a schematic block diagram of a virtual machine system provided by an embodiment of the present invention;

[0026] Figure 3 It is a schematic block diagram of another virtual machine system provided by an embodiment of the present invention.

[0027] Reference Signs:

[0028] 11 - Monitoring Module 12 - Threshold Adjustment Module 13 - First Marking Module

[0029] 14 - Migration Module 15 - Second Marking Module 20 - Source Physical Machine

[0030] 21 - Source Virtual Machine 30 - Destination Physical Machine 31 - Destination Virtual Machine Detailed Embodiments

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to 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.

[0032] To facilitate the understanding of the virtual machine live migration method provided by the embodiments of the present invention, the application scenario of the virtual machine live migration method provided by the embodiments of the present invention will be described first below. This virtual machine live migration method is applied to the process of live migrating a source virtual machine to be migrated from a source physical machine to a destination physical machine. Among them, virtual machine live migration is mainly divided into three stages: 1. Mark all the memory in the source virtual machine to be migrated as dirty pages; 2. Continuously iterate to send the dirty pages of the source virtual machine to be migrated to the destination physical machine, and stop iterating and sending when certain conditions are met; 3. Stop the source virtual machine to be migrated, send the remaining dirty pages and device status to the destination physical machine, and activate the destination virtual machine on the destination physical machine. The virtual machine live migration method provided by this application is mainly applied to the second and third stages described above. The virtual machine live migration method will be described in detail below with reference to the accompanying drawings.

[0033] Referring to Figure 1 and Figure 2 , the virtual machine live migration method provided by the embodiments of the present invention includes:

[0034] Step10: Monitor in real time the dirty page rate of each memory block in the source virtual machine 21 to be migrated, and the network bandwidth between the source physical machine 20 and the destination physical machine 30;

[0035] Step20: Set and dynamically adjust a floating threshold according to the network bandwidth monitored in real time and the dirty page rate of each memory block;

[0036] Step30: Mark the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, and dynamically update the first memory block table to be transmitted after dynamically adjusting the floating threshold;

[0037] Step40: Transmit the memory blocks in the first memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30;

[0038] Step50: Mark the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and dynamically update the second memory block table to be transmitted after dynamically adjusting the floating threshold;

[0039] Step60: When there are no memory blocks in the first memory block table to be transmitted, transmit the memory blocks in the second memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30.

[0040] In the above solution, by monitoring the dirty page rate of each memory block in the source virtual machine 21 and the network bandwidth in real time, the floating threshold is dynamically adjusted. Memory blocks with a dirty page rate less than the floating threshold are marked to form the first memory block table to be transferred, and memory blocks with a dirty page rate greater than or equal to the floating threshold are marked to form the second memory block table to be transferred. After the floating threshold is adjusted, the first memory block table to be transferred and the second memory block table to be transferred are updated in real time. In this process, the memory blocks in the first memory block table to be transferred are first transferred from the source physical machine 20 to the destination physical machine 30, and when there are no memory blocks in the first memory block table to be transferred, the memory blocks in the second memory block table to be transferred are transferred from the source physical machine 20 to the destination physical machine 30. Compared with the prior art, the present application updates the floating threshold in real time and dynamically, and divides it into the first memory block table to be transferred and the second memory block table to be transferred. First, the memory blocks in the first memory block table to be transferred, which are currently non-hot, are transferred, and then the memory blocks in the second memory block table to be transferred, which are currently in the hot state, are transferred. It can control the migration timing of hot memory, reduce the frequency of repeatedly iteratively sending hot memory blocks with a high dirty page rate during the virtual machine iterative memory block sending stage, reduce the hot migration time, and improve the hot migration speed to enhance the customer experience. The following will introduce each of the above steps in detail with reference to the accompanying drawings.

[0041] First, refer to Figure 1 and Figure 3 , and monitor the dirty page rate of each memory block in the source virtual machine 21 to be migrated and the network bandwidth between the source physical machine 20 and the destination physical machine 30 in real time. When specifically monitoring, the dirty page rate of each memory block in the source virtual machine 21 and the network bandwidth between the source physical machine 20 and the destination physical machine 30 can be detected at regular intervals. The specific time interval length can be 1 second, 5 seconds, 10 seconds, 20 seconds, etc. Among them, the detected dirty page rate of each memory block can represent the newly added dirty page amount in each memory block. The larger the dirty page rate, the higher the frequency of access and writing to this memory block by the source virtual machine 21, and the more likely it is to be a hot memory block; conversely, the smaller the dirty page rate, the lower the frequency of access and writing to this memory block by the source virtual machine 21, and the more likely it is to be a non-hot memory block.

[0042] When specifically monitoring the dirty page rate of each memory block, a counter can be added to each memory block. Each time the source virtual machine 21 performs a write access to this memory block, 1 is added to the counter, which represents the increase in the number of write access operations to this memory block by the source virtual machine 21. Combining the monitored time interval, the dirty page rate of each memory block is obtained. As Figure 3As shown in the figure, the monitoring of the source virtual machine 21 and the dirty page change rate of the memory block can be implemented through a virtual machine operating system simulator (QEMU). A thread can be created on the virtual machine operating system simulator, and this thread can be called the dirty page evaluation thread. The dirty page evaluation thread notifies the virtual machine monitor to start tracking the write access operations of the source virtual machine 21 to the memory block through the interface provided by the virtual machine monitor (Kvm). The dirty page evaluation thread can obtain the dirty page situation of the memory block of the source virtual machine 21 through the interface provided by the virtual machine monitor at regular intervals. If a memory block has been written by the source virtual machine 21 once, the counter corresponding to this memory block is incremented by 1.

[0043] Next, as Figure 1 shown in the figure, according to the real-time monitored network bandwidth and the dirty page rate of each memory block, the floating threshold is set and dynamically adjusted. Specifically, initially, an initial floating threshold is set according to the monitored network bandwidth and the dirty page rate of each memory block; then, after each detection of the change in the network bandwidth and the change in the dirty page rate of each memory block, that is, according to the newly detected network bandwidth and the dirty page rate of each memory block, the size of the floating threshold is dynamically readjusted. The specific adjustment method can be to increase the floating threshold or decrease the floating threshold.

[0044] When setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block, the maximum amount of data that can be transmitted at one time can be calculated first according to the real-time monitored network bandwidth; then, according to the maximum amount of data and the dirty page rate of each memory block, the floating threshold is set and dynamically adjusted. This is convenient for accurately determining and adjusting the size of the floating threshold in a quantitative manner. It should be understood that the method of dynamically adjusting the floating threshold can also adopt other methods in addition to the method shown above.

[0045] In addition, during the process of setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block, it is possible to monitor whether the bandwidth change rate of the network bandwidth reaches a certain level, so as to decide whether to keep the floating threshold unchanged or adjust the floating threshold. Specifically, the bandwidth change rate of the network bandwidth can be calculated based on the real-time monitored network bandwidth. Then, it is judged whether the bandwidth change rate is greater than the bandwidth mutation threshold. If the bandwidth change rate is not greater than the bandwidth mutation threshold, the floating threshold remains unchanged. If the bandwidth change rate is greater than the bandwidth mutation threshold, the floating threshold is adjusted. Only when the bandwidth change rate of the network bandwidth is greater than the bandwidth mutation threshold, the mechanism for adjusting the floating threshold is started, which can optimize the mechanism for adjusting the floating threshold, so that when it is necessary to adjust the floating threshold, the floating threshold can be adjusted in time, improving the timeliness and accuracy of the floating threshold adjustment. It should be noted that the size of the above-mentioned bandwidth mutation threshold can be determined according to the specific application scenario, combined with the empirical values accumulated in the historical application process or the test values obtained through pre-testing.

[0046] Of course, when deciding whether to keep the floating threshold unchanged or adjust the floating threshold, in addition to being related to the bandwidth change rate of the network bandwidth, other methods can also be adopted. For example, it can also be decided according to the change rate of the dirty page rate of the memory block. When the change rate of the dirty page rate reaches a certain level, it is decided whether to keep the floating threshold unchanged or adjust the floating threshold. Specifically, the change rate of the dirty page rate of each memory block can be calculated first based on the real-time monitored dirty page rate of each memory block. Then, it is judged whether there is a change rate of the dirty page rate of a memory block greater than the dirty page change rate mutation threshold. If there is no change rate of the dirty page rate of a memory block greater than the dirty page change rate mutation threshold, the floating threshold remains unchanged. If there is a change rate of the dirty page rate of a memory block greater than the dirty page change rate mutation threshold, the floating threshold is adjusted. As long as there is a change rate of the dirty page rate of a memory block greater than the dirty page change rate mutation threshold, it means that this memory block may need to be moved between the first memory block table to be transmitted and the second memory block table to be transmitted, so as to adjust the floating threshold in time, move the memory block with the change rate of the dirty page rate greater than the dirty page change rate mutation threshold between the first memory block table to be transmitted and the second memory block table to be transmitted, and improve the timeliness and accuracy of the floating threshold adjustment. It should be noted that the size of the above-mentioned dirty page change rate mutation threshold can be specifically determined by combining various factors such as the specific type of virtual machine processing transactions, the parameters of the server running the virtual machine, the empirical values accumulated in the historical application process, or the test values obtained through pre-testing.

[0047] Exemplarily, in other ways, it is also possible to decide to adjust the floating threshold only when the number of memory blocks with the dirty page rate change rate reaching a certain level reaches a relatively large number; when the number of memory blocks with the dirty page rate change rate reaching a certain level does not reach a relatively large number, the floating threshold remains unchanged. Specifically, first, according to the dirty page rate of each memory block monitored in real time, calculate the dirty page rate change rate of each memory block. Then, count the number of memory blocks with the dirty page rate change rate greater than the dirty page rate mutation threshold. Next, determine whether the number of memory blocks is greater than the threshold number. If the number of memory blocks is not greater than the threshold number, the floating threshold remains unchanged. If the number of memory blocks is greater than the threshold number, the floating threshold is adjusted. Only when the number of memory blocks with the dirty page rate change rate greater than the dirty page rate mutation threshold is greater than the threshold number, the floating threshold is adjusted, reducing the number of times of adjusting the floating threshold. It should be noted that the size of the above threshold number can be specifically determined by combining various factors such as the specific type of transactions processed by the virtual machine, the parameters of the server running the virtual machine, the total number of memory blocks configured for the virtual machine, the empirical values accumulated in the historical application process, or the test values obtained through pre-testing of the experience.

[0048] It should be noted that during the process of dynamically adjusting the floating threshold, in addition to the methods shown above, other methods can also be used to determine whether to start the mechanism for adjusting the floating threshold. For example, a mechanism for periodically adjusting the floating threshold can also be adopted, that is, adjusting the floating threshold once every certain period of time. Among them, the time intervals between two adjacent adjustments of the floating threshold can be equal or unequal. When the time intervals between two adjacent adjustments of the floating threshold are unequal, a time node table for adjusting the floating threshold can be preset, and the floating threshold is adjusted according to the time node table.

[0049] Next, refer to Figure 1, mark the memory blocks with a dirty page rate less than the floating threshold to form the first memory block table to be transferred, and dynamically update the first memory block table to be transferred after dynamically adjusting the floating threshold. Specifically, after initially determining the size of the floating threshold, mark the memory blocks with a dirty page rate less than the floating threshold according to the floating threshold, and form the first memory block table to be transferred from the marked memory blocks with a dirty page rate less than the floating threshold. After each subsequent dynamic adjustment of the size of the floating threshold, dynamically update the first memory block table to be transferred according to the adjusted size of the floating threshold. The specific update method can be that after the floating threshold is increased, some memory blocks not in the first memory block table to be transferred may need to be added to the first memory block table to be transferred to expand the first memory block table to be transferred; after the floating threshold is decreased, some memory blocks in the first memory block table to be transferred may need to be deleted from the first memory block table to be transferred to shrink the first memory block table to be transferred. It should be noted that after the next adjustment of the floating threshold, during the process of updating the first memory block table to be transferred, if some memory blocks in the first memory block table to be transferred have completed the transfer, when deleting the memory blocks in the first memory block table to be transferred from the first memory block table to be transferred, the memory blocks that have completed the transfer can be ignored.

[0050] Next, as Figure 1 shown, transfer the memory blocks in the first memory block table to be transferred from the source physical machine 20 to the destination physical machine 30. After determining the first memory block table to be transferred, start transferring the memory blocks in the first memory block table to be transferred to the destination physical machine 30 in sequence according to the memory block list in the first memory block table to be transferred. After a memory block in the first memory block table to be transferred has completed the transfer, immediately delete the memory block that has completed the transfer from the first memory block table to be transferred to ensure that all memory blocks in the first memory block table to be transferred are memory blocks that have not completed the transfer and need to be transferred.

[0051] When transferring the memory blocks in the first memory block table to be transferred from the source physical machine 20 to the destination physical machine 30, multiple methods can be adopted. Exemplarily, in one transfer method, the memory blocks in the first memory block table to be transferred can be sorted according to the dirty page rate first, and after dynamically adjusting the floating threshold, the sorting of the memory blocks in the first memory block table to be transferred can be dynamically updated. Then, starting from the memory block with the lowest dirty page rate in the first memory block table to be transferred, the memory blocks in the first memory block to be transferred are sequentially transferred from the source physical machine 20 to the destination physical machine 30. When transferring the memory blocks in the first memory block table to be transferred, the memory blocks with a lower dirty page rate are still transferred first. Since the memory blocks with a lower dirty page rate in the first memory block table to be transferred have a lower probability of being accessed by the source virtual machine 21 for a write operation again compared to the memory blocks with a higher dirty page rate, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a lower probability of being moved from the first memory block table to be transferred to the second memory block table to be transferred compared to the memory blocks with a higher dirty page rate. Thus, it is possible to further reduce the frequency of repeatedly iteratively sending the hot memory blocks with a high dirty page rate during the virtual machine iterative memory block sending stage.

[0052] Next, as Figure 1As shown, the memory blocks with the dirty page rate greater than or equal to the floating threshold form the second memory block table to be transferred, and after dynamically adjusting the floating threshold, the second memory block table to be transferred is dynamically updated. Specifically, after initially determining the size of the floating threshold, the memory blocks with the dirty page rate greater than or equal to the floating threshold are marked according to the floating threshold, and the second memory block table to be transferred is composed of the marked memory blocks with the dirty page rate greater than or equal to the floating threshold. After each subsequent dynamic adjustment of the size of the floating threshold, the second memory block table to be transferred is dynamically updated according to the adjusted size of the floating threshold. The specific update method can be that after the floating threshold is reduced, some memory blocks not in the second memory block table to be transferred may need to be added to the second memory block table to be transferred to expand the second memory block table to be transferred; after the floating threshold is increased, some memory blocks in the second memory block table to be transferred may need to be deleted from the second memory block table to be transferred to reduce the second memory block table to be transferred. It can be seen that after the floating threshold is reduced, some memory blocks in the first memory block table to be transferred may need to be moved from the first memory block table to the second memory block table to be transferred; after the floating threshold is increased, some memory blocks in the second memory block table to be transferred may need to be moved from the second memory block table to the first memory block table to be transferred. It should be explained that after the next adjustment of the floating threshold, during the process of updating the second memory block table to be transferred, if some memory blocks in the second memory block table to be transferred have completed the transfer, then when some memory blocks in the second memory block table to be transferred need to be deleted from the second memory block table to be transferred, the memory blocks that have completed the transfer can be ignored. However, since the priority of the second memory block table to be transferred is lower than that of the first memory block table to be transferred, the situation where some memory blocks in the second memory block table to be transferred have completed the transfer but there are still memory blocks in the first memory block table is less likely, and it may only exist in a short moment when there are fewer memory blocks in the first memory block table to be transferred, and at this time the network bandwidth is large, and during the short moment when the first memory block table to be transferred is not updated, some memory blocks in the second memory block table to be transferred are transferred out.

[0053] Next, as Figure 1As shown, when there is no memory block in the first memory block table to be transmitted, the memory blocks in the second memory block table to be transmitted are transmitted from the source physical machine 20 to the destination physical machine 30. That is, the priority of the second memory block table to be transmitted is lower than that of the first memory block table to be transmitted. When there are still memory blocks in the first memory block table to be transmitted that have not been completed, the memory blocks in the first memory block table to be transmitted are preferentially transmitted. Only when all the memory blocks in the first memory block table to be transmitted have been completely transmitted, the memory blocks in the second memory block table to be transmitted are started to be transmitted. Since the first memory block table to be transmitted and the second memory block table to be transmitted need to be updated after each update of the floating threshold, in the case where the network bandwidth suddenly increases at a certain moment, after all the memory blocks in the first memory block table to be transmitted at this time are transmitted, there may still be a little time left to allow some memory blocks in the second memory block table to be transmitted.

[0054] When there is no memory block in the first memory block table to be transmitted, specifically when transmitting the memory blocks in the second memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30, various methods can be adopted. Exemplarily, in one method, the memory blocks in the second memory block table to be transmitted can be sorted according to the dirty page rate first, and after dynamically adjusting the floating threshold, the sorting of the memory blocks in the second memory block table to be transmitted is dynamically updated. Then, when there is no memory block in the first memory block table to be transmitted, starting from the memory block with the lowest dirty page rate in the second memory block table, the memory blocks in the second memory block to be transmitted are sequentially transmitted from the source physical machine 20 to the destination physical machine 30. When transmitting the memory blocks in the second memory block table to be transmitted, the memory blocks with a lower dirty page rate are still transmitted first. Since the memory blocks with a lower dirty page rate in the second memory block table to be transmitted have a lower probability of being accessed by the source virtual machine 21 for a write operation again compared to the memory blocks with a higher dirty page rate, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a higher probability of being moved from the second memory block table to be transmitted to the first memory block table compared to the memory blocks with a higher dirty page rate, thus further reducing the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate in the virtual machine iterative memory block sending stage.

[0055] It should be noted that Figure 1 Among the various steps in, due to the need to monitor the network bandwidth and the dirty page rate of the memory blocks in real time, and also due to the need to dynamically adjust the floating threshold and update the first memory block table to be transmitted and the second memory block table to be transmitted, so Figure 1 the execution order among the various steps in is not strictly as Figure 1Rather than the execution order presented, it is at a short moment after each dynamic adjustment of the floating threshold and the update of the first memory block table to be transmitted and the second memory block table to be transmitted that the steps are generally as described above. It is generally divided into the steps of real-time monitoring, the steps of updating the floating threshold, the first memory block table to be transmitted and the second memory block table to be transmitted, and the steps of transmitting memory blocks according to the first memory block table to be transmitted. After the memory blocks in the first memory block table to be transmitted are completed, the step of transmitting the first memory block table to be transmitted.

[0056] In addition, the virtual machine live migration method may further include: real-time monitoring of the total data volume of the remaining memory blocks not transmitted in the source virtual machine 21; when the total data volume of the remaining memory blocks not transmitted is less than a preset threshold, merging the first memory block table to be transmitted and the second memory block table to be transmitted into a third memory block table to be transmitted; transmitting the memory blocks in the third memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. When the total data volume of the remaining memory blocks not transmitted is relatively low, it indicates that most of the memory blocks of the source virtual machine 21 have been transmitted. Then, the update of the floating threshold, the first memory block table to be transmitted and the second memory block table to be transmitted can be stopped, and the remaining memory blocks can be transmitted to the destination physical machine 30 together, dynamically balancing between the monitoring calculation amount and the migration efficiency, improving the live migration efficiency, and reducing the monitoring calculation amount at the same time. Refer to Figure 2 and Figure 3 , after the destination physical machine 30 receives all the dirty pages and device states of the source virtual machine 21, stop the source virtual machine 21 and activate the destination virtual machine 31 to complete the live migration.

[0057] In each of the above-described embodiments, by real-time monitoring the dirty page rate of each memory block and the network bandwidth in the source virtual machine 21, dynamically adjusting the floating threshold, marking the memory blocks with a dirty page rate less than the floating threshold to form the first memory block table to be transmitted, marking the memory blocks with a dirty page rate greater than or equal to the floating threshold to form the second memory block table to be transmitted, and real-time updating the first memory block table to be transmitted and the second memory block table to be transmitted after the floating threshold is adjusted; during this process, first transmit the memory blocks in the first memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30, and when there are no memory blocks in the first memory block table to be transmitted, transmit the memory blocks in the second memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. Compared with the prior art, the present application updates the floating threshold in real time and dynamically, divides it into the first memory block table to be transmitted and the second memory block table to be transmitted, first transmits the memory blocks in the first memory block table to be transmitted that are currently not hot, and then transmits the memory blocks in the second memory block table to be transmitted that are currently in the hot state. It can control the migration timing of hot memory, reduce the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate during the virtual machine iterative transmission of memory blocks stage, reduce the live migration time, and improve the live migration speed to enhance the customer experience.

[0058] In addition, an embodiment of the present invention further provides a virtual machine live migration device. Refer to Figure 1 and Figure 2 , the virtual machine live migration device includes: a monitoring module 11, a threshold adjustment module 12, a first marking module 13, a migration module 14, and a second marking module 15. Among them, the monitoring module 11 is used to monitor in real time the dirty page rate of each memory block in the source virtual machine 21 to be migrated, and the network bandwidth between the source physical machine 20 and the destination physical machine 30. The threshold adjustment module 12 is used to set and dynamically adjust a floating threshold according to the network bandwidth and the dirty page rate of each memory block monitored in real time. The first marking module 13 is used to mark the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, and dynamically update the first memory block table to be transmitted after dynamically adjusting the floating threshold. The migration module 14 is used to transmit the memory blocks in the first memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. The second marking module 15 is used to mark the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and dynamically update the second memory block table to be transmitted after dynamically adjusting the floating threshold. The migration module 14 is further used to transmit the memory blocks in the second memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30 when there are no memory blocks in the first memory block table to be transmitted.

[0059] By monitoring in real time the dirty page rate of each memory block in the source virtual machine 21 and the network bandwidth, dynamically adjusting the floating threshold, marking the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, marking the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and updating the first memory block table to be transmitted and the second memory block table to be transmitted in real time after the floating threshold is adjusted; in this process, first transmit the memory blocks in the first memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30, and when there are no memory blocks in the first memory block table to be transmitted, transmit the memory blocks in the second memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. Compared with the prior art, the present application updates the floating threshold in real time dynamically, divides it into a first memory block table to be transmitted and a second memory block table to be transmitted, first transmits the memory blocks in the first memory block table to be transmitted that are currently not hot, and then transmits the memory blocks in the second memory block table to be transmitted that are currently in the hot state. It can control the migration timing of hot memory, reduce the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate in multiple iterations during the virtual machine iterative memory block sending stage, reduce the live migration time, and improve the live migration speed to enhance the customer experience.

[0060] Among them, the above-mentioned threshold adjustment module 12 may include: a calculation module and a determination module. The calculation module is used to calculate the maximum amount of data that can be transmitted at one time according to the real-time monitored network bandwidth; the determination module is used to set and dynamically adjust the floating threshold according to the maximum amount of data and the dirty page rate of each memory block. It is convenient to accurately determine and adjust the size of the floating threshold in a quantitative manner.

[0061] In other ways, the threshold adjustment module 12 may further include: a calculation module, a judgment module, and a determination module. Among them, the calculation module is used to calculate the bandwidth change rate of the network bandwidth according to the real-time monitored network bandwidth. The judgment module is used to judge whether the bandwidth change rate is greater than the bandwidth mutation threshold. The determination module is used to keep the floating threshold unchanged when the bandwidth change rate is not greater than the bandwidth mutation threshold; the determination module is also used to adjust the floating threshold when the bandwidth change rate is greater than the bandwidth mutation threshold. When the bandwidth change rate of the network bandwidth is greater than the bandwidth mutation threshold, the mechanism for adjusting the floating threshold is started, which can optimize the mechanism for adjusting the floating threshold, so that when it is necessary to adjust the floating threshold, the floating threshold can be adjusted in time, improving the timeliness and accuracy of the floating threshold adjustment.

[0062] In other ways, the threshold adjustment module 12 may further include: a calculation module, a judgment module, and a determination module. Among them, the calculation module is used to calculate the dirty page rate change rate of each memory block according to the real-time monitored dirty page rate of each memory block. The judgment module is used to judge whether there is a dirty page rate change rate of a memory block greater than the dirty page change rate mutation threshold. The determination module is used to keep the floating threshold unchanged when the judgment result of the judgment module is that there is no dirty page rate change rate of a memory block greater than the dirty page change rate mutation threshold; the determination module is also used to adjust the floating threshold when the dirty page rate change rate of a memory block is greater than the dirty page change rate mutation threshold. As long as there is a dirty page rate change rate of a memory block greater than the dirty page change rate mutation threshold, it means that the memory block may need to be moved between the first memory block table to be transmitted and the second memory block table to be transmitted, so as to adjust the floating threshold in time, move the memory block with the dirty page rate change rate greater than the dirty page change rate mutation threshold between the first memory block table to be transmitted and the second memory block table to be transmitted, and improve the timeliness and accuracy of the floating threshold adjustment.

[0063] In other ways, the threshold adjustment module 12 may further include: a calculation module, a statistics module, a judgment module, and a determination module. Among them, the calculation module is used to calculate the change rate of the dirty page rate of each memory block according to the dirty page rate of each memory block monitored in real time. The statistics module is used to count the number of memory blocks whose dirty page rate change rate is greater than the dirty page change rate mutation threshold. The judgment module is used to judge whether the number of memory blocks is greater than the threshold number. The determination module is used to keep the floating threshold unchanged when the number of memory blocks is not greater than the threshold number; the determination module is also used to adjust the floating threshold when the number of memory blocks is greater than the threshold number. Only when the number of memory blocks whose dirty page rate change rate is greater than the dirty page change rate mutation threshold is greater than the threshold number, the floating threshold is adjusted to reduce the number of times of adjusting the floating threshold.

[0064] The above-mentioned migration module 14 may include: a first sorting unit and a first migration unit. The first sorting unit is used to sort the memory blocks in the first memory block table to be transmitted according to the dirty page rate size, and dynamically update the sorting of the memory blocks in the first memory block table to be transmitted after dynamically adjusting the floating threshold. The first migration unit is used to start from the memory block with the lowest dirty page rate in the first memory block table to be transmitted, and sequentially transmit the memory blocks in the first memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. When transmitting the memory blocks in the first memory block table to be transmitted, the memory blocks with a lower dirty page rate are still transmitted first. Since the memory blocks with a lower dirty page rate in the first memory block table to be transmitted have a lower probability of being accessed by the source virtual machine 21 again in a write operation, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a lower probability of being moved from the first memory block table to be transmitted to the second memory block table compared to the memory blocks with a higher dirty page rate. Therefore, the frequency of repeatedly transmitting the hot memory blocks with a high dirty page rate in the virtual machine iterative memory block sending stage can be further reduced.

[0065] The above-mentioned migration module 14 may further include: a second sorting unit and a second migration unit. Among them, the second sorting unit is used to sort the memory blocks in the second memory block table to be transmitted according to the dirty page rate, and dynamically update the sorting of the memory blocks in the second memory block table to be transmitted after dynamically adjusting the floating threshold. The second migration unit is used to start from the memory block with the lowest dirty page rate in the second memory block table to be transmitted when there is no memory block in the first memory block table to be transmitted, and sequentially transmit the memory blocks in the second memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. When transmitting the memory blocks in the second memory block table to be transmitted, the memory blocks with a lower dirty page rate are still transmitted first. Since the memory blocks with a lower dirty page rate in the second memory block table to be transmitted have a lower probability of being accessed by the source virtual machine 21 for a write operation again, that is, after the next update of the floating threshold, the memory blocks with a lower dirty page rate have a higher probability of being moved from the second memory block table to be transmitted to the first memory block table compared to the memory blocks with a higher dirty page rate, so as to further reduce the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate in the virtual machine iterative memory block sending stage.

[0066] The above-mentioned monitoring module 11 is also used to monitor in real time the total data volume of the remaining memory blocks not transmitted in the source virtual machine 21. At this time, as Figure 3 shown, the virtual machine hot migration device may further include a merging module. The merging module is used to merge the first memory block table to be transmitted and the second memory block table to be transmitted into a third memory block table to be transmitted when the total data volume of the remaining memory blocks not transmitted is less than a preset threshold. The migration module 14 is also used to transmit the memory blocks in the third memory block table to be transmitted from the source physical machine 20 to the destination physical machine 30. When the total data volume of the remaining memory blocks not transmitted is relatively low, it indicates that most of the memory blocks of the source virtual machine 21 have been transmitted. Then, the update of the floating threshold, the first memory block table to be transmitted, and the second memory block table to be transmitted can be stopped, and the remaining memory blocks can be transmitted to the destination physical machine 30 together, dynamically balancing between the monitoring calculation amount and the migration efficiency, improving the efficiency of hot migration, and reducing the monitoring calculation amount at the same time.

[0067] It should be explained that any one of the monitoring module 11, the threshold adjustment module 12, the first marking module 13, the migration module 14, the second marking module 15, and the merging module is a functional module, which not only includes the software code for executing the corresponding steps, but also includes the storage medium for storing the corresponding software code, and the logical operation medium for reading, writing, and running the corresponding software code.

[0068] In addition, the embodiment of the present invention also provides a virtual machine hot migration system. Refer to Figure 1 and Figure 3, the virtual machine live migration system includes: a source physical machine 20, a destination physical machine 30, and any one of the above virtual machine live migration devices. Among them, a source virtual machine 21 to be migrated is running on the source physical machine 20. By monitoring the dirty page rate of each memory block in the source virtual machine 21 and the network bandwidth in real time, the floating threshold is dynamically adjusted. Memory blocks with a dirty page rate less than the floating threshold are marked to form a first memory block table to be transmitted, and memory blocks with a dirty page rate greater than or equal to the floating threshold are marked to form a second memory block table to be transmitted. After the floating threshold is adjusted, the first memory block table to be transmitted and the second memory block table to be transmitted are updated in real time; during this process, the memory blocks in the first memory block table to be transmitted are first transferred from the source physical machine 20 to the destination physical machine 30, and when there are no memory blocks in the first memory block table to be transmitted, the memory blocks in the second memory block table to be transmitted are transferred from the source physical machine 20 to the destination physical machine 30. Compared with the prior art, the present application updates the floating threshold in real time and dynamically, and divides it into a first memory block table to be transmitted and a second memory block table to be transmitted. First, the memory blocks in the first memory block table to be transmitted, which are currently not hot, are transmitted, and then the memory blocks in the second memory block table to be transmitted, which are currently in the hot state, are transmitted. It can control the migration timing of hot memory, reduce the frequency of repeatedly transmitting hot memory blocks with a high dirty page rate during the iterative transmission of memory blocks in the virtual machine, reduce the live migration time, and improve the live migration speed to enhance the customer experience.

[0069] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for hot migration of virtual machines, characterized in that, Including: Real-time monitoring of the dirty page rate of each memory block in the source virtual machine to be migrated, as well as the network bandwidth between the source physical machine and the destination physical machine; Setting and dynamically adjusting a floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block; Marking the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transmitted, and dynamically updating the first memory block table to be transmitted after dynamically adjusting the floating threshold; Transmitting the memory blocks in the first memory block table to be transmitted from the source physical machine to the destination physical machine; Marking the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transmitted, and dynamically updating the second memory block table to be transmitted after dynamically adjusting the floating threshold; When there are no memory blocks in the first memory block table to be transmitted, transmitting the memory blocks in the second memory block table to be transmitted from the source physical machine to the destination physical machine.

2. The virtual machine hot migration method according to claim 1, wherein The setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block includes: Calculating the maximum amount of data that can be transmitted at one time according to the real-time monitored network bandwidth; Setting and dynamically adjusting the floating threshold according to the maximum amount of data and the dirty page rate of each memory block.

3. The virtual machine hot migration method according to claim 1, characterized in that, The setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block includes: Calculating the bandwidth change rate of the network bandwidth according to the real-time monitored network bandwidth; Judging whether the bandwidth change rate is greater than a bandwidth mutation threshold; If the bandwidth change rate is not greater than the bandwidth mutation threshold, keeping the floating threshold unchanged; If the bandwidth change rate is greater than the bandwidth mutation threshold, adjusting the floating threshold.

4. The virtual machine hot migration method according to claim 1, characterized in that, The setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block includes: Calculating the dirty page rate change rate of each memory block according to the real-time monitored dirty page rate of each memory block; Judging whether there is a dirty page rate change rate of a memory block greater than a dirty page change rate mutation threshold; If there is no dirty page rate change rate of a memory block greater than the dirty page change rate mutation threshold, keeping the floating threshold unchanged; If there is a dirty page rate change rate of a memory block greater than the dirty page change rate mutation threshold, adjusting the floating threshold.

5. The virtual machine hot migration method according to claim 1, wherein The setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block includes: Calculating the dirty page rate change rate of each memory block according to the real-time monitored dirty page rate of each memory block; Counting the number of memory blocks with a dirty page rate change rate greater than the dirty page change rate mutation threshold; Judging whether the number of memory blocks is greater than a threshold number; If the number of memory blocks is not greater than the threshold number, keeping the floating threshold unchanged; If the number of memory blocks is greater than the threshold number, adjusting the floating threshold.

6. The virtual machine hot migration method according to claim 1, wherein The transmitting the memory blocks in the first memory block table to be transmitted from the source physical machine to the destination physical machine includes: Sort the memory blocks in the first memory block table to be transferred according to the dirty page rate, and dynamically update the sorting of the memory blocks in the first memory block table to be transferred after dynamically adjusting the floating threshold; Starting from the memory block with the smallest dirty page rate in the first memory block table to be transferred, sequentially transfer the memory blocks in the first memory block to be transferred from the source physical machine to the destination physical machine.

7. The virtual machine hot migration method according to claim 1, wherein When there are no memory blocks in the first memory block table to be transferred, transferring the memory blocks in the second memory block table to be transferred from the source physical machine to the destination physical machine includes: Sort the memory blocks in the second memory block table to be transferred according to the dirty page rate, and dynamically update the sorting of the memory blocks in the second memory block table to be transferred after dynamically adjusting the floating threshold; When there are no memory blocks in the first memory block table to be transferred, starting from the memory block with the smallest dirty page rate in the second memory block table to be transferred, sequentially transfer the memory blocks in the second memory block to be transferred from the source physical machine to the destination physical machine.

8. The virtual machine hot migration method according to claim 1, characterized in that, Further includes: Real-time monitor the total data volume of the remaining memory blocks to be transferred in the source virtual machine; When the total data volume of the remaining memory blocks to be transferred is less than a preset threshold, merge the first memory block table to be transferred and the second memory block table to be transferred into a third memory block table to be transferred; Transfer the memory blocks in the third memory block table to be transferred from the source physical machine to the destination physical machine.

9. A virtual machine live migration device, characterized in that Includes: A monitoring module for real-time monitoring the dirty page rate of each memory block in the source virtual machine to be migrated and the network bandwidth between the source physical machine and the destination physical machine; A threshold adjustment module for setting and dynamically adjusting the floating threshold according to the real-time monitored network bandwidth and the dirty page rate of each memory block; A first marking module for marking the memory blocks with a dirty page rate less than the floating threshold to form a first memory block table to be transferred, and dynamically updating the first memory block table to be transferred after dynamically adjusting the floating threshold; A migration module for transferring the memory blocks in the first memory block table to be transferred from the source physical machine to the destination physical machine; A second marking module for marking the memory blocks with a dirty page rate greater than or equal to the floating threshold to form a second memory block table to be transferred, and dynamically updating the second memory block table to be transferred after dynamically adjusting the floating threshold; The migration module is further configured to transfer the memory blocks in the second memory block table to be transferred from the source physical machine to the destination physical machine when there are no memory blocks in the first memory block table to be transferred.

10. The virtual machine live migration device according to claim 9, wherein, The threshold adjustment module includes: A calculation module for calculating the maximum data volume that can be transferred at one time according to the real-time monitored network bandwidth; A determination module for setting and dynamically adjusting the floating threshold according to the maximum data volume and the dirty page rate of each memory block.

11. The virtual machine hot migration device according to claim 9, characterized in that, The threshold adjustment module includes: A calculation module for calculating the bandwidth change rate of the network bandwidth according to the real-time monitored network bandwidth; A judgment module for judging whether the bandwidth change rate is greater than the bandwidth mutation threshold; A determination module, configured to keep the floating threshold unchanged when the bandwidth change rate is not greater than the bandwidth mutation threshold; and further configured to adjust the floating threshold when the bandwidth change rate is greater than the bandwidth mutation threshold.

12. The virtual machine live migration device according to claim 9, wherein, The migration module includes: A first sorting unit, configured to sort the memory blocks in the first memory block table to be transferred according to the dirty page rate, and dynamically update the sorting of the memory blocks in the first memory block table to be transferred after dynamically adjusting the floating threshold; A first migration unit, configured to sequentially transfer the memory blocks in the first memory block to be transferred from the source physical machine to the destination physical machine starting from the memory block with the smallest dirty page rate in the first memory block table to be transferred.

13. A virtual machine live migration system, characterized in that Comprising: A source physical machine and a destination physical machine; A source virtual machine to be migrated running on the source physical machine; The virtual machine live migration device according to any one of claims 9 to 12.

Citation Information

Patent Citations

  • Virtual machine thermal migration method and device, storage medium and electronic equipment

    CN111176781A

  • Techniques to select virtual machines for migration

    US20180246751A1