Virtual machine migration method and device and electronic equipment
By predicting future resource utilization of virtual machines and performing group migration, the problem of lag caused by CPU resource contention among virtual machines in cloud networks has been solved, improving SLA and service stability.
Patent Information
- Application Number
- CN202511820017.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-28
AI Technical Summary
In cloud networks, shared virtual machines can experience lag due to CPU resource contention, impacting virtual machine services. How can we reduce or avoid this impact to improve the Service Level Agreement (SLA)?
By collecting information from virtual machines and physical machines, we can predict the future resource utilization trend of virtual machines, group and migrate virtual machines, ensure staggered CPU utilization, and avoid virtual machines on the same physical machine reaching their peak values simultaneously.
Reduce or avoid CPU resource contention, improve the SLA (Service Level Agreement) of virtual machines, ensure the stable operation of customer businesses, and avoid the impact of frequent migrations.
Smart Images

Figure CN121934948A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of cloud service technology, specifically relating to a virtual machine migration method, apparatus, and electronic device. Background Technology
[0002] In practice, multiple physical machines are deployed in a cloud network, and each physical machine can host virtual machines. Virtual machines, as elastic and scalable computing services and resources, are widely used in cloud networks. Specifically, a virtual machine is a virtual computer that simulates one or more independent virtual computers with full computer functions on a physical machine through virtualization technology. Cloud services can then be provided to users via the network.
[0003] Virtual machines provided by cloud service providers to customers are typically divided into shared virtual machines and dedicated virtual machines. Shared virtual machines refer to multiple virtual machines sharing the CPU (Central Processing Unit) resources of the physical machine, while dedicated virtual machines have their own CPU resources. Because shared virtual machines share CPU resources with other virtual machines, when a large number of virtual machines are running CPU-intensive tasks simultaneously, CPU resource contention will occur. This can cause virtual machines to lag due to not being able to obtain CPU resources, thus affecting virtual machine services.
[0004] Therefore, how to reduce or avoid the impact of CPU resource contention on virtual machine services, improve the SLA (Service Level Agreement) of virtual machines, and ensure the stable operation of customer services are problems that cloud vendors need to solve. Summary of the Invention
[0005] The purpose of this application is to provide a virtual machine migration method, apparatus, and electronic device to overcome or at least partially solve the above-mentioned problems.
[0006] To solve the above-mentioned technical problems, this application is implemented as follows: A virtual machine migration method, the method comprising: Collect virtual machine information and physical machine information; the virtual machine information includes at least the historical resource utilization rate of the virtual machine; The virtual machine profile is predicted based on the virtual machine information; the virtual machine profile includes at least the resource utilization trend information of the virtual machine over a preset future time period; the resource utilization trend information includes at least the future resource utilization. The virtual machines are assigned to corresponding virtual machine groups based on the virtual machine profile and the physical machine information; wherein each virtual machine group has a corresponding target physical machine. The virtual machine is migrated to the target physical machine corresponding to the virtual machine group to which it belongs.
[0007] In the above embodiments, the virtual machine scheduling system can predict the future resource utilization of virtual machines in a preset future time period based on the historical resource utilization of virtual machines, and group virtual machines for virtual machine migration. This allows virtual machines with staggered CPU utilization to be placed together, ensuring that virtual machines on the same physical machine will not experience CPU contention due to a large number of CPU utilizations reaching their peak at the same time. This can reduce or avoid the impact on virtual machine services caused by CPU resource contention, improve the SLA (Service Level Agreement) of virtual machines, and ensure the stable operation of customer services.
[0008] In one embodiment of this application, after collecting the virtual machine information of the virtual machine and the physical machine information of the physical machine, the method further includes: The historical resource utilization rate is divided into multiple periodic historical resource utilization rates according to a preset period; The historical resource utilization rate of the period is divided into time-based resource utilization rates for multiple moments; the time-based resource utilization rate for each moment is the maximum value of the historical resource utilization rate of the period to which the moment belongs.
[0009] In the above embodiments, the historical resource utilization rate is divided into a series of historical resource utilization rates for multiple periods according to the period and time. The resource utilization rate of each time in the historical resource utilization rate series is the maximum value of the periodic historical resource utilization rate of the time segment to which the time belongs. This realizes the standardized processing of historical resource utilization rate, simplifies virtual machine information, and facilitates subsequent analysis of historical resource utilization rate.
[0010] In one embodiment of this application, predicting the virtual machine profile based on the virtual machine information includes: The virtual machine type is determined based on the virtual machine's historical resource utilization rate; each virtual machine type has a corresponding prediction model. The historical resource utilization rate is input into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model.
[0011] In the above embodiments, the virtual machine type is determined based on historical resource utilization, and then the historical resource utilization of the virtual machine is input into its corresponding prediction model to perform virtual machine profile prediction, thereby improving the accuracy of virtual machine profile prediction.
[0012] In one embodiment of this application, the step of inputting the historical resource utilization rate into a prediction model corresponding to the virtual machine type of the virtual machine to obtain a virtual machine profile of the virtual machine output by the prediction model includes: When the virtual type corresponding to the virtual machine is periodic, the historical resource utilization rate is input into the prediction model corresponding to the periodic type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the prediction model. The future resource utilization rate is generated based on the historical resource utilization rate of the virtual machine.
[0013] In one embodiment of this application, the step of inputting the historical resource utilization rate into a prediction model corresponding to the virtual machine type of the virtual machine to obtain a virtual machine profile of the virtual machine output by the prediction model includes: When the virtual type corresponding to the virtual machine is trend-type, the historical resource utilization rate is input into the quadratic exponential smoothing model corresponding to the trend type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the quadratic exponential smoothing model.
[0014] In one embodiment of this application, the step of inputting the historical resource utilization rate into a prediction model corresponding to the virtual machine type of the virtual machine to obtain a virtual machine profile of the virtual machine output by the prediction model includes: When the virtual type corresponding to the virtual machine is regular-irregular, the historical resource utilization rate is input to the sequence-to-sequence model corresponding to the regular-irregular type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the sequence-to-sequence model.
[0015] In one embodiment of this application, the sequence-to-sequence model includes an encoder and a decoder. The encoder of the sequence-to-sequence model is used to encode the input historical resource utilization sequence to obtain a context information vector. The decoder of the sequence-to-sequence model is used to decode the context information vector and output the future resource utilization of the virtual machine for a preset future time period.
[0016] In the above embodiments, for periodic virtual machines, a simple and efficient periodic inference model can be used for prediction; for trend-oriented virtual machines, a quadratic exponential smoothing model that is good at capturing slopes can be used; and for irregular virtual machines, a Seq2Seq model that can understand long-term dependencies can be used. In this way, using corresponding prediction models for different types of virtual machines to predict virtual machine profiles can avoid the systematic bias or underfit caused by using general models, so that virtual machines of different types can be predicted by corresponding prediction models, thereby improving the accuracy of virtual machine profile prediction.
[0017] In one embodiment of this application, the step of assigning the virtual machine to the corresponding virtual machine group based on the virtual machine profile and the physical machine information includes: The virtual machines are assigned to the corresponding virtual machine groups according to the preset grouping principles, the virtual machine profile, and the physical machine information.
[0018] In one embodiment of this application, the preset grouping principle includes at least: Virtual machines whose future resource utilization is at its peak at the same time are placed in different virtual machine groups; At the same time, virtual machines in the same group are placed at the peak and trough of future resource utilization. The sum of future resource utilization rates for each virtual machine group does not exceed a preset threshold; the sum of future resource utilization rates is determined based on the number of virtual machine cores in the virtual machine group, the total number of sellable cores of the physical machine, and the future resource utilization rate of the virtual machines.
[0019] In the above embodiments, virtual machines are assigned to corresponding virtual machine groups according to preset grouping principles, virtual machine profiles, and physical machine information. Then, virtual machine migration is performed according to the physical machines mapped by the virtual machine groups. This ensures that after the virtual machine migration, multiple virtual machines on the same physical machine will not reach the peak resource utilization rate at the same time in the future, which would lead to fierce competition for the physical machine's CPU resources, resulting in virtual machine performance degradation, service level agreement (SLA) degradation, and frequent secondary migration issues.
[0020] In one embodiment of this application, after migrating the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs, the method further includes: Obtain the stolen time of the virtual machine; The stolen time is sent to the front end so that the front end can display the stolen time of the virtual machine and the stolen time trend change information generated based on the stolen time of the virtual machine.
[0021] In the above embodiments, after the virtual machine is migrated, the ST value (steal time) of the virtual machine can be obtained, and the virtual machine ST value and ST value trend changes can be displayed to relevant personnel, so that relevant personnel can understand the performance status of the virtual machine after migration, and then choose whether to continue the migration or maintain the status quo, thus ensuring the performance of the virtual machine after migration.
[0022] In one embodiment of this application, after migrating the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs, the method further includes: Obtain the total current resource utilization of the virtual machines in the target physical machine; The virtual machine migration is performed based on the sum of the current resource utilization of the target physical machine.
[0023] In the above embodiments, it can be determined whether virtual machine migration is necessary based on the total current resource utilization of virtual machines in the target physical machine. This can avoid frequent virtual machine migrations, which would increase network latency and prevent customers from reporting faults due to perceived service lag.
[0024] In one embodiment of this application, the virtual machine migration based on the sum of the current resource utilization of the target physical machine includes: When the total current resource utilization of the target physical machine exceeds a preset change threshold, the target physical machine is identified as the target migration physical machine; The virtual machines in the target migration physical machine are migrated.
[0025] In the above embodiments, when the total current resource utilization of the target physical machine exceeds a preset change threshold, the target virtual machine is used as the target migration physical machine, and the virtual machines in the target migration physical machine are migrated. This can reduce the number of virtual machines that need to be migrated and reduce the system overhead and performance impact caused by virtual machine migration.
[0026] A virtual machine migration apparatus, the apparatus comprising: The historical resource utilization rate acquisition module is used to collect virtual machine information and physical machine information; the virtual machine information includes at least the historical resource utilization rate of the virtual machine. The virtual machine profile prediction module is used to predict the virtual machine profile of the virtual machine based on the virtual machine information; the virtual machine profile includes at least the resource utilization trend information of the virtual machine in a preset future time period; The virtual machine grouping module is used to allocate the virtual machines to corresponding virtual machine groups according to the virtual machine profile and the physical machine information; wherein, each virtual machine group has a corresponding target physical machine; The virtual machine migration module is used to migrate the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs.
[0027] An electronic device includes: a processor; and a memory for storing processor-executable instructions. The processor is configured to execute the instructions to implement the virtual machine migration method described above.
[0028] A computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a mobile terminal, enables the mobile terminal to perform the virtual machine migration method described above.
[0029] The embodiments of this application have at least the following beneficial effects: In this embodiment, the virtual machine scheduling system can collect virtual machine information and physical machine information. The virtual machine information includes at least the historical resource utilization rate of the virtual machine. Based on the virtual machine information, a virtual machine profile is predicted. This profile includes at least the resource utilization trend information of the virtual machine over a preset future time period, and the trend information includes at least the future resource utilization rate. Subsequently, the virtual machine can be allocated to corresponding virtual machine groups based on the virtual machine profile and physical machine information. Each virtual machine group is mapped to a corresponding physical machine, and the virtual machine is migrated to the physical machine corresponding to its virtual machine group. This virtual machine scheduling system can predict the future resource utilization rate of virtual machines over a preset future time period based on their historical resource utilization rate, grouping them for virtual machine migration. This ensures that virtual machines with staggered CPU utilization are placed together, preventing CPU contention on the same physical machine due to a large number of machines simultaneously reaching peak CPU utilization. This reduces or avoids the impact of CPU resource contention on virtual machine services, improves the SLA (Service Level Agreement) of virtual machines, and ensures stable operation of customer services. Attached Figure Description
[0030] Figure 1 This is a flowchart illustrating the steps of a virtual machine migration method provided in this application embodiment; Figure 2 This is a diagram of a virtual machine scheduling system architecture provided in the embodiments of this application; Figure 3 This application provides a predictive model for the future resource utilization of a virtual machine in its embodiments. Figure 4 This is a schematic diagram of a sequence-to-sequence model provided in an embodiment of this application; Figure 5 This is a virtual machine CPU utilization trend chart provided in the embodiments of this application; Figure 6 This is a flowchart illustrating a virtual machine stability scheduling process provided in an embodiment of this application. Figure 7 This is a schematic diagram of the structure of a virtual machine migration device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0031] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.
[0032] It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).
[0033] To facilitate understanding of the embodiments of this application by those skilled in the art, some terms involved in the embodiments of this application are explained below.
[0034] SLA (Service Level Agreement): A service level agreement is used to define the service expectations and standards between a service provider and a customer.
[0035] ST (Steal Time): When a virtual machine shares CPU resources on the same physical machine with other virtual machines, if the physical machine's resources are insufficient or unevenly distributed, some virtual machines may need to wait for other virtual machines to release their CPU time slices. This waiting time is called Steal Time.
[0036] Current technical solutions for reducing or avoiding the impact of CPU resource contention on virtual machine services typically involve migrating the virtual machine when it experiences lag or when its Stealth Time (ST) value reaches a threshold. This can be achieved by migrating the virtual machine to a physical machine with lower CPU utilization. However, these solutions have two problems: first, the virtual machine may already be experiencing lag due to CPU resource contention, and the user's business may already be aware of the impact; second, while the physical machine may indeed have low utilization at the moment of migration, CPU utilization is dynamic and may increase at the next moment, causing the virtual machine to experience CPU contention and lag again, leading to frequent virtual machine migrations.
[0037] To address the aforementioned issues, this application proposes a method based on virtual machine profiles to perceive the CPU resource utilization of virtual machines over a future period. Then, virtual machines are grouped according to CPU utilization trends, placing virtual machines with staggered CPU utilization together. This ensures that virtual machines on the same physical machine do not experience CPU contention due to a large number of machines simultaneously reaching peak CPU utilization, thus preventing virtual machine resource contention in advance, improving virtual machine SLA, preventing customers from reporting faults due to perceived service lag, and avoiding frequent virtual machine migrations.
[0038] Reference Figure 1 The diagram illustrates a flowchart of a virtual machine migration method provided in an embodiment of this application. The method specifically includes the following steps: Step 101: Collect virtual machine information and physical machine information; the virtual machine information includes at least the historical resource utilization rate of the virtual machine.
[0039] In this embodiment of the application, virtual machine migration can be achieved through a service virtual machine scheduling system deployed on a server (management node) in the management control area of a cloud network.
[0040] In one embodiment of this application, reference is made to Figure 2 This is a diagram of a virtual machine scheduling system architecture provided in this application embodiment. The virtual machine scheduling system mainly consists of several modules: data service, profile service, virtual machine combination service, virtual machine migration service, virtual machine ST reporting service, and virtual machine ST display.
[0041] Specifically, the data service can collect virtual machine information and physical machine information. The virtual machine information includes at least the number of CPU cores, memory size, and historical resource utilization of the virtual machine, such as the resource utilization of the virtual machine in the most recent year or month. The physical machine information can include the number of CPU cores, memory size, and other information of the physical machine. The collected virtual machine information and physical machine information are stored in a database.
[0042] Step 102: Predict the virtual machine profile of the virtual machine based on the virtual machine information; the virtual machine profile includes at least the resource utilization trend information of the virtual machine in a preset future time period, and the resource utilization trend information includes at least the future resource utilization.
[0043] In this embodiment of the application, a prediction model can be deployed in the virtual machine scheduling system. The prediction model can be used to predict the virtual machine profile (future utilization profile) of virtual machines in a preset future time period (such as the next day). The profile service in the virtual machine scheduling system can construct a virtual machine profile based on the virtual machine information through the prediction model. The virtual machine profile can include the specifications of the virtual machine (number of CPU cores, memory size) and the future resource utilization rate of CPU resources in the next day (future CPU utilization). The most important part of the virtual machine profile is the prediction of the future resource utilization rate of CPU resources in the next day. Its accuracy determines the scheduling effect of the virtual machine scheduling system on the virtual machine and the stability of the virtual machine.
[0044] Step 103: Assign the virtual machine to the corresponding virtual machine group according to the virtual machine profile and the physical machine information; wherein, each virtual machine group has a corresponding target physical machine.
[0045] Step 104: Migrate the virtual machine to the target physical machine corresponding to the virtual machine group in which it belongs.
[0046] In this embodiment, the virtual machine scheduling system's virtual machine composition service can group virtual machines into multiple virtual machine groups based on their virtual machine profiles. Virtual machines within the same virtual machine group will be placed on the same target physical machine; therefore, the number of virtual machine groups is equal to the number of physical machines. After grouping the virtual machines, the virtual machines are migrated to the target physical machine corresponding to their respective virtual machine group. By predicting the virtual machine profiles, the system can anticipate the possibility of CPU contention causing virtual machine stuttering and avoid this problem through reasonable virtual machine scheduling, thereby improving the performance stability of the virtual machines.
[0047] It should be noted that the virtual machine migration is a hot migration. Hot migration refers to the process of migrating a virtual machine from one physical machine to another physical host while the virtual machine remains powered on and the service continues to be provided. This process is imperceptible to the user and will not affect the user's virtual machine service.
[0048] In the above embodiments, the virtual machine scheduling system can collect virtual machine information and physical machine information. The virtual machine information includes at least the historical resource utilization rate of the virtual machine. Based on the virtual machine information, a virtual machine profile is predicted. The virtual machine profile can include at least the resource utilization trend information of the virtual machine in a preset future time period, and the resource utilization trend information can include at least the future resource utilization rate. Subsequently, the virtual machine can be allocated to corresponding virtual machine groups based on the virtual machine profile and physical machine information. Each virtual machine group is mapped to a corresponding physical machine, and the virtual machine is migrated to the physical machine corresponding to its virtual machine group. The virtual machine scheduling system of this application embodiment can predict the future resource utilization rate of virtual machines in a preset future time period based on the historical resource utilization rate of the virtual machine, and group the virtual machines for virtual machine migration. This allows virtual machines with staggered CPU utilization to be placed together, ensuring that virtual machines on the same physical machine do not experience CPU contention due to a large number of machines reaching peak CPU utilization simultaneously. This reduces or avoids the impact of CPU resource contention on virtual machine services, improves the SLA (Service Level Agreement) of virtual machines, and ensures the stable operation of customer services.
[0049] In one embodiment of this application, after collecting the virtual machine information of the virtual machine and the physical machine information of the physical machine, the method may further include: The historical resource utilization rate is divided into multiple periodic historical resource utilization rates according to a preset period; The historical resource utilization rate of the period is divided into time-based resource utilization rates for multiple moments; the time-based resource utilization rate for each moment is the maximum value of the historical resource utilization rate of the period to which the moment belongs.
[0050] In this embodiment, the virtual machine scheduling system's profile service divides the virtual machine's historical utilization data for the past year into a preset period (which can be in days) to obtain the periodic historical resource utilization for multiple periods. For the periodic historical resource utilization, if each hour is taken as a time point (moment), then the historical resource utilization for each day is the data of 24 time points. Among them, the moment resource utilization of each time point is the maximum value of the periodic historical resource utilization of the time segment to which it belongs. For example, the moment utilization of each time point is the maximum value of that hour. The historical resource utilization of each day is processed into a 24-dimensional vector.
[0051] In the above embodiments, the historical resource utilization rate is divided into a series of historical resource utilization rates for multiple periods according to the period and time. The resource utilization rate of each time in the historical resource utilization rate series is the maximum value of the periodic historical resource utilization rate of the time segment to which the time belongs. This realizes the standardized processing of historical resource utilization rate, simplifies virtual machine information, and facilitates subsequent analysis of historical resource utilization rate.
[0052] In one embodiment of this application, predicting the virtual machine profile based on the virtual machine information may include: The virtual machine type is determined based on the virtual machine's historical resource utilization rate; each virtual machine type has a corresponding prediction model. The historical resource utilization rate is input into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model.
[0053] In practice, if all virtual machines use the same general model to predict historical resource utilization, the prediction accuracy of virtual machine profiles will be low. This is because in order to adapt to all virtual machines, the prediction model needs to take into account all types of virtual machines. It is a general model, which leads to the model being underfit to periodic data and overly sensitive to trend data, resulting in inaccurate predictions for any type of virtual machine.
[0054] To improve the accuracy of virtual machine profile prediction, virtual machines can be classified based on their historical resource utilization, and different prediction models can be used for different virtual machine types.
[0055] Specifically, virtual machines that run certain services regularly and whose historical resource utilization rates are periodic are classified as periodic virtual machines; those whose historical resource utilization rates show an upward or downward trend across periods are classified as trending virtual machines; and those whose historical resource utilization rates are irregular are classified as irregular virtual machines.
[0056] In this embodiment of the application, the virtual machine scheduling system is equipped with prediction models corresponding to different virtual machine types. When predicting the virtual machine profile, the virtual machine type corresponding to the virtual machine can be determined based on the historical resource utilization rate of the virtual machine. Then, the historical resource utilization rate can be input into the prediction model corresponding to the virtual machine type of the virtual machine, and the prediction model can output the virtual machine profile of the virtual machine based on the historical resource utilization rate.
[0057] For example, the data service of the virtual machine scheduling system collects relevant data of virtual machines and physical machines into the database. The profiling service queries the database and preprocesses the virtual machine information, using a daily cycle and an hourly cycle. The resource utilization rate at each hourly cycle is the maximum utilization rate within the current hour. After processing, the historical resource utilization rate sequence for each cycle is [util1, util2, ..., util24]. Virtual machines are classified based on historical resource utilization rates. Then, according to different virtual machine types, the historical resource utilization rate sequence is input into the corresponding prediction model, outputting the future resource utilization rate sequence for the next day [utilp1, utilp2, ..., utilp24]. Based on the predicted future resource utilization rate sequence, combined with information such as CPU and memory resources of virtual machines and physical machines, virtual machines are grouped. The number of groups is equal to the number of physical machines. After grouping, each virtual machine forms a mapping with a physical machine [virtual machine, target physical machine]. Then, the virtual machines are hot-migrated according to the mapping relationship.
[0058] In the above embodiments, the virtual machine type is determined based on historical resource utilization, and then the historical resource utilization of the virtual machine is input into its corresponding prediction model to perform virtual machine profile prediction, thereby improving the accuracy of virtual machine profile prediction.
[0059] In one embodiment of this application, the step of inputting the historical resource utilization rate into a prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model may include: When the virtual type corresponding to the virtual machine is periodic, the historical resource utilization rate is input into the prediction model corresponding to the periodic type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the prediction model. The future resource utilization rate is generated based on the historical resource utilization rate of the virtual machine. When the virtual type corresponding to the virtual machine is trend type, the historical resource utilization rate is input into the quadratic exponential smoothing model corresponding to the trend type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the quadratic exponential smoothing model. When the virtual type corresponding to the virtual machine is regular-irregular, the historical resource utilization rate is input to the sequence-to-sequence model corresponding to the regular-irregular type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the sequence-to-sequence model.
[0060] Reference Figure 3This application provides a prediction model for the future resource utilization of a virtual machine. For virtual machines of the periodic type, since the resource utilization has a strict periodicity, the future resource utilization can continue to follow the historical resource utilization trend. Therefore, by performing periodic analysis based on the input historical resource utilization through a simple periodic inference model, the corresponding future resource utilization can be output.
[0061] For virtual machines of trend-based types, a quadratic exponential smoothing model is used as the prediction model to predict future resource utilization over a preset time period (e.g., the next day). The quadratic exponential smoothing model is a model for predicting trend-based sequences. This model predicts future resource utilization at a certain point in the future by using smoothed historical resource utilization and a smoothed trend (determined based on historical resource utilization). The specific formula is shown below: (1) (2) Wherein, formula (1) is the smoothed historical resource utilization rate, and formula (2) is the smoothed trend. It is the value at time i. Smoothed historical resource utilization rate (time-based resource utilization rate). It is the smoothed value at time i. Smoothing value at time i-1 The difference, that is, how much the smoothing signal has changed in the previous time step, indicates the current trend. and These are parameters fitted based on the training data. The prediction for 24 moments in the next day is achieved by taking the smoothed value of the last moment of the previous day (smoothed historical resource utilization). Then, for each additional time step, the smoothed value is added to the smoothed value along with the smoothed trend from the previous day. The specific formula is shown below: (3) in, Let be the predicted value (future resource utilization rate) at time i+h. Based on this model, predict the future resource utilization rate at 24 times in the next day.
[0062] For virtual machines with irregular patterns, a Seq2Seq model is used to predict future resource utilization trends, referring to... Figure 4This is a schematic diagram of a sequence-to-sequence model provided in an embodiment of this application. The sequence-to-sequence model includes an encoder and a decoder. Here, x (x1, x2, x3, ...) is the sequence of historical resource utilization of the input virtual machine (usually the sequence of resource utilization at the moment after preprocessing the historical resource utilization), y' (y'1, y'2, y'3, ...) is the sequence of predicted future resource utilization of the output virtual machine, c is the information vector after being encoded by the encoder, and h0, h1, h2, ... are the hidden states of each neuron during encoding. At time step t, the recurrent neural network transforms the input feature vectors xt and ht-1 (i.e., the hidden states of the previous time step) of the word into ht (i.e., the hidden states of the current step). If a function f is used to describe the transformation made by the recurrent layer of the recurrent neural network: ht = f(xt, ht-1). h'1, h'2, ... are the hidden states of each neuron during decoding. At time step t, h't-1 (the hidden state of the previous time step) is transformed into h't (the hidden state of the current time step). If a function g is used to describe the transformation made by the recurrent layers of the recurrent neural network: h't = g(h't-1), and if a function q is used to describe the transformation of the final output: y't = q(h't). Specifically, the encoder of the sequence-to-sequence model is used to encode the input historical resource utilization sequence to obtain a context information vector, and the decoder of the sequence-to-sequence model is used to decode the context information vector to output the future resource utilization of the virtual machine for a preset future time period.
[0063] In some embodiments, the Encoder and Decoder of the sequence-to-sequence model use Long Short-Term Memory (LSTM) recurrent neural networks.
[0064] In the above embodiments, for periodic virtual machines, a simple and efficient periodic inference model can be used for prediction; for trend-oriented virtual machines, a quadratic exponential smoothing model that is good at capturing slopes can be used; and for irregular patterns, a Seq2Seq model that can understand long-term dependencies can be used. In this way, using corresponding prediction models for different types of virtual machines to predict virtual machine profiles can avoid the systematic bias or underfit caused by using general models, so that virtual machines of different types can be predicted by corresponding prediction models, thereby improving the accuracy of virtual machine profile prediction.
[0065] In one embodiment of this application, the step of assigning the virtual machine to the corresponding virtual machine group based on the virtual machine profile and the physical machine information includes: The virtual machines are assigned to the corresponding virtual machine groups according to the preset grouping principles, the virtual machine profile, and the physical machine information.
[0066] The preset grouping principle may include at least the following: Virtual machines whose future resource utilization is at its peak at the same time are placed in different virtual machine groups; At the same time, virtual machines in the same group are placed at the peak and trough of future resource utilization. The sum of future resource utilization rates for each virtual machine group does not exceed a preset threshold; wherein, the sum of future resource utilization rates is determined based on the number of virtual machine cores (virtual machine CPU cores) of the virtual machines in the virtual machine group, the total number of sellable cores of the physical machine (total number of sellable CPU cores of the physical machine), and the future resource utilization rate (future CPU utilization rate) of the virtual machines.
[0067] In this embodiment, virtual machines are grouped according to their virtual machine profiles and placed into corresponding virtual machine groups. Then, virtual machines are placed into physical machines according to their virtual machine groups. The number of groups is equal to the number of physical machines. The grouping principle can be: 1) Virtual machine utilization is staggered, and virtual machines with future resource utilization at the same time are placed into different virtual machine groups; 2) Virtual machines with future resource utilization at the same time are placed into the same virtual machine group as those with future resource utilization at the same time; 3) The sum of future resource utilization of all virtual machines in each virtual machine group does not exceed a preset threshold (e.g., not exceeding 75% of the preset threshold). The calculation method of the sum of future resource utilization is shown in formula (4): The sum of future resource utilization rates of virtual machines on the same physical machine at each moment is calculated as follows:
[0068] Where k is the number of virtual machines allocated to physical machines.
[0069] After grouping according to the above grouping principles, the mapping relationship between virtual machine groups and the target physical machines to which they are to be migrated (virtual machine - target physical machine) is obtained. For example, refer to... Figure 5 The above is a trend chart of virtual machine CPU utilization (future resource utilization) provided in the embodiment of this application. It can be observed that the future resource utilization of virtual machine 1 and virtual machine 2 at the same time is at the peak and the trough, respectively. Therefore, they can be placed in the same virtual machine group. Assuming that the physical machine mapped to the virtual machine group is physical machine 3, virtual machine 1 and virtual machine 2 can be migrated to physical machine 3.
[0070] In the above embodiments, virtual machines are assigned to corresponding virtual machine groups according to preset grouping principles, virtual machine profiles, and physical machine information. Then, virtual machine migration is performed according to the physical machines mapped by the virtual machine groups. This ensures that after the virtual machine migration, multiple virtual machines on the same physical machine will not reach the peak resource utilization rate at the same time in the future, which would lead to fierce competition for the physical machine's CPU resources, resulting in virtual machine performance degradation, service level agreement (SLA) degradation, and frequent secondary migration issues.
[0071] In one embodiment of this application, after migrating the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs, the method may further include: Obtain the stolen time of the virtual machine; The stolen time is sent to the front end so that the front end can display the stolen time of the virtual machine and the stolen time trend change information generated based on the stolen time of the virtual machine.
[0072] In this embodiment of the application, after the virtual machine is migrated, the virtual machine ST value reporting service of the virtual machine scheduling system is responsible for periodically collecting the ST value (stealing time) of the virtual machine and reporting it to the front end for real-time display of the virtual machine ST value and the display of ST value trend changes (trend change information). Specifically, the virtual machine ST value and ST value trend changes can be displayed through the virtual machine ST display, so as to conveniently and intuitively display the performance of the virtual machine after being scheduled by the virtual machine scheduling system.
[0073] In the above embodiments, after the virtual machine is migrated, the ST value (steal time) of the virtual machine can be obtained, and the virtual machine ST value and ST value trend changes can be displayed to relevant personnel, so that relevant personnel can understand the performance status of the virtual machine after migration, and then choose whether to continue the migration or maintain the status quo, thus ensuring the performance of the virtual machine after migration.
[0074] In one embodiment of this application, after migrating the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs, the method may further include: Obtain the total current resource utilization of the virtual machines in the target physical machine; The virtual machine migration is performed based on the sum of the current resource utilization of the target physical machine.
[0075] In this embodiment of the application, the sum of current and future resource utilization is determined based on the number of virtual machine cores (number of virtual machine CPU cores) of the virtual machines in the virtual machine group, the total number of sellable cores of the physical machine (total number of sellable CPU cores of the physical machine), and the current resource utilization of the virtual machines (current CPU utilization).
[0076] In this embodiment of the application, the prediction of virtual machine profiles can be performed once a day, which will predict the future resource utilization rate for the next day. The number of virtual machines involved in the migration and adjustment will be larger on the first run because the resource utilization of virtual machines has been staggered. Subsequent runs will only migrate virtual machines based on the total current resource utilization of virtual machines. Therefore, after the virtual machine migration, the total current resource utilization of virtual machines in the target physical machine is obtained, and then it can be determined whether to migrate virtual machines based on the total current resource utilization of the target physical machine.
[0077] In the above embodiments, it can be determined whether virtual machine migration is necessary based on the total current resource utilization of virtual machines in the target physical machine. This can avoid frequent virtual machine migrations, which would increase network latency and prevent customers from reporting faults due to perceived service lag.
[0078] In one embodiment of this application, the virtual machine migration based on the sum of the current resource utilization of the target physical machine may include: When the total current resource utilization of the target physical machine exceeds a preset change threshold, the target physical machine is identified as the target migration physical machine; The virtual machines in the target migration physical machine are migrated.
[0079] In this embodiment, after migrating virtual machines based on the virtual machine profile, only virtual machines in the target physical machine whose current total resource utilization exceeds a preset change threshold will be adjusted. If the current total resource utilization of the target physical machine does not exceed the preset change threshold, it indicates that the resource utilization trend of the target virtual machine is not significant, and virtual machine migration will not be performed. Conversely, if the current total resource utilization of the target physical machine exceeds the preset change threshold, it indicates that the resource utilization trend of the virtual machine is significant, and the target virtual machine can be used as the target migration physical machine, and the virtual machines in the target migration physical machine will be migrated.
[0080] In the above embodiments, when the total current resource utilization of the target physical machine exceeds a preset change threshold, the target virtual machine is used as the target migration physical machine, and the virtual machines in the target migration physical machine are migrated. This can reduce the number of virtual machines that need to be migrated and reduce the system overhead and performance impact caused by virtual machine migration.
[0081] In summary, the embodiments of this application are based on virtual machine profiles to perceive the future resource utilization of virtual machines over a period of time. Then, virtual machines are grouped according to the trend of future resource utilization, so that virtual machines with staggered future resource utilization are placed together. This ensures that virtual machines on the same physical machine will not experience CPU contention due to a large number of virtual machines reaching peak resource utilization at the same time, thus avoiding the occurrence of virtual machine resource contention problems in advance, improving the SLA of virtual machines, and preventing customers from reporting faults due to perceived business lag. By grouping and orchestrating virtual machines based on future trends, frequent virtual machine migrations are avoided.
[0082] Reference Figure 6 This is a flowchart of virtual machine stability scheduling provided in the embodiments of this application. The main process of virtual machine migration is as follows: First, collect virtual machine information such as historical resource utilization of virtual machines; then, construct a future virtual machine profile of virtual machines based on historical resource utilization; combine virtual machines in staggered peaks according to the virtual machine profile of virtual machines; construct a virtual machine migration plan; migrate virtual machines according to the migration plan; monitor the ST value of virtual machines after migration.
[0083] By applying the embodiments of this application, virtual machine orchestration, grouping, and scheduling can be performed in advance using virtual machine profiles that include future resource utilization rates. This allows for early detection of potential CPU contention leading to virtual machine stuttering, and the reasonable scheduling of virtual machines can prevent such issues, thus improving virtual machine performance stability. Furthermore, the prediction of virtual machine profiles, through advance virtual machine classification and the use of different prediction models for different virtual machine types, improves the accuracy of the prediction models' forecasts of future resource utilization, further ensuring the performance stability of migrated virtual machines.
[0084] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of this application.
[0085] Reference Figure 7 The diagram shows a structural block diagram of a virtual machine migration device provided in an embodiment of this application. The device may include the following modules: The historical resource utilization rate acquisition module 701 is used to acquire virtual machine information of virtual machines and physical machine information of physical machines; the virtual machine information includes at least the historical resource utilization rate of the virtual machine. The virtual machine profile prediction module 702 is used to predict the virtual machine profile of the virtual machine based on the virtual machine information; the virtual machine profile includes at least the resource utilization trend information of the virtual machine in a preset future time period; The virtual machine grouping module 703 is used to allocate the virtual machine to a corresponding virtual machine group according to the virtual machine profile and the physical machine information; wherein, each virtual machine group has a corresponding target physical machine; The virtual machine migration module 704 is used to migrate the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs.
[0086] In one embodiment of this application, the apparatus further includes: a preprocessing module, configured to: The historical resource utilization rate is divided into multiple periodic historical resource utilization rates according to a preset period; The historical resource utilization rate of the period is divided into time-based resource utilization rates for multiple moments; the time-based resource utilization rate for each moment is the maximum value of the historical resource utilization rate of the period to which the moment belongs.
[0087] In one embodiment of this application, the virtual machine profile prediction module 702 is used for: The virtual machine type is determined based on the virtual machine's historical resource utilization rate; each virtual machine type has a corresponding prediction model. The historical resource utilization rate is input into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model.
[0088] In one embodiment of this application, the virtual machine profile prediction module 702 is used for: When the virtual type corresponding to the virtual machine is periodic, the historical resource utilization rate is input into the prediction model corresponding to the periodic type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the prediction model. The future resource utilization rate is generated based on the historical resource utilization rate of the virtual machine.
[0089] In one embodiment of this application, the virtual machine profile prediction module 702 is used for: When the virtual type corresponding to the virtual machine is trend-type, the historical resource utilization rate is input into the quadratic exponential smoothing model corresponding to the trend type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the quadratic exponential smoothing model.
[0090] In one embodiment of this application, the virtual machine profile prediction module 702 is used for: When the virtual type corresponding to the virtual machine is regular-irregular, the historical resource utilization rate is input to the sequence-to-sequence model corresponding to the regular-irregular type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the sequence-to-sequence model.
[0091] In one embodiment of this application, the sequence-to-sequence model includes an encoder and a decoder. The encoder of the sequence-to-sequence model is used to encode the input historical resource utilization sequence to obtain a context information vector. The decoder of the sequence-to-sequence model is used to decode the context information vector and output the future resource utilization of the virtual machine for a preset future time period.
[0092] In one embodiment of this application, the virtual machine grouping module 703 is used for: The virtual machines are assigned to the corresponding virtual machine groups according to the preset grouping principles, the virtual machine profile, and the physical machine information.
[0093] In one embodiment of this application, the preset grouping principle includes at least: Virtual machines whose future resource utilization is at its peak at the same time are placed in different virtual machine groups; At the same time, virtual machines in the same group are placed at the peak and trough of future resource utilization. The sum of future resource utilization rates for each virtual machine group does not exceed a preset threshold; the sum of future resource utilization rates is determined based on the number of virtual machine cores in the virtual machine group, the total number of sellable cores of the physical machine, and the future resource utilization rate of the virtual machines.
[0094] In one embodiment of this application, the device further includes: a display module, used for: Obtain the stolen time of the virtual machine; The stolen time is sent to the front end so that the front end can display the stolen time of the virtual machine and the stolen time trend change information generated based on the stolen time of the virtual machine.
[0095] In one embodiment of this application, the apparatus further includes: a secondary migration module, used for: Obtain the total current resource utilization of the virtual machines in the target physical machine; The virtual machine migration is performed based on the sum of the current resource utilization of the target physical machine.
[0096] In one embodiment of this application, the secondary migration module is used for: When the total current resource utilization of the target physical machine exceeds a preset change threshold, the target physical machine is identified as the target migration physical machine; The virtual machines in the target migration physical machine are migrated.
[0097] In this embodiment, the virtual machine scheduling system can collect virtual machine information and physical machine information. The virtual machine information includes at least the historical resource utilization rate of the virtual machine. Based on the virtual machine information, a virtual machine profile is predicted. This profile includes at least the resource utilization trend information of the virtual machine over a preset future time period, and the trend information includes at least the future resource utilization rate. Subsequently, the virtual machine can be allocated to corresponding virtual machine groups based on the virtual machine profile and physical machine information. Each virtual machine group is mapped to a corresponding physical machine, and the virtual machine is migrated to the physical machine corresponding to its virtual machine group. This virtual machine scheduling system can predict the future resource utilization rate of virtual machines over a preset future time period based on their historical resource utilization rate, grouping them for virtual machine migration. This ensures that virtual machines with staggered CPU utilization are placed together, preventing CPU contention on the same physical machine due to a large number of machines simultaneously reaching peak CPU utilization. This reduces or avoids the impact of CPU resource contention on virtual machine services, improves the SLA (Service Level Agreement) of virtual machines, and ensures stable operation of customer services.
[0098] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment. This application also provides an electronic device, such as... Figure 8 As shown, it includes a processor 1001, a device interface 1002, a memory 1003, and a bus 1004; Memory 1003 is used to store computer programs; The processor 1001 executes the above steps when executing the program stored in the memory 1003.
[0099] The bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0100] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0101] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0102] This application also provides a storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the virtual machine migration method of the foregoing embodiments.
[0103] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0104] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. The structure required to construct such a device is obvious from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0105] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0106] Similarly, it should be understood that, in order to simplify this application and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0107] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0108] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the sequencing device according to this application. This application can also be implemented as a device or apparatus program for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can take the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0109] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0111] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
[0112] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0113] It should be noted that the various data-related processes in the embodiments of this application are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.
Claims
1. A virtual machine migration method, characterized in that, The method includes: Collect virtual machine information and physical machine information; the virtual machine information includes at least the historical resource utilization rate of the virtual machine; The virtual machine profile is predicted based on the virtual machine information; the virtual machine profile includes at least the resource utilization trend information of the virtual machine over a preset future time period; the resource utilization trend information includes at least the future resource utilization. The virtual machines are assigned to corresponding virtual machine groups based on the virtual machine profile and the physical machine information; wherein each virtual machine group has a corresponding target physical machine. The virtual machine is migrated to the target physical machine corresponding to the virtual machine group to which it belongs.
2. The method according to claim 1, characterized in that, After collecting the virtual machine information of the virtual machine and the physical machine information of the physical machine, the method further includes: The historical resource utilization rate is divided into multiple periodic historical resource utilization rates according to a preset period; The historical resource utilization rate of the period is divided into time-based resource utilization rates for multiple moments; the time-based resource utilization rate for each moment is the maximum value of the historical resource utilization rate of the period to which the moment belongs.
3. The method according to claim 1, characterized in that, The step of predicting the virtual machine profile based on the virtual machine information includes: The virtual machine type is determined based on the virtual machine's historical resource utilization rate; each virtual machine type has a corresponding prediction model. The historical resource utilization rate is input into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model.
4. The method according to claim 3, characterized in that, The step of inputting the historical resource utilization rate into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model includes: When the virtual type corresponding to the virtual machine is periodic, the historical resource utilization rate is input into the prediction model corresponding to the periodic type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the prediction model. The future resource utilization rate is generated based on the historical resource utilization rate of the virtual machine.
5. The method according to claim 3, characterized in that, The step of inputting the historical resource utilization rate into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model includes: When the virtual type corresponding to the virtual machine is trend-type, the historical resource utilization rate is input into the quadratic exponential smoothing model corresponding to the trend type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the quadratic exponential smoothing model.
6. The method according to claim 3, characterized in that, The step of inputting the historical resource utilization rate into the prediction model corresponding to the virtual machine type of the virtual machine to obtain the virtual machine profile of the virtual machine output by the prediction model includes: When the virtual type corresponding to the virtual machine is regular-irregular, the historical resource utilization rate is input to the sequence-to-sequence model corresponding to the regular-irregular type to obtain the future resource utilization rate of the virtual machine in a preset future time period output by the sequence-to-sequence model.
7. The method according to claim 6, characterized in that, The sequence-to-sequence model includes an encoder and a decoder. The encoder of the sequence-to-sequence model is used to encode the input historical resource utilization sequence to obtain a context information vector. The decoder of the sequence-to-sequence model is used to decode the context information vector and output the future resource utilization of the virtual machine for a preset future time period.
8. The method according to claim 1, characterized in that, The step of assigning the virtual machine to the corresponding virtual machine group based on the virtual machine profile and the physical machine information includes: The virtual machines are assigned to the corresponding virtual machine groups according to the preset grouping principles, the virtual machine profile, and the physical machine information.
9. The method according to claim 8, characterized in that, The preset grouping principles include at least the following: Virtual machines whose future resource utilization is at its peak at the same time are placed in different virtual machine groups; At the same time, virtual machines in the same group are placed at the peak and trough of future resource utilization. The sum of future resource utilization rates for each virtual machine group does not exceed a preset threshold; the sum of future resource utilization rates is determined based on the number of virtual machine cores in the virtual machine group, the total number of sellable cores of the physical machine, and the future resource utilization rate of the virtual machines.
10. The method according to claim 1, characterized in that, After migrating the virtual machine to the target physical machine corresponding to its virtual machine group, the method further includes: Obtain the stolen time of the virtual machine; The stolen time is sent to the front end so that the front end can display the stolen time of the virtual machine and the stolen time trend change information generated based on the stolen time of the virtual machine.
11. The method according to claim 1, characterized in that, After migrating the virtual machine to the target physical machine corresponding to its virtual machine group, the method further includes: Obtain the total current resource utilization of the virtual machines in the target physical machine; The virtual machine migration is performed based on the sum of the current resource utilization of the target physical machine.
12. The method according to claim 11, characterized in that, The virtual machine migration based on the sum of the current resource utilization of the target physical machine includes: When the total current resource utilization of the target physical machine exceeds a preset change threshold, the target physical machine is identified as the target migration physical machine; The virtual machines in the target migration physical machine are migrated.
13. A virtual machine migration device, characterized in that, The device includes: The historical resource utilization rate acquisition module is used to collect virtual machine information and physical machine information; the virtual machine information includes at least the historical resource utilization rate of the virtual machine. The virtual machine profile prediction module is used to predict the virtual machine profile of the virtual machine based on the virtual machine information; the virtual machine profile includes at least the resource utilization trend information of the virtual machine in a preset future time period; The virtual machine grouping module is used to allocate the virtual machines to corresponding virtual machine groups according to the virtual machine profile and the physical machine information; wherein, each virtual machine group has a corresponding target physical machine; The virtual machine migration module is used to migrate the virtual machine to the target physical machine corresponding to the virtual machine group to which it belongs.
14. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the instructions to implement the virtual machine migration method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the mobile terminal, the mobile terminal is able to perform the virtual machine migration method as described in any one of claims 1 to 12.