Method and electronic device, storage medium, program product for live migration of virtual machines
A progressive write memory management strategy for virtual machine hot migration addresses unbalanced dirty page generation, ensuring successful migration with reduced application downtime by gradually adjusting restrictions on dirty pages.
Patent Information
- Application Number
- HK42026123449
- Authority / Receiving Office
- HK · HK
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2026-05-14
- Publication Date
- 2026-07-31
AI Technical Summary
Existing virtual machine hot migration technologies face failures due to unbalanced dirty page generation rates among virtual CPUs, leading to application request timeouts and processing bottlenecks, especially during memory-intensive operations.
A progressive write memory management strategy is employed to manage dirty page generation intervals, allowing the first part to be below a minimum threshold and gradually increasing restrictions to ensure the second part meets or exceeds this threshold, thereby reducing dirty pages generated below the minimum interval.
This approach ensures successful virtual machine migration with minimal impact on application operations by smoothly transitioning from lenient to strict management, avoiding sudden restrictions on high-load CPUs and reducing application request failures.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
(19) State Intellectual Property Office (12) Invention Patent Application (10) Application Publication Number (43) Application Publication Date (21) Application Number 202411196352.9 (22) Application Date 2024.08.28 (71) Applicant Alibaba Cloud Computing Co., Ltd. Address Room 1-2-A06, Yung Valley Park, No. 1008, Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province, 310030 (72) Inventor Li Min (74) Patent Agency Beijing Bosijia Intellectual Property Agency Co., Ltd. 11415 Patent Attorney Li Wei (51) Int.Cl. G06F 9 / 455 (2018.01) (54) Invention Title: Method and Electronic Device, Storage Medium, and Program Product for Hot Migration of Virtual Machines (57) Abstract: This specification provides a method and electronic device, storage medium, and program product for hot migration of virtual machines. The method includes: in response to a hot migration request for a virtual machine, determining a minimum dirty page generation interval corresponding to the transfer speed of the hot migration; in each round of synchronization operation performed according to the hot migration request, employing a write memory management strategy to manage the write memory operation of the current round, so as to: allow the dirty page generation interval corresponding to the first part of the write memory operation to be less than the minimum dirty page generation interval, and restrict the dirty page generation interval corresponding to the second part of the write memory operation to be not less than the minimum dirty page generation interval; gradually strengthen the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round that are less than the minimum dirty page generation interval. Claims (3 pages), Description (16 pages), Drawings (7 pages), CN 121636039 A, 2026.03.10, CN 1 21 63 60 39 A. 1. A method for hot migration of a virtual machine, characterized in that it includes: responding to a hot migration request for a virtual machine, determining a minimum dirty page generation interval corresponding to the transmission speed of the hot migration; in each round of synchronization operations implemented according to the hot migration request, employing a write memory management strategy to manage the write memory operations of the current round, so as to: allow the dirty page generation interval corresponding to the first part of the write memory operations to be less than the minimum dirty page generation interval, and restrict the dirty page generation interval corresponding to the second part of the write memory operations to be not less than the minimum dirty page generation interval; gradually strengthening the restriction of dirty pages by the write memory management strategy to gradually reduce the dirty pages generated in each round at intervals less than the minimum dirty page generation interval. 2. The method according to claim 1, wherein the write memory management strategy defines management levels and the remaining number of management operations corresponding to each management level in each round; the management levels include: a first type of management level corresponding to the write memory operation of the first part, and at least one second type of management level corresponding to the write memory operation of the second part, and different management levels correspond to different dirty page generation intervals.The method of managing the write memory operation in this round using a write memory management strategy includes: for each write memory operation in this round, determining the corresponding target management level from the management levels with a remaining management count greater than 0; managing the corresponding write memory operation according to the determined target management level, and reducing the remaining management count of the target management level; the method of gradually strengthening the restriction of the write memory management strategy on dirty pages includes: reducing the initial value of the remaining management count corresponding to the first type of management level, and / or increasing the initial value of the remaining management count corresponding to the second type of management level. 3. The method according to claim 2, wherein the write memory management strategy further defines an adjustment intensity; reducing the initial value of the remaining management count corresponding to the first type of management level includes: reducing the initial value of the remaining management count corresponding to the first type of management level in each round according to the reduction amount corresponding to the adjustment intensity; increasing the initial value of the remaining management count corresponding to the second type of management level includes: increasing the initial value of the remaining management count corresponding to the second type of management level in each round according to the increase amount corresponding to the adjustment intensity. 4. The method according to claim 2, characterized in that it further includes: before the end of any round of synchronization operation, if the remaining management counts corresponding to each management level are all zero, then the remaining management counts corresponding to each management level in this round are reset based on the write memory management strategy. 5. The method according to claim 2, characterized in that the write memory management strategy defines the arrangement order of each management level in each round; the step of using the write memory management strategy to manage the write memory operation in this round includes: sequentially selecting each management level to manage the write memory operation in this round according to the arrangement order defined in the write memory management strategy; wherein, the arrangement order in the first round is consistent with the ascending arrangement order of the dirty page generation intervals corresponding to each management level; the step of gradually strengthening the restriction of the write memory management strategy on dirty pages includes: gradually adjusting the management level with a relatively larger dirty page generation interval to before the management level with a relatively smaller dirty page generation interval. 6. The method according to any one of claims 2-5, characterized in that each management level corresponds to a different duration interval, and the dirty page generation interval corresponding to each management level belongs to its corresponding duration interval; the stepwise strengthening of the write memory management strategy's restriction on dirty pages includes: gradually increasing the dirty page generation interval within its respective duration interval. Claims 1 / 3 page 2 CN 121636039 A 7. The method according to any one of claims 1-5, characterized in that the virtual machine includes multiple virtual CPUs, and the multiple virtual CPUs correspond to a unified write memory management strategy; the stepwise management of the write memory operation in this round using the write memory management strategy includes:For each of the plurality of virtual CPUs, the unified write memory management strategy is used to manage the write memory operation in this round. 8. The method according to any one of claims 1-5, wherein the virtual machine includes a plurality of virtual CPUs, each virtual CPU corresponding to an independent write memory management strategy; the management of the write memory operation in this round using the write memory management strategy includes: for each write memory operation of the virtual machine in this round, determining the corresponding virtual CPU, and further determining the write memory management strategy corresponding to the determined virtual CPU; managing the corresponding write memory operation according to the determined write memory management strategy. 9. The method according to claim 8, wherein the strictness of the write memory management strategy corresponding to each virtual CPU in limiting dirty pages is negatively correlated with the load level of the corresponding virtual CPU. 10. A system for hot migration of virtual machines, characterized in that it comprises: a source host and a target host, wherein the source host is deployed with a virtual machine and a virtualization platform instance; wherein the virtualization platform instance is configured to: determine, in response to a hot migration request for the virtual machine, a minimum dirty page generation interval corresponding to the transmission speed of the hot migration; in each round of synchronization operations implemented according to the hot migration request, employ a write memory management strategy to manage the write memory operations of the current round, so as to: allow the dirty page generation interval corresponding to the first part of the write memory operations to be less than the minimum dirty page generation interval, and restrict the dirty page generation interval corresponding to the second part of the write memory operations to be not less than the minimum dirty page generation interval; gradually strengthen the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round at a time less than the minimum dirty page generation interval. 11. The system according to claim 10, wherein the write memory management strategy defines management levels and the remaining management counts corresponding to each management level in each round; the management levels include: a first type of management level corresponding to the write memory operation of the first part, and at least one second type of management level corresponding to the write memory operation of the second part, and different management levels correspond to different dirty page generation intervals; the step of managing the write memory operation of the current round using the write memory management strategy includes: for each write memory operation of the current round, determining the corresponding target management level from the management levels with a remaining management count greater than 0; managing the corresponding write memory operation according to the determined target management level, and reducing the remaining management count of the target management level; the step of gradually strengthening the restriction of the write memory management strategy on dirty pages includes: decreasing the initial value of the remaining management count corresponding to the first type of management level, and / or increasing the initial value of the remaining management count corresponding to the second type of management level. 12. The system according to claim 11, wherein the write memory management strategy defines management levels.In each round of arrangement order; the management of write memory operations in this round using the write memory management strategy includes: sequentially selecting each management level to manage the write memory operations in this round according to the arrangement order defined in the write memory management strategy; wherein, the arrangement order of the first claim 2 / 3 pages 3 CN 121636039 A is consistent with the arrangement order of the dirty page generation intervals corresponding to each management level from smallest to largest; the gradual strengthening of the write memory management strategy's restriction on dirty pages includes: gradually adjusting the management level with a relatively larger dirty page generation interval to before the management level with a relatively smaller dirty page generation interval. 13. An electronic device, characterized in that it includes: a processor; a memory for storing processor-executable instructions; wherein, the processor implements the steps of the method as described in any one of claims 1-9 by running the executable instructions. 14. A computer-readable storage medium, characterized in that it stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in any one of claims 1-9. 15. A computer program product, characterized in that it comprises a computer program / instructions, which, when executed by a processor, implement the steps of the method as described in any one of claims 1-9. Claims 3 / 3 Page 4 CN 121636039 A Method and Electronic Device, Storage Medium, Program Product for Hot Migration of Virtual Machines Technical Field
[0001] One or more embodiments of this specification relate to the field of virtual machine technology, and more particularly to a method and electronic device, storage medium, and program product for hot migration of virtual machines. Background Art
[0002] A virtual machine (VM) is a computer system simulated by software, which can run multiple isolated instances of operating systems on the same physical host. Virtual machine technology uses a virtualization platform (such as a hypervisor) to abstract various physical resources such as CPU (Central Processing Unit), memory, and storage, so that multiple virtual machines can run on shared physical resources while remaining independent of each other. Virtual machine technology is widely used in cloud computing, server consolidation, test development, and other fields, which can improve resource utilization, simplify system management, and improve system flexibility and scalability.
[0003] In some scenarios, hot migration of virtual machines is required, allowing the virtual machine to move from the source host to the target host without stopping its operation. During hot migration, the virtual machine on the source host continues to modify data in memory, creating dirty pages. Especially when serving memory-intensive applications, the rate of dirty page generation can easily exceed the data transfer rate from the source host to the target host, leading to hot migration failure.
[0004] In related technologies, to ensure successful hot migration, the rate of dirty page generation is limited to no more than the transfer rate throughout the entire process. However, this method is a one-step, sudden limitation, especially in scenarios where there are significant load differences among multiple vCPUs (virtual CPUs) on a virtual machine. This management approach concentrates the limitations on the high-load vCPUs, causing application requests (used to request write memory operations) on the high-load vCPUs to become blocked. Consequently, a large number of application requests fail due to processing timeouts, significantly impacting application operation.
[0005] In view of the above, one or more embodiments of this specification provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of this specification, a method for hot migration of a virtual machine is proposed, comprising:
[0007] In response to a hot migration request for a virtual machine, determining a minimum dirty page generation interval corresponding to the transmission speed of the hot migration;
[0008] In each round of synchronization operation implemented according to the hot migration request, a write memory management strategy is adopted to manage the write memory operation of the current round, so as to: allow the dirty page generation interval corresponding to the first part of the write memory operation to be less than the minimum dirty page generation interval, and restrict the dirty page generation interval corresponding to the second part of the write memory operation to be not less than the minimum dirty page generation interval;
[0009] Gradually strengthen the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round at less than the minimum dirty page generation interval.
[0010] According to a second aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method as described in the first aspect by running the executable instructions. Specification 1 / 16 Page 5 CN 121636039 A
[0011] According to a third aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.
[0012] According to a fourth aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.
[0013] According to a fifth aspect of one or more embodiments of this specification, a system for hot migration of virtual machines is provided, comprising:
[0014] a source host and a target host, wherein a virtual machine and a virtualization platform instance are deployed on the source host;
[0015] wherein the virtualization platform instance is configured to:
[0016] determine, in response to a hot migration request for the virtual machine, the minimum dirty page generation interval corresponding to the transfer speed of the hot migration;
[0017] In each round of synchronization operation implemented according to the hot migration request, a write memory management strategy is adopted to manage the write memory operation of this round, so as to achieve: allowing the dirty page generation interval corresponding to the first part of the write memory operation to be less than the minimum dirty page generation interval, and restricting the dirty page generation interval corresponding to the second part of the write memory operation to be no less than the minimum dirty page generation interval;
[0018] Gradually strengthen the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round at a time less than the minimum dirty page generation interval.
[0019] As can be seen from the above embodiments, the technical solution of this specification, after determining the minimum dirty page generation interval, does not restrict the generation interval of all dirty pages of the virtual machine to be no less than the minimum dirty page generation interval in one step. Instead, it gradually approaches this goal through a progressively strengthened write memory management strategy. This process smoothly transitions from a relatively lenient management strategy to a relatively strict management strategy, without suddenly impacting the virtual machine's processing of application requests. Even if there are large load differences among multiple vCPUs in the virtual machine, it will not suddenly impose excessive restrictions on high-load vCPUs, and will not cause a large number of application requests to be blocked or timed out. Thus, while ensuring the success rate of virtual machine hot migration, it also takes into account reducing or eliminating the impact on application operation. Brief Description of the Drawings
[0020] Figure 1 is a schematic diagram of a virtual machine hot migration scenario provided by an exemplary embodiment.
[0021] Figure 2 is a flowchart of a virtual machine hot migration method provided by an exemplary embodiment.
[0022] Figure 3 is a schematic diagram of a round-by-round implementation of synchronization operation provided by an exemplary embodiment.
[0023] Figures 4a-4h are schematic diagrams of managing write memory operations provided by an exemplary embodiment.
[0024] FIG5 is a schematic diagram of the structure of a device provided in an exemplary embodiment.
[0025] FIG6 is a block diagram of a virtual machine hot migration device provided in an exemplary embodiment.
[0026] FIG7 is a schematic diagram of the architecture of a virtual machine hot migration system provided in an exemplary embodiment. Detailed Description
[0027] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0028] Virtual machine migration refers to the process of moving a virtual machine from a source host to a target host. Virtual machine migration technology, especially specification 2 / 16 pages 6 CN 121636039 A, plays an important role in the cloud computing environment, which can help realize functions such as resource optimization, load balancing, and fault recovery.At the same time, the continuity of virtual machine services is maintained. Depending on whether the virtual machine needs to be stopped during the migration process, virtual machine migration can be divided into two main types: cold migration and hot migration. Cold migration refers to the process of migrating a virtual machine from the source host to the target host while the virtual machine is stopped, which will cause the virtual machine service to be interrupted for a period of time. Therefore, in actual use, hot migration is often preferred in more scenarios. Hot migration refers to the process of migrating a virtual machine from the source host to the target host without stopping the virtual machine. Hot migration technology is very important for maintaining service continuity, as it can make the virtual machine almost uninterrupted during the migration process.
[0029] For example, as shown in Figure 1, a virtual machine VM11a is running on the source host 11. Assume that the virtual machine VM11a is configured with 4 virtual processors (vCPU0, vCPU1, vCPU2 and vCPU3) and memory 110. The virtual machine VM11a is managed by a virtualization platform instance running on the source host 11, such as the virtualization platform instance in Figure 1, which is specifically a Hypervisor instance. Assuming a hot migration of virtual machine VM11a is required, specifically migrating it from source host 11 to target host 12, this process can be performed by the aforementioned Hypervisor instance running on source host 11. To distinguish the virtual machine before and after the migration, the virtual machine on target host 12 can be labeled as VM12a. The configuration of virtual machine VM12a is the same as that of virtual machine VM11a, including four virtual processors (vCPU0', vCPU1', vCPU2', and vCPU3') and memory 120. Virtual machine VM12a is managed by the virtualization platform instance running on target host 12.
[0030] During the hot migration process, virtual machine VM11a on the source host will continue to process application requests from application A. If the application request requires a write operation to memory, it will modify the data in memory 110, forming dirty pages. The hot migration process involves continuously transferring dirty pages from memory 110 to memory 120. If the transfer rate of dirty pages is greater than their generation rate, it can be ensured that the transfer of all dirty pages will be completed after a certain period of time, thus successfully achieving the hot migration of virtual machine VM11a to virtual machine VM12a. However, especially when application A is a memory-intensive application, the generation rate of dirty pages in memory 110 may be very fast. If it exceeds the transfer rate of dirty pages, there will always be dirty pages in memory 110, and they cannot be completely transferred to memory 120, causing the hot migration to fail.
[0031] Based on the transfer rate of the hot migration of virtual machine VM11a, the minimum dirty page generation interval t that can be tolerated at this transfer rate can be calculated. That is, if the dirty page generation interval in memory 110 is not less than t, it can be ensured that the dirty page generation rate is not greater than the transfer rate, thus ensuring the successful hot migration of virtual machine VM11a; in other words, the minimum dirty page generation intervalThe interval t is the lower limit threshold for the dirty page generation interval allowed by memory 110, provided that the hot migration of virtual machine VM11a is successful. Therefore, the solution in the related technology is to propose a one-step write memory management strategy: directly limit the dirty page generation interval of virtual machine VM11a to no less than t until the hot migration is successful.
[0032] If the load of vCPU0 to vCPU3 can be kept balanced, then the above-mentioned restrictions on virtual machine VM11a in the related technology will also be applied evenly to vCPU0 to vCPU3, so the impact on the operation of application A is acceptable. However, the load between different vCPUs is often not balanced, but usually varies greatly, and the load of each vCPU will also change dynamically. Therefore, the actual scenario is: the load of some vCPUs is very high, and the load of the remaining vCPUs is very low. For example, if vCPU0 has a high load while vCPU1 to vCPU3 have a low load, then when using the above-mentioned write memory management strategy in the related technology: Since the load of vCPU1 to vCPU3 is very low, the speed at which they generate dirty pages is inherently slow, and they are minimally or not restricted at all by this solution. However, the load of vCPU0 is very high, and the speed at which it generates dirty pages is inherently fast. Therefore, the restriction of this write memory management strategy will be applied more to vCPU0, causing vCPU0 to respond drastically to the application requests of application A, which can easily cause application requests to be blocked, and consequently cause a large number of application requests to fail due to processing timeouts, which has a significant impact on the operation of application A.
[0033] More specifically, assuming that the virtual machine VM11a has a 4-core configuration as shown in Figure 1 (i.e., vCPU0 to vCPU3), and the memory configuration of the memory specification page 3 / 16 7 CN 121636039 A 110 is 16G. If four memory test tasks (such as memtest tasks) occupying 3G of memory are run on the virtual machine VM11a, then:
[0034] In case 1, if all four memtest tasks run on the same vCPU, for example, on vCPU0, i.e., vCPU0 is under high load and vCPU1-3 is under low load, after management based on the one-step write memory management strategy in the related technology, the dirty page rate (the number of dirty pages generated per second) in each round will be reduced to 25% or less of the original.
[0035] In case 2, if the four memtest tasks run on two vCPUs, for example, on vCPU0 and vCPU1, this will make the load of vCPU0-1 relatively high and the load of vCPU2-3 relatively low. For example, the load of vCPU0-1 is higher than the predefined load threshold, while the load of vCPU2-3 is lower than the predefined load threshold. After management based on the one-step write memory management strategy in the related technology, the dirty page rate in each round will be reduced to 25% or less of the original.
[0036] In case 3, if the four memtest tasks each run exclusively on a vCPU, that is, each memtest task independently occupies a vCPU, the load of vCPUs 0 to 3 is balanced. After management based on the one-step write memory management strategy in related technologies, the dirty page rate in each round is reduced to about 50% of the original, which is close to the desired effect.
[0037] Therefore, this specification proposes a new virtual machine hot migration scheme, which adopts the principle of progressive iterative approximation. Through a gradually strengthened write memory management strategy, the timing of writing memory can be controlled, so that the time interval between the generation of dirty pages by the virtual machine changes from less than the minimum dirty page generation interval mentioned above to gradually increase to not less than the minimum dirty page generation interval t, or so that the dirty pages generated by the virtual machine at a time less than the minimum dirty page generation interval t are gradually reduced, etc., thereby ensuring the success rate of virtual machine hot migration while reducing or eliminating the impact on application operation. The following will be described in detail with reference to the accompanying drawings.
[0038] Figure 2 is a flowchart of a virtual machine hot migration method provided by an exemplary embodiment. As shown in Figure 2, the method may include:
[0039] Step 202, in response to a hot migration request for a virtual machine, determining the minimum dirty page generation interval corresponding to the hot migration transfer speed.
[0040] The hot migration request is used to instruct the virtual machine to be hot migrated. The hot migration request may be initiated by the user to whom the virtual machine belongs; or, if the virtual machine is provided and maintained by, for example, a cloud computing service provider, the hot migration request may be initiated by the user to whom the virtual machine belongs, or by the relevant operation and maintenance personnel. Of course, regardless of who initiates the request, it does not affect the process of hot migration of the virtual machine based on the hot migration request in this specification.
[0041] The hot migration transfer speed may be pre-configured. For example, a specified amount of transfer bandwidth may be pre-allocated for the hot migration process of the virtual machine, and this transfer bandwidth may be used to characterize the hot migration transfer speed; or, the transfer bandwidth may be converted into other forms of transfer speed commonly used, and this specification does not limit this. Of course, the hot migration transfer speed may also be obtained by monitoring the transfer process.
[0042] Assume that the hot migration transfer speed is: data transfer volume Q per second. For a virtual machine, each memory page in its memory is of a predefined size m, for example, m is usually 4KB. Therefore, the number of memory pages transferred per second can be calculated as N = Q / m. Based on this, the minimum dirty page generation interval t corresponding to the hot migration transfer speed can be determined, for example:
[0043] t = 1 / N = m / Q
[0044] Of course, other methods can also be used to calculate the above minimum dirty page generation interval, and this specification does not limit this.
[0045] Step 204: In each round of synchronization operations implemented according to the hot migration request, a write memory management strategy is adopted to manage the write memory operations of this round, so as to achieve: allowing the dirty page generation interval corresponding to the first part of the write memory operations to be less than the minimum dirty page generation interval, and restricting the dirty page generation interval corresponding to the second part of the write memory operations to be no less than the minimum dirty page generation interval described in the specification, page 4 / 16, CN 121636039 A.
[0046] During the hot migration process, the virtual machine will continue to receive and process application requests. Application requests may need to perform write memory operations to modify the data in the virtual machine's memory. The write memory management strategy refers to the strategy for managing write memory operations. By managing write memory operations, it can control the timing of dirty pages generated in memory by write memory operations, thereby ensuring that the dirty page generation interval meets the requirements of this specification.
[0047] During the hot migration process, synchronization operations are implemented on the virtual machine round by round. Each round of synchronization operations corresponds to a time period, and each round of synchronization operations will synchronize the dirty pages generated based on write memory operations within that time period. For example, the start time of this time period can be the time when the synchronization action was performed in the previous round of synchronization operation, and the end time can be the time when the synchronization action was performed in the current round of synchronization operation. In short, the entire hot migration process is divided into multiple time periods, and a certain number of dirty pages will be accumulated in each time period and these dirty pages will be synchronized.
[0048] For example, as shown in Figure 3, a synchronization action was performed at time T0, time T1 and time T2 respectively. Among them, a time period is formed between time T0 and time T1, which can be considered to correspond to a round of synchronization operation. This round of synchronization operation realizes: accumulating dirty pages formed between time T0 and time T1, and synchronizing the accumulated dirty pages at time T1. Specifically, between time T0 and time T1, vCPU0 performed write operations on memory pages P1 and P4, while vCPU1 performed a write operation on memory page P3. Therefore, the dirty pages that need to be synchronized at time T1 include memory pages P1, P3, and P4. However, only memory page P2 was read during this period, so memory page P2 did not become a dirty page that needs to be synchronized at time T1. Similarly, the time period between time T1 and time T2 can be considered as corresponding to a round of synchronization operations. This round of synchronization operations achieves the following: accumulating the dirty pages formed between time T1 and time T2, and synchronizing the accumulated dirty pages at time T2. Specifically, between time T1 and time T2, vCPU0 performed a write operation on memory page P3, and vCPU1 performed write operations on memory pages P1 and P2. Therefore, the dirty pages that need to be synchronized at time T2 include memory pages P1, P2, and P3. However, only memory page P4 was read during this period, so memory page P4 did not become the page that needs to be synchronized at time T2.Dirty pages in each round of synchronization operation.
[0049] In each round of synchronization operation, the dirty pages managed by the write memory management strategy of this specification can be defined according to actual needs, and this specification does not limit them.
[0050] For example, the managed dirty pages can be: memory pages that have been written in the current round of synchronization operation. For example, in the embodiment shown in Figure 3, assuming that the nth round of synchronization operation is formed between time T0 and time T1, and the (n+1)th round of synchronization operation is formed between time T1 and time T2, then the dirty pages to be managed in the (n+1)th round of synchronization operation are: memory pages P1, P2 and P3.
[0051] For another example, the managed dirty pages can be: memory pages that have been written in both the previous round and the current round of synchronization operation. Since these memory pages have been written in both consecutive rounds of synchronization operation, it can be inferred that they have relatively higher activity and are relatively "hotter" memory pages. Compared to other memory pages, this type of memory page is more likely to be written to in subsequent rounds of synchronization operations and generate dirty pages. Therefore, this type of memory page can be managed in this round to make the management more targeted. For example, in the embodiment shown in Figure 3, although the memory pages that were written to in the (n+1)th round of synchronization operations are P1, P2 and P3, since only memory pages P1 and P3 were written to in the nth round of synchronization operations and memory page P2 was only read, the dirty pages that need to be managed in the (n+1)th round of synchronization operations are memory pages P1 and P3.
[0052] Step 206, gradually strengthen the restriction of the write memory management strategy on dirty pages to gradually reduce the dirty pages generated in each round with a time interval smaller than the minimum dirty page generation interval.
[0053] After each round of synchronization operations, the write memory management strategy can be strengthened so that the write memory management strategy used in the next round of synchronization operations is more stringent than that of the current round. Alternatively, the write memory management strategy can be strengthened only at intervals of more rounds, such as every 2 or 3 rounds (or other number of rounds) as described on page 5 / 16 of the manual (CN 121636039 A). Of course, besides strengthening the write memory management strategy at fixed intervals of every round or multiple rounds (such as the aforementioned 2, 3, or other number of rounds), it can also be dynamically adjusted according to the actual situation of hot migration. For example, the virtual machine's running status parameters (such as dirty page rate) can be monitored, and the write memory management strategy can be strengthened only when the running status parameters meet a predefined change pattern; otherwise, the write memory management strategy is not strengthened.
[0054] It should be noted that step 204 describes the management process of using the write memory management strategy in each round, while step 206 describes the gradual strengthening of the write memory management strategy, which creates a cyclical relationship between steps 204 and 206. For example, after executing step 204 once or multiple times, step 206 will be entered to strengthen the write memory management strategy.The process is repeated, and then it returns to step 204, executing step 204 one or more times using the enhanced write memory management strategy, and so on, until the hot migration is completed.
[0055] The write memory management strategy of this specification and the enhancement method of the write memory management strategy are described in detail below.
[0056] The write memory management strategy adopted in this specification can define: management level. Among them, the management level can include: a first type of management level corresponding to the write memory operation in the first part above, and at least one second type of management level corresponding to the write memory operation in the second part above. Therefore, the management objective of the first type of management level is: to allow the dirty page generation interval corresponding to the write memory operation in the first part to be less than the minimum dirty page generation interval; and the management objective of the second type of management level is: to limit the dirty page generation interval corresponding to the write memory operation in the second part to not be less than the minimum dirty page generation interval. The ultimate goal of this specification is to eliminate the write memory operation in the first part or the dirty pages generated therefrom, so as to ensure the success of the hot migration.
[0057] Different management levels correspond to different dirty page generation intervals. The dirty page generation interval corresponding to each management level is the minimum allowed dirty page generation interval under that management level. Therefore, due to different management objectives, the first and second management levels obviously correspond to different dirty page generation intervals: the dirty page generation interval corresponding to the first management level is less than the minimum dirty page generation interval, while the dirty page generation interval corresponding to the second management level is greater than or equal to the minimum dirty page generation interval. Furthermore, if there are multiple second management levels, the dirty page generation intervals corresponding to these second management levels should also differ from each other.
[0058] For example, let the first management level be defined as management level 0, and its corresponding dirty page generation interval belongs to the time interval (0, t), where t is the aforementioned minimum dirty page generation interval. And, define 5 second-class management levels as management levels 1 to 5, wherein: the dirty page generation interval corresponding to management level 1 belongs to the time interval [t, 2t), the dirty page generation interval corresponding to management level 2 belongs to the time interval [2t, 3t), the dirty page generation interval corresponding to management level 3 belongs to the time interval [3t, 4t), the dirty page generation interval corresponding to management level 4 belongs to the time interval [4t, 5t), and the dirty page generation interval corresponding to management level 5 belongs to the time interval [5t, +∞). Of course, the number of second-class management levels here is only for illustration, and the number of second-class management levels is not limited in this specification.
[0059] In combination with the above management levels, the write memory management strategy adopted in this specification can also define: the remaining number of management times corresponding to each management level in each round. Accordingly, the action of managing the write memory operation in this round by adopting the write memory management strategy in step 204 can include: for each write memory operation in this round, respectively from the corresponding remaining management time interval.The corresponding target management level is determined from the management levels with a count greater than 0; the corresponding write memory operation is managed according to the determined target management level, and the remaining management count of the target management level is decremented. It can be seen that by setting the corresponding remaining management count for the first type of management level, the number of write memory operations in the first part above is actually defined. Similarly, by setting the corresponding remaining management count for the second type of management level, the number of write memory operations in the second part above is actually defined.
[0060] Take Figure 4a as an example. Based on the management levels 0-5 mentioned above, assuming that in the first round of synchronization operation (i.e., "round ①"), the initial value of the remaining management counts is set to 100 for management level 0, 50 for management level 1, 40 for management level 2, 30 for management level 3, 20 for management level 4, and 10 for management level 5. Based on the aforementioned definitions, the interval between dirty page generation increases from management level 0 to management level 5, effectively tightening the restrictions on memory write operations. However, by defining the initial values of the remaining management counts to be correspondingly smaller, it can be seen that in round ①, the overall restrictions on memory write operations are relatively lenient. This also aligns with the gradual strengthening approach outlined in this specification.
[0061] So, when the first application request is received in round ①, such as application request 1 as shown in Figure 4b, the remaining management counts of each management level can be checked in the order of management level 0 to management level 5 to determine a certain management level with a remaining management count greater than 0. For example, in Figure 4b, the remaining management counts corresponding to management level 0 are checked first. The remaining management counts are initially 100 instead of 0. Therefore, management level 0 can be selected to manage the write memory operation (1) corresponding to application request 1, that is, to control the dirty page generation interval of the write memory operation (1) to be in the time interval (0, t). Also, the management of the write memory operation (1) will consume the remaining management counts corresponding to management level 0. Therefore, the remaining management counts corresponding to management level 0 will decrease. For example, it can be updated to 99 after subtracting 1 from the initial value of 100.
[0062] Furthermore, when a second application request is received in round ①, such as application request 2 as shown in Figure 4c, it will continue to be processed according to the above logic. Similarly, management level 0 will be selected to manage the write memory operation (2) corresponding to application request 2, that is, to control the dirty page generation interval of the write memory operation (2) to be within the time range.(0, t). And, the management of the write memory operation (2) will consume the remaining management counts corresponding to management level 0, so the remaining management counts corresponding to management level 0 will decrease, for example, it can be updated to 98 after decreasing 1 from 99 above.
[0063] By analogy, after 100 application requests, the remaining management counts corresponding to management level 0 will gradually decrease to 0, as shown in Figure 4d. On this basis, when the application request 101 is received again: first check the remaining management counts corresponding to management level 0. Since the remaining management counts have decreased to 0, then check the remaining management counts corresponding to management level 1. Since the remaining management counts are the initial value of 50 and not 0, the management level 1 can be selected to manage the write memory operation (101) corresponding to the application request 101, that is: control the dirty page generation interval of the write memory operation (101) to be in the time interval [t, 2t). And, the management of the write memory operation (101) will consume the remaining management counts corresponding to management level 1, so the remaining management counts corresponding to management level 1 will decrease, for example, it can be updated to 49 after subtracting 1 from the initial value of 50.
[0064] By analogy, after 150 application requests, the remaining management counts corresponding to management level 0 and management level 1 will gradually decrease to 0. And, after 250 application requests, the remaining management counts corresponding to management levels 0 to 5 will gradually decrease to 0. So, if round ① has not ended and the time for executing the synchronization action has not yet arrived, the remaining management counts corresponding to management levels 0 to 5 can be reset, thereby entering the state shown in Figure 4e, at which time the remaining management counts of each management level are the same as in Figure 4a. Then, starting from application request 251, its processing process is similar to that of the aforementioned application request 1, for example, management level 0 is selected to manage the corresponding write memory operation (251); and, the virtual machine will continue to process the application requests received in round ①. Generally, one reset should be sufficient; however, if round ① takes a long time or the initial value of the remaining management count is small, multiple resets may be triggered, and this manual does not impose any restrictions on this. Furthermore, similar to round ①, in fact, during each round of synchronization operation, a reset can be triggered once or more (as described on page 7 / 16 of this manual, CN 121636039 A). This can be summarized as follows: before the end of any round of synchronization operation, if the remaining management counts corresponding to each management level are all zero, then the remaining management counts corresponding to each management level in that round are reset based on the write memory management strategy. In other words, at the beginning of any round of synchronization operation, the remaining management counts corresponding to each management level are all initial values, and as the round of synchronization operation progresses, the remaining management counts corresponding to each management level gradually decrease; until each management level...After the remaining management counts corresponding to each management level are all reset to zero, if the synchronization operation of that round is still not finished, the remaining management counts corresponding to each management level are reset to their initial values, thus resetting the remaining management counts corresponding to each management level in that round.
[0065] It should be noted that: the definition of management level and the definition of the initial value of the remaining management counts corresponding to each management level can be determined by those skilled in the art based on the actual situation, and this specification does not limit their specific values. For example, those skilled in the art can define them based on the actual load of the virtual machine, hot migration throughput, the number of rounds of the synchronization operation and / or other indicators, and this specification does not limit them.
[0066] Regarding the remaining management counts corresponding to each management level, the way to gradually strengthen the restriction of dirty pages by the write memory management strategy in this specification may include: reducing the initial value of the remaining management counts corresponding to the first type of management level; or increasing the initial value of the remaining management counts corresponding to the second type of management level; or simultaneously reducing the initial value of the remaining management counts corresponding to the first type of management level and increasing the initial value of the remaining management counts corresponding to the second type of management level. As mentioned above, the first management level corresponds to relatively lenient management restrictions, and the second management level corresponds to relatively strict management restrictions. Therefore, by decreasing the initial value of the remaining management count corresponding to the first management level, and / or increasing the initial value of the remaining management count corresponding to the second management level, the write memory management strategy can be made to impose stricter restrictions on dirty pages overall, thereby reducing the number of dirty pages generated in this round at intervals less than the minimum dirty page generation interval t.
[0067] When adjusting (decreasing or increasing) the initial value of the remaining management count, the specific adjustment amount can be determined temporarily. Alternatively, the adjustment amount can be preset. For example, the write memory management strategy also defines an adjustment intensity, which can be used to indicate the corresponding adjustment amount, such as a decrease or an increase. Therefore, gradually strengthening the write memory management strategy's restriction on dirty pages can include: decreasing the initial value of the remaining management count corresponding to the first management level in each round according to the decrease amount corresponding to the adjustment intensity; and / or increasing the initial value of the remaining management count corresponding to the second management level in each round according to the increase amount corresponding to the adjustment intensity.
[0068] The value of the adjustment intensity can be defined according to the actual situation of the virtual machine to select the most suitable value for the virtual machine. There can be a certain value relationship between the adjustment intensity value and the adjustment amount. For example, when the adjustment intensity value is speed, the adjustment amount can be speed*k, where k is a predefined value. For instance, if k=5, when speed=1, it indicates that when adjusting the initial value of the remaining management times, it will decrease or increase by 5. Referring to the embodiments shown in Figures 4a-4e, in...In round ①, the initial value of the remaining management times corresponding to management level 0 is 100, the initial value of the remaining management times corresponding to management level 1 is 50, the initial value of the remaining management times corresponding to management level 2 is 40, the initial value of the remaining management times corresponding to management level 3 is 30, the initial value of the remaining management times corresponding to management level 4 is 20, and the initial value of the remaining management times corresponding to management level 5 is 10.
[0069] Assuming that the decrease and increase are both 5, then as shown in Figure 4f, in round ②: the initial value of the remaining management times corresponding to management level 0 decreases to 95, the initial value of the remaining management times corresponding to management level 1 increases to 55, the initial value of the remaining management times corresponding to management level 2 increases to 45, the initial value of the remaining management times corresponding to management level 3 increases to 35, the initial value of the remaining management times corresponding to management level 4 increases to 25, and the initial value of the remaining management times corresponding to management level 5 increases to 15. Similarly, assuming both the decrease and increase are 10, then as shown in Figure 4g, in round ②: the initial value of the remaining management count corresponding to management level 0 decreases to 90, the initial value of the remaining management count corresponding to management level 1 increases to 60, the initial value of the remaining management count corresponding to management level 2 increases to 50, the initial value of the remaining management count corresponding to management level 3 increases to 40, the initial value of the remaining management count corresponding to management level 4 increases to 30, and the initial value of the remaining management count corresponding to management level 5 increases to 20.
[0070] Taking Figure 4f as an example, when the first application request is received in round ②, such as application request 1', the remaining management count of each management level can be checked sequentially according to the order of management level 0 to management level 5 to determine a certain management level with a remaining management count greater than 0. For example, in Figure 4f, first check the remaining management count corresponding to management level 0. The remaining management count is the initial value of 95 instead of 0. Therefore, management level 0 can be selected to manage the write memory operation (1)' corresponding to application request 1', that is, to control the dirty page generation interval of the write memory operation (1)' to be in the interval (0, t). And, the management of the write memory operation (1)' will consume the remaining management count corresponding to management level 0. Therefore, the remaining management count corresponding to management level 0 will be reduced. For example, it can be updated to 94 after reducing the initial value of 95 by 1. Similarly, in the embodiment shown in Figure 4g, for the first application request received in round ②, such as application request 1', management level 0 will also be selected to manage the corresponding write memory operation (1)', and the remaining management count corresponding to management level 0 will be reduced. This will not be elaborated here.
[0071] Of course, the adjustment amount corresponding to different management levels is not necessarily the same. For example, different management levels can correspond toCompletely independent adjustment amounts, for example, management level 0 corresponds to k0, and the corresponding adjustment amount is speed*k0; management level 1 corresponds to k1, and the corresponding adjustment amount is speed*k1, ...; management level 5 corresponds to k5, and the corresponding adjustment amount is speed*k5. In addition, the adjustment amount can be adjusted based on addition and subtraction calculations, or it can be calculated proportionally. For example, the increase amount can be increased by 5%, and the decrease amount can be decreased by 5%, etc. The rest can be referred to the above embodiments, and will not be repeated here. In summary, by setting the value of the adjustment intensity speed, the initial value of the remaining management times corresponding to the management level can be defined, and the degree of strengthening of the write memory management strategy can be configured: if you want to increase the restriction intensity, you can increase the value of speed; if you want to decrease the restriction intensity, you can decrease the value of speed.
[0072] As mentioned above, for the received application request, you can select from various management levels in a certain order, and use the selected management level to manage the write memory operation corresponding to the application request. The order mentioned here is the arrangement order of the various management levels. The write memory management strategy can define the arrangement order. In one embodiment, the arrangement order is consistent in each round, that is, after the round changes, the reinforcement of the write memory management strategy can be independent of the arrangement order. In another embodiment, the arrangement order of each round can be independent of each other, so the write memory management strategy can define the arrangement order of each management level in each round, so that after the round changes, the reinforcement of the write memory management strategy can involve adjusting the arrangement order. Of course, such adjustment is not necessarily involved in every reinforcement of the write memory management strategy, and it is not excluded that the arrangement order may be the same between some rounds.
[0073] It should be noted that: when defining the arrangement order of each management level in each round in the write memory management strategy, the arrangement order of each management level in each round can be directly recorded. For example, if 30 rounds are predefined, 30 sets of arrangement orders will be recorded. Alternatively, it could only record the arrangement order of each management level in some rounds, and the derivation logic for the arrangement order towards other rounds based on this. For example, it could only record the arrangement order of each management level in the first round, and the arrangement order of non-first rounds could be derived based on the arrangement order of the first round or the round before it.
[0074] As for how to specifically adjust the arrangement order when strengthening the write memory management strategy, it can be determined by those skilled in the art based on the actual situation, and this specification does not limit this. For example, it is assumed that when selecting the management strategy, the method adopted is: according to the arrangement order defined in the write memory management strategy, each management level is selected in turn to manage the write memory operation of this round, and the interval between the arrangement order of the first round and the dirty pages corresponding to each management level is small.The order of the management levels is consistent with the order of the dirty pages, that is, the management level with the smaller the interval between dirty page generation is arranged earlier, and the management level with the larger the interval between dirty page generation is arranged later. Taking the aforementioned management levels 0 to 5 as an example, the arrangement order is as shown in Figure 4f: management level 0, management level 1, management level 2, management level 3, management level 4, management level 5. As mentioned above, under this arrangement, management levels 0 to 5 will be selected in sequence, so that the restriction on dirty pages is smaller at the beginning and gradually stricter later. This is equivalent to achieving a smooth transition of gradually stricter restrictions within the same round, so as to further reduce the impact on the application.
[0075] On this basis, the restrictions on dirty pages by the write memory management strategy are gradually strengthened, including: gradually adjusting the management level with the relatively larger interval between dirty pages to the management level with the relatively smaller interval between dirty pages. Since using a memory management level with a larger dirty page generation interval allows memory write operations to generate dirty pages at relatively longer intervals, thus slowing down the dirty page generation process, it can be understood that the larger the dirty page generation interval, the stricter the restrictions on dirty pages imposed by the corresponding memory management level. Therefore, by gradually adjusting the memory management levels with larger dirty page generation intervals to those with smaller intervals—that is, by gradually adjusting the stricter management levels to those with more lenient intervals—the more stringent management levels can be selected earlier and earlier during the sequential selection of memory management levels. It is understandable that if the arrangement of management levels with smaller dirty page generation intervals (arranging them earlier and those with larger intervals later) achieves a gradually stricter smooth transition within the same cycle, then gradually moving management levels with larger dirty page generation intervals before those with smaller intervals weakens the smooth transition within the same cycle and increases its abruptness. The earlier the management level with larger intervals is arranged, the stronger this weakening of smooth transition or increase in abruptness, thus making the restrictions on dirty page generation more stringent. Therefore, by gradually moving management levels with larger intervals before those with smaller intervals, the write memory management strategy can gradually strengthen its restrictions on dirty pages. Of course, the weakening of smooth transition or increase in abruptness mentioned above is limited to within the same cycle. If multiple cycles are considered as a whole, the technical solution in this specification still achieves a smooth transition between cycles. Thus, with synchronizationAs the number of operation rounds increases, write memory operations will be subject to stricter restrictions with higher priority, thereby accelerating the convergence speed while maintaining a smooth overall transition.
[0076] This should be understood as follows: any two or more management levels can be grouped together. As long as the management level with a relatively larger dirty page generation interval within the group is adjusted to a relatively earlier order, it is considered to satisfy the above-mentioned order adjustment method, and it is not necessary to consider all management levels each time. For example, as shown in Figure 4h, management levels 1-3 can be grouped together, and management level 3 with a relatively larger dirty page generation interval is adjusted before management level 1-2, and management level 2 with a relatively larger dirty page generation interval is adjusted before management level 1. Similarly, management levels 4-5 can be grouped together, and management level 5 with a relatively larger dirty page generation interval is adjusted before management level 4. In addition, in subsequent rounds, for example, management level 4 or 5 with a relatively larger dirty page generation interval can be adjusted before at least one of management levels 1-3.
[0077] In addition to adjusting the second type of management levels in the order described above, the first type of management levels and the second type of management levels can also be adjusted in the order described above to further enhance the effect. For example, any one or more of management levels 1 to 5 can be adjusted to be before management level 0, which can further enhance the restriction on dirty pages than adjusting the order only between management levels 1 to 5.
[0078] It should be noted that when determining which management level to use to manage each received memory write operation, in addition to the method described above, that is, checking the remaining management times of each management level in the order of management levels 0 to 5 until a management level with a corresponding remaining management level greater than 0 is encountered, other processing logic can also be used. For example, the order between management levels can be ignored and a random selection can be made. Of course, other processing logic can also be used, and this specification does not limit this.
[0079] As mentioned above, each management level corresponds to a different duration interval, and the dirty page generation interval corresponding to each management level belongs to its corresponding duration interval; accordingly, gradually strengthening the restriction of the write memory management strategy on dirty pages may include: gradually increasing the dirty page generation interval within its respective duration interval. Because a relatively larger dirty page generation interval is used, even with the same management level, the implemented restriction will be relatively stricter, thus strengthening the restriction of the write memory management strategy on dirty pages.
[0080] Take management level 0 as an example. The duration interval corresponding to management level 0 is (0, t). Assume that in the first round of synchronization operation...At the beginning, the dirty page generation interval corresponding to management level 0 is t / 8, meaning the minimum interval allowed for a write operation to generate a dirty page is t / 8. In the second round of synchronization, although it also falls within the time interval (0, t), the dirty page generation interval corresponding to management level 0 can be increased to t / 4, meaning the minimum interval allowed for a write operation to generate a dirty page increases to t / 4, which obviously reduces the rate of dirty page generation. Similarly, although it also falls within the time interval (0, t), the dirty page generation interval corresponding to management level 0 can continue to increase with each round, for example, to t / 2, 3t / 4, etc., which will not be listed here. Of course, the t / 8, t / 4, etc. mentioned above are only illustrative examples. At the same time, other management levels can also gradually increase their corresponding dirty page generation intervals in a similar manner, which will not be listed here.
[0081] In the above embodiments, this specification proposes to gradually strengthen the restriction of the write memory management strategy on dirty pages from dimensions such as the initial value of the remaining management times, the adjustment intensity of the initial value, the arrangement order of management levels, and the interval of dirty page generation corresponding to the management level. In practical applications, adjustments can be made from one or more of these dimensions; where adjustments are made from multiple dimensions, it can mean adjusting from multiple dimensions simultaneously in the same round, or adjusting from multiple dimensions separately in different rounds, but only adjusting from one dimension in each round. This specification does not limit this. Furthermore, the specific values used in each adjustment can be set according to the actual situation. The actual situation may include, for example, the actual load of the virtual machine, the hot migration throughput, the number of rounds of the synchronous operation, and / or other indicators. This specification does not limit this.
[0082] The virtual machine that needs to be hot migrated in this specification may contain multiple vCPUs. Different methods can be used to manage these multiple vCPUs.
[0083] In one embodiment, multiple vCPUs correspond to a unified write memory management strategy. Accordingly, the write memory management strategy for this round of write memory operations can include: for each vCPU in the multiple vCPUs, the same write memory management strategy is used for the write memory operations in this round. For example, assuming that the virtual machine contains vCPU0 to vCPU3, taking Figure 4b as an example: if vCPU0 receives application request 1 and triggers the corresponding write memory operation (1), it will select management level 0 for management, and the remaining management count corresponding to management level 0 will decrease from 100 to 99; and taking Figure 4c as an example: if vCPU1 further receives application request 2 and triggers the corresponding write memory operation (2), it will select management level 0 for management, and the remaining management count corresponding to management level 0 will decrease from 99 to 98. It can be seen that the multiple vCPUs contained in the virtual machine will share a unified write memory management strategy, such as sharing the remaining management count defined for each management level in the write memory management strategy.Management frequency. Similarly, other contents defined in the write memory management strategy, such as the order of management levels, the adjustment strength of the initial value, and the interval for generating dirty pages corresponding to the management level, can also be shared among multiple vCPUs, and will not be elaborated here.
[0084] In another embodiment, each vCPU corresponds to an independent write memory management strategy. Accordingly, managing the write memory operation in this round using the write memory management strategy may include: determining the corresponding vCPU and its corresponding write memory management strategy for each write memory operation of the virtual machine in this round; and managing the corresponding write memory operation according to the determined write memory management strategy. For example, assuming that the virtual machine contains vCPU0 to vCPU3, four independent write memory management strategies will be defined accordingly. These write memory management strategies can be the same or different, and this specification does not limit this. Taking the same write memory management strategy as an example, for example, as shown in Figure 4b. So, if vCPU0 receives application request 1 and triggers the corresponding write memory operation (1), it will select management level 0 for management, and in the write memory management policy corresponding to vCPU0, the remaining management count corresponding to management level 0 will be reduced from 100 to 99; and if vCPU1 further receives application request 2 and triggers the corresponding write memory operation (2), although the write memory operation (2) is the second write memory operation in general, it is the first write memory operation executed by vCPU1. Therefore, in the write memory management policy corresponding to vCPU1, the remaining management count corresponding to management level 0 is still the initial value of 100. So if management level 0 is selected for management at this time, the remaining management count corresponding to management level 0 will be reduced from 100 to 99 in the write memory management policy corresponding to vCPU1.
[0085] If the write memory management policies corresponding to multiple vCPUs are different, then higher flexibility can be provided. For example, the strictness of the write memory management policy corresponding to each vCPU for limiting dirty pages can be negatively correlated with the load of the corresponding vCPU. Specifically, taking any vCPU as an example, the write memory management policy corresponding to that vCPU restricts the interval between dirty page generation. Specifically, the stricter the restriction, the longer the interval between dirty page generation; conversely, the looser the restriction, the shorter the interval. In other words, the higher the load on a vCPU, the looser the write memory management policy should be in restricting dirty pages to avoid putting excessive pressure on the vCPU (high load indicates a large number and high frequency of application requests, which inherently leads to a longer interval between dirty page generation).The lower the load of the vCPU, the more stringent the restrictions on dirty pages should be in the corresponding write memory management strategy. This way, there is no need to worry about affecting the application served by the vCPU (low load means fewer and less frequent application requests, and the dirty page generation interval is inherently larger), and the convergence speed of hot migration can be improved.
[0086] In summary, after determining the minimum dirty page generation interval, the technical solution of this specification does not restrict the generation interval of all dirty pages of the virtual machine to be no less than the minimum dirty page generation interval in one step. Instead, it gradually approaches this goal through a progressively strengthened write memory management strategy. This process smoothly transitions from a relatively lenient management strategy to a relatively strict management strategy. It will not suddenly impact the virtual machine's processing of application requests. Even if there is a large load difference between multiple vCPUs in the virtual machine, it will not suddenly impose excessive restrictions on the high-load vCPU, and will not cause a large number of application requests to be blocked and timed out. Thus, while ensuring the success rate of the virtual machine's hot migration, it also takes into account reducing or eliminating the impact on application operation.
[0087] Through actual testing, for cases 1 to 3 mentioned above, when the virtual machine hot migration scheme of this specification is adopted, the rate at which the virtual machine generates dirty pages gradually decreases as the hot migration progresses until the hot migration is successful. Furthermore, during the hot migration process, the impact of rate limiting on the generation of dirty pages in the virtual machine is greatly reduced; the lowest dirty page generation rate can reach 60% of that before rate limiting, which is far higher than the 25% or lower dirty page rate in related technologies. That is, the technical solution of this specification has a significantly smaller impact on the application while ensuring the success rate of hot migration.
[0088] Figure 5 is a schematic structural diagram of a device provided in an exemplary embodiment. Referring to Figure 5, at the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, memory 505, and non-volatile memory 510, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 502 reads the corresponding computer program from the non-volatile memory 510 into memory 505 and then runs it. Of course, besides the software implementation, one or more embodiments in this specification do not exclude other implementation methods, such as logical devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logical unit, but can also be hardware or logical devices.
[0089] Please refer to Figure 6. The virtual machine hot migration device can be applied to the device shown in Figure 5 to implement the technical solution of this specification. The device may include:
[0090] Interval determination unit 601, in response to a hot migration request for a virtual machine, determines the minimum dirty page generation interval corresponding to the hot migration transmission speed;
[0091] Write memory management unit 602, in each round of synchronization operation implemented according to the hot migration request, adopts a write memory management strategy to manage the write memory operation of the current round, so as to: allow the dirty page generation interval corresponding to the first part of the write memory operation to be less than the minimum dirty page generation interval, and restrict the dirty page generation interval corresponding to the second part of the write memory operation to be not less than the minimum dirty page generation interval;
[0092] Strategy reinforcement unit 603, gradually strengthens the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round that are less than the minimum dirty page generation interval.
[0093] Optionally, the write memory management strategy defines management levels and the remaining management counts corresponding to each management level in each round; the management levels include: a first type of management level corresponding to the write memory operation of the first part, and at least one second type of management level corresponding to the write memory operation of the second part, and different management levels correspond to different dirty page generation intervals;
[0094] The write memory management unit 602 is specifically used to: for each write memory operation in this round, determine the corresponding target management level from the management levels with the corresponding remaining management counts greater than 0; manage the corresponding write memory operation according to the determined target management level, and decrease the remaining management counts of the target management level;
[0095] The strategy strengthening unit 603 is specifically used to: decrease the initial value of the remaining management counts corresponding to the first type of management level, and / or increase the initial value of the remaining management counts corresponding to the second type of management level.
[0096] Optionally, the write memory management strategy further defines an adjustment intensity; the strategy strengthening unit 603 is specifically used to:
[0097] reduce the initial value of the remaining management count of the first type of management level in each round according to the reduction amount corresponding to the adjustment intensity; and / or,
[0098] increase the initial value of the remaining management count of the second type of management level in each round according to the increase amount corresponding to the adjustment intensity.
[0099] Optionally, the device further includes:
[0100] a count reset unit, which, before the end of any round of synchronization operation, if the remaining management counts corresponding to each management level are all zero, resets the remaining management counts corresponding to each management level in that round based on the write memory management strategy.
[0101] Optionally, the write memory management strategy defines the arrangement order of each management level in each round;
[0102] The write memory management unit 602 is specifically used to: manage the write memory operation of this round by sequentially selecting each management level according to the arrangement order defined in the write memory management strategy; wherein, the arrangement order of the first round is related to the management levels.The order of the dirty page generation intervals from smallest to largest is consistent;
[0103] The strategy enhancement unit 603 is specifically used to: gradually adjust the management level with a relatively larger dirty page generation interval to a relatively earlier order.
[0104] Optionally, each management level corresponds to a different time interval, and the dirty page generation interval corresponding to each management level belongs to its corresponding time interval; Specification 13 / 16 pages 17 CN 121636039 A
[0105] The strategy enhancement unit 603 is specifically used to: gradually increase the dirty page generation interval within its time interval.
[0106] Optionally, the virtual machine includes multiple virtual CPUs, and the multiple virtual CPUs correspond to a unified write memory management strategy; the write memory management unit 602 is specifically used to:
[0107] For each of the multiple virtual CPUs, the unified write memory management strategy is used to manage the write memory operation in this round.
[0108] Optionally, the virtual machine includes multiple virtual CPUs, each virtual CPU corresponding to an independent write memory management strategy; the write memory management unit 602 is specifically used for:
[0109] determining the corresponding virtual CPU and its corresponding write memory management strategy for each write memory operation of the virtual machine in this round;
[0110] managing the corresponding write memory operation according to the determined write memory management strategy.
[0111] Optionally, the strictness of the write memory management strategy corresponding to each virtual CPU in restricting dirty pages is negatively correlated with the load of the corresponding virtual CPU.
[0112] Figure 7 is a schematic diagram of the architecture of a virtual machine hot migration system provided by an exemplary embodiment. As shown in Figure 7, the system may include: a source host 710 and a target host 720; wherein, a virtual machine 711 and a virtualization platform instance 712 are deployed on the source host 710.
[0113] Virtualization platform instance 712 is used to hot-migrate virtual machine 711 from source host 710 to target host 720 through the following process:
[0114] ① In response to a hot-migration request for the virtual machine, determine the minimum dirty page generation interval corresponding to the hot-migration transfer speed;
[0115] ② In each round of synchronization operation implemented according to the hot-migration request, a write memory management strategy is adopted to manage the write memory operation of the current round, so as to: allow the dirty page generation interval corresponding to the first part of the write memory operation to be less than the minimum dirty page generation interval, and restrict the dirty page generation interval corresponding to the second part of the write memory operation to be not less than the minimum dirty page generation interval;
[0116] ③ Gradually strengthen the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round at a time less than the minimum dirty page generation interval.
[0117] Optionally, the write memory management strategy defines management levels and the remaining management counts corresponding to each management level in each round; the management levels include: a first type of management level corresponding to the write memory operation of the first part, and at least one second type of management level corresponding to the write memory operation of the second part, and different management levels correspond to different dirty page generation intervals;
[0118] The step of using the write memory management strategy to manage the write memory operation of this round includes: for each write memory operation of this round, determining the corresponding target management level from the management levels with a remaining management count greater than 0; managing the corresponding write memory operation according to the determined target management level, and reducing the remaining management count of the target management level;
[0119] The step of gradually strengthening the restriction of the write memory management strategy on dirty pages includes: reducing the initial value of the remaining management count corresponding to the first type of management level, and / or increasing the initial value of the remaining management count corresponding to the second type of management level.
[0120] Optionally, the write memory management strategy further defines an adjustment intensity;
[0121] The reduction of the initial value of the remaining management count corresponding to the first type of management level includes: reducing the initial value of the remaining management count corresponding to the first type of management level in each round according to the reduction amount corresponding to the adjustment intensity;
[0122] The increase of the initial value of the remaining management count corresponding to the second type of management level includes: increasing the initial value of the remaining management count corresponding to the second type of management level in each round according to the increase amount corresponding to the adjustment intensity.
[0123] Optionally, it further includes:
[0124] Before the end of any round of synchronization operation, if the remaining management count corresponding to each management level is all zero, then the remaining management count corresponding to each management level in this round is reset based on the write memory management strategy.
[0125] Optionally, the write memory management strategy defines the arrangement order of each management level in each round;
[0126] The step of using the write memory management strategy to manage the write memory operation in this round includes: sequentially selecting each management level to manage the write memory operation in this round according to the arrangement order defined in the write memory management strategy; wherein, the arrangement order in the first round is consistent with the arrangement order of the dirty page generation intervals corresponding to each management level from smallest to largest;
[0127] The step of gradually strengthening the restriction of the write memory management strategy on dirty pages includes: gradually adjusting the management level with a relatively larger dirty page generation interval to before the management level with a relatively smaller dirty page generation interval.
[0128] Optionally, each management level corresponds to a different duration interval, and the dirty page generation interval corresponding to each management level belongs to its corresponding duration interval;
[0129] The stepwise strengthening of the write memory management strategy's restriction on dirty pages includes: gradually increasing the dirty page generation interval within the corresponding time interval.
[0130] Optionally, the virtual machine includes multiple virtual CPUs, and the multiple virtual CPUs correspond to a unified write memory management strategy; the use of the write memory management strategy to manage the write memory operation in this round includes:
[0131] For each of the multiple virtual CPUs, the unified write memory management strategy is used to manage the write memory operation in this round.
[0132] Optionally, the virtual machine includes multiple virtual CPUs, and each virtual CPU corresponds to an independent write memory management strategy; the use of the write memory management strategy to manage the write memory operation in this round includes:
[0133] For each write memory operation of the virtual machine in this round, the corresponding virtual CPU is determined, and the write memory management strategy corresponding to the determined virtual CPU is further determined;
[0134] The corresponding write memory operation is managed according to the determined write memory management strategy.
[0135] Optionally, the strictness of the write memory management strategy corresponding to each virtual CPU in restricting dirty pages is negatively correlated with the load of the corresponding virtual CPU.
[0136] Those skilled in the art will understand that the above steps ① to ③ performed during the process of hot-migrating virtual machine 711 from source host 710 to target host 720 by virtualization platform instance 712 can actually refer to steps 202 to 206 in the embodiment shown in FIG2. Therefore, for each feature involved in steps ① to ③, refer to the relevant description of steps 202 to 206 in conjunction with FIG3 and FIG4a to 4h above, which will not be repeated here. Similarly, for the above optional embodiments, refer to the description of the extended embodiments provided based on the embodiment shown in FIG2 in conjunction with FIG3 and FIG4a to 4h above, which will not be repeated here.
[0137] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method as described in any of the above embodiments by running the executable instructions.
[0138] Based on the same concept as the above method, this specification also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method as described in any of the above embodiments.
[0139] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method as described in any of the above embodiments. (Pages 15 / 16, CN 121636039 A, Figure 1)Figure 2. Appendix 1 / 7, page 21, CN 121636039 A. Figure 3. Figure 4a. Appendix 2 / 7, page 22, CN 121636039 A. Figure 4b. Figure 4c. Appendix 3 / 7, page 23, CN 121636039 A. Figure 4d. Figure 4e. Appendix 4 / 7, page 24, CN 121636039 A. Figure 4f. Figure 4g. Appendix 5 / 7, page 25, CN 121636039 A. Figure 4h. Figure 5. Figure 6. Appendix 6 / 7, page 26, CN 121636039 A. Figure 7. Appendix 7 / 7, page 27, CN 121636039 A. Abstract: This specification provides a method and electronic equipment, storage medium, and program product for virtual machine live migration. The method comprises: in response to a live migration request for a virtual machine, determining a minimum dirty page generation interval corresponding to a transmission speed of live migration; in each round of synchronization operation implemented according to the live migration... request, manage the write memory operation of the current round by using a write memory management strategy, so as to allow the dirty page generation interval corresponding to the first part of the write memory operation to be less than the minimum dirty page generation interval, and limitthe dirty page generation interval corresponding to the second part of the write memory operation to be not less than the minimum dirty page generation interval; gradually strengthening the restriction of the write memory management strategy on the dirty page, so as to gradually reduce the dirty page generated in each round and less than the minimum dirty page generation interval.
Claims
1. A method for virtual machine live migration, the method comprising: The method comprises: in response to a live migration request for a virtual machine, determining a minimum dirty page generation interval corresponding to a transmission speed of live migration; in each round of synchronization operation implemented according to the live migration request, managing write memory operations in the round by using a write memory management strategy, so as to: allow a first part of write memory operations to correspond to a dirty page generation interval smaller than the minimum dirty page generation interval, and limit a second part of write memory operations to correspond to a dirty page generation interval not smaller than the minimum dirty page generation interval; gradually strengthening the restriction of the write memory management strategy on dirty pages, so as to gradually reduce the dirty pages generated in each round and smaller than the minimum dirty page generation interval.
2. The method of claim 1, wherein, The write memory management strategy defines management gears and respective remaining management times of each management gear in each round; the management gears comprise: a first type of management gear corresponding to the first part of write memory operations, and at least one second type of management gear corresponding to the second part of write memory operations, and different management gears correspond to different dirty page generation intervals; The management of write memory operations in the round by using the write memory management strategy comprises: for each write memory operation in the round, determining a corresponding target management gear from the management gears with a remaining management time greater than 0; managing the corresponding write memory operation according to the determined target management gear, and reducing the remaining management time of the target management gear; The gradually strengthening the restriction of the write memory management strategy on dirty pages comprises: reducing an initial value of the remaining management time corresponding to the first type of management gear, and / or increasing an initial value of the remaining management time corresponding to the second type of management gear.
3. The method of claim 2, wherein, The write memory management strategy further defines an adjustment intensity; The reducing the initial value of the remaining management time corresponding to the first type of management gear comprises: reducing the initial value of the remaining management time corresponding to the first type of management gear in each round according to a reduction amount corresponding to the adjustment intensity; The increasing the initial value of the remaining management time corresponding to the second type of management gear comprises: increasing the initial value of the remaining management time corresponding to the second type of management gear in each round according to an increase amount corresponding to the adjustment intensity.
4. The method of claim 2, wherein, The method further comprises: before the end of any round of synchronization operation, if the remaining management times of all management gears are zero, resetting the remaining management times of all management gears in the round according to the write memory management strategy.
5. The method of claim 2, wherein, The write memory management strategy defines an arrangement order of each management gear in each round; The management of write memory operations in the round by using the write memory management strategy comprises: selecting each management gear in turn to manage write memory operations in the round according to the arrangement order defined in the write memory management strategy; wherein the arrangement order of the first round is consistent with the arrangement order from small to large of the dirty page generation intervals corresponding to each management gear; The gradually strengthening the restriction of the write memory management strategy on dirty pages comprises: gradually adjusting the management gears corresponding to relatively larger dirty page generation intervals to the management gears corresponding to relatively smaller dirty page generation intervals.
6. The method according to any one of claims 2-5, characterized in that, Each management level corresponds to a different time interval, and the dirty page generation interval corresponding to each management level belongs to its corresponding time interval; The step-by-step strengthening of the restriction of the write memory management strategy on dirty pages includes gradually increasing the dirty page generation interval within the corresponding time interval.
7. The method according to any one of claims 1-5, characterized in that, The virtual machine includes a plurality of virtual CPUs, and the plurality of virtual CPUs correspond to a unified write memory management strategy; The management of the write memory operation in the current round by using the write memory management strategy includes: Each virtual CPU in the plurality of virtual CPUs is managed by using the unified write memory management strategy for the write memory operation in the current round.
8. The method according to any one of claims 1-5, characterized in that, The virtual machine includes a plurality of virtual CPUs, and each virtual CPU corresponds to an independent write memory management strategy; The management of the write memory operation in the current round by using the write memory management strategy includes: For each write memory operation in the current round of the virtual machine, a corresponding virtual CPU is determined, and a write memory management strategy corresponding to the determined virtual CPU is further determined; The corresponding write memory operation is managed according to the determined write memory management strategy.
9. The method of claim 8, wherein, The strictness of the restriction of the write memory management strategy corresponding to each virtual CPU on dirty pages is negatively correlated with the load of the corresponding virtual CPU.
10. A system for virtual machine live migration, the system comprising: It includes: A source host and a target host, and a virtual machine and a virtualization platform instance are deployed on the source host; The virtualization platform instance is configured to: In response to a live migration request for the virtual machine, determine a minimum dirty page generation interval corresponding to a transmission speed of live migration; In each round of synchronization operation implemented according to the live migration request, a write memory management strategy is used to manage the write memory operation in the current round, so as to allow the dirty page generation interval corresponding to a first part of the write memory operation to be less than the minimum dirty page generation interval, and limit the dirty page generation interval corresponding to a second part of the write memory operation to be not less than the minimum dirty page generation interval; The restriction of the write memory management strategy on dirty pages is gradually strengthened to gradually reduce the dirty pages generated in each round and less than the minimum dirty page generation interval.
11. The system of claim 10, wherein, The write memory management strategy defines management levels and the remaining management times corresponding to each management level in each round; the management levels include first-type management levels corresponding to the first part of the write memory operation and at least one second-type management level corresponding to the second part of the write memory operation, and different management levels correspond to different dirty page generation intervals; The management of the write memory operation in the current round by using the write memory management strategy includes: for each write memory operation in the current round, a corresponding target management level is determined from the management levels with a remaining management time greater than 0; the corresponding write memory operation is managed according to the determined target management level, and the remaining management time of the target management level is reduced; The step-by-step strengthening of the restriction of the write memory management strategy on dirty pages includes reducing the initial value of the remaining management time corresponding to the first-type management level and / or increasing the initial value of the remaining management time corresponding to the second-type management level.
12. The system of claim 11, wherein, The write memory management strategy defines the arrangement order of each management gear in each round; The write memory management strategy is used to manage the write memory operation in the current round, including: according to the arrangement order defined in the write memory management strategy, each management gear is selected in turn to manage the write memory operation in the current round; wherein the arrangement order of the first round is consistent with the arrangement order from small to large of the dirty page generation interval corresponding to each management gear; The write memory management strategy is gradually strengthened to limit the dirty page, including: gradually adjusting the management gear corresponding to the relatively larger dirty page generation interval to the management gear corresponding to the relatively smaller dirty page generation interval.
13. An electronic device, comprising: Comprise: A processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1-9 by running the executable instructions.
14. A computer-readable storage medium, characterized in that, A computer program / product / instructions are stored thereon, which are executed by a processor to implement the steps of the method according to any one of claims 1-9.
15. A computer program product, characterised in that, A computer program / product / instructions are stored thereon, which are executed by a processor to implement the steps of the method according to any one of claims 1-9.