A hot migration method, device, program product and medium
By constructing a dirty page generation rate prediction model based on the long short-term memory network, the bottleneck problem of dirty page processing in virtual machine live migration is solved, the migration success rate and data center resource utilization are improved, and the user experience is optimized.
Patent Information
- Application Number
- CN202410939697.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-15
AI Technical Summary
In a cloud computing environment, dirty page processing during virtual machine live migration has become a performance bottleneck. Especially when a large number of dirty pages need to be synchronized, migration time and interruption time are significantly increased, affecting user experience. It is difficult for existing technology to effectively solve the problem of reasonable The problem of performing live migration of virtual machines to improve the success rate.
By building a dirty page generation rate prediction model based on the long short-term memory network, we can accurately predict the dirty page generation rate, and determine the hot migration timing based on the prediction results, so as to select the appropriate physical host for migration and avoid performing migration during the peak period of the dirty page generation rate. , Reduce the impact of the migration process on the business.
It improves the success rate of virtual machine live migration, reduces network bandwidth consumption and service interruption time, improves the overall resource utilization and response speed of the data center, and ensures business continuity and user experience.
Smart Images

Figure CN118502885B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a hot migration method, device, program product and medium. Background Art
[0002] In cloud computing environments, virtual machine hot migration is a key technology for achieving dynamic resource scheduling, load balancing, and fault recovery. However, dirty page processing during hot migration often becomes a performance bottleneck, especially when a large number of dirty pages need to be synchronized, which significantly increases migration time and interruption time, affecting user experience. Therefore, how to reasonably hot migrate virtual machines, improve the success rate of hot migration, and meet user business needs is an urgent problem to be solved in existing technologies. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a hot migration method, device, program product and medium, which can accurately predict the dirty page generation rate and make hot migration decisions based on it, thereby improving the success rate of virtual machine hot migration. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a thermal migration method, comprising:
[0005] Determine the virtual machine to be migrated and obtain a list of physical hosts that meet the preset hot migration conditions;
[0006] Capturing current running data from the virtual machine to be migrated, and performing data processing on the current running data to obtain target running data;
[0007] The target operation data is input into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, and the hot migration timing of the virtual machine to be migrated is determined according to the dirty page generation rate; wherein the dirty page generation rate prediction model is constructed based on the historical operation data of the virtual machine to be migrated as an input parameter, and the historical operation data includes the historical data of the dirty page generation rate; the dirty page generation rate prediction model is a model constructed based on a long short-term memory network;
[0008] A target physical host is selected from the physical host list, and the virtual machine to be migrated is migrated to the target physical host based on the hot migration opportunity.
[0009] Optionally, obtaining a list of physical hosts that meet preset hot migration conditions includes:
[0010] Obtain resource usage of each physical host in the data center through a preset monitoring service component of the cloud platform, and screen the physical hosts according to the resource usage to obtain a list of physical hosts that meet preset hot migration conditions;
[0011] Or, call the first target interface corresponding to the component computing service of the cloud platform to obtain the resource usage of each physical host in the data center; filter the physical hosts according to the resource usage to obtain a list of physical hosts that meet preset hot migration conditions.
[0012] Optionally, after obtaining the list of physical hosts that meet the preset hot migration conditions, the method further includes:
[0013] Collect network bandwidth data corresponding to each physical host in the physical host list;
[0014] Correspondingly, selecting a target physical host from the physical host list includes:
[0015] The maximum network bandwidth data is screened out from the network bandwidth data corresponding to each physical host in the physical host list, and the physical host corresponding to the maximum network bandwidth data is determined as the target physical host.
[0016] Optionally, capturing current running data from the virtual machine to be migrated includes:
[0017] The current running data of the virtual machine to be migrated is obtained by using the virtual memory statistics command of the operating system in the virtual machine to be migrated, and the second target interface and monitoring tool provided by the virtual machine monitor.
[0018] Optionally, the performing data processing on the current operation data to obtain target operation data includes:
[0019] The current operation data is preprocessed and converted into a data format that can be input into the dirty page generation rate prediction model to obtain target operation data.
[0020] Optionally, before inputting the target operation data into a pre-trained dirty page generation rate prediction model, the method further includes:
[0021] Obtaining the dirty page generation history and historical operation data of the virtual machine to be migrated;
[0022] The dirty page generation history record and the historical operation data are used as a data set, and the data set is divided into a training set and a test set by using a rolling window data segmentation method;
[0023] The training set is used to train a neural network model pre-constructed based on a long short-term memory network, and the test set is used to test the neural network model to obtain the dirty page generation rate prediction model.
[0024] Optionally, before using the training set to train the neural network model pre-built based on the long short-term memory network, the method further includes:
[0025] A neural network model consisting of an input layer, a long short-term memory network layer, a discard layer, and an output layer is constructed to obtain the neural network model constructed based on the long short-term memory network.
[0026] Optionally, before using the training set to train the neural network model pre-built based on the long short-term memory network, the method further includes:
[0027] The neural network model based on the long short-term memory network is built using a preset machine learning framework and a corresponding preset deep learning library.
[0028] Optionally, the using the training set to train a neural network model pre-constructed based on a long short-term memory network includes:
[0029] Obtaining initialization parameters of the neural network model;
[0030] The training set is input into a neural network model pre-constructed based on a long short-term memory network, and the initialization parameters are updated using the mean square error as a loss function and the root mean square error as an evaluation indicator, and the parameters of the neural network model are adjusted using an optimizer based on adaptive moment estimation.
[0031] Optionally, inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate within a preset time period output by the dirty page generation rate prediction model, and determining the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate, includes:
[0032] Inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate within a preset time period output by the dirty page generation rate prediction model;
[0033] A target time period corresponding to when the dirty page generation rate is the smallest within the preset time period is determined, and a start time of the target time period is used as a hot migration opportunity of the virtual machine to be migrated.
[0034] Optionally, the thermal migration method further includes:
[0035] The dirty page generation rate prediction model is updated based on a preset time interval to obtain an updated model, and the updated model is used to predict the dirty page generation rate of the virtual machine to be migrated.
[0036] Optionally, after inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, the method further includes:
[0037] When it is monitored that the dirty page generation rate exceeds a preset dirty page generation rate threshold, data processing is performed on the virtual machine to be migrated based on a preset data processing strategy.
[0038] In a second aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the thermal migration method as described above.
[0039] In a third aspect, the present application discloses a computer program product, including a computer program / instruction, which implements the steps of the aforementioned hot migration method when executed by a processor.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned hot migration method when executed by a processor.
[0041] The present application provides a hot migration method, comprising: determining a virtual machine to be migrated, and obtaining a list of physical hosts that meet preset hot migration conditions; capturing current operating data from the virtual machine to be migrated, and performing data processing on the current operating data to obtain target operating data; inputting the target operating data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate within a preset time period output by the dirty page generation rate prediction model, and determining the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate; wherein the dirty page generation rate prediction model is constructed based on taking the historical operating data of the virtual machine to be migrated as an input parameter, and the historical operating data includes historical data of the dirty page generation rate; the dirty page generation rate prediction model is a model constructed based on a long short-term memory network; selecting a target physical host from the physical host list, and migrating the virtual machine to be migrated to the target physical host based on the hot migration timing.
[0042] The beneficial technical effect of the present application is as follows: by using the dirty page generation rate prediction model to predict the dirty page generation rate of the virtual machine to be migrated during the hot migration process, and by analyzing the prediction results, a reasonable hot migration timing is given. The migration operation can be planned in advance, and more accurate and efficient migration decisions can be made to avoid performing migration during the peak period of dirty page generation rate, reduce the impact on the business during the migration process, and thus improve the success rate of virtual machine hot migration. In addition, the target physical host is selected from the list of physical hosts that meet the preset hot migration conditions, and the virtual machine to be migrated is migrated to the target physical host, which can adapt to the changing workload characteristics and dynamically adjust the migration strategy. It can be seen that, combined with the dirty page generation rate predicted by the prediction model, and the target physical host selected from the list of physical hosts based on the hot migration timing, the network congestion caused by the synchronization of a large amount of data can be avoided, and the network bandwidth consumption can be reduced to minimize the service interruption time. Furthermore, it can improve the overall resource utilization and response speed of the data center, while optimizing the allocation of data center resources to ensure business continuity and user experience.
[0043] In addition, the present application provides a thermal migration device, a program product, and a medium, which correspond to the above-mentioned thermal migration method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 A flow chart of a thermal migration method disclosed in this application;
[0046] Figure 2 A schematic diagram of a dirty page generation rate prediction model constructed and disclosed in the present application;
[0047] Figure 3 A schematic diagram of a hot migration system execution process disclosed in this application;
[0048] Figure 4 A schematic diagram of a thermal migration process disclosed in this application;
[0049] Figure 5 A schematic diagram of the structure of a thermal migration device disclosed in this application;
[0050] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] Currently, the hot migration process mainly migrates the memory of the virtual machine to be migrated from the source host to the target host. Whether the migration is successful depends on user experience. When the user experience is insufficient, it is impossible to give a reasonable hot migration strategy, and the hot migration success rate is low. When the load of the virtual machine to be migrated is high, the virtual machine to be migrated will continuously access the memory, resulting in a high rate of dirty page generation. In the iterative migration of the virtual machine memory, a lot of time will be spent on multiple memory migrations, resulting in a long period of non-convergence of hot migration, service interruption, and impact on user business.
[0053] To this end, the present application provides a hot migration solution that can accurately predict the dirty page generation rate and make hot migration decisions based on it, thereby improving the success rate of virtual machine hot migration.
[0054] Before introducing the present application, in order to facilitate a better understanding of the present application, the relevant terms used in the present application are first explained.
[0055] Hot migration: also known as live migration, is an advanced feature in modern virtualization technology that allows a virtual machine (VM) to be migrated from one physical host to another without shutting down the machine. During hot migration, the running status of the virtual machine, including its memory status, CPU (Central Processing Unit) register status, and all related virtual disk and network configuration information, will be transmitted to the target host in real time.
[0056] Dirty page: A concept in the Linux kernel. Because the read and write speed of the hard disk is far slower than the speed of the memory, the system puts the data that is read and written more frequently into the memory in advance to increase the read and write speed. This is called cache. Linux uses pages as the unit of cache. When the process modifies the data in the cache, the page is marked as a dirty page by the kernel.
[0057] LSTM (Long Short-Term Memory) is a special type of time recurrent neural network (RNN). When processing time series data, it can retain long-term context information without the problem of gradient disappearance or gradient explosion. It is particularly good at solving time series prediction problems.
[0058] The optimizer is a very important part of this process. Its main responsibility is to update the model parameters (such as weights and biases) according to the gradient calculated by the loss function (i.e. the direction and size of the model prediction error) in the hope of gradually reducing the value of the loss function, so that the model performs better and better on the training data. Adam (Adaptive MomentEstimation): is one of the most commonly used optimizers in deep learning because it performs well on many problems and can automatically adjust the learning rate.
[0059] Overfitting is a common phenomenon in machine learning and statistical modeling, which means that the model performs too well on the training data, so that it learns the noise and details in the training data instead of the real rules or general patterns behind the data. This causes the model to lose its generalization ability, that is, it performs poorly on unseen test data or new data.
[0060] The embodiment of the present invention discloses a thermal migration method, see Figure 1 As shown, the method includes:
[0061] Step S11: determine the virtual machine to be migrated, and obtain a list of physical hosts that meet preset hot migration conditions.
[0062] First, the user selects a virtual machine to be migrated that needs to be hot migrated. After the user selects the virtual machine to be migrated, the system will screen out a list of physical hosts that meet the hot migration requirements, that is, determine a list of physical hosts that meet the preset hot migration conditions.
[0063] Specifically, the system can obtain the resource usage of each physical host in the data center through the preset monitoring service component of the cloud platform, and filter the physical hosts according to the resource usage to obtain a list of physical hosts that meet the preset hot migration conditions; or, call the first target interface corresponding to the component computing service of the cloud platform to obtain the resource usage of each physical host in the data center; filter the physical hosts according to the resource usage to obtain a list of physical hosts that meet the preset hot migration conditions.
[0064] It is understandable that the monitoring service components of the cloud platform mainly include computing monitoring, network monitoring, storage monitoring, database monitoring, middleware monitoring, application monitoring, log monitoring, custom monitoring, etc. The types of preset monitoring service components are not limited in the embodiments of the present application. In addition, the component computing service of the cloud platform is a component used to manage and maintain computing resources in a cloud computing environment. It can be seen that the system will obtain the resource usage of all physical hosts in the entire data center through the monitoring service components of the cloud platform or directly call the relevant interfaces of the component computing service of the cloud platform, and then select a list of physical hosts that meet the requirements of hot migration through the pre-check mechanism.
[0065] It should be noted that the resource usage of each physical host in a data center or cloud platform may include CPU (Central Processing Unit) load, memory usage, network bandwidth, etc. Filtering out the host list that currently meets the hot migration conditions can ensure the feasibility of the migration operation.
[0066] Step S12: capturing current running data from the virtual machine to be migrated, and performing data processing on the current running data to obtain target running data.
[0067] In an embodiment of the present application, runtime data is continuously captured from the virtual machine to be migrated, including but not limited to memory access mode, I / O (Input / output) activity frequency, CPU utilization, memory utilization, network bandwidth, dirty page generation rate, etc., to provide basic information for subsequent analysis.
[0068] Specifically, the current running data of the virtual machine to be migrated is obtained by using the virtual memory statistics command of the operating system in the virtual machine to be migrated, and the second target interface and monitoring tool provided by the virtual machine monitor. Exemplarily, the current running data of the virtual machine to be migrated is obtained by using the monitoring tool vmstat (Virtual Memory Statistics) command inside the virtual machine operating system and the interface and tools (some debugging and monitoring features in the QEMU (Quick Emulator, virtual operating system simulator) / KVM (Kernel-based Virtual Machine, kernel-based virtual machine) environment) provided by the hypervisor (virtual machine monitor).
[0069] Furthermore, the collected data cannot be used directly and needs to be processed. Specifically, the current operating data is preprocessed and converted into a data format that can be input into the dirty page generation rate prediction model to obtain the target operating data. The preprocessing process may include cleaning, integration, missing value processing, feature engineering, normalization, etc., and may also include removing outliers in the data to ensure data quality. In this way, after preprocessing, it is made into a data format that can be used by the model and input into the model for prediction.
[0070] Step S13: input the target operation data into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, and determine the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate.
[0071] Among them, the dirty page generation rate prediction model is constructed based on the historical operation data of the virtual machine to be migrated as an input parameter, and the historical operation data includes historical data of the dirty page generation rate; the dirty page generation rate prediction model is a model constructed based on a long short-term memory network.
[0072] In the embodiment of the present application, the target operation data is data in a data format suitable for use by the model, and the target operation data is input into a pre-trained dirty page generation rate prediction model that can predict the dirty page generation rate, so that it outputs the predicted dirty page generation rate. It should be pointed out that after predicting the dirty page generation rate for a period of time in the future, a preliminary analysis is performed in combination with the current load of the virtual machine to analyze and determine whether the hot migration threshold is about to be reached and when is the best time for migration.
[0073] In a specific implementation, when the dirty page generation rate is monitored to exceed a preset dirty page generation rate threshold, data processing is performed on the virtual machine to be migrated based on a preset data processing strategy. In this way, when it is predicted that the dirty page generation rate increases significantly, measures such as temporarily suspending non-critical write operations can be taken to reduce the amount of data that needs to be synchronized during migration, accelerate migration convergence, and reduce migration time.
[0074] In another specific implementation, by finding the time period T in which the dirty page generation rate of the virtual machine is the smallest within a period of time in the future, the starting moment T0 of this time period T is determined as the best hot migration time for the virtual machine to be migrated. Specifically, the target operation data is input into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate within a preset time period output by the dirty page generation rate prediction model; the target time period corresponding to the time when the dirty page generation rate is the smallest within the preset time period is determined, and the starting moment of the target time period is used as the hot migration time for the virtual machine to be migrated. In this way, determining the hot migration time can plan the migration operation in advance, avoid performing migration during the peak period of dirty page generation rate, improve the efficiency and success rate of hot migration, and reduce the impact on the business during the migration process.
[0075] Step S14: Select a target physical host from the physical host list, and migrate the virtual machine to be migrated to the target physical host based on the hot migration opportunity.
[0076] It can be seen from the above steps that after the user selects the virtual machine to be migrated, a list of physical hosts that meet the hot migration conditions is screened out. Therefore, in the embodiment of the present application, when hot migration of the virtual machine to be migrated is performed, based on the list of hosts that currently meet the hot migration conditions, the impact of hot migration of the virtual machine to these hosts on the cloud platform is evaluated, and the final hot migration decision is made. That is, the most suitable host is selected from the list of physical hosts as the target physical host, and the hot migration task is automatically triggered at the best migration time to migrate the virtual machine to the target physical host.
[0077] It should be noted that after obtaining the list of physical hosts that meet the preset hot migration conditions, it also includes: collecting network bandwidth data corresponding to each physical host in the list of physical hosts. Correspondingly, selecting the target physical host from the list of physical hosts includes: filtering out the maximum network bandwidth data from the network bandwidth data corresponding to each physical host in the list of physical hosts, and determining the physical host corresponding to the maximum network bandwidth data as the target physical host.
[0078] It can be seen that after filtering out the list of physical hosts that meet the hot migration conditions, the network bandwidth data of the physical hosts are collected, and then by comparing the network bandwidth of each physical host, the host with the largest network bandwidth is filtered out from the list of physical hosts that meet the hot migration conditions, that is, the physical host that is most suitable for hot migration. At this time, the corresponding analysis result is the hot migration decision fed back by the hot migration mechanism. In this way, the migration decision provided in the embodiment of the present application can also help reduce network bandwidth consumption, avoid network congestion caused by synchronization of large amounts of data, and further improve the overall resource utilization and response speed of the data center.
[0079] The present application provides a hot migration method, including: determining a virtual machine to be migrated, and obtaining a list of physical hosts that meet preset hot migration conditions; capturing current running data from the virtual machine to be migrated, and performing data processing on the current running data to obtain target running data; inputting the target running data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate within a preset time period output by the dirty page generation rate prediction model, and determining the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate; selecting a target physical host from the physical host list, and migrating the virtual machine to be migrated to the target physical host based on the hot migration timing.
[0080] The beneficial technical effect of the present application is as follows: by using the dirty page generation rate prediction model to predict the dirty page generation rate of the virtual machine to be migrated during the hot migration process, and by analyzing the prediction results, a reasonable hot migration timing is given. The migration operation can be planned in advance, and more accurate and efficient migration decisions can be made to avoid performing migration during the peak period of dirty page generation rate, reduce the impact on the business during the migration process, and thus improve the success rate of virtual machine hot migration. In addition, the target physical host is selected from the list of physical hosts that meet the preset hot migration conditions, and the virtual machine to be migrated is migrated to the target physical host, which can adapt to the changing workload characteristics and dynamically adjust the migration strategy. It can be seen that, combined with the dirty page generation rate predicted by the prediction model, and the target physical host selected from the list of physical hosts based on the hot migration timing, the network congestion caused by the synchronization of a large amount of data can be avoided, and the network bandwidth consumption can be reduced to minimize the service interruption time. Furthermore, it can improve the overall resource utilization and response speed of the data center, while optimizing the allocation of data center resources to ensure business continuity and user experience.
[0081] Based on the above embodiment, in a feasible implementation, in order to obtain the final dirty page generation rate prediction model, the dirty page generation rate prediction model is trained in the embodiment of the present application. Specifically, before inputting the target operation data into the pre-trained dirty page generation rate prediction model, the following steps may also be included:
[0082] Obtaining the dirty page generation history and historical operation data of the virtual machine to be migrated;
[0083] The dirty page generation history record and the historical operation data are used as a data set, and the data set is divided into a training set and a test set by using a rolling window data segmentation method;
[0084] The training set is used to train a neural network model pre-constructed based on a long short-term memory network, and the test set is used to test the neural network model to obtain the dirty page generation rate prediction model.
[0085] In the embodiment of the present application, the dirty page generation history record and historical operation data of the virtual machine to be migrated can also be obtained by using the monitoring tools inside the virtual machine operating system and the interfaces and tools provided by the hypervisor. Among them, the dirty page generation history record records the historical data of the dirty page generation rate; the historical operation data includes the historical data of the operation information, such as CPU usage, memory usage, network bandwidth, etc.
[0086] Furthermore, the collected data cannot be used directly, and it is necessary to convert it into a data format suitable for model training, and at the same time remove outliers in the data to ensure data quality. The dirty page generation history records and historical operation data are used as data sets, and then the data sets are divided into training sets and test sets. Taking into account the characteristics of time series, the rolling window method is used in the embodiment of the present application to split the data to ensure that the training set and the test set maintain temporal continuity. Finally, the training set is used to train advanced machine learning models, such as deep learning neural networks, time series prediction models, etc., and then the model is tested using the test set.
[0087] In a specific implementation, considering that the generation of dirty pages is periodic and related to the internal timing tasks of the virtual machine, a neural network model pre-built based on the long short-term memory network (LTSM) is trained using a training set, and the neural network model is tested using a test set to obtain the final dirty page generation rate prediction model. In addition, in the process of model training, a parameter tuning algorithm is combined to improve the overall performance of the model to predict the dirty page generation rate of the virtual machine in the future time period. The model is updated regularly to adapt to changes in the operating status of the virtual machine.
[0088] Wherein, a neural network model consisting of an input layer, a long short-term memory network layer, a discard layer and an output layer is constructed to obtain the neural network model constructed based on the long short-term memory network. Figure 2 The figure shows a schematic diagram of the structure of a neural network model based on a long short-term memory network. The model consists of an input layer, three LSTM layers, a potential Dropout layer (abandonment layer) (mainly used to prevent overfitting) and an output layer.
[0089] The neural network model based on the long short-term memory network is built by using a preset machine learning framework and a corresponding preset deep learning library. For example, a specific model is built by using tensorflow and keras.
[0090] Furthermore, given the model initialization parameters; for predicting continuous values (such as dirty page generation rate), the output layer uses a linear activation function. When compiling the model, specify the loss function as Mean Squared Error (MSE), the optimizer as Adam based on adaptive moment estimation, and the evaluation indicator as Root Mean Square Error (RMSE). Adjust the model parameters based on the Adam optimizer, build the model, input the edited historical dirty page data into the model just built to train the model, and after the parameter tuning is completed, you can get the final prediction model.
[0091] Specifically, the initialization parameters of the neural network model are obtained; the training set is input into a neural network model pre-constructed based on a long short-term memory network, and the initialization parameters are updated using the mean square error as a loss function and the root mean square error as an evaluation indicator, and the parameters of the neural network model are adjusted using an optimizer based on adaptive moment estimation.
[0092] In addition, the model is updated regularly to adapt to changes in the running state of the virtual machine. Specifically, the dirty page generation rate prediction model is updated based on a preset time interval to obtain an updated model, and the updated model is used to predict the dirty page generation rate of the virtual machine to be migrated.
[0093] like Figure 3 The figure shows an innovative virtual machine hot migration optimization device system provided in combination with the above-mentioned embodiments, which aims to predict the dirty page generation rate through intelligent prediction technology, and give a reasonable hot migration strategy by analyzing the prediction results to improve the success rate of virtual machine hot migration. The system mainly includes the following key modules:
[0094] (1) Host status check module: responsible for real-time monitoring and evaluation of the resource status of each physical host in the data center or cloud platform (such as CPU load, memory usage, network bandwidth, etc.), screening out the list of hosts that currently meet the hot migration conditions, and ensuring the feasibility of the migration operation.
[0095] (2) Data collection module: This module is an efficient data collection mechanism that continuously captures runtime data from the virtual machine to be migrated, including but not limited to memory access patterns, I / O activity frequency, dirty page generation history, etc., to provide basic information for subsequent analysis.
[0096] (3) Data processing module: This module will systematically clean, integrate and feature-engineer the received data, convert it into a data format suitable for model training, and remove outliers in the data to ensure data quality.
[0097] (4) Prediction model training module: Use historical data to train advanced machine learning models (such as deep learning neural networks, time series prediction models, etc.), and combine parameter tuning algorithms to improve the overall performance of the model to predict the dirty page generation rate of the virtual machine in the future time period. The model is updated regularly to adapt to changes in the operating status of the virtual machine.
[0098] (5) Prediction result analysis module: Based on the dirty page generation rate output by the prediction model and the current virtual machine load, it analyzes whether the hot migration threshold is about to be reached and when is the best time to migrate. At the same time, based on the current list of hosts that meet the hot migration conditions, it evaluates the impact of hot migration of virtual machines to these hosts on the cloud platform and finally makes a hot migration decision.
[0099] (6) Hot migration decision feedback mechanism: Based on the analysis results, the hot migration task is automatically triggered at the best migration time, and the most suitable host is selected as the migration target.
[0100] Further, such as Figure 4 As shown, a specific implementation process combined with the above modules is demonstrated. By checking the host status and collecting host data, the network bandwidth of the physical host is utilized and the prediction results output by the model are used for prediction result analysis. It uses machine learning technology to collect and process virtual machine data, and then predicts the dirty page generation rate of the virtual machine to be migrated after model training, so as to make more accurate and efficient hot migration decisions. Finally, the analysis result feedback mechanism will feed back the analysis results to the user, and when the virtual machine to be migrated meets the hot migration conditions, it will automatically trigger the hot migration of the virtual machine, and successfully hot migrate the virtual machine to be migrated to the corresponding physical host. It can be seen that the system can adapt to the changing workload characteristics and dynamically adjust the migration strategy to minimize service interruption time, ensure business continuity and user experience, and optimize data center resource allocation.
[0101] Correspondingly, the present application also discloses a thermal migration device, see Figure 5 As shown, the device comprises:
[0102] A physical host list acquisition module 11 is used to determine the virtual machines to be migrated and obtain a list of physical hosts that meet preset hot migration conditions;
[0103] An operation data processing module 12 is used to capture current operation data from the virtual machine to be migrated, and perform data processing on the current operation data to obtain target operation data;
[0104] A hot migration timing determination module 13 is used to input the target operation data into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, and determine the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate; wherein the dirty page generation rate prediction model is constructed based on the historical operation data of the virtual machine to be migrated as an input parameter, and the historical operation data includes the historical data of the dirty page generation rate; the dirty page generation rate prediction model is a model constructed based on a long short-term memory network;
[0105] The hot migration module 14 is used to select a target physical host from the physical host list and migrate the virtual machine to be migrated to the target physical host based on the hot migration opportunity.
[0106] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0107] It can be seen that the above scheme of this embodiment includes: determining the virtual machine to be migrated, and obtaining a list of physical hosts that meet the preset hot migration conditions; capturing current running data from the virtual machine to be migrated, and performing data processing on the current running data to obtain target running data; inputting the target running data into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate within a preset time period output by the dirty page generation rate prediction model, and determining the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate; wherein the dirty page generation rate prediction model is constructed based on the historical running data of the virtual machine to be migrated as an input parameter, and the historical running data includes historical data of the dirty page generation rate; the dirty page generation rate prediction model is a model constructed based on a long short-term memory network; selecting a target physical host from the physical host list, and migrating the virtual machine to be migrated to the target physical host based on the hot migration timing.
[0108] The beneficial technical effect of the present application is as follows: by using the dirty page generation rate prediction model to predict the dirty page generation rate of the virtual machine to be migrated during the hot migration process, and by analyzing the prediction results, a reasonable hot migration timing is given. The migration operation can be planned in advance, and more accurate and efficient migration decisions can be made to avoid performing migration during the peak period of dirty page generation rate, reduce the impact on the business during the migration process, and thus improve the success rate of virtual machine hot migration. In addition, the target physical host is selected from the list of physical hosts that meet the preset hot migration conditions, and the virtual machine to be migrated is migrated to the target physical host, which can adapt to the changing workload characteristics and dynamically adjust the migration strategy. It can be seen that, combined with the dirty page generation rate predicted by the prediction model, and the target physical host selected from the list of physical hosts based on the hot migration timing, the network congestion caused by the synchronization of a large amount of data can be avoided, and the network bandwidth consumption can be reduced to minimize the service interruption time. Furthermore, it can improve the overall resource utilization and response speed of the data center, while optimizing the allocation of data center resources to ensure business continuity and user experience.
[0109] In a specific implementation process, the physical host list acquisition module 11 includes:
[0110] A first acquisition unit is used to acquire resource usage of each physical host in the data center through a preset monitoring service component of the cloud platform, and screen the physical hosts according to the resource usage to obtain a list of physical hosts that meet preset hot migration conditions;
[0111] Or, a second acquisition unit is used to call the first target interface corresponding to the component computing service of the cloud platform to obtain the resource usage of each physical host in the data center; according to the resource usage, the physical hosts are screened to obtain a list of physical hosts that meet the preset hot migration conditions.
[0112] In a specific implementation process, the operation data processing module 12 further includes:
[0113] A network bandwidth data collection unit, used to collect network bandwidth data corresponding to each physical host in the physical host list;
[0114] Accordingly, the thermal migration module 14 is specifically used for:
[0115] The maximum network bandwidth data is screened out from the network bandwidth data corresponding to each physical host in the physical host list, and the physical host corresponding to the maximum network bandwidth data is determined as the target physical host.
[0116] In a specific implementation process, the operation data processing module 12 is specifically used to:
[0117] The current running data of the virtual machine to be migrated is obtained by using the virtual memory statistics command of the operating system in the virtual machine to be migrated, and the second target interface and monitoring tool provided by the virtual machine monitor.
[0118] In a specific implementation process, the operation data processing module 12 includes:
[0119] The format conversion unit is used to pre-process the current operation data and convert the current operation data into a data format that can be input into the dirty page generation rate prediction model to obtain target operation data.
[0120] In a specific implementation process, the thermal migration device further includes a model training module, and the model training module is used to:
[0121] Obtaining the dirty page generation history and historical operation data of the virtual machine to be migrated;
[0122] The dirty page generation history record and the historical operation data are used as a data set, and the data set is divided into a training set and a test set by using a rolling window data segmentation method;
[0123] The training set is used to train a neural network model pre-constructed based on a long short-term memory network, and the test set is used to test the neural network model to obtain the dirty page generation rate prediction model.
[0124] In a specific implementation process, the model training module further includes:
[0125] The first model construction unit is used to construct a neural network model consisting of an input layer, a long short-term memory network layer, a discard layer and an output layer to obtain the neural network model constructed based on the long short-term memory network.
[0126] The second model building unit is used to use a preset machine learning framework and a corresponding preset deep learning library to build the neural network model based on the long short-term memory network.
[0127] In a specific implementation process, the model training module includes:
[0128] An initialization parameter acquisition unit, used to acquire the initialization parameters of the neural network model;
[0129] A model training unit is used to input the training set into a neural network model pre-constructed based on a long short-term memory network, and use the mean square error as a loss function and the root mean square error as an evaluation indicator to update the initialization parameters, and use an optimizer based on adaptive moment estimation to adjust the parameters of the neural network model.
[0130] In a specific implementation process, the hot migration timing determination module 13 includes:
[0131] A dirty page generation rate output unit, used for inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate within a preset time period output by the dirty page generation rate prediction model;
[0132] The hot migration timing determination unit is used to determine a target time period corresponding to when the dirty page generation rate is the minimum within the preset time period, and use the start time of the target time period as the hot migration timing of the virtual machine to be migrated.
[0133] In a specific implementation process, the thermal migration method further includes:
[0134] The model updating module is used to update the dirty page generation rate prediction model based on a preset time interval to obtain an updated model, and use the updated model to predict the dirty page generation rate of the virtual machine to be migrated.
[0135] In a specific implementation process, the thermal migration device further includes:
[0136] The policy execution module is used to perform data processing on the virtual machine to be migrated based on a preset data processing policy when it is monitored that the dirty page generation rate exceeds a preset dirty page generation rate threshold.
[0137] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0138] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in 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. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the hot migration method disclosed in any of the aforementioned embodiments.
[0139] 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 the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0140] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The data 223 may include various data. The storage method may be temporary storage or permanent storage.
[0141] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the hot migration method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0142] Furthermore, the embodiment of the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium mentioned here includes a random access memory (Random Access Memory, RAM), a memory, a read-only memory (Read-Only Memory, ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the aforementioned hot migration method is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiment, and no further description will be given here.
[0143] Furthermore, an embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements any one of the above-mentioned hot migration methods when executed by a processor.
[0144] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred 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 the relevant parts can be referred to the method part.
[0145] The steps of the hot migration method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0146] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0147] The above is a detailed introduction to a thermal migration method, device, program product and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A thermal migration method, characterized in that: include: Determine the virtual machine to be migrated and obtain a list of physical hosts that meet the preset hot migration conditions; Capturing current running data from the virtual machine to be migrated, and performing data processing on the current running data to obtain target running data; The target operation data is input into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, and the hot migration timing of the virtual machine to be migrated is determined according to the dirty page generation rate; wherein the dirty page generation rate prediction model is constructed based on the historical operation data of the virtual machine to be migrated as an input parameter, and the historical operation data includes the historical data of the dirty page generation rate; the dirty page generation rate prediction model is a model constructed based on a long short-term memory network; after predicting the dirty page generation rate, whether the hot migration threshold is about to be reached is analyzed and determined in combination with the load condition of the current virtual machine, and the hot migration timing is determined; Select a target physical host from the physical host list, and migrate the virtual machine to be migrated to the target physical host based on the hot migration opportunity; wherein the target physical host is: based on the physical host list that currently meets the preset hot migration conditions, evaluate the impact of hot migration of the virtual machine to be migrated to the host in the physical host list on the cloud platform, and give a final hot migration decision; The capturing of current running data from the virtual machine to be migrated includes: The current running data of the virtual machine to be migrated is obtained by using the virtual memory statistics command of the operating system in the virtual machine to be migrated, and the second target interface and monitoring tool provided by the virtual machine monitor.
2. The thermal migration method according to claim 1, characterized in that: The step of obtaining a list of physical hosts that meet preset hot migration conditions includes: Obtain resource usage of each physical host in the data center through a preset monitoring service component of the cloud platform, and screen the physical hosts according to the resource usage to obtain a list of physical hosts that meet preset hot migration conditions; Or, call the first target interface corresponding to the component computing service of the cloud platform to obtain the resource usage of each physical host in the data center; filter the physical hosts according to the resource usage to obtain a list of physical hosts that meet preset hot migration conditions.
3. The thermal migration method according to claim 1, characterized in that: After obtaining the list of physical hosts that meet the preset hot migration conditions, the method further includes: Collect network bandwidth data corresponding to each physical host in the physical host list; Correspondingly, selecting a target physical host from the physical host list includes: The maximum network bandwidth data is screened out from the network bandwidth data corresponding to each physical host in the physical host list, and the physical host corresponding to the maximum network bandwidth data is determined as the target physical host.
4. The thermal migration method according to claim 1, characterized in that: The performing data processing on the current operation data to obtain target operation data includes: The current operation data is preprocessed and converted into a data format that can be input into the dirty page generation rate prediction model to obtain target operation data.
5. The thermal migration method according to claim 1, characterized in that: Before inputting the target operation data into the pre-trained dirty page generation rate prediction model, the method further includes: Obtaining the dirty page generation history and historical operation data of the virtual machine to be migrated; The dirty page generation history record and the historical operation data are used as a data set, and the data set is divided into a training set and a test set by using a rolling window data segmentation method; The training set is used to train a neural network model pre-constructed based on a long short-term memory network, and the test set is used to test the neural network model to obtain the dirty page generation rate prediction model.
6. The thermal migration method according to claim 5, characterized in that: Before using the training set to train the neural network model pre-built based on the long short-term memory network, the method further includes: A neural network model consisting of an input layer, a long short-term memory network layer, a discard layer, and an output layer is constructed to obtain the neural network model constructed based on the long short-term memory network.
7. The thermal migration method according to claim 5, characterized in that: Before using the training set to train the neural network model pre-built based on the long short-term memory network, the method further includes: The neural network model based on the long short-term memory network is built using a preset machine learning framework and a corresponding preset deep learning library.
8. The thermal migration method according to claim 5, characterized in that: The step of using the training set to train a neural network model pre-built based on a long short-term memory network includes: Obtaining initialization parameters of the neural network model; The training set is input into a neural network model pre-constructed based on a long short-term memory network, and the initialization parameters are updated using the mean square error as a loss function and the root mean square error as an evaluation indicator, and the parameters of the neural network model are adjusted using an optimizer based on adaptive moment estimation.
9. The thermal migration method according to claim 1, characterized in that: The step of inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, and determining the hot migration timing of the virtual machine to be migrated according to the dirty page generation rate includes: Inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain a dirty page generation rate within a preset time period output by the dirty page generation rate prediction model; A target time period corresponding to when the dirty page generation rate is the smallest within the preset time period is determined, and a start time of the target time period is used as a hot migration opportunity of the virtual machine to be migrated.
10. The thermal migration method according to claim 1, characterized in that: Also includes: The dirty page generation rate prediction model is updated based on a preset time interval to obtain an updated model, and the updated model is used to predict the dirty page generation rate of the virtual machine to be migrated.
11. The thermal migration method according to any one of claims 1 to 10, characterized in that: After inputting the target operation data into a pre-trained dirty page generation rate prediction model to obtain the dirty page generation rate output by the dirty page generation rate prediction model within a preset time period, the method further includes: When it is monitored that the dirty page generation rate exceeds a preset dirty page generation rate threshold, data processing is performed on the virtual machine to be migrated based on a preset data processing strategy.
12. An electronic device, characterized in that: The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the thermal migration method according to any one of claims 1 to 11.
13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the thermal migration method according to any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein when the computer program is executed by a processor, the hot migration method according to any one of claims 1 to 11 is implemented.
