An online migration method, device, equipment, and storage medium for cloud hosts
By recording the amount and rate of dirty page data during cloud host migration, and using prediction and comparison adaptive selection of migration methods, the problem of difficult to determine the migration threshold under high load and low bandwidth is solved, and efficient online migration of cloud hosts is achieved, reducing downtime and total migration time.
Patent Information
- Application Number
- CN202211032618.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-08-26
AI Technical Summary
In the case of high load, low bandwidth or large fluctuations in the existing technology, it is difficult to determine a reasonable migration threshold, resulting in the migration time of cloud hosts being too long or unable to effectively converge, and it is impossible to achieve efficient online migration of cloud hosts under complex situations such as high load and low bandwidth or large fluctuations in load and bandwidth.
After the full copy is completed, the amount of dirty page data and dirty page rate is recorded, and the migration method is adaptively selected, the number of invalid cycles is reduced, and the migration strategy is automatically adjusted to adapt to different loads and bandwidth changes.
Without setting a fixed migration threshold, reduce cloud host downtime, improve migration efficiency, adapt to complex network environments, and reduce the total migration time.
Smart Images

Figure CN115357194B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and particularly to a method, device, equipment, and storage medium for online migration of cloud hosts. Background Art
[0002] Cloud Computing refers to a new computing model that realizes the sharing of IT resources through virtualization based on Internet-related services. Its core idea is to uniformly manage and schedule resources such as computing, storage, network, and software through the network, realize resource integration and configuration optimization, and meet various needs of different users to obtain and expand at any time, use on demand and pay, and minimize costs in the form of services.
[0003] In a cloud computing platform, it is often necessary to perform online migration of cloud hosts, including the migration of VCPU, memory, and devices. For the migration of cloud server memory, the commonly used methods are PreCopy and PostCopy. The process of PreCopy is as follows: The cloud host is still running on the source server. In the first loop, all the memory images of the cloud host on the source server are copied to the target server. During the copying process, the monitor will monitor the changes in the cloud host memory. In subsequent loops, it is checked whether the memory has changed in the previous loop. If a change has occurred, then the monitor will copy the changed memory pages (Dirty pages) to the target server again and overwrite the previous memory pages. At this stage, the monitor will continue to monitor the changes in the cloud host memory. The monitor will continue such a memory copying loop. As the number of loops increases, the number of Dirty pages to be copied will decrease significantly, and the time consumed for copying will also gradually become shorter. Finally, when the difference in memory data between the source server and the target server reaches a certain standard, the memory copying operation ends, and at the same time, the cloud host is stopped on the source server and started on the destination server to complete the migration. This PreCopy migration scheme can achieve good migration results when the cloud host has a low load and high bandwidth, and the number of memory dirty pages can converge quickly, and finally complete the migration with a very short downtime. However, the problem is that when the cloud host has a high load and continuously writes a large amount of data to the memory, the number of memory dirty pages may converge slowly or even not converge. For this situation, there is no mature solution in the current industry. The usual method is that when the number of iterations of copying memory data is greater than a certain threshold, it is considered that convergence cannot be achieved, and at this time, the cloud host is paused on the source server for forced migration; when the number of memory dirty pages is less than a certain threshold or the predicted downtime is less than a certain threshold, the cloud host is stopped on the source server and started on the destination server to complete the migration. In the case of high load and low bandwidth or large fluctuations in load and bandwidth, it may not be possible to converge in a short time, so it is not possible to effectively determine the threshold of the number of loops for copying memory dirty pages.
[0004] In summary, how to automatically adapt to various complex situations such as high load and low bandwidth or large fluctuations in load and bandwidth without setting a fixed migration threshold, reduce the number of ineffective loops, reduce the downtime of the cloud host, and achieve online migration of the cloud host is a technical problem to be solved in this field. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment, and storage medium for online migration of cloud hosts, which can automatically adapt to various complex situations such as high load and low bandwidth or large fluctuations in load and bandwidth without setting a fixed migration threshold, reduce the number of ineffective loops, reduce the downtime of the cloud host, and achieve online migration of the cloud host. The specific solutions are as follows:
[0006] In the first aspect, the present application discloses a method for online migration of cloud hosts, including:
[0007] Copy the memory image of the cloud host on the source server and make a full copy to the target server;
[0008] When it is detected that the full copy is completed, start the operation of circularly copying the changed dirty page data in the cloud host, and record the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation;
[0009] If the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation;
[0010] If the target dirty page rate is greater than the average migration speed of the dirty page data migration, it is determined that the dirty page data can be successfully migrated, and continue to perform the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed;
[0011] If the target dirty page rate is less than the average migration speed of the dirty page data migration, compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result;
[0012] Select a corresponding dirty page data migration method based on the comparison result to perform dirty page data migration.
[0013] Optionally, before the step of predicting the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation if the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, it further includes:
[0014] Determine the remaining migration time based on the remaining amount of dirty page data and the average migration time.
[0015] Optionally, the online migration method of the cloud host further includes:
[0016] If the remaining migration time of the remaining dirty page data in the cloud host is less than the preset cloud host downtime, the cloud host on the source server is paused to copy the remaining dirty page data to the target server to complete the online migration of the cloud host.
[0017] Optionally, before comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result, it further includes:
[0018] Determine the average bandwidth based on a certain number of total migration data volumes and the corresponding total migration times.
[0019] Optionally, before comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result, it further includes:
[0020] Collect the dirty page rate of each cycle as a prediction sample, and predict the next dirty page rate based on the preset exponential smoothing algorithm and the prediction sample to obtain the predicted next dirty page rate.
[0021] Optionally, comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result includes:
[0022] If the predicted next dirty page rate is less than the average bandwidth, obtain a first comparison result;
[0023] If the predicted next dirty page rate is greater than the average bandwidth, predict the dirty page rate trend to obtain a second comparison result including the dirty page rate trend.
[0024] Optionally, predicting the dirty page rate trend to obtain a second comparison result including the dirty page rate trend includes:
[0025] Predict the dirty page rate trend based on a preset trend test algorithm to obtain a second comparison result including the convergence and / or divergence of the dirty page rate trend.
[0026] In a second aspect, the present application discloses an online migration device for a cloud host, including:
[0027] A memory mirroring module for copying the memory mirror of the cloud host on the source server and fully copying it to the target server;
[0028] A data copying module for, when detecting that the full copy is completed, starting to loop-copy the changed dirty page data in the cloud host and recording the dirty page data volume and the dirty page rate of the dirty page data for each loop-copy operation;
[0029] A dirty page rate prediction module, configured to, if the remaining migration time of the remaining dirty page data in the cloud host is greater than a preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation;
[0030] A first migration module, configured to, if the target dirty page rate is greater than the average migration speed of dirty page data migration, determine that the dirty page data can be successfully migrated, and continue to execute the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed;
[0031] A result comparison module, configured to, if the target dirty page rate is less than the average migration speed of dirty page data migration, compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result;
[0032] A second migration module, configured to select a corresponding dirty page data migration method based on the comparison result to perform dirty page data migration.
[0033] In a third aspect, the present application discloses an electronic device, including:
[0034] A memory, configured to store a computer program;
[0035] A processor, configured to execute the computer program to implement the steps of the aforementioned cloud host online migration method.
[0036] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned cloud host online migration method are implemented.
[0037] As can be seen, the present application discloses a method for online migration of cloud hosts, including: copying the memory image of the cloud host on the source server and making a full copy to the target server; when it is detected that the full copy is completed, starting the operation of circularly copying the changed dirty page data in the cloud host, and recording the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation; if the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predicting the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation; if the target dirty page rate is greater than the average migration speed of the dirty page data migration, determining that the dirty page data can be successfully migrated, and continuing to execute the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed; if the target dirty page rate is less than the average migration speed of the dirty page data migration, comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result; and migrating the dirty page data by selecting a corresponding dirty page data migration method based on the comparison result. It can be seen that by setting the dirty page rate prediction method in the present application to obtain the corresponding adaptive threshold according to the copy situation of the changed dirty page data of each cloud host, the problem of difficult manual setting of a reasonable migration threshold is solved, and it can be adaptive to different dirty page rates and network bandwidths, reducing the total migration time and controlling the downtime within a relatively small range as much as possible, and achieving a balance between reducing the total migration time to improve the migration efficiency and reducing the cloud host downtime. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0039] Figure 1 It is a flowchart of a method for online migration of cloud hosts disclosed in the present application;
[0040] Figure 2 It is a flowchart of a specific method for online migration of cloud hosts disclosed in the present application;
[0041] Figure 3 It is a schematic structural diagram of a device for online migration of cloud hosts disclosed in the present application;
[0042] Figure 4 It is a structural diagram of an electronic device disclosed in the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0044] In a cloud computing platform, it is often necessary to perform online migration of cloud hosts, including the migration of VCPUs, memory, and devices. For the migration of cloud server memory, common methods include PreCopy and PostCopy. The process of PreCopy is as follows: The cloud host is still running on the source server. In the first cycle, all the memory images of the cloud host on the source server are copied to the target server. During the copying process, the monitor will monitor the changes in the cloud host memory. In subsequent cycles, it is checked whether the memory has changed in the previous cycle. If a change has occurred, then the monitor will copy the changed memory pages (Dirty pages) to the target server again and overwrite the previous memory pages. At this stage, the monitor will continue to monitor the changes in the cloud host memory. The monitor will continue such a memory copying cycle. As the number of cycles increases, the number of Dirty pages to be copied will significantly decrease, and the time consumed for copying will also gradually become shorter. Finally, when the difference in memory data between the source server and the target server reaches a certain standard, the memory copying operation ends. At the same time, the cloud host is stopped on the source server and started on the destination server to complete the migration. This PreCopy migration scheme can achieve better migration effects when the cloud host has a low load and high bandwidth. The number of memory dirty pages can quickly converge, and finally the migration can be completed with a very short downtime. However, the problem is that when the cloud host has a high load and continuously writes a large amount of data to the memory, the number of memory dirty pages may converge slowly or even not converge. For this situation, there is no mature solution in the current industry. Usually, when the number of iterations of copying memory data is greater than a certain threshold, it is considered that convergence cannot be achieved. At this time, the cloud host is paused on the source server for forced migration; when the number of memory dirty pages is less than a certain threshold or the predicted downtime is less than a certain threshold, the cloud host is stopped on the source server and started on the destination server to complete the migration. In the case of high load and low bandwidth or large fluctuations in load and bandwidth, it may not be possible to converge in a short time, and thus it is not possible to effectively determine the threshold of the number of cycles for copying memory dirty pages.
[0045] Therefore, the present application provides a cloud host online migration scheme, which can automatically adapt to various complex situations such as high load and low bandwidth or large fluctuations in load and bandwidth without setting a fixed migration threshold, reduce the number of ineffective cycles, reduce the downtime of the cloud host, and achieve online migration of the cloud host.
[0046] Referring to Figure 1 As shown, an embodiment of the present invention discloses a method for online migration of cloud hosts, including:
[0047] Step S11: Copy the memory image of the cloud host on the source server and perform a full copy to the target server.
[0048] In this embodiment, the entire memory image of the cloud host on the source server is copied to the target server. During the process of copying the entire memory image of the cloud host on the source server, the cloud host is still running on the source server. At the same time, a virtual job platform is provided through the hypervisor (virtual machine monitor) to execute the guest operating systems, which is responsible for managing the execution stage of other guest operating systems; these guest operating systems share the virtualized hardware resources together. Among them, the hypervisor is software, firmware, or hardware used to create and execute virtual machines.
[0049] Step S12: When it is detected that the full copy is completed, start the operation of circularly copying the dirty page data that has changed in the cloud host, and record the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation.
[0050] In this embodiment, when it is detected that the full copy is completed, the changed cloud host memory data, that is, the dirty page data, is circularly copied, and the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy are recorded. It can be understood that recording the amount of dirty page data for each circular copy of the dirty page data provides conditions for automatically calculating relevant thresholds in the subsequent process; in the traditional method, certain specific thresholds need to be set manually before each migration of the cloud host, and the migration stops when the threshold is reached. For example, setting the total migration time as the threshold. If the set threshold is too large, it may keep migrating due to the non-convergence of the dirty page rate, wasting time.
[0051] Step S13: If the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation.
[0052] In this embodiment, before predicting the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation when the remaining migration time of the remaining dirty page data quantity in the cloud host is greater than the preset cloud host downtime, it further includes: determining the remaining migration time based on the remaining dirty page data quantity and the average migration time. It can be understood that the remaining migration time required for migrating the remaining dirty page data is calculated by dividing the remaining dirty page data quantity by the average migration speed, where the calculation process of the average migration speed is to divide the total data volume of several previous migrations by the total time of several previous migrations; if the calculated remaining migration time of the remaining dirty page data quantity is greater than the preset cloud host downtime, then predict the target dirty page rate of this cyclic copy operation based on the dirty page rate of the previous cyclic copy operation. For example: if the copy loop count is greater than 10 times and the migration is still not completed, it is considered that the dirty page quantity of each loop may not converge, and it is necessary to predict the target dirty page rate based on the dirty page rate of the previous cyclic copy operation, and compare the average migration speed of the dirty page data migration with the target dirty page rate.
[0053] In this embodiment, if the remaining migration time of the remaining dirty page data quantity in the cloud host is less than the preset cloud host downtime, then pause the cloud host on the source server so as to copy the remaining dirty page data to the target server to complete the online migration of the cloud host. It can be understood that if this time is less than the expected maximum cloud host downtime, it is considered that the condition for cloud host switching is met, pause the cloud host on the source host, copy the remaining dirty pages on the source host to the destination host, and then resume the cloud host on the destination host to complete the migration. For example: if the copy loop count is less than 10 times and the memory dirty pages converge to be small enough to ensure that the cloud host can be switched between the source server and the destination server in a sufficiently short time, then the migration can be completed.
[0054] Step S14: If the target dirty page rate is greater than the average migration speed of the dirty page data migration, then determine that the dirty page data can be successfully migrated, and continue to perform the operation of cyclically copying the changed dirty page data in the cloud host until the dirty page data migration is completed.
[0055] In this embodiment, if the average migration speed is greater than the target dirty page rate, it is considered that the quantity of dirty pages in each loop will gradually decrease and can be migrated successfully, and continue to cyclically copy the data until the dirty page data migration is completed.
[0056] Step S15: If the target dirty page rate is less than the average migration speed of the dirty page data migration, then compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result.
[0057] In this embodiment, if it is detected that the target dirty page rate is less than the average migration speed of dirty page data migration, a second comparison operation is started to compare the predicted next dirty page rate with the average bandwidth, and a corresponding comparison result is obtained. It can be understood that on the premise that the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, the current target dirty page rate is predicted, and on the premise that the target dirty page rate is less than the average migration speed for the second time, the dirty page rate for the next cyclic copy operation is predicted, the next dirty page rate is compared with the average bandwidth, and a corresponding comparison result is obtained.
[0058] In this embodiment, before comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result, it further includes: determining the average bandwidth based on a certain number of total migration data volumes and corresponding total migration times. It can be understood that before comparing the average bandwidth, according to the recorded total amount of migrated and copied data and the total migration time, the total amount of data is divided by the total migration time as the average bandwidth.
[0059] Step S16: Select a corresponding dirty page data migration method based on the comparison result to perform dirty page data migration.
[0060] In this embodiment, based on the comparison result of comparing the predicted next dirty page rate with the average bandwidth, a migration method of continuing to copy the remaining dirty page data until the copying is completed or a forced intervention measure is taken to inhibit some operations of the cloud host in the source host, and then the dirty page data after the inhibition operation is copied until the copying is completed is selected for dirty page data migration. It can be understood that by adopting the adaptive threshold method proposed in this application, the trend of non-convergence of the dirty page rate can be predicted in advance, and intervention measures can be taken in time to avoid falling into an infinite loop of copying data for a long time, improving the migration efficiency; if the set threshold is too small, there may be a large number of remaining dirty pages not migrated. At this time, if forced downtime migration is performed, the cloud host downtime will be too long. By adopting the adaptive threshold method, the trend of convergence of the dirty page rate can be predicted, the number of cycles can be increased until the number of remaining dirty pages is small, and then downtime migration is performed, reducing the downtime of the cloud host during the migration process. There is no need to artificially set the total migration time, total migration data volume, or total number of cycles as a threshold before migration, and it can be adaptive to different dirty page rates and network bandwidths, automatically selecting an appropriate cloud host downtime switching timing.
[0061] It can be seen that the present application discloses a method for online migration of cloud hosts, including: copying the memory image of the cloud host on the source server and making a full copy to the target server; when it is detected that the full copy is completed, starting an operation of circularly copying the changed dirty page data in the cloud host, and recording the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation; if the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predicting the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation; if the target dirty page rate is greater than the average migration speed of the dirty page data migration, determining that the dirty page data can be successfully migrated, and continuing to execute the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed; if the target dirty page rate is less than the average migration speed of the dirty page data migration, comparing the predicted dirty page rate of the next time with the average bandwidth to obtain a comparison result; and migrating the dirty page data by selecting a corresponding dirty page data migration method based on the comparison result. It can be seen that by setting the dirty page rate prediction method in the present application to obtain the corresponding adaptive threshold according to the copy situation of the changed dirty page data of each cloud host, the problem of difficult manual setting of a reasonable migration threshold is solved, and it can be adaptive to different dirty page rates and network bandwidths, reducing the total migration time and controlling the downtime within a relatively small range as much as possible, and achieving a balance between reducing the total migration time to improve the migration efficiency and reducing the cloud host downtime.
[0062] Referring to Figure 2 As shown, an embodiment of the present invention discloses a specific method for online migration of cloud hosts. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:
[0063] Step S21: Copy the memory image of the cloud host on the source server and make a full copy to the target server.
[0064] Step S22: When it is detected that the full copy is completed, start an operation of circularly copying the changed dirty page data in the cloud host, and record the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation.
[0065] Step S23: If the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation.
[0066] Step S24: If the target dirty page rate is greater than the average migration speed of the dirty page data migration, determine that the dirty page data can be successfully migrated, and continue to execute the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed.
[0067] Among them, for the more detailed processing procedures in steps S21, S22, S23, and S24, please refer to the content of the foregoing disclosed embodiments, and will not be elaborated herein.
[0068] Step S25: If the target dirty page rate is less than the average migration speed of dirty page data migration, then compare the predicted next dirty page rate with the average bandwidth. If the predicted next dirty page rate is less than the average bandwidth, a first comparison result is obtained; if the predicted next dirty page rate is greater than the average bandwidth, then predict the dirty page rate trend to obtain a second comparison result including the dirty page rate trend.
[0069] In this embodiment, if the average migration speed is less than the dirty page rate, then if the loop continues, the number of dirty pages in each loop may not converge. It is necessary to predict the dirty page rate in the next loop and then predict the trend of the dirty page rate. Before comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result, it further includes: collecting the dirty page rate of each loop as a prediction sample, and predicting the next dirty page rate based on a preset exponential smoothing algorithm and the prediction sample to obtain the predicted next dirty page rate. It can be understood that the method of predicting the dirty page rate is to use the dirty page rate of several previous loops as samples and adopt the exponential smoothing algorithm to predict the dirty page rate of the next loop.
[0070] In this embodiment, predicting the dirty page rate trend to obtain a second comparison result including the dirty page rate trend includes: predicting the dirty page rate trend based on a preset trend test algorithm to obtain a second comparison result including the convergence and / or divergence of the dirty page rate trend.
[0071] In one implementation, if the predicted result is that the dirty page rate in the next loop is less than the average bandwidth, then continue to loop for migration, and judge whether the trend of the dirty page rate will diverge in each copy loop. If the trend of the dirty page rate does not diverge, then continue with the next loop. After each loop, judge whether the requirements for the downtime of the foregoing cloud host are met according to the foregoing method. If the conditions are met, switch between the source host and the destination host to complete the migration; if the downtime requirements are not met, then judge whether the dirty page rate converges according to the above dirty page rate judgment conditions, and select forced intervention or continue to loop.
[0072] In another embodiment, if the predicted result is that the dirty page rate in the next cycle is greater than the average bandwidth, then if data copying continues in a loop, the dirty page rate may not converge. To further confirm the trend of the dirty page rate, the trend of the dirty page rate is predicted. Methods such as the Cox-Stuart test or the Mann-Kendall test can be used to predict the trend of the dirty page rate. If, within a certain confidence interval, the predicted trend of the dirty page rate is upward, then continuing the migration at this time is likely to fail, and coercive measures need to be taken for intervention. For example, suppress the memory writes of the cloud host on the source host to artificially reduce the dirty page rate; or forcibly pause the cloud host on the source host, copy the remaining dirty pages on the source host to the destination host, and then resume the cloud host on the destination host to complete the migration.
[0073] Step S26: Based on the comparison result, select the corresponding dirty page data migration method to perform dirty page data migration.
[0074] In this embodiment, based on the first comparison result and the second comparison result, select the corresponding dirty page data migration method to perform the data migration operation, and finally complete the migration of the cloud host from the source host to the target host.
[0075] It can be seen that the technical solution of this application can be applied to various complex scenarios. Whether the dirty page rate gradually adjusts from being initially less than the network bandwidth to exceeding the network bandwidth, or the dirty page rate gradually adjusts from being initially greater than the network bandwidth to less than the network bandwidth, this solution can be used to improve the migration effect. Among them, when the dirty page rate and the network environment change continuously, it can be automatically adjusted for self-adaptation. It takes into account two goals of reducing the total migration time and reducing the cloud host downtime. In the case where the dirty page rate does not converge, methods such as suppressing the memory writes of the cloud host or other methods can be used for intervention to improve the migration effect. On the basis of using the exponential smoothing algorithm for prediction, a trend test is carried out, which further ensures the accuracy of the prediction.
[0076] Refer to Figure 3 As shown, an embodiment of the present invention also correspondingly discloses a cloud host online migration device, including:
[0077] A memory mirroring module 11, configured to copy the memory mirror of the cloud host on the source server and perform a full copy to the target server;
[0078] A data copying module 12, configured to, when detecting that the full copy is completed, start the operation of circularly copying the changed dirty page data in the cloud host, and record the amount of dirty page data and the dirty page rate of the dirty page data for each circular copying operation;
[0079] The dirty page rate prediction module 13 is configured to, if the remaining migration time of the remaining dirty page data quantity in the cloud host is greater than the preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation;
[0080] The first migration module 14 is configured to, if the target dirty page rate is greater than the average migration speed of the dirty page data migration, determine that the dirty page data can be successfully migrated, and continue to execute the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed;
[0081] The result comparison module 15 is configured to, if the target dirty page rate is less than the average migration speed of the dirty page data migration, compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result;
[0082] The second migration module 16 is configured to perform dirty page data migration based on the comparison result by selecting a corresponding dirty page data migration method.
[0083] It can be seen that the present application discloses a cloud host online migration method, including: copying the memory image of the cloud host on the source server, and performing a full copy to the target server; when it is detected that the full copy is completed, starting the operation of circularly copying the changed dirty page data in the cloud host, and recording the dirty page data quantity and the dirty page rate of the dirty page data for each circular copy operation; if the remaining migration time of the remaining dirty page data quantity in the cloud host is greater than the preset cloud host downtime, predicting the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation; if the target dirty page rate is greater than the average migration speed of the dirty page data migration, determining that the dirty page data can be successfully migrated, and continuing to execute the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed; if the target dirty page rate is less than the average migration speed of the dirty page data migration, comparing the predicted next dirty page rate with the average bandwidth to obtain a comparison result; performing dirty page data migration based on the comparison result by selecting a corresponding dirty page data migration method. It can be seen that by setting the dirty page rate prediction method in the present application to obtain the corresponding adaptive threshold according to the copy situation of the changed dirty page data of each cloud host, the problem of difficult manual setting of a reasonable migration threshold is solved, and it can be adaptive to different dirty page rates and network bandwidths, reducing the total migration time and controlling the downtime within a relatively small range as much as possible, and achieving a balance between reducing the total migration time to improve the migration efficiency and reducing the cloud host downtime.
[0084] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 4 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be regarded as any limitation on the usage scope of the present application.
[0085] Figure 4 This is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the cloud host online migration method disclosed in any of the foregoing embodiments. Additionally, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0086] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of the present application, and specific limitations are not imposed here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitations are made here.
[0087] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one of the following hardware forms: DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0088] Additionally, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0089] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the online migration method of the cloud host executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. In addition to the data transmitted by external devices received by the electronic device, the data 223 may also include data collected by its own input / output interface 25, etc.
[0090] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the online migration method of the cloud host disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0091] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts between the various embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and reference can be made to the description in the method part for related parts.
[0092] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application. The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the technical field.
[0093] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent in such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element.
[0094] The above has introduced in detail a cloud host online migration method, apparatus, device, and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. An online migration method for cloud hosts, characterized in that, Including: Copy the memory image of the cloud host on the source server and make a full copy to the target server; When it is detected that the full copy is completed, start the operation of circularly copying the changed dirty page data in the cloud host, and record the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation; If the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation; If the target dirty page rate is greater than the average migration speed of the dirty page data migration, determine that the dirty page data can be successfully migrated, and continue to perform the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed; If the target dirty page rate is less than the average migration speed of the dirty page data migration, compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result; Based on the comparison result, select the corresponding dirty page data migration method to perform the dirty page data migration.
2. The online migration method of the cloud host according to claim 1, wherein Before the step of if the remaining migration time of the remaining dirty page data in the cloud host is greater than the preset cloud host downtime, predict the target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation, it further includes: Determine the remaining migration time based on the remaining dirty page data quantity and the average migration time.
3. The online migration method of the cloud host according to claim 1, wherein It also includes: If the remaining migration time of the remaining dirty page data in the cloud host is less than the preset cloud host downtime, pause the cloud host on the source server so as to copy the remaining dirty page data to the target server and complete the online migration of the cloud host.
4. The online migration method of a cloud host according to claim 1, wherein Before the step of compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result, it further includes: Determine the average bandwidth based on a certain number of total migration data volumes and the corresponding total migration times.
5. The online migration method of a cloud host according to claim 1, characterized in that Before the step of compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result, it further includes: Collect the dirty page rate of each cycle as a prediction sample, and predict the next dirty page rate based on the preset exponential smoothing algorithm and the prediction sample to obtain the predicted next dirty page rate.
6. The online migration method of a cloud host according to any one of claims 1 to 5, characterized in that, The step of compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result includes: If the predicted next dirty page rate is less than the average bandwidth, obtain a first comparison result; If the predicted next dirty page rate is greater than the average bandwidth, predict the dirty page rate trend to obtain a second comparison result including the dirty page rate trend.
7. The online migration method of the cloud host according to claim 6, characterized in that The step of predict the dirty page rate trend to obtain a second comparison result including the dirty page rate trend includes: Predict the dirty page rate trend based on the preset trend test algorithm to obtain a second comparison result including the convergence and / or divergence of the dirty page rate trend.
8. An online migration device for cloud hosts, characterized in that, Including: A memory image module, which is used to copy the memory image of the cloud host on the source server and make a full copy to the target server; A data copy module, which is used to start the operation of circularly copying the changed dirty page data in the cloud host when it is detected that the full copy is completed, and record the amount of dirty page data and the dirty page rate of the dirty page data for each circular copy operation; A dirty page rate prediction module, configured to predict a target dirty page rate of the current copy operation based on the dirty page rate of the previous copy operation if the remaining migration time of the remaining dirty page data in the cloud host is greater than a preset cloud host downtime; A first migration module, configured to determine that the dirty page data can be successfully migrated and continue to perform the operation of circularly copying the changed dirty page data in the cloud host until the dirty page data migration is completed if the target dirty page rate is greater than the average migration speed of the dirty page data migration; A result comparison module, configured to compare the predicted next dirty page rate with the average bandwidth to obtain a comparison result if the target dirty page rate is less than the average migration speed of the dirty page data migration; A second migration module, configured to perform dirty page data migration by selecting a corresponding dirty page data migration method based on the comparison result.
9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the cloud host online migration method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by the processor, the steps of the cloud host online migration method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Scheduling method and system for virtual-machine memory self-adaption thermal migration in hybrid cloud mode
CN107479944A
Method for determining virtual machine migration opportunity based on prediction of utilization rate change trend
CN108804198A