Data migration method and device, virtual machine to be migrated, medium and product
By dynamically adjusting the granularity of virtual machine disk bitmap data blocks and the dirty page transfer time in memory, the problems of dirty page amplification and bandwidth imbalance in virtual machine hot migration are solved, achieving efficient and successful virtual machine migration.
Patent Information
- Application Number
- CN202511353264.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-09-22
AI Technical Summary
In existing technologies, during virtual machine hot migration, the data block granularity of the disk bitmap is fixed, which cannot adapt to different input/output load characteristics, resulting in dirty page amplification. When memory and disk dirty page transfers are carried out in parallel, the bandwidth allocation is unbalanced, resulting in low migration success rate and efficiency.
By dynamically determining the granularity of the disk bitmap data blocks of the virtual machine to be migrated, and scheduling the transfer time of dirty pages in memory based on the disk dirty page rate and the frequency of dirty page transfer in memory, dynamic balance between memory and disk bandwidth resources is achieved, avoiding dirty page amplification and bandwidth contention.
It improves the success rate and efficiency of virtual machine hot migration, reduces data redundancy and bandwidth conflicts, and enhances migration performance under high load scenarios.
Smart Images

Figure CN120849025A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data migration method, apparatus, virtual machine to be migrated, medium, and product. Background Technology
[0002] Virtual machine hot migration refers to migrating a running virtual machine from one physical host to another while ensuring business continuity. However, the data block granularity of the disk bitmap used in existing hot migration technologies is usually fixed, which cannot adapt to different input / output load characteristics. This leads to dirty page amplification, an increase in the amount of invalid migration data, and a lack of dynamic coordination mechanism when memory and disk dirty page transfers are performed in parallel. Memory transfers frequently consume bandwidth, especially in the initial stage when disk transfer pressure is high, causing bandwidth imbalance and resulting in low migration success rate and efficiency. Summary of the Invention
[0003] To address the aforementioned technical problems, embodiments of this application provide a data migration method, apparatus, virtual machine to be migrated, medium, and product, which can solve the problem of low migration success rate and migration efficiency in related technologies.
[0004] The technical solution of this application is implemented as follows: A data migration method, the method comprising: Based on the input / output data generated by the virtual machine to be migrated during its operation, the data block granularity of the disk bitmap of the virtual machine to be migrated is determined; After each round of dirty page transfer is completed, the target transfer time for the next round of dirty page transfer is determined based on the first dirty page rate obtained by disk bitmap tracking determined by the data block granularity. Schedule the next round of dirty page transfers according to the target transfer time.
[0005] In the above scheme, determining the data block granularity of the disk bitmap of the virtual machine to be migrated based on the input / output data generated during the operation of the virtual machine includes: From the input / output data, obtain the number of disk blocks that changed during the sampling period and the total amount of data written; Based on the quantity and the total amount of data written, determine the average block granularity of the input / output data; The data block granularity is determined based on the average block granularity and the target strategy; wherein the target strategy characterizes the mapping relationship between the average block granularity and the data block granularity.
[0006] In the above scheme, determining the target transfer time for the next round of dirty page transfer based on the first dirty page rate obtained from the disk bitmap tracking determined by the data block granularity includes: Get the current transfer time of this round of dirty page transfer; The target transfer time is determined based on the first disk dirty page rate and the current transfer time.
[0007] In the above scheme, determining the target transfer time based on the first disk dirty page rate and the current transfer time includes: If the dirty page rate of the first disk is less than the first threshold, the target transfer time is determined to be the target value; If the dirty page rate of the first disk is greater than or equal to the first threshold, the target transmission time is determined based on the dirty page rate of the first disk, the current transmission time, and the dirty page rate of the second disk in the previous round of dirty page transmission.
[0008] In the above scheme, determining the target transmission time based on the first disk dirty page rate, the current transmission time, and the second disk dirty page rate from the previous round of disk dirty page transmission includes: Based on the first disk dirty page rate and the second disk dirty page rate, a first rate of change of the disk dirty page rate is determined; The target transmission time is determined based on the first rate of change and the current transmission time.
[0009] In the above scheme, determining the target transmission time based on the first rate of change value and the current transmission time includes: If the first rate of change is less than the second threshold, the target transmission time is obtained by subtracting the current transmission time from the target ratio. If the first rate of change is greater than or equal to the second threshold, the current transmission time is determined to be the target transmission time.
[0010] In the above scheme, scheduling the next round of dirty page transfer according to the target transfer time includes: After multiple rounds of dirty page transfers are completed, the target interruption time for the next round of dirty page transfers is determined based on whether the virtual machine to be migrated meets the target conditions. The target conditions include automatic convergence being enabled, or automatic convergence not being enabled and the total number of rounds of current dirty page transfers being greater than the starting round for initiating shutdown adjustment. According to the target transmission time, and within the time limit of the target interruption time, the next round of dirty page transmission is scheduled.
[0011] In the above scheme, the target interruption time for the next round of dirty page transfer is determined based on whether the virtual machine to be migrated meets the target conditions, including: If the target condition is not met, the current interrupt time of this round of dirty page transfer is determined as the target interrupt time; If the target conditions are met, the time period between the interruption time threshold of the virtual machine to be migrated and the current interruption time is divided based on the target number of copies to obtain multiple time intervals; The target interrupt time is determined based on the first dirty page rate of the current round of dirty page transfer, the second dirty page rate of the previous round of dirty page transfer, the multiple time intervals, and the current interrupt time.
[0012] In the above scheme, determining the target interrupt time based on the first dirty page rate of the current round of dirty page transfer, the second dirty page rate of the previous round of dirty page transfer, the multiple time intervals, and the current interrupt time includes: Based on the first dirty page rate and the second dirty page rate, a second rate of change of the dirty page rate is determined; The target interruption time is determined based on the second rate of change, the plurality of time intervals, and the current interruption time.
[0013] In the above scheme, determining the target interruption time based on the second rate of change, the plurality of time intervals, and the current interruption time includes: If the second rate of change indicates that the dirty page rate is decreasing and the decrease is less than the third threshold, or the dirty page rate is increasing, the target interrupt time is determined based on the current interrupt time and a time interval; wherein the target interrupt time is less than or equal to the interrupt time threshold. If the second rate of change indicates that the dirty page rate of memory is decreasing and the decrease is greater than or equal to the third threshold, the current interrupt time is determined as the target interrupt time.
[0014] A data migration apparatus, the apparatus comprising: The first processing unit is used to determine the data block granularity of the disk bitmap of the virtual machine to be migrated based on the input / output data generated during the operation of the virtual machine to be migrated. The second processing unit is used to determine the target transfer time for the next round of memory dirty page transfer based on the first disk dirty page rate obtained by disk bitmap tracking determined by the data block granularity after each round of disk dirty page transfer is completed. The transmission unit is used to schedule the transmission of the next round of dirty pages in memory according to the target transmission time.
[0015] A virtual machine to be migrated, the virtual machine to be migrated includes: a processor, memory and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the data migration program stored in the memory to implement the steps of the above data migration method.
[0016] A computer-readable storage medium storing one or more programs that can be executed by one or more processors to perform the steps of the data migration method described above.
[0017] A computer program product includes a computer program that, when executed by a processor, implements the steps of the data migration method described above.
[0018] The data migration method, apparatus, virtual machine to be migrated, medium, and product provided in this application dynamically determine the data block granularity of the disk bitmap based on the actual input / output data of the virtual machine to be migrated. This ensures that the bitmap granularity matches the average block size of the input / output operations, thereby accurately tracking dirty pages and avoiding the problem of dirty page amplification caused by fixed granularity, reducing invalid data transmission. Simultaneously, after each round of disk dirty page transmission, the target transmission time for the next round of memory dirty page transmission is dynamically calculated based on the dirty page rate and its changing trend obtained from disk bitmap tracking. This allows the memory transmission rhythm to adapt to disk transmission pressure; that is, when the disk dirty page rate is high in the early stages of migration, the transmission time is extended to prioritize disk bandwidth, and when the disk load decreases in the later stages of migration, the transmission time is shortened to accelerate memory transmission, thus achieving a dynamic balance between memory and disk bandwidth resources. Furthermore, by scheduling transmission according to the target transmission time, it ensures that memory dirty page transmission is executed within the optimal time window, avoiding migration delays or failures caused by bandwidth contention. Ultimately, this not only reduces data redundancy and bandwidth conflicts during the migration process but also improves the migration success rate and efficiency under high load scenarios. Attached Figure Description
[0019] Figure 1 A flowchart illustrating a data migration method provided in an embodiment of this application; Figure 2 A flowchart illustrating another data migration method provided in an embodiment of this application; Figure 3 A flowchart illustrating another data migration method provided in an embodiment of this application; Figure 4 A schematic diagram illustrating the adjustment of interruption time in a data migration method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a data migration device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a virtual machine to be migrated, provided as an embodiment of this application. Detailed Implementation
[0020] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0021] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0022] It should be noted that the main process of migrating a local disk virtual machine is as follows: First, check the hardware compatibility and resource configuration of the peer, and then migrate all disk and memory data to the destination. Next, enter the incremental transfer phase. During the dirty page incremental transfer phase, changes in memory and disk pages during migration are recorded on different bitmaps. In each iteration, it checks how many bits in the bitmap are marked as dirty data and transfers these incremental dirty data to the destination virtual machine. During this process, it assesses how long it will take to transfer the remaining dirty page data based on the estimated bandwidth and the amount of remaining dirty data. If the transfer can be completed within the interrupt time limit, the source virtual machine is paused, and the remaining dirty data and device status data (Central Processing Unit (CPU), network card, etc.) are migrated to the destination virtual machine. Finally, the destination virtual machine runs the original program, and the source virtual machine is destroyed.
[0023] Virtual machine hot migration requires migrating both dirty page data in memory and disk data simultaneously. To improve efficiency and success rate, the process can be optimized in terms of data transfer and data generation. Specifically, in terms of data transfer, when transferring dirty pages, the data to be migrated can be compressed before transmission to reduce the amount of data sent to the destination virtual machine, thus better utilizing bandwidth resources. However, compression consumes additional CPU resources; techniques such as Quick Assist Technology (QAT) can be used to handle these computationally intensive operations. For core-bound virtual machines, during data transfer, the migration thread may compete with the virtual CPU (vCPU) thread for CPU resources, affecting migration efficiency. Before the migration operation, idle physical cores on the host machine can be identified, and the hot migration thread can be bound to these idle cores. Another approach is to restrict the source of dirty page data generation, such as enabling auto_converge to reduce the virtual machine's CPU frequency, gradually reducing the vCPU thread's runtime per unit time during the migration process, thereby suppressing the rate at which dirty page data is generated in the virtual machine's memory. Furthermore, when virtual machine hot migration enters the incremental iterative migration phase, some hot memory areas may be frequently modified, potentially leading to repeated migrations during iterative transfers. Based on the principle of memory locality, data in some hot memory areas is migrated with a delay to reduce the amount of data transferred. Additionally, since disk data also needs to be migrated, intensive input / output (I / O) can generate excessive dirty pages, making migration difficult. To ensure a high success rate, it may be necessary to limit disk I / O speeds using Quality of Service (QoS).
[0024] However, the above solution has the following problems: 1. For local virtual machine hot migration scenarios, the block size of the I / O operation of the virtual machine will vary under different business scenarios (e.g., during I / O testing (e.g., fio), the block size may be 1 megabyte (MB), 256 kilobytes (KB), etc.). However, the granularity of the disk bitmap data block in the hot migration process is fixed, which may lead to the problem of amplification of dirty data during disk hot migration. For example, if the block size of fio is relatively small and it is a random write scenario, the dirty data on the disk will be amplified many times, resulting in more data being migrated ineffectively. 2. For local virtual machine hot migration scenarios, disk dirty pages and memory are transferred in parallel during the incremental migration phase. The read and write performance of memory devices and disk devices differs greatly. The number of dirty pages generated by virtual machine memory per unit time may be tens of times that of disk dirty pages, but the amount of disk data is usually large, and most of the time is spent on data disk migration. Due to the unreasonable allocation of time slices for memory hot migration, during the parallel transfer of disk and memory dirty pages, memory dirty pages are transferred iteratively multiple times, which will consume a lot of bandwidth resources. Therefore, in the early stages when there is a large amount of data transfer on the disk, we can try to limit the transfer efficiency of dirty pages in memory. When the growth of dirty page data on the disk slows down, we can gradually increase the transfer efficiency of dirty pages in memory. 3. To prevent excessive dirty pages from being generated by the virtual machine, which could cause hot migration to fail to converge, an automatic convergence function (auto_converge) is generally used to limit the CPU utilization of the virtual machine's vCPU threads. The strategy of auto_converge is to start by reducing the guest vCPU execution time by 20%. If the migration is not completed, it will reduce the runtime allocated to the vCPU by 10% each time, until the vCPU runtime is reduced to a maximum of 99%, until the virtual machine can migrate successfully. When auto_converge limits the virtual machine CPU, the downtime is fixed and short, and has almost no impact on all services. However, in actual use, except for a very few services, most service scenarios can tolerate a larger downtime, especially in local virtual machine migration scenarios. Reducing the virtual machine CPU utilization will affect the stable operation of virtual machine services, especially in the later stages of migration frequency reduction, and may even cause stuttering. It is advisable to appropriately relax the downtime to enable faster convergence and avoid limiting the virtual machine CPU utilization to a low level.
[0025] Based on this, embodiments of this application provide a data migration method, which can be applied to virtual machines to be migrated, as described above. Figure 1 As shown, the method includes the following steps: Step 101: Based on the input / output data generated by the virtual machine to be migrated during its operation, determine the data block granularity of the disk bitmap of the virtual machine to be migrated.
[0026] In this embodiment, the virtual machine to be migrated refers to a running local virtual machine that needs to be migrated; input / output data (i.e., I / O data) refers to the data generated by the virtual machine to be migrated when it performs read and write operations on the disk during operation, including the number of read and write operations, data block size, total number of bytes written, etc.; a disk bitmap is a data structure used to track changes in disk data, where each bit represents whether a data block on the disk has been modified (i.e., whether it is a dirty page); and data block granularity refers to the size of the disk data block represented by each bit in the disk bitmap.
[0027] In this embodiment, the I / O data generated by the virtual machine to be migrated during operation can be monitored and analyzed to obtain the number of disk blocks that changed within the target time and the total number of bytes written. Then, the optimal granularity of the disk bitmap is determined based on the number and the total number of bytes written to reduce dirty page amplification and improve migration efficiency.
[0028] Step 102: After each round of dirty page transfer is completed, determine the target transfer time for the next round of dirty page transfer based on the first dirty page rate obtained by disk bitmap tracking determined by data block granularity.
[0029] In this embodiment, the first disk dirty page rate refers to the disk dirty page rate corresponding to this round of disk dirty page transfer, and the disk dirty page rate refers to the proportion of data blocks that have been modified but not yet synchronized in the disk within a unit of time to the total number of data blocks; the target transfer time refers to the time parameter that controls the frequency of memory dirty page transfer during the hot migration process, which is used to balance the bandwidth usage of disk and memory data transfer.
[0030] In this embodiment, after each round of dirty page transfer is completed, the dirty page rate of the current round (i.e., the first dirty page rate) is calculated based on the current disk bitmap. Then, the transfer time for the next round of dirty page transfer is directly determined based on the current dirty page rate, or the transfer time for the next round of dirty page transfer is determined by combining the current dirty page rate with the previous round's dirty page rate. It should be noted that determining the transfer time for dirty page transfer allows the rhythm (i.e., frequency) of memory transfer to match the pressure of disk transfer. Specifically, in the early stages of migration, the dirty page rate is high (disk transfer pressure is high), and the determined target transfer time will be long, meaning the memory transfer thread will sleep for a long time before working, thus freeing up a large amount of bandwidth for disk transfer. In the later stages of migration, the dirty page rate decreases (disk transfer pressure is low), and the determined target transfer time will be shorter, meaning the memory transfer thread will be woken up more frequently, thus accelerating the rhythm of memory transfer and quickly completing the migration using the surplus bandwidth. In other words, by adjusting the transfer time of dirty page transfer, the transfer of dirty pages in memory and on disk is balanced.
[0031] Step 103: Schedule the next round of dirty page transfers according to the target transfer time.
[0032] In this embodiment, the transfer of dirty pages refers to the process of transferring modified but not yet written data pages in the memory of the virtual machine to be migrated to the destination host. Based on the determined target transfer time, a time window is set, and the next round of dirty page transfer tasks is arranged within the time window to ensure that the dirty page transfer is carried out within a reasonable time window, thereby ensuring that the migration efficiency will not decrease or the migration will fail due to bandwidth contention during the transfer process.
[0033] The data migration method provided in this application dynamically determines the data block granularity of the disk bitmap based on the actual input / output data of the virtual machine to be migrated, matching the bitmap granularity with the average block size of input / output operations. This accurately tracks dirty pages, avoiding the problem of dirty page amplification caused by fixed granularity and reducing invalid data transmission. Simultaneously, after each round of disk dirty page transmission, the target transmission time for the next round of memory dirty page transmission is dynamically calculated based on the dirty page rate and its changing trend obtained from disk bitmap tracking. This allows the memory transmission rhythm to adapt to disk transmission pressure; that is, when the disk dirty page rate is high in the early stages of migration, the transmission time is extended to prioritize disk bandwidth, and when the disk load decreases in the later stages of migration, the transmission time is shortened to accelerate memory transmission, thereby achieving a dynamic balance between memory and disk bandwidth resources. Furthermore, by scheduling transmission according to the target transmission time, it ensures that memory dirty page transmission is executed within the optimal time window, avoiding migration delays or failures caused by bandwidth contention. Ultimately, this not only reduces data redundancy and bandwidth conflicts during the migration process but also improves the migration success rate and efficiency under high load scenarios.
[0034] Based on the foregoing embodiments, this application also provides another data migration method, referring to... Figure 2 As shown, the method includes the following steps: Step 201: The virtual machine to be migrated obtains the number of disk blocks that changed and the total amount of data written during the sampling period from the input / output data.
[0035] In this embodiment, the sampling period is a preset sampling time window. Choosing an appropriate sampling period can balance the real-time performance and stability of the data, avoiding misjudgments caused by instantaneous traffic fluctuations. Changed disk blocks refer to disk storage units modified by write operations of the virtual machine to be migrated within the sampling period, and the data content of these blocks has changed compared to before. Therefore, these changed data blocks can be used to evaluate the appropriate data block granularity of the disk bitmap. The total written data volume refers to the sum of all write operations of the virtual machine to be migrated within the target time. In one feasible implementation, the target time can specifically be 1 second, 5 seconds, or 10 seconds in the past. Input / output data can be obtained through the in-virtual machine agent (QEMU Guest Agent, QGA).
[0036] In this embodiment of the application, before the migration begins, the virtual machine to be migrated starts monitoring its own disk I / O operations and determines a sampling period. Then, within each sampling period window, the number of disk blocks that have changed is counted, and the data size of all write operations is accumulated to obtain the total amount of written data within the sampling period.
[0037] Step 202: Determine the average block granularity of input / output data based on the number of virtual machines to be migrated and the total amount of data written.
[0038] In this embodiment, the average block granularity, also known as the average I / O size, is not a pre-set value, but a statistical value calculated based on the collected data and the total amount of data written. It represents the average data size of each disk write operation of the virtual machine to be migrated within a target time period. The formula for calculating the average block granularity is: Average block granularity = Total number of bytes written / Number of changed disk blocks. In one feasible implementation, the data collection and total amount of data written can be performed within the virtual machine to be migrated using the iostat command or other tools.
[0039] Step 203: Based on the average block granularity and the target strategy, determine the data block granularity of the disk bitmap of the virtual machine to be migrated.
[0040] The target strategy represents the mapping relationship between the average block granularity and the data block granularity.
[0041] In this embodiment, the target strategy is a preset decision rule or mapping table used to map the calculated average block granularity to the most suitable preset disk bitmap granularity. This strategy can be an optimization scheme based on experience or experimentation. The calculated average block granularity is compared with the threshold defined in the target strategy to select an optimal data block granularity of the disk bitmap. Subsequently, this new data block granularity can be used to track dirty data on the disk throughout the migration process. In this way, by estimating the average I / O operation block size and selecting an appropriate disk bitmap size, the problem of dirty data amplification during hot disk migration is mitigated, and the efficiency of disk migration is improved.
[0042] In one feasible implementation, the target strategy could be to determine the data block granularity as 1MB when the average block granularity is above 512KB; to determine the data block granularity as 256KB when the average block granularity is between 512KB and 64KB; and to determine the data block granularity as 64KB when the average block granularity is below 64KB.
[0043] It should be noted that after each round of dirty page transfer on disk is completed, the virtual machine to be migrated needs to determine the target transfer time for the next round of dirty page transfer in memory, as follows: Step 204: Obtain the current transfer time of the current round of dirty page transfer for the virtual machine to be migrated.
[0044] In this embodiment, the current transfer time refers to the transfer time used in the current round of dirty page transfer, and it is a known and specific value (e.g., 100 milliseconds (ms)); the current transfer time can be read from the variable or configuration item storing this value.
[0045] Step 205: The virtual machine to be migrated determines the target transfer time based on the dirty page rate of the first disk and the current transfer time.
[0046] In this embodiment of the application, the dirty page rate of the first disk and the first threshold can be compared, and then the target transmission time can be determined based on the comparison result and the current transmission time.
[0047] It should be noted that step 205 can be achieved in the following way: Step 205A: If the dirty page rate of the first disk is less than the first threshold, the virtual machine to be migrated determines the target transfer time as the target value.
[0048] In this embodiment, the target value is a very short time that is close to zero (or even zero); the first threshold is a preset critical value used for judgment, which is used to distinguish whether the disk dirty page rate is high or low; if the first disk dirty page rate is less than the first threshold, it means that the speed at which dirty data is generated on the disk is very slow, and the pressure of disk migration has been greatly reduced. At this time, it is no longer necessary to deliberately suppress memory transfer to make way for the disk, and the target transfer time can be directly set to the target value. This means that the next round of memory transfer can wait for a very short time (or no waiting is required), thereby speeding up the overall migration progress.
[0049] Step 205B: If the dirty page rate of the first disk is greater than or equal to the first threshold, the virtual machine to be migrated determines the target transfer time based on the dirty page rate of the first disk, the current transfer time, and the dirty page rate of the second disk in the previous round of disk dirty page transfer.
[0050] In this embodiment of the application, if the first disk dirty page rate is greater than or equal to the first threshold, it indicates that the disk is still generating dirty data very quickly, and disk migration still requires a lot of bandwidth. At this time, it is necessary to further analyze the trend to decide whether to maintain or relax the restrictions on memory transfer.
[0051] It should be noted that step 205B can be achieved in the following way: Step 205b1: The virtual machine to be migrated determines the first rate of change of the disk dirty page rate based on the first disk dirty page rate and the second disk dirty page rate.
[0052] In this embodiment, the first rate of change reflects the trend of disk load change, i.e., whether the disk load is increasing, stabilizing, or decreasing; the first rate of change can be specifically calculated by the following expression: first rate of change = (first disk dirty page rate and - second disk dirty page rate) / second disk dirty page rate.
[0053] Step 205b2: The virtual machine to be migrated determines the target transfer time based on the first rate of change and the current transfer time.
[0054] In this embodiment of the application, the first rate of change can be analyzed, and the target transmission time can be determined together with the analysis results and the current transmission time. It should be noted that the transmission time is no longer a fixed time, but is used as a control lever. The transmission time is dynamically increased or decreased according to the actual load of the disk (i.e., dirty page rate) and its changing trend, so as to achieve the optimal allocation of bandwidth resources between disk migration and memory migration.
[0055] Step 206: The virtual machine to be migrated schedules the next round of dirty page transfer according to the target transfer time.
[0056] In this embodiment, after completing the current round of dirty page transfer, the virtual machine to be migrated sets a timer or sleep mechanism based on the calculated target transfer time, causing the memory transfer thread to enter a waiting state. If the target transfer time is 0, the next round of transfer is started immediately; if the target transfer time is greater than 0, the thread sleeps for the corresponding time and is then woken up. After the transfer time ends, the scheduler of the virtual machine to be migrated wakes up the memory transfer thread and starts the next round of dirty page collection and transfer process.
[0057] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0058] The data migration method provided in this application dynamically determines the data block granularity of the disk bitmap based on the actual input / output data of the virtual machine to be migrated, matching the bitmap granularity with the average block size of input / output operations. This accurately tracks dirty pages, avoiding the problem of dirty page amplification caused by fixed granularity and reducing invalid data transmission. Simultaneously, after each round of disk dirty page transmission, the target transmission time for the next round of memory dirty page transmission is dynamically calculated based on the dirty page rate and its changing trend obtained from disk bitmap tracking. This allows the memory transmission rhythm to adapt to disk transmission pressure; that is, when the disk dirty page rate is high in the early stages of migration, the transmission time is extended to prioritize disk bandwidth, and when the disk load decreases in the later stages of migration, the transmission time is shortened to accelerate memory transmission, thereby achieving a dynamic balance between memory and disk bandwidth resources. Furthermore, by scheduling transmission according to the target transmission time, it ensures that memory dirty page transmission is executed within the optimal time window, avoiding migration delays or failures caused by bandwidth contention. Ultimately, this not only reduces data redundancy and bandwidth conflicts during the migration process but also improves the migration success rate and efficiency under high load scenarios.
[0059] Based on the foregoing embodiments, this application also provides another data migration method, referring to... Figure 3 As shown, the method includes the following steps: Step 301: The virtual machine to be migrated obtains the number of disk blocks that changed during the sampling period and the total amount of data written from the input / output data.
[0060] Step 302: Determine the average block granularity of input / output data based on the number of virtual machines to be migrated and the total amount of data written.
[0061] Step 303: The virtual machine to be migrated determines the data block granularity based on the average block granularity and the target strategy.
[0062] The target strategy represents the mapping relationship between the average block granularity and the data block granularity.
[0063] It should be noted that after each round of dirty page transfer on disk is completed, the virtual machine to be migrated needs to determine the target transfer time for the next round of dirty page transfer in memory, as follows: It should be noted that after step 303, step 304 can be executed, or steps 305 to 308 can be executed; Step 304: If the dirty page rate of the first disk is less than the first threshold, the virtual machine to be migrated determines the target transfer time as the target value.
[0064] Step 305: If the dirty page rate of the first disk is greater than or equal to the first threshold, the virtual machine to be migrated obtains the current transfer time of the current round of dirty page transfer.
[0065] Step 306: The virtual machine to be migrated determines the first rate of change of the disk dirty page rate based on the first disk dirty page rate and the second disk dirty page rate.
[0066] It should be noted that after step 306, either step 307 or step 308 can be executed. Step 307: If the first rate of change is less than the second threshold, the virtual machine to be migrated shall reduce the current transmission time according to the target ratio to obtain the target transmission time.
[0067] In this embodiment, the second threshold is a preset critical value used to determine whether the disk load change trend is significant, and this value is usually a negative number to determine whether the dirty page rate decreases fast enough; the target ratio is a preset reduction coefficient used to multiply the current transfer time to obtain a new, shorter transfer time; the first disk dirty page rate being less than the first threshold indicates that the disk dirty page rate is not only decreasing, but decreasing very quickly, also indicating that the pressure of disk data transfer is rapidly decreasing, and sufficient bandwidth can be released for memory transfer. Therefore, it can be calculated by the expression: target transfer time = current transfer time * (100% - target ratio); in this way, the transfer time of the next round of memory dirty page transfer is shortened, the memory transfer thread will be awakened faster, and data transfer will be performed more frequently, thereby using the newly released bandwidth to accelerate the synchronization of memory data and promote the migration process to complete faster.
[0068] In one feasible implementation, the second threshold can be set to -5%; assuming the current transmission time is 100 milliseconds and the target ratio is preset to 0.2 (i.e., decreasing by 20% each time), the calculated target transmission time is 100*(100%-20%)=80 milliseconds.
[0069] Step 308: If the first rate of change is greater than or equal to the second threshold, the virtual machine to be migrated determines the current transmission time as the target transmission time.
[0070] In this embodiment, a first rate of change greater than or equal to a second threshold indicates that the trend of the dirty page rate is not ideal. Specifically, this includes two situations: one is that the dirty page rate is decreasing, but the rate of decrease is very slow, which indicates that the disk transfer pressure is still high and it is not yet time to significantly free up bandwidth; the other is that the dirty page rate does not change or is even increasing (the rate of change is 0 or positive), which indicates that disk write activity is still very frequent and the load has not been reduced or has even increased. In this case, the virtual machine to be migrated determines that it is not appropriate to relax the restrictions on memory transfer at present, and directly sets the target transfer time to the same value as the current transfer time. In this way, the next round of memory dirty page transfer will continue to maintain the current transfer duration, which means that memory transfer will continue to be "suppressed", thereby reserving the necessary bandwidth for disk transfer and avoiding the disk and memory competing for bandwidth due to blindly accelerating memory transfer, which would affect the overall migration stability.
[0071] It should be noted that after scheduling multiple rounds of dirty page transfers in memory is completed, refer to Figure 4 As shown, the virtual machine to be migrated can also determine whether it has entered the dynamic growth phase of the interruption time. By increasing the interruption time in a step-by-step manner, the migration efficiency and success rate can be improved, as detailed below: It should be noted that after steps 304, 307, and 308, steps 309 or 310-313 can be executed. Step 309: If the virtual machine to be migrated does not meet the target conditions, the virtual machine to be migrated determines the current interrupt time of the current round of dirty page transfer as the target interrupt time of the next round of dirty page transfer.
[0072] The target conditions include: automatic convergence is enabled, or automatic convergence is not enabled and the total number of rounds of current dirty page transfers is greater than the starting round of the shutdown adjustment.
[0073] In this embodiment, the virtual machine to be migrated not meeting the target conditions specifically refers to the automatic convergence function not being enabled, and the total number of rounds of current dirty page transfer being less than or equal to the initial round. Auto-converge is a technique that actively reduces the running speed of the virtual machine's vCPU to suppress the rate of dirty page generation. When the migration process cannot keep up with the rate of dirty page generation, limiting the vCPU reduces the amount of data to be migrated from the source, thus enabling the migration to converge. The initial round is a preset iteration round threshold, indicating how many rounds of dirty page transfer are needed before the migration is considered to have reached a bottleneck and the interrupt time is considered to be adjusted, without enabling the automatic convergence function. The current interrupt time is the interrupt time used in the current round of dirty page transfer. The target interrupt time is the interrupt time planned and set for the next round of dirty page transfer.
[0074] In this embodiment, after completing one round of dirty page transfer, the virtual machine to be migrated will evaluate whether the current state meets the above target conditions. That is, it will check whether the automatic convergence function has been enabled. If it is not enabled, it will check whether the total number of rounds of dirty page transfer that have been completed exceeds the preset starting round. If it also does not meet the requirements, it means that the migration is still in the early or stable stage and there are no obvious signs of convergence difficulties. Therefore, there is no need to risk increasing the interrupt time. Maintaining the current stable configuration is the safest and most reasonable choice. Then the virtual machine to be migrated directly determines the current interrupt time as the target interrupt time. That is, the interrupt time set for the next round of dirty page transfer will be exactly the same as the interrupt time used in this round. In this way, the migration process will continue to iterate with the current fixed and usually short default interrupt time parameter until the target conditions are met.
[0075] Step 310: If the target conditions are met, the virtual machines to be migrated are divided into multiple time intervals based on the target number of virtual machines to be migrated, the interrupt time threshold of the virtual machines to be migrated, and the current interrupt time.
[0076] In this embodiment, the target number of parts is a preset integer, representing how many parts a time interval will be divided into. It determines the fineness and smoothness of the increase in interruption time. The more parts there are, the smaller the step size of each adjustment, and the smoother the adjustment. The interruption time threshold (Maximum Downtime / Tolerance Time) is the longest business interruption time that the business can tolerate (i.e., the maximum interruption time). It is a safety upper limit to ensure that no matter how it is adjusted, the interruption time will not exceed this value, thereby ensuring that business continuity is not catastrophically affected. The time interval is the length of each part obtained by dividing the difference between the interruption time threshold and the current interruption time equally according to the target number of parts. It represents the step size of each allowed increase in interruption.
[0077] In the embodiments of this application, the time interval can be specifically calculated by the following expression: Time interval = (interruption time threshold - current interruption time) / target number of copies; In a feasible implementation, if the current interruption time is 100ms, the interruption time threshold is 200ms, and the target number of copies is 10, then each time interval is 10ms, and the interruption time can be gradually increased in units of 10ms.
[0078] Step 311: The virtual machine to be migrated determines the second rate of change of the dirty page rate based on the first dirty page rate of the current round of dirty page transfer and the second dirty page rate of the previous round of dirty page transfer.
[0079] In this embodiment, the first dirty page rate is the dirty page rate generated during the current round of dirty page transfer, representing the modification speed of memory pages in the current iteration; the second dirty page rate is the dirty page rate generated during the previous round of dirty page transfer; the second rate of change is used to measure the trend and magnitude of the change in the dirty page rate between two iterations, and the second rate of change can be specifically calculated by the following expression: second rate of change = (first dirty page rate - second dirty page rate) / second dirty page rate; it should be noted that a negative second rate of change indicates that the dirty page rate decreases between two iterations, and a positive second rate of change indicates that the dirty page rate increases between two iterations.
[0080] It should be noted that step 312 can be executed after step 311, and step 313 can also be executed after step 311. Step 312: If the second rate of change indicates that the dirty page rate is decreasing and the decrease is less than the third threshold, or the dirty page rate is increasing, the virtual machine to be migrated determines the target interrupt time based on the current interrupt time and a time interval.
[0081] Among them, the target interruption time is less than or equal to the interruption time threshold.
[0082] In this embodiment, the second rate of change indicates that the dirty page rate is decreasing but the decrease is less than the third threshold, indicating that the suppression effect is poor and the dirty page generation rate is still very fast. An increase in the dirty page rate (i.e., a positive rate of change) indicates that the situation is worsening and dirty pages are being generated even faster. In other words, effective convergence is not possible under the current interruption time limit, and measures must be taken to increase the interruption time, allowing more data to be transmitted in a single round to catch up with the dirty page generation rate more quickly. Specifically, the target interruption time can be calculated using the following expression: current interruption time + a time interval. It should be noted that after determining the target interruption time, it is also necessary to check whether the calculated target interruption time is greater than the interruption time threshold. If so, the target interruption time is forced to equal the interruption time threshold to ensure that the business tolerance limit is never exceeded.
[0083] Step 313: If the second rate of change indicates that the dirty page rate of memory has decreased and the decrease is greater than or equal to the third threshold, the virtual machine to be migrated determines the current interrupt time as the target interrupt time.
[0084] In this embodiment, a decrease greater than or equal to the third threshold indicates that the current dirty page rate is decreasing rapidly, suggesting that the existing migration strategy (including the current interrupt time setting and possibly enabled auto-converge) is very effective. In this case, it should be maintained, i.e., the target interrupt time should be directly set to the current interrupt time.
[0085] It should be noted that step 314 can be executed after steps 309, 312, and 313; Step 314: The virtual machine to be migrated schedules the next round of dirty page transfer according to the target transfer time and within the time limit of the target interruption time.
[0086] In this embodiment, the system first waits for the target transmission time, reserving bandwidth for disk transmission. After the wait is complete, the next round of dirty page transmission is initiated. Simultaneously, a hard timeout period, the target interruption time, is set for this round of transmission, and the transmission operation must be completed within this time window. If the transmission is not completed by the timeout period, the current round of transmission will be forcibly paused, and the next iteration will begin, ensuring that service interruption does not exceed a preset safety range.
[0087] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0088] The data migration method provided in this application dynamically determines the data block granularity of the disk bitmap based on the actual input / output data of the virtual machine to be migrated, matching the bitmap granularity with the average block size of input / output operations. This accurately tracks dirty pages, avoiding the problem of dirty page amplification caused by fixed granularity and reducing invalid data transmission. Simultaneously, after each round of disk dirty page transmission, the target transmission time for the next round of memory dirty page transmission is dynamically calculated based on the dirty page rate and its changing trend obtained from disk bitmap tracking. This allows the memory transmission rhythm to adapt to disk transmission pressure; that is, when the disk dirty page rate is high in the early stages of migration, the transmission time is extended to prioritize disk bandwidth, and when the disk load decreases in the later stages of migration, the transmission time is shortened to accelerate memory transmission, thereby achieving a dynamic balance between memory and disk bandwidth resources. Furthermore, by scheduling transmission according to the target transmission time, it ensures that memory dirty page transmission is executed within the optimal time window, avoiding migration delays or failures caused by bandwidth contention. Ultimately, this not only reduces data redundancy and bandwidth conflicts during the migration process but also improves the migration success rate and efficiency under high load scenarios.
[0089] Based on the foregoing embodiments, this application provides a data migration apparatus that can be applied to... Figures 1-3 In the data migration method provided in the corresponding embodiment, refer to Figure 5 As shown, the data migration device 4 may include: a first processing unit 41, a second processing unit 42, and a transmission unit 43, wherein: The first processing unit 41 is used to determine the data block granularity of the disk bitmap of the virtual machine to be migrated based on the input / output data generated during the operation of the virtual machine to be migrated. The second processing unit 42 is used to determine the target transfer time for the next round of memory dirty page transfer based on the first disk dirty page rate obtained by disk bitmap tracking determined by data block granularity after each round of disk dirty page transfer is completed. The transmission unit 43 is used to schedule the transmission of the next round of dirty pages in memory according to the target transmission time.
[0090] In other embodiments of this application, the first processing unit 41 is further configured to perform the following steps: From the input / output data, obtain the number of disk blocks that changed during the sampling period and the total amount of data written; Determine the average block granularity of input / output data based on the quantity and total amount of data written; The data block granularity is determined based on the average block granularity and the target strategy; whereby the target strategy characterizes the mapping relationship between the average block granularity and the data block granularity.
[0091] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: Get the current transfer time of this round of dirty page transfer; The target transfer time is determined based on the dirty page rate of the first disk and the current transfer time.
[0092] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: If the dirty page rate of the first disk is less than the first threshold, the target transfer time is determined to be the target value. If the dirty page rate of the first disk is greater than or equal to the first threshold, the target transfer time is determined based on the dirty page rate of the first disk, the current transfer time, and the dirty page rate of the second disk in the previous round of dirty page transfer.
[0093] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: Based on the first disk dirty page rate and the second disk dirty page rate, determine the first rate of change of the disk dirty page rate; The target transmission time is determined based on the first rate of change and the current transmission time.
[0094] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: If the first rate of change is less than the second threshold, the target transmission time is obtained by subtracting the current transmission time from the target ratio. If the first rate of change is greater than or equal to the second threshold, the current transmission time is determined as the target transmission time.
[0095] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: After scheduling multiple rounds of dirty page transfers are completed, the target interrupt time for the next round of dirty page transfers is determined based on whether the virtual machine to be migrated meets the target conditions. The target conditions include: automatic convergence is enabled, or automatic convergence is not enabled and the total number of rounds of current dirty page transfers is greater than the starting round of interrupt adjustment. According to the target transfer time, and within the time limit of the target interrupt time, schedule the next round of dirty page transfer.
[0096] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: If the target condition is not met, the current interrupt time of this round of dirty page transfer is determined as the target interrupt time; If the target conditions are met, the time period between the interruption time threshold of the virtual machine to be migrated and the current interruption time is divided based on the target number of virtual machines, resulting in multiple time intervals; The target interrupt time is determined based on the first dirty page rate of the current round of dirty page transfer, the second dirty page rate of the previous round of dirty page transfer, multiple time intervals, and the current interrupt time.
[0097] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: Based on the first and second dirty page rates, a second rate of change of the dirty page rate is determined. The target interruption time is determined based on the second rate of change, multiple time intervals, and the current interruption time.
[0098] In other embodiments of this application, the second processing unit 42 is further configured to perform the following steps: If the second rate of change indicates that the dirty page rate is decreasing and the decrease is less than the third threshold, or if the dirty page rate is increasing, the target interrupt time is determined based on the current interrupt time and a time interval; wherein the target interrupt time is less than or equal to the interrupt time threshold. If the second rate of change indicates that the dirty page rate of memory is decreasing and the decrease is greater than or equal to the third threshold, the current interrupt time is determined as the target interrupt time.
[0099] It should be noted that the specific implementation process of the steps performed by each module in the embodiments of this application can be referred to Figures 1-3 The implementation process of the data migration method provided in the corresponding embodiment will not be described in detail here.
[0100] The data migration apparatus provided in this application dynamically determines the data block granularity of the disk bitmap based on the actual input / output data of the virtual machine to be migrated, matching the bitmap granularity with the average block size of input / output operations. This accurately tracks dirty pages, avoiding the problem of dirty page amplification caused by fixed granularity and reducing invalid data transmission. Simultaneously, after each round of disk dirty page transmission, the target transmission time for the next round of memory dirty page transmission is dynamically calculated based on the dirty page rate and its changing trend obtained from disk bitmap tracking. This allows the memory transmission rhythm to adapt to disk transmission pressure; that is, when the disk dirty page rate is high in the early stages of migration, the transmission time is extended to prioritize disk bandwidth, and when the disk load decreases in the later stages of migration, the transmission time is shortened to accelerate memory transmission, thereby achieving a dynamic balance between memory and disk bandwidth resources. Furthermore, by scheduling transmission according to the target transmission time, it ensures that memory dirty page transmission is executed within the optimal time window, avoiding migration delays or failures caused by bandwidth contention. Ultimately, this not only reduces data redundancy and bandwidth conflicts during the migration process but also improves the migration success rate and efficiency under high load scenarios.
[0101] Based on the foregoing embodiments, embodiments of this application provide a virtual machine to be migrated, which can be applied to... Figures 1-3 In the data migration method provided in the corresponding embodiment, refer to Figure 6 As shown, the virtual machine 5 to be migrated may include: a processor 51, a memory 52, and a communication bus 53, wherein: Communication bus 53 is used to realize the communication connection between processor 51 and memory 52; Processor 51 is used to execute the data migration program in memory 52 to perform the following steps: Based on the input / output data generated by the virtual machine to be migrated during its operation, determine the data block granularity of the disk bitmap of the virtual machine to be migrated; After each round of dirty page transfer is completed, the target transfer time for the next round of dirty page transfer is determined based on the first dirty page rate obtained by disk bitmap tracking determined by data block granularity. Schedule the next round of dirty page transfers based on the target transfer time.
[0102] In other embodiments of this application, processor 51 is used to execute the data migration program in memory 52 to determine the data block granularity of the disk bitmap of the virtual machine to be migrated based on the input / output data generated during the operation of the virtual machine to be migrated, in order to implement the following steps: From the input / output data, obtain the number of disk blocks that changed during the sampling period and the total amount of data written; Determine the average block granularity of input / output data based on the quantity and total amount of data written; The data block granularity is determined based on the average block granularity and the target strategy; whereby the target strategy characterizes the mapping relationship between the average block granularity and the data block granularity.
[0103] In other embodiments of this application, processor 51 is used to execute a data migration program in memory 52 to determine the target transfer time for the next round of dirty page transfer based on a first dirty page rate obtained from disk bitmap tracking determined by data block granularity, in order to implement the following steps: Get the current transfer time of this round of dirty page transfer; The target transfer time is determined based on the dirty page rate of the first disk and the current transfer time.
[0104] In other embodiments of this application, processor 51 is used to execute a data migration program in memory 52 to determine a target transfer time based on a first disk dirty page rate and the current transfer time, in order to perform the following steps: If the dirty page rate of the first disk is less than the first threshold, the target transfer time is determined to be the target value. If the dirty page rate of the first disk is greater than or equal to the first threshold, the target transfer time is determined based on the dirty page rate of the first disk, the current transfer time, and the dirty page rate of the second disk in the previous round of dirty page transfer.
[0105] In other embodiments of this application, the processor 51 is used to execute the data migration program in the memory 52 to determine the target transfer time based on the first disk dirty page rate, the current transfer time, and the second disk dirty page rate of the previous round of disk dirty page transfer, in order to implement the following steps: Based on the first disk dirty page rate and the second disk dirty page rate, determine the first rate of change of the disk dirty page rate; The target transmission time is determined based on the first rate of change and the current transmission time.
[0106] In other embodiments of this application, processor 51 is used to execute a data migration program in memory 52 to determine a target transmission time based on a first rate of change value and the current transmission time, in order to implement the following steps: If the first rate of change is less than the second threshold, the target transmission time is obtained by subtracting the current transmission time from the target ratio. If the first rate of change is greater than or equal to the second threshold, the current transmission time is determined as the target transmission time.
[0107] In other embodiments of this application, the processor 51 is used to execute the data migration program in the memory 52 to schedule the next round of dirty page transfer according to the target transfer time, in order to implement the following steps: After multiple rounds of dirty page transfers are completed, the target interruption time for the next round of dirty page transfers is determined based on whether the virtual machine to be migrated meets the target conditions. The target conditions include: automatic convergence is enabled, or automatic convergence is not enabled and the total number of rounds of current dirty page transfers is greater than the starting round of the shutdown adjustment. According to the target transfer time, and within the time limit of the target interrupt time, schedule the next round of dirty page transfer.
[0108] In other embodiments of this application, the processor 51 is used to execute the data migration program in the memory 52 to determine the target interrupt time for the next round of dirty page transfer based on whether the virtual machine to be migrated meets the target conditions, in order to implement the following steps: If the target condition is not met, the current interrupt time of this round of dirty page transfer is determined as the target interrupt time; If the target conditions are met, the time period between the interruption time threshold of the virtual machine to be migrated and the current interruption time is divided based on the target number of virtual machines, resulting in multiple time intervals; The target interrupt time is determined based on the first dirty page rate of the current round of dirty page transfer, the second dirty page rate of the previous round of dirty page transfer, multiple time intervals, and the current interrupt time.
[0109] In other embodiments of this application, processor 51 is used to execute a data migration program in memory 52 to determine a target interrupt time based on a first dirty page rate of the current round of dirty page transfer, a second dirty page rate of the previous round of dirty page transfer, multiple time intervals, and the current interrupt time, in order to implement the following steps: Based on the first and second dirty page rates, a second rate of change of the dirty page rate is determined. The target interruption time is determined based on the second rate of change, multiple time intervals, and the current interruption time.
[0110] In other embodiments of this application, processor 51 is configured to execute a data migration program in memory 52 to determine a target interrupt time based on a second rate of change, multiple time intervals, and the current interrupt time, in order to perform the following steps: If the second rate of change indicates that the dirty page rate is decreasing and the decrease is less than the third threshold, or if the dirty page rate is increasing, the target interrupt time is determined based on the current interrupt time and a time interval; wherein the target interrupt time is less than or equal to the interrupt time threshold. If the second rate of change indicates that the dirty page rate of memory is decreasing and the decrease is greater than or equal to the third threshold, the current interrupt time is determined as the target interrupt time.
[0111] It should be noted that a detailed description of the steps performed by the processor can be found in [reference needed]. Figures 1-3The implementation process of the data migration method provided in the corresponding embodiment will not be described in detail here.
[0112] The virtual machine to be migrated provided in this application dynamically determines the data block granularity of the disk bitmap based on the actual input / output data of the virtual machine to be migrated, so that the bitmap granularity matches the average block size of the input / output operations, thereby accurately tracking dirty pages and avoiding the problem of dirty page amplification caused by fixed granularity, reducing invalid data transmission. At the same time, after each round of disk dirty page transmission is completed, the target transmission time of the next round of memory dirty page transmission is dynamically calculated based on the dirty page rate and its changing trend obtained from disk bitmap tracking. This allows the memory transmission rhythm to adapt to disk transmission pressure. That is, when the disk dirty page rate is high in the early stage of migration, the transmission time is extended to prioritize disk bandwidth, and when the disk load decreases in the later stage of migration, the transmission time is shortened to accelerate memory transmission, thereby achieving a dynamic balance between memory and disk bandwidth resources. Furthermore, by scheduling transmission according to the target transmission time, it is ensured that memory dirty page transmission is executed within the optimal time window, avoiding migration delays or failures caused by bandwidth contention. Ultimately, this not only reduces data redundancy and bandwidth conflicts during the migration process, but also improves the migration success rate and migration efficiency under high load scenarios.
[0113] Based on the foregoing embodiments, this application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to achieve... Figures 1-3 The steps in the data migration method provided in the corresponding embodiment.
[0114] Based on the foregoing embodiments, this application provides a computer program product, which, when executed by a processor, implements... Figures 1-3 The steps in the data migration method provided in the corresponding embodiment.
[0115] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0116] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0117] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0119] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0120] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0121] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0122] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A data migration method, characterized in that, The method includes: Based on the input / output data generated by the virtual machine to be migrated during its operation, the data block granularity of the disk bitmap of the virtual machine to be migrated is determined; After each round of dirty page transfer is completed, the target transfer time for the next round of dirty page transfer is determined based on the first dirty page rate obtained by disk bitmap tracking determined by the data block granularity. Schedule the next round of dirty page transfers according to the target transfer time.
2. The method according to claim 1, characterized in that, The process of determining the data block granularity of the disk bitmap of the virtual machine to be migrated based on the input / output data generated during the operation of the virtual machine includes: From the input / output data, obtain the number of disk blocks that changed during the sampling period and the total amount of data written; Based on the quantity and the total amount of data written, determine the average block granularity of the input / output data; The data block granularity is determined based on the average block granularity and the target strategy; wherein the target strategy characterizes the mapping relationship between the average block granularity and the data block granularity.
3. The method according to claim 1, characterized in that, Based on the first dirty page rate obtained from disk bitmap tracking determined by the data block granularity, the target transfer time for the next round of dirty page transfer is determined, including: Get the current transfer time of this round of dirty page transfer; The target transfer time is determined based on the first disk dirty page rate and the current transfer time.
4. The method according to claim 3, characterized in that, Determining the target transfer time based on the first disk dirty page rate and the current transfer time includes: If the dirty page rate of the first disk is less than the first threshold, the target transfer time is determined to be the target value; If the dirty page rate of the first disk is greater than or equal to the first threshold, the target transmission time is determined based on the dirty page rate of the first disk, the current transmission time, and the dirty page rate of the second disk in the previous round of dirty page transmission.
5. The method according to claim 4, characterized in that, Determining the target transfer time based on the first disk dirty page rate, the current transfer time, and the second disk dirty page rate from the previous round of disk dirty page transfer includes: Based on the first disk dirty page rate and the second disk dirty page rate, a first rate of change of the disk dirty page rate is determined; The target transmission time is determined based on the first rate of change and the current transmission time.
6. The method according to claim 5, characterized in that, Determining the target transmission time based on the first rate of change value and the current transmission time includes: If the first rate of change is less than the second threshold, the target transmission time is obtained by subtracting the current transmission time from the target ratio. If the first rate of change is greater than or equal to the second threshold, the current transmission time is determined to be the target transmission time.
7. The method according to claim 1, characterized in that, The step of scheduling the next round of dirty page transfers according to the target transfer time includes: After multiple rounds of dirty page transfers are completed, the target interruption time for the next round of dirty page transfers is determined based on whether the virtual machine to be migrated meets the target conditions. The target conditions include automatic convergence being enabled, or automatic convergence not being enabled and the total number of rounds of current dirty page transfers being greater than the starting round for initiating shutdown adjustment. According to the target transmission time, and within the time limit of the target interruption time, the next round of dirty page transmission is scheduled.
8. The method according to claim 7, characterized in that, Based on whether the virtual machine to be migrated meets the target conditions, the target outage time for the next round of dirty page transfer is determined, including: If the target condition is not met, the current interrupt time of this round of dirty page transfer is determined as the target interrupt time; If the target conditions are met, the time period between the interruption time threshold of the virtual machine to be migrated and the current interruption time is divided based on the target number of copies to obtain multiple time intervals; The target interrupt time is determined based on the first dirty page rate of the current round of dirty page transfer, the second dirty page rate of the previous round of dirty page transfer, the multiple time intervals, and the current interrupt time.
9. The method according to claim 8, characterized in that, The determination of the target interrupt time based on the first dirty page rate of the current round of dirty page transfer, the second dirty page rate of the previous round of dirty page transfer, the multiple time intervals, and the current interrupt time includes: Based on the first dirty page rate and the second dirty page rate, a second rate of change of the dirty page rate is determined; The target interruption time is determined based on the second rate of change, the plurality of time intervals, and the current interruption time.
10. The method according to claim 9, characterized in that, Determining the target interruption time based on the second rate of change, the plurality of time intervals, and the current interruption time includes: If the second rate of change indicates that the dirty page rate is decreasing and the decrease is less than the third threshold, or the dirty page rate is increasing, the target interrupt time is determined based on the current interrupt time and a time interval; wherein the target interrupt time is less than or equal to the interrupt time threshold. If the second rate of change indicates that the dirty page rate of memory is decreasing and the decrease is greater than or equal to the third threshold, the current interrupt time is determined as the target interrupt time.
11. A data migration device, characterized in that, The device includes: The first processing unit is used to determine the data block granularity of the disk bitmap of the virtual machine to be migrated based on the input / output data generated during the operation of the virtual machine to be migrated. The second processing unit is used to determine the target transfer time for the next round of memory dirty page transfer based on the first disk dirty page rate obtained by disk bitmap tracking determined by the data block granularity after each round of disk dirty page transfer is completed. The transmission unit is used to schedule the transmission of the next round of dirty pages in memory according to the target transmission time.
12. A virtual machine to be migrated, characterized in that, The virtual machine to be migrated includes: a processor, memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute a data migration program in memory to implement the steps of the data migration method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the data migration method as described in any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data migration method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Virtual machine memory migration method and device based on automatic adjustment of iteration time
CN111090496A
Virtual machine migration method and device, electronic equipment and storage medium
CN111638937A
Virtual machine live migration method and device, electronic equipment and storage medium
CN114942825A
Statistical method and device of dirty page rate, electronic equipment and storage medium
CN115794315A
Multi-channel parallel virtual machine online migration method and system based on memory layering
CN120353542A