Virtual machine live migration method, electronic equipment, storage medium and program product
By adjusting the dirty page generation interval through a progressively enhanced write memory management strategy, the problem of migration failure and application request blocking caused by excessively rapid dirty page generation during virtual machine hot migration was solved, achieving an efficient migration process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2026-03-10
AI Technical Summary
During virtual machine hot migration, the rate of dirty page generation exceeds the transmission rate, causing migration failure. Existing technologies limit the interval of dirty page generation in one step, which leads to a decrease in the response speed of application requests under high load vCPU and request blocking.
A progressively stronger write memory management strategy is adopted. By adjusting the dirty page generation interval in rounds, the interval is gradually approached to the minimum dirty page generation interval, smoothly transitioning to strict management and avoiding sudden limitations on high-load vCPUs.
While ensuring successful live migration of virtual machines, the impact on application operation is reduced, and application request blocking and timeouts are avoided.
Smart Images

Figure CN121636039A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the technical field of virtual machine, and particularly relate to a method for virtual machine live migration, and an electronic device, a storage medium, and a program product. BACKGROUND
[0002] A virtual machine (VM) is a computer system simulated by software, which can run multiple isolated operating system instances on the same physical host. Virtual machine technology uses a virtualization platform (such as Hypervisor) to abstract various physical resources such as CPU (Central Processing Unit), memory, storage, etc., so that multiple virtual machines can run on shared physical resources while maintaining independence between each other. Virtual machine technology is widely used in cloud computing, server integration, testing and development, etc., and can improve resource utilization, simplify system management and improve system flexibility and scalability.
[0003] In some scenarios, it is necessary to perform live migration on a virtual machine, so that the virtual machine is moved from a source host to a target host without stopping running. During the live migration process, the virtual machine on the source host will still modify the data in the memory to form dirty pages. Especially in the case of serving memory-intensive applications, it is easy to occur that the dirty page generation speed is greater than the data transmission speed from the source host to the target host, thereby causing the live migration of the virtual machine to fail.
[0004] In related technologies, in order to ensure the success of live migration, the dirty page generation speed is limited to be not greater than the transmission speed throughout the entire live migration process. However, this method is a one-step approach to bursty restriction, especially for scenarios where the load difference between multiple vCPUs (virtual CPUs) on the virtual machine is large. This management method will concentrate more restrictions on the virtual machine on the high-load vCPU, causing the application request (for requesting to perform write memory operation) at the high-load vCPU to be blocked, and further causing a large number of application requests to fail due to timeout, which has a greater impact on application running. SUMMARY
[0005] Therefore, one or more embodiments of the present specification provide technical solutions as follows:
[0006] According to a first aspect of one or more embodiments of the present specification, a method for virtual machine live migration is provided, comprising:
[0007] 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;
[0008] In each round of synchronization operation implemented according to the hot migration request, a write memory management strategy is adopted to manage write memory operations in the round, so as to allow a first part of write memory operations to generate dirty pages with an interval less than the minimum dirty page generation interval, and limit a second part of write memory operations to generate dirty pages with an interval not less than the minimum dirty page generation interval.
[0009] The write memory management strategy is gradually strengthened to limit dirty pages, so as to gradually reduce dirty pages generated in each round with an interval less than the minimum dirty page generation interval.
[0010] According to a second aspect of one or more embodiments of the present specification, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method according to the first aspect by running the executable instructions.
[0011] According to a third aspect of one or more embodiments of the present specification, a computer readable storage medium is provided, having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to the first aspect.
[0012] According to a fourth aspect of one or more embodiments of the present specification, a computer program product is provided, comprising computer program / instructions, which, when executed by a processor, implement the steps of the method according to the first aspect.
[0013] According to a fifth aspect of one or more embodiments of the present specification, a system for virtual machine hot migration is provided, comprising:
[0014] a source host and a target host, wherein the source host is deployed with a virtual machine and a virtualization platform instance;
[0015] The virtualization platform instance is configured to:
[0016] In response to a hot migration request for the virtual machine, determine a minimum dirty page generation interval corresponding to a transmission 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 write memory operations in the round, so as to allow a first part of write memory operations to generate dirty pages with an interval less than the minimum dirty page generation interval, and limit a second part of write memory operations to generate dirty pages with an interval not less than the minimum dirty page generation interval;
[0018] The write memory management strategy is gradually strengthened to limit dirty pages, so as to gradually reduce dirty pages generated in each round with an interval less than the minimum dirty page generation interval.
[0019] From the above embodiments, it can be seen that after determining the minimum dirty page generation interval, the technical solution of the present specification does not limit the generation interval of all dirty pages of the virtual machine to be not less than the minimum dirty page generation interval in one step, but gradually approaches this goal through a gradually reinforced write memory management strategy. The process gradually and smoothly transitions from a relatively loose management strategy to a relatively strict management strategy, and does not suddenly impact the processing of application requests by the virtual machine. Even if there is a large load difference between multiple vCPUs in the virtual machine, the high-load vCPUs will not be suddenly limited too much, and a large number of application request blockages and timeouts will not be caused by this. Therefore, while ensuring the success rate of the live migration of the virtual machine, the impact on the application running is reduced or eliminated. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 FIG. 1 is a schematic diagram of a virtual machine live migration scenario provided by an example embodiment.
[0021] Figure 2 FIG. 2 is a flowchart of a virtual machine live migration method provided by an example embodiment.
[0022] Figure 3 FIG. 3 is a schematic diagram of a round-by-round implementation of a synchronization operation provided by an example embodiment.
[0023] Figures 4a-4h FIG. 4 is a schematic diagram of management of a write memory operation provided by an example embodiment.
[0024] Figure 5 FIG. 5 is a structural schematic diagram of a device provided by an example embodiment.
[0025] Figure 6 FIG. 6 is a block diagram of a virtual machine live migration apparatus provided by an example embodiment.
[0026] Figure 7 FIG. 7 is an architectural schematic diagram of a virtual machine live migration system provided by an example 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 for analysis, stored data, displayed data, etc.) involved in the present specification are information and data authorized by the user or authorized by all parties, and the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of relevant countries and regions, and provide corresponding operation entrances for the user to choose authorization or refusal.
[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 plays an important role, especially in cloud computing environments, which can help achieve resource optimization, load balancing, fault recovery, and other functions while maintaining the continuity of virtual machine services. According to whether the virtual machine needs to be shut down 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 a source host to a 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 a source host to a 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 migration.
[0029] For example Figure 1 As shown in FIG. 1, a virtual machine VM11a is running on a source host 11. It is assumed that the virtual machine VM11a is configured with four 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 a Hypervisor instance in Figure 1 It is assumed that hot migration of the virtual machine VM11a is required, specifically from the source host 11 to a target host 12, which can be performed by the Hypervisor instance running on the source host 11. To distinguish the virtual machine before and after migration, the virtual machine on the target host 12 can be marked as VM12a. The virtual machine VM12a has the same configuration as the virtual machine VM11a, including four virtual processors (vCPU0', vCPU1', vCPU2', and vCPU3') and memory 120. The virtual machine VM12a is managed by a virtualization platform instance running on the target host 12.
[0030] During the hot migration process, the virtual machine VM11a on the source host will continue to process application requests from the application A. If the application request needs to perform a write memory operation, it will modify the data in the memory 110, forming dirty pages. The hot migration process involves continuously transferring dirty pages in the memory 110 to the memory 120. If the transfer speed of dirty pages is greater than the generation speed, it can be ensured that after a certain period of time, the transfer of all dirty pages is completed, thereby successfully implementing the hot migration of the virtual machine VM11a to the virtual machine VM12a. However, especially in the case of memory-intensive applications, the generation speed of dirty pages in the memory 110 can be very fast, and if it exceeds the transfer speed of dirty pages, there will always be dirty pages in the memory 110 that cannot be completely transferred to the memory 120, resulting in a failed hot migration.
[0031] Based on the transfer speed during the hot migration of virtual machine VM11a, the minimum tolerable dirty page generation interval t at that transfer speed can be calculated. That is, if the dirty page generation interval in memory 110 is not less than t, the dirty page generation speed can be ensured not to exceed the transfer speed, thus ensuring the successful hot migration of virtual machine VM11a. In other words, the minimum dirty page generation interval t is the lower limit threshold of the dirty page generation interval allowed by memory 110 under the premise of ensuring the successful hot migration of virtual machine VM11a. Therefore, the solution in related technologies proposes a one-step write memory management strategy: directly limiting the dirty page generation interval of virtual machine VM11a to not less than t until the hot migration is successful.
[0032] If the load of vCPU0 through vCPU3 can remain balanced, then the aforementioned restrictions on virtual machine VM11a in related technologies will also be applied evenly to vCPU0 through vCPU3, thus the impact on the operation of application A is acceptable. However, the load between different vCPUs is often not balanced, but rather varies considerably, and the load of each vCPU also changes dynamically. Therefore, the actual scenario is that some vCPUs have high loads, while the remaining vCPUs have low loads. For example, if the load of vCPU0 is high, while the loads of vCPU1 through vCPU3 are low, then when using the aforementioned write memory management strategy in related technologies: because the loads of vCPU1 through vCPU3 are low, their rate of generating dirty pages is inherently slow, and they are minimally or not restricted at all by this solution; while the load of vCPU0 is high, its rate of generating dirty pages is inherently fast. Therefore, the restrictions of this write memory management strategy will be applied more to vCPU0, causing a sharp decrease in the response speed of vCPU0 to application requests from application A, easily causing application request blocking, and consequently causing 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 the virtual machine VM11a is as follows: Figure 1 The configuration shown is a 4-core system (vCPU0 to vCPU3) with 16GB of memory (version 110). If four memory test tasks (such as the memtest task) each requiring 3GB of memory are run on this virtual machine VM11a, then:
[0034] In case 1, if all four memtest tasks run on the same vCPU, for example, vCPU0 (high load) and vCPUs 1-3 (low load), then managing the memory using a one-step write memory management strategy based on related technologies will reduce the dirty page rate (number of dirty pages generated per second) to 25% or lower.
[0035] In case 2, if the four memtest tasks run on two vCPUs, such as vCPU0 and vCPU1, this will result in a relatively high load on vCPU0-1 and a relatively low load on vCPU2-3. For example, the load on vCPU0-1 may exceed a predefined load threshold, while the load on vCPU2-3 may be below the predefined load threshold. After implementing a one-step write memory management strategy based on related technologies, the dirty page rate per round will be reduced to 25% or lower.
[0036] In case 3, if the four memtest tasks each run exclusively on a vCPU, meaning each memtest task occupies a separate vCPU, the load on vCPUs 0 through 3 is balanced. After implementing a one-step write memory management strategy based on related technologies, the dirty page rate in each round is reduced to about 50% of the original, 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 progressively strengthened memory write management strategy, the timing of memory writes can be controlled, so that the time interval for the virtual machine to generate dirty pages 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 the dirty pages generated by the virtual machine at a time less than the minimum dirty page generation interval t are gradually reduced. Thus, while ensuring the success rate of virtual machine hot migration, the impact on application operation is reduced or eliminated. The following will be described in detail with reference to the accompanying drawings.
[0038] Figure 2 This is a flowchart illustrating a method for hot migration of a virtual machine, as provided in an exemplary embodiment. Figure 2 As shown, the method may include:
[0039] Step 202: In response to a live migration request for a virtual machine, determine the minimum dirty page generation interval corresponding to the live migration transfer speed.
[0040] A hot migration request is used to instruct the virtual machine to be hot migrated. A hot migration request can be initiated by the user to whom the virtual machine belongs; alternatively, if the virtual machine is provided and maintained by, for example, a cloud service provider, the hot migration request can be initiated by either the user or the relevant operations and maintenance personnel. Of course, regardless of who initiates the request, it does not affect the process of hot migrating the virtual machine based on the hot migration request described in this specification.
[0041] The transfer speed for hot migration can be pre-configured. For example, a specified amount of transfer bandwidth can be pre-allocated for the hot migration process of the virtual machine, and this bandwidth can be used to characterize the transfer speed of the hot migration; or, the transfer bandwidth can be converted to other commonly used transfer speeds, and this specification does not limit this. Of course, the transfer speed of hot migration can also be obtained by monitoring the transfer process.
[0042] Assume the hot migration transfer rate is Q, the amount of data transferred per second. For a virtual machine, each memory page has a predefined size m, for example, m is typically 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 rate can be determined, for example:
[0043] t = 1 / N = m / Q
[0044] Of course, other methods can be used to calculate the minimum dirty page generation interval mentioned above, and this specification does not limit this.
[0045] Step 204: In each round of synchronization operation performed 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: 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 no less than the minimum dirty page generation interval.
[0046] During hot migration, the virtual machine continues to receive and process application requests. These requests may require write-memory operations, thereby modifying data in the virtual machine's memory. Write-memory management strategy refers to the strategy for managing write-memory operations. By managing write-memory operations, it can control when dirty pages are generated in memory, thus ensuring that the dirty page generation interval meets the requirements of this specification.
[0047] During the hot migration process, synchronization operations are performed on the virtual machine in rounds. Each round of synchronization operations corresponds to a time period, and each round synchronizes dirty pages generated based on write memory operations within that time period. For example, the start time of this time period can be the moment when synchronization actions were performed in the previous round, and the end time can be the moment when synchronization actions were performed in the current round. In short, the entire hot migration process is divided into multiple time periods, and a certain number of dirty pages accumulate within each time period, and these dirty pages are synchronized.
[0048] For example Figure 3As shown, a synchronization operation was performed at times T0, T1, and T2. The time period between T0 and T1 can be considered as one round of synchronization operation, which accumulated dirty pages formed between T0 and T1 and synchronized these accumulated dirty pages at time T1. Specifically, between T0 and T1, vCPU0 performed write operations on memory pages P1 and P4, and vCPU1 performed a write operation on memory page P3. Therefore, the dirty pages to be synchronized at time T1 include memory pages P1, P3, and P4. Only memory page P2 was read during this period, so it did not become a dirty page to be synchronized at time T1. Similarly, the time period between T1 and T2 can be considered as one round of synchronization operation, which accumulated dirty pages formed between T1 and T2 and synchronized these 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 a dirty page that needs to be synchronized at time T2.
[0049] In each round of synchronization operations, the dirty pages managed by the write memory management strategy in this manual can be defined according to actual needs, and this manual does not impose any restrictions on this.
[0050] For example, the managed dirty pages can be: memory pages that have undergone write operations during this round of synchronization. For instance, in... Figure 3 In the embodiment shown, it is assumed 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 example, the dirty pages being managed can be memory pages that have undergone write operations in both the previous and current synchronization operations. Because these memory pages have been written to in two consecutive synchronization operations, they can be inferred to have relatively higher activity levels and are considered relatively "hotter" memory pages. Compared to other memory pages, these pages are more likely to be written to in subsequent synchronization operations, thus increasing the probability of them becoming dirty pages. Therefore, they can be managed in the current round, making management more targeted. For example, in... Figure 3In the embodiment shown, although the memory pages that were written in the (n+1)th round of synchronization operation are P1, P2 and P3, since only memory pages P1 and P3 were written in the nth round of synchronization operation and memory page P2 was only read, the dirty pages that need to be managed in the (n+1)th round of synchronization operation are memory pages P1 and P3.
[0052] Step 206: Gradually strengthen the restrictions on dirty pages by the write memory management strategy, so as to gradually reduce the number of dirty pages generated in each round at intervals smaller than the minimum dirty page generation interval.
[0053] After each round of synchronization operations, the write memory management strategy can be strengthened to make the write memory management strategy used in the next round of synchronization operations 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 numbers of rounds). Of course, in addition to strengthening the write memory management strategy every round or every multiple rounds (such as the 2 rounds, 3 rounds or other numbers of rounds mentioned above), 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 if the running status parameters meet the 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 employing a write memory management strategy in each round, while step 206 illustrates the gradual strengthening of the write memory management strategy. This creates a cyclical relationship between steps 204 and 206. For example, after executing step 204 once or multiple times, the process will proceed to step 206 to strengthen the write memory management strategy. Then, it will return to step 204 and execute step 204 once or multiple times with the strengthened write memory management strategy, repeating this cycle until the hot migration is complete.
[0055] The following section provides a detailed introduction to the write memory management strategy outlined in this manual, as well as methods for enhancing that strategy.
[0056] The write memory management strategy adopted in this specification can define management levels. These management levels can include a first type of management level corresponding to the write memory operations described in the first part, and at least one second type of management level corresponding to the write memory operations described in the second part. Therefore, the management objective of the first type of management level is to allow the dirty page generation interval corresponding to the write memory operations 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 operations in the second part to be no less than the minimum dirty page generation interval. The ultimate goal of this specification is to eliminate the write memory operations in the first part or the dirty pages generated therefrom, in order to ensure successful hot migration.
[0057] Different management levels correspond to different dirty page generation intervals. The dirty page generation interval for each management level is the minimum allowed dirty page generation interval under that management level. Therefore, due to different management objectives, it is clear that the first and second management levels correspond to different dirty page generation intervals: the dirty page generation interval for the first management level is less than the minimum dirty page generation interval, while the dirty page generation interval for the second management level is greater than or equal to the minimum dirty page generation interval. Furthermore, if multiple second-level management levels exist, the dirty page generation intervals corresponding to these second-level management levels should also differ from each other.
[0058] For example, the first type of management level is defined as management level 0, and its corresponding dirty page generation interval belongs to the duration interval (0, t), where t is the minimum dirty page generation interval mentioned above. And, five second type management levels are defined as management levels 1 to 5, where: the dirty page generation interval corresponding to management level 1 belongs to the duration interval [t, 2t), the dirty page generation interval corresponding to management level 2 belongs to the duration interval [2t, 3t), the dirty page generation interval corresponding to management level 3 belongs to the duration interval [3t, 4t), the dirty page generation interval corresponding to management level 4 belongs to the duration interval [4t, 5t), and the dirty page generation interval corresponding to management level 5 belongs to the duration interval [5t, +∞). Of course, the number of second type management levels here is only for illustration, and this specification does not impose any limit on the number of second type management levels.
[0059] Based on the aforementioned management levels, the write memory management strategy adopted in this specification can also define the remaining management counts for each management level in each round. Accordingly, step 204, which uses the write memory management strategy to manage the write memory operations of this round, can include: 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 decrementing the remaining management count of that target management level. It is evident that by setting corresponding remaining management counts for the first type of management level, the number of write memory operations in the first part of the above description is effectively defined. Similarly, by setting corresponding remaining management counts for the second type of management level, the number of write memory operations in the second part of the above description is effectively defined.
[0060] by Figure 4aFor example, based on the management levels 0 to 5 mentioned above, assume 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 from management level 0 to management level 5 increases, 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 ①, for example... Figure 4b The application request 1 shown can sequentially check the remaining management attempts for each management level from 0 to 5 to determine the management level with a remaining management attempt greater than 0. For example, in... Figure 4b First, check the remaining management count corresponding to management level 0. The remaining management count is initially 100, not 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 within the time interval (0, t). Also, 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 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 ①, for example... Figure 4c Application request 2 will continue to be processed according to the logic described above. 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 interval (0, t). In addition, 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 changed from 99 to 98 after subtracting 1.
[0063] And so on. After 100 application requests, the remaining number of management attempts corresponding to management level 0 will gradually decrease to 0. For example... Figure 4dAs shown. Based on this, when application request 101 is received again: first, check the remaining management count corresponding to management level 0. Since the remaining management count has been reduced to 0, check the remaining management count corresponding to management level 1. Since the remaining management count is the initial value of 50 and not 0, management level 1 can be selected to manage the write memory operation (101) corresponding to 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). In addition, the management of the write memory operation (101) will consume the remaining management count corresponding to management level 1, so the remaining management count corresponding to management level 1 will be reduced, for example, it can be updated to 49 after subtracting 1 from the initial value of 50.
[0064] Similarly, after 150 application requests, the remaining management counts for management level 0 and management level 1 will gradually decrease to 0. After 250 application requests, the remaining management counts for management levels 0-5 will also gradually decrease to 0. Therefore, if round ① has not yet ended and the time to execute the synchronization action has not yet arrived, the remaining management counts for management levels 0-5 can be reset, thus entering... Figure 4e The status shown indicates the remaining number of management attempts for each management level. Figure 4a The process is the same. Then, starting with application request 251, the processing is similar to that of application request 1, for example, using management level 0 to manage the corresponding write memory operation (251); and the virtual machine will continue to process subsequent application requests received in round ①. Generally speaking, one reset should be sufficient; of course, if round ① takes a long time or the initial value of the remaining management count is small, multiple resets may be triggered, and this specification does not limit this. In addition, similar to round ①, in fact, during each round of synchronization operation, a reset can be triggered once or multiple times, which 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 start of any round of synchronization operation, the remaining number of management operations corresponding to each management level is the initial value. As the round of synchronization operation proceeds, the remaining number of management operations corresponding to each management level gradually decreases. If the round of synchronization operation has not ended after the remaining number of management operations corresponding to each management level has reached zero, the remaining number of management operations corresponding to each management level is reset to the initial value, thus resetting the remaining number of management operations corresponding to each management level in this round.
[0065] It should be noted that the definition of management levels and the initial value of the remaining management times 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 synchronous operation, and / or other indicators, and this specification does not limit them.
[0066] Regarding the remaining management counts corresponding to the aforementioned management levels, the methods described in this specification for progressively strengthening the write memory management strategy's restrictions on dirty pages may include: decreasing 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 decreasing 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 earlier, the first type of management level corresponds to relatively lenient management restrictions, while the second type of management level corresponds to relatively strict management restrictions. Therefore, by decreasing the initial value of the remaining management counts corresponding to the first type of management level and / or increasing the initial value of the remaining management counts corresponding to the second type of management level, the overall write memory management strategy can be made to impose stricter restrictions on dirty pages, 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 cycles, the specific adjustment amount can be determined temporarily. Alternatively, the adjustment amount can be pre-set; for example, the write memory management strategy may also define an adjustment strength, which can be used to indicate the corresponding adjustment amount, such as a decrease or an increase. Therefore, progressively strengthening the write memory management strategy's restriction on dirty pages may include: decreasing the initial value of the remaining management cycles for the first management level in each round according to the decrease amount corresponding to the adjustment strength; and / or increasing the initial value of the remaining management cycles for the second management level in each round according to the increase amount corresponding to the adjustment strength.
[0068] The adjustment intensity value can be defined based on the actual situation of the virtual machine to select the most suitable value. There can be a certain 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`, and `speed = 1`, it indicates that when adjusting the initial value of the remaining management cycles, it will decrease or increase by 5. Combined with... Figures 4a-4eIn the embodiment shown, in round ①, the initial value of the remaining number of management times corresponding to management level 0 is 100, the initial value of the remaining number of management times corresponding to management level 1 is 50, the initial value of the remaining number of management times corresponding to management level 2 is 40, the initial value of the remaining number of management times corresponding to management level 3 is 30, the initial value of the remaining number of management times corresponding to management level 4 is 20, and the initial value of the remaining number of management times corresponding to management level 5 is 10.
[0069] Assuming both the decrease and increase are 5, then if Figure 4f As shown, in round ②: the initial value of the remaining management count corresponding to management level 0 decreases to 95, the initial value of the remaining management count corresponding to management level 1 increases to 55, the initial value of the remaining management count corresponding to management level 2 increases to 45, the initial value of the remaining management count corresponding to management level 3 increases to 35, the initial value of the remaining management count corresponding to management level 4 increases to 25, and the initial value of the remaining management count corresponding to management level 5 increases to 15. Similarly, assuming that both the decrease and increase are 10, then... Figure 4g As shown, in round ②: the initial value of the remaining management times corresponding to management level 0 is reduced to 90, the initial value of the remaining management times corresponding to management level 1 is increased to 60, the initial value of the remaining management times corresponding to management level 2 is increased to 50, the initial value of the remaining management times corresponding to management level 3 is increased to 40, the initial value of the remaining management times corresponding to management level 4 is increased to 30, and the initial value of the remaining management times corresponding to management level 5 is increased to 20.
[0070] by Figure 4f For example, when the first application request is received in round ②, such as application request 1', the remaining management attempts for each management level can be checked sequentially from management level 0 to management level 5 to determine the management level with a remaining management attempt greater than 0. For example, in Figure 4f First, check the remaining management count corresponding to management level 0. This remaining count is currently at an initial value of 95, not 0. Therefore, management level 0 can be selected to manage the write memory operation (1)' corresponding to application request 1', i.e., controlling the dirty page generation interval of the write memory operation (1)' to be within the interval (0, t). Furthermore, managing the write memory operation (1)' will consume the remaining management count corresponding to management level 0, so the remaining management count corresponding to management level 0 will decrease, for example, it can be updated to 94 after subtracting 1 from the initial value of 95. Similarly, in Figure 4g In the embodiment shown, for the first application request received in round ②, such as application request 1', management level 0 will be selected to manage the corresponding write memory operation (1)', and the remaining management times corresponding to management level 0 will be decremented, which will not be elaborated here.
[0071] Of course, the adjustment amounts corresponding to different management levels are not necessarily the same. For example, different management levels can correspond to completely independent adjustment amounts. For instance, 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, and so on, with management level 5 corresponding to k5 and the corresponding adjustment amount being speed*k5. Furthermore, in addition to adjustments based on addition and subtraction, the adjustment amount can also be calculated proportionally. For example, an increase could be 5%, and a decrease could be 5%, etc. The rest can be referred to in 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 cycles corresponding to the management level can be defined, thereby configuring the degree of strengthening of the write memory management strategy: 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 earlier, for received application requests, management levels can be selected in a certain order, and the selected management level is used to manage the corresponding write memory operations for that application request. The order mentioned here refers to the arrangement of the management levels. This arrangement order can be defined in the write memory management strategy. In one embodiment, this arrangement order is consistent across all rounds, meaning that after a round change, the strengthening of the write memory management strategy can be independent of this arrangement order. In another embodiment, the arrangement order of each round can be independent of each other. Therefore, the write memory management strategy can define the arrangement order of each management level in each round, so that after a round change, the strengthening of the write memory management strategy can involve adjusting the arrangement order. Of course, this adjustment is not necessarily involved in every strengthening of the write memory management strategy, and it is possible that the arrangement order may be the same across some rounds.
[0073] It should be noted that when defining the arrangement order of each management level in each round in the memory management strategy, it can be that the arrangement order of each management level in each round is directly recorded. For example, if 30 rounds are predefined, 30 sets of arrangement orders will be recorded. Alternatively, it can be that only the arrangement order of each management level in some rounds is recorded, along with the derivation logic for the arrangement order in other rounds. For example, only the arrangement order of each management level in the first round can be recorded, and the arrangement order in subsequent rounds can be derived from the arrangement order in the first round or the round preceding it.
[0074] The specific adjustment of the order of operations when strengthening the write memory management strategy can be determined by those skilled in the art based on the actual situation, and this specification does not impose any restrictions on this. For example, suppose that when selecting the management strategy, the method adopted is to manage the write memory operation in this round by sequentially selecting each management level according to the order defined in the write memory management strategy, and the order of the first round is consistent with the order of the dirty page generation intervals corresponding to each management level from smallest to largest, that is, the management level with the smaller the dirty page generation interval is placed earlier, and the management level with the larger the dirty page generation interval is placed later. Taking the aforementioned management levels 0 to 5 as an example, the order is as follows: Figure 4f The diagram shows: Management Level 0, Management Level 1, Management Level 2, Management Level 3, Management Level 4, and Management Level 5. As mentioned earlier, this arrangement will sequentially select management levels 0 to 5, resulting in initially lower restrictions on dirty pages and gradually stricter restrictions thereafter. This effectively achieves a smooth transition with progressively stricter restrictions within the same round, further reducing the impact on the application.
[0075] Building upon this, the write memory management strategy's restrictions on dirty pages are gradually strengthened. This includes progressively adjusting management levels with larger dirty page generation intervals to those with smaller intervals. Since using a management level with a larger dirty page generation interval allows write memory operations to generate dirty pages at longer intervals, thus slowing down the generation process, it can be understood that a larger dirty page generation interval means a stricter restriction on dirty pages. Therefore, by progressively adjusting management levels with larger dirty page generation intervals to those with smaller intervals—that is, by progressively adjusting stricter management levels to more lenient ones—the more stringent management levels are selected earlier and earlier during the sequential selection of 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 the 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, as the number of rounds of synchronization operations increases, memory write 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 levels within that group with a relatively larger interval between dirty page generation are moved to a more recent position, the above-mentioned order adjustment method is considered satisfied, and it is not necessary to consider all management levels each time. For example... Figure 4hAs shown, management levels 1-3 can be grouped together, and management level 3, which has a relatively larger dirty page generation interval, can be moved before management levels 1-2, and management level 2, which has a relatively larger dirty page generation interval, can be moved before management level 1. Similarly, management levels 4-5 can be grouped together, and management level 5, which has a relatively larger dirty page generation interval, can be moved before management level 4. Furthermore, in subsequent rounds, for example, management levels 4 or 5, which have relatively larger dirty page generation intervals, can be moved before at least one of management levels 1-3.
[0077] In addition to adjusting the management levels in the order described above, the same order can also be used between the management levels 1 and 2 to further enhance the restrictions. For example, any one or more management levels 1 to 5 can be moved before management level 0, which further strengthens the control over dirty pages compared to simply adjusting the order between management levels 1 to 5.
[0078] It should be noted that when determining which management level to use for each received memory write operation, besides the previously described method of sequentially checking the remaining management cycles of each management level from 0 to 5 until a management level with a remaining cycle greater than 0 is encountered, other processing logic can also be used. For example, the order of the management levels can be disregarded, and a random selection can be made. Of course, other processing logic can also be used, and this manual does not impose any restrictions on this.
[0079] As mentioned earlier, each management level corresponds to a different duration interval, and the dirty page generation interval for each management level belongs to its corresponding duration interval. Accordingly, gradually strengthening the write memory management strategy's restriction on dirty pages can 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 restrictions will be relatively stricter, thus strengthening the write memory management strategy's restriction on dirty pages.
[0080] Taking management level 0 as an example. The duration interval corresponding to management level 0 is (0, t). Assume that during the first round of synchronization operations, the dirty page generation interval for management level 0 is t / 8, meaning the minimum interval allowed for write operations to generate dirty pages is t / 8. During the second round of synchronization operations, although it still falls within the duration interval (0, t), the dirty page generation interval for management level 0 can be increased to t / 4, meaning the minimum interval allowed for write operations to generate dirty pages increases to t / 4, which obviously reduces the rate of dirty page generation. Similarly, although it also falls within the duration interval (0, t), the dirty page generation interval for 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. 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 progressively strengthen the write memory management strategy's restriction on dirty pages from dimensions such as the initial value of the remaining management cycles, the adjustment intensity of the initial value, the arrangement order of management levels, and the interval between dirty pages generated by the management levels. In practical applications, adjustments can be made from one or more of these dimensions; if adjustments are made from multiple dimensions, this can mean adjusting from multiple dimensions simultaneously in the same round, or adjusting from multiple dimensions separately in different rounds, but adjusting only one dimension in each round. This specification does not impose any limitations on this. Furthermore, the specific values used in each adjustment can be set according to actual conditions, such as the actual load of the virtual machine, hot migration throughput, the number of rounds of the synchronous operation, and / or other indicators. This specification does not impose any limitations on this.
[0082] The virtual machines requiring hot migration described in this manual can contain multiple vCPUs. These multiple vCPUs can be managed in different ways.
[0083] In one embodiment, multiple vCPUs correspond to a unified write memory management strategy. Accordingly, managing the write memory operations in this round using the write memory management strategy can include: managing the write memory operations of each vCPU in this round using the unified write memory management strategy. For example, assuming the virtual machine contains vCPU0 to vCPU3, ... Figure 4b For example: if vCPU0 receives application request 1 and triggers the corresponding write memory operation (1), it will select management level 0 for management, and reduce the remaining management count corresponding to management level 0 from 100 to 99; and, with Figure 4cFor 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 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. 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, which will not be elaborated here.
[0084] In another embodiment, each vCPU corresponds to an independent write memory management policy. Accordingly, managing the write memory operations of this round using a write memory management policy may include: determining the corresponding vCPU and its corresponding write memory management policy 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 policy. For example, assuming the virtual machine contains vCPU0 to vCPU3, four independent write memory management policies will be defined accordingly. These write memory management policies can be the same or different, and this specification does not limit this. Taking the same write memory management policy as an example, for instance, all of them are as follows: Figure 4b As shown. 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 number of management operations 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 number of management operations corresponding to management level 0 is still the initial value of 100. So if management level 0 is selected for management at this time, in the write memory management policy corresponding to vCPU1, the remaining number of management operations corresponding to management level 0 will be reduced from 100 to 99.
[0085] If multiple vCPUs have different write memory management policies, greater flexibility can be provided. For example, the strictness of the write memory management policy's restrictions on dirty pages for each vCPU can be negatively correlated with the load level of the corresponding vCPU. Specifically, taking any given vCPU as an example, the restriction on dirty pages by its write memory management policy refers to the policy's limitation on the interval between dirty page generation for that vCPU. Specifically, the stricter the restriction, the longer the interval between dirty page generation for that vCPU; conversely, the looser the restriction, the shorter the interval between dirty page generation for that vCPU. In other words, the higher the load on a vCPU, the more lenient its write memory management strategy should be in terms of restrictions on dirty pages, in order to avoid putting too much pressure on the vCPU (high load indicates a large number and frequency of application requests, and the interval between dirty page generation is inherently smaller), which helps the vCPU to smoothly transition to a more stringent restriction. On the other hand, the lower the load on a vCPU, the more stringent its write memory management strategy should be in terms of restrictions on dirty pages, so that there is no need to worry about affecting the applications served by the vCPU (low load indicates a small number and frequency of application requests, and the interval between dirty page generation is inherently larger), and the convergence speed of hot migration can be improved.
[0086] In summary, the technical solution in this specification, after determining the minimum dirty page generation interval, does not immediately restrict the generation interval of all dirty pages in the virtual machine to be no less than this minimum dirty page generation interval. 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, avoiding sudden disruptions to the virtual machine's processing of application requests. Even if there are significant load differences among multiple vCPUs in the virtual machine, it will not suddenly impose excessive restrictions on the high-load vCPU, thus preventing a large number of application requests from being blocked or timed out. Therefore, while ensuring the success rate of virtual machine 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 using the virtual machine hot migration solution in this manual, the rate at which the virtual machine generates dirty pages gradually decreases as the hot migration progresses until it is successful. Furthermore, during the hot migration process, the impact of rate limiting on the generation of dirty pages is significantly reduced; the lowest dirty page generation rate can reach 60% of the rate-limited rate, far exceeding the 25% or lower dirty page rate in related technologies. In other words, the technical solution in this manual has a significantly smaller impact on the application while ensuring a high success rate for hot migration.
[0088] Figure 5 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 5At 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, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic 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 logic unit, but can also be hardware or logic devices.
[0089] Please refer to Figure 6 Virtual machine hot migration devices can be applied to, for example Figure 5 The device shown is used 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] The 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 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.
[0092] The strategy enhancement unit 603 gradually strengthens the restrictions of the write memory management strategy on dirty pages, so as to gradually reduce the number of dirty pages generated in each round at intervals smaller than the minimum dirty page generation interval.
[0093] Optionally, the write memory management strategy defines management levels and the remaining number of management operations for each management level in each round; the management levels include: a first type of management level corresponding to the write memory operation in the first part, and at least one second type of management level corresponding to the write memory operation in 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 a remaining management count greater than 0; manage the corresponding write memory operation according to the determined target management level, and decrement the remaining management count of the target management level;
[0095] The strategy enhancement unit 603 is specifically used to: reduce the initial value of the remaining number of management times corresponding to the first type of management level, and / or increase the initial value of the remaining number of management times corresponding to the second type of management level.
[0096] Optionally, the write memory management strategy further defines an adjustment strength; the strategy strengthening unit 603 is specifically used for:
[0097] Based on the reduction amount corresponding to the adjustment intensity, reduce the initial value of the remaining management count for the first type of management level in each round; and / or,
[0098] Based on the increase corresponding to the adjustment intensity, increase the initial value of the remaining number of management times for the second type of management level in each round.
[0099] Optionally, the device further includes:
[0100] The count reset unit resets the remaining management counts for each management level in that round based on the write memory management strategy if the remaining management counts for each management level are all zero before the end of any round of synchronization operation.
[0101] Optionally, the write memory management strategy defines the order in which each management level is arranged 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 consistent with the arrangement order of the dirty page generation intervals corresponding to each management level from small to large.
[0103] The strategy enhancement unit 603 is specifically used to: gradually adjust the management level with a relatively larger interval between the generation of dirty pages 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.
[0105] The strategy enhancement unit 603 is specifically used to: gradually increase the dirty page generation interval within the corresponding 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 for:
[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] For each write memory operation of the virtual machine in this round, the corresponding virtual CPU and its corresponding write memory management strategy are determined respectively;
[0110] Based on the determined write memory management strategy, the corresponding write memory operations are managed.
[0111] Optionally, the strictness of the write memory management strategy for each virtual CPU in restricting dirty pages is negatively correlated with the load of the corresponding virtual CPU.
[0112] Figure 7 This is a schematic diagram of the architecture of a system for live migration of virtual machines, provided as an exemplary embodiment. Figure 7 As shown, 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 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.
[0116] ③ Gradually strengthen the restrictions on dirty pages in the write memory management strategy to gradually reduce the number of dirty pages generated in each round at intervals smaller than the minimum dirty page generation interval.
[0117] Optionally, the write memory management strategy defines management levels and the remaining number of management operations for each management level in each round; the management levels include: a first type of management level corresponding to the write memory operation in the first part, and at least one second type of management level corresponding to the write memory operation in the second part, and different management levels correspond to different dirty page generation intervals.
[0118] The method of using a write memory management strategy to manage the write memory operations in this round 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;
[0119] The stepwise strengthening of the write memory management strategy's restriction on dirty pages includes: reducing the initial value of the remaining number of management operations corresponding to the first type of management level, and / or increasing the initial value of the remaining number of management operations corresponding to the second type of management level.
[0120] Optionally, the write memory management strategy also defines an adjustment strength;
[0121] The reduction of the initial value of the remaining number of management times corresponding to the first type of management level includes: reducing the initial value of the remaining number of management times corresponding to the first type of management level in each round according to the reduction amount corresponding to the adjustment intensity;
[0122] The step of increasing the initial value of the remaining number of management sessions corresponding to the second type of management level includes: increasing the initial value of the remaining number of management sessions corresponding to the second type of management level in each round according to the increase amount corresponding to the adjustment intensity.
[0123] Optional, also includes:
[0124] Before the end of any round of synchronization operation, if the remaining number of management operations corresponding to each management level is all zero, then the remaining number of management operations corresponding to each management level in that round is reset based on the write memory management strategy.
[0125] Optionally, the write memory management strategy defines the order in which each management level is arranged in each round;
[0126] The method of using a write memory management strategy to manage the write memory operation in this round includes: selecting each management level in sequence 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 stepwise strengthening of the write memory management strategy's restriction on dirty pages includes: gradually adjusting the management level with a relatively larger interval between dirty page generation to a management level with a relatively smaller interval between dirty page generation.
[0128] 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.
[0129] The stepwise strengthening of the write memory management strategy's restriction on dirty pages includes: gradually increasing the interval between dirty page generation within the corresponding time range.
[0130] Optionally, the virtual machine includes multiple virtual CPUs, and the multiple virtual CPUs correspond to a unified write memory management strategy; the management of the write memory operation in this round using the write memory management strategy 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, each virtual CPU corresponding to an independent write memory management strategy; the management of write memory operations in this round using the write memory management strategy 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] Based on the determined write memory management strategy, the corresponding write memory operations are managed.
[0135] Optionally, the strictness of the write memory management strategy for 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 steps ① to ③ performed by the virtualization platform instance 712 during the hot migration of virtual machine 711 from source host 710 to target host 720 can actually be referred to as follows: Figure 2 In the illustrated embodiment, steps 202-206, and for each feature involved in steps ①-③, can be referred to in conjunction with the preceding text. Figure 3 and Figures 4a-4h The descriptions of steps 202 to 206 will not be repeated here. Similarly, for the various optional embodiments described above, please refer to the preceding text in conjunction with... Figure 3 and Figures 4a-4h based on Figure 2 The description of the extended embodiments provided by the illustrated embodiments will not be repeated here.
[0137] Based on the same concept as the methods described above, this specification also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor performs the steps of the method as described in any of the above embodiments by executing the executable instructions.
[0138] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0139] Based on the same concept as the methods described above, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
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.