Search

CN-121560462-B - Virtual machine migration method and device, terminal equipment and storage medium

CN121560462BCN 121560462 BCN121560462 BCN 121560462BCN-121560462-B

Abstract

The invention discloses a virtual machine migration method, a device, terminal equipment and a storage medium, wherein the method comprises the steps of obtaining all servers to be decided at the current moment; the method comprises the steps of carrying out load detection on each server to be decided, determining each overload server and each non-overload server, constructing a server candidate queue at the current moment according to each non-overload server, calculating CPU interference degree of each virtual machine in the current overload server according to the total number of CPU cores of the current overload server, the total number of virtual CPU cores of each virtual machine and the CPU utilization rate of each virtual machine for each overload server, constructing a virtual machine CPU interference degree sequence of the current overload server, constructing a virtual machine queue to be migrated according to the CPU interference degree sequence of each virtual machine of each overload server and each virtual machine, and migrating all virtual machines in the virtual machine queue to be migrated to each non-overload server in the server candidate queue according to the bandwidth utilization rate of each non-overload server in the server candidate queue.

Inventors

  • ZOU LIXIAN

Assignees

  • 云宏信息科技股份有限公司

Dates

Publication Date
20260508
Application Date
20260126

Claims (10)

  1. 1. A virtual machine migration method, comprising: Acquiring all servers to be decided at the current moment, wherein each server to be decided comprises a plurality of virtual machines; load detection is carried out on each server to be decided at the current moment, and each overload server at the current moment and each non-overload server at the current moment are determined; constructing a server candidate queue at the current moment according to each non-overload server at the current moment; For each overload server at the current moment, calculating the CPU interference degree of each virtual machine in the current overload server according to the total number of CPU cores of the current overload server, the total number of virtual CPU cores of each virtual machine and the CPU utilization rate of each virtual machine, wherein the CPU interference degree is the average value of the CPU utilization ratio of the virtual machine in a specified time interval and based on the number of the own virtual CPU cores relative to the total CPU cores of the server; according to the CPU interference degree of each virtual machine in the current overload server, constructing a virtual machine CPU interference degree sequence of the current overload server; An initial virtual machine queue to be migrated is constructed, virtual machines with CPU interference degree meeting a threshold value in each overload server are added into the initial virtual machine queue to be migrated according to the virtual machine CPU interference degree sequence of each overload server, and the virtual machine queue to be migrated at the current time is obtained; And migrating all virtual machines in the virtual machine queue to be migrated at the current moment to target servers of all the non-overloaded servers in the server candidate queue at the current moment according to the bandwidth utilization rate of the non-overloaded servers in the server candidate queue at the current moment, wherein the target servers are obtained by calculating measurement indexes according to preset weight parameters and the bandwidth utilization rate of the servers and screening according to the measurement indexes.
  2. 2. The method for migrating a virtual machine according to claim 1, wherein migrating all virtual machines in the virtual machine queue to be migrated at the current time to each non-overloaded server in the server candidate queue at the current time according to the bandwidth utilization of each non-overloaded server in the server candidate queue at the current time comprises: repeatedly executing virtual machine migration operation until a virtual machine queue to be migrated is empty at the current moment; Wherein the virtual machine migration operation includes: Acquiring the bandwidth utilization rate of each non-overload server in a server candidate queue at the current moment, and selecting a target server according to the bandwidth utilization rate of each non-overload server; Selecting a target virtual machine from a virtual machine queue to be migrated, and migrating the target virtual machine to a target server; and removing the target virtual machine from the virtual machine queue to be migrated.
  3. 3. The virtual machine migration method of claim 2, further comprising: when the virtual machine queue to be migrated is empty at the current time, generating a virtual machine migration topological graph and a virtual machine migration mapping table at the current time according to the virtual machine queue to be migrated and the server candidate queue; And migrating each virtual machine according to the virtual machine migration topological graph and the virtual machine migration mapping table at the current moment.
  4. 4. A virtual machine migration method as claimed in claim 3, wherein the detecting the load of each server to be decided at the current time, determining each overloaded server at the current time and each un-overloaded server at the current time, comprises: The method comprises the steps of obtaining loads of each server to be decided at the time of historical overload, loads of each server to be decided at the current time, historical overload time of each server to be decided and virtual machine migration topological graphs of each server to be decided at the time of historical overload; determining the prediction time of each server to be decided according to the historical overload time of each server to be decided and the virtual machine migration topological graph under the historical overload time of each server to be decided; The CPU utilization rate of each server to be decided in a preset period is obtained, wherein the preset period comprises a starting time, a current time and a predicted time; Determining overload proportion according to the load of each server to be decided at the historical overload time and the load of each server to be decided at the current time; when the server to be decided at any current moment meets the preset overload judging condition, judging that the server to be decided at the current moment is an overload server; When the server to be decided at any current moment does not meet the preset overload judging condition, judging that the server to be decided at the current moment is a non-overload server; the preset overload judging condition comprises that the CPU utilization rate of the server to be decided is not smaller than a thermal threshold value or the overload proportion of the server to be decided is not smaller than an accumulated overload threshold value in a preset period.
  5. 5. The virtual machine migration method of claim 4, wherein determining the predicted time of each server to be decided according to the virtual machine migration topology under the historical overload time of each server to be decided and the historical overload time of each server to be decided comprises: Constructing a virtual machine migration topology graph set according to the virtual machine migration topology graph of each server to be decided under the historical overload time; For each server to be decided, constructing a time sequence data set to be processed according to the historical overload moment and the current moment of the server to be decided; acquiring time sequence data at a selected time from the time sequence data set to be processed, acquiring a virtual machine migration topological graph at the selected time from the virtual machine migration topological graph set, and constructing binary data to be processed according to the time sequence data at the selected time and the virtual machine migration topological graph at the selected time; inputting the binary data to be processed into a preset time sequence prediction model so as to enable the preset time sequence prediction model to output a predicted time sequence length; And determining the prediction time of the server to be decided according to the prediction time sequence length.
  6. 6. The virtual machine migration method of claim 5, wherein the predetermined timing prediction model comprises a normalization layer, a first bi-directional recursion loop layer, a second bi-directional recursion loop layer, a prediction layer, and an inverse normalization layer; The inputting the binary group data to be processed into a preset time sequence prediction model so that the preset time sequence prediction model outputs a predicted time sequence length comprises the following steps: Inputting the data of the to-be-processed binary group into a normalization layer so that the normalization layer outputs normalized binary group data, wherein the normalized binary group data comprises normalized time sequence data at a selected moment and a virtual machine migration topological graph at the selected moment; Inputting normalized binary data into a first bidirectional recursion cyclic layer in a forward direction, so that the first bidirectional recursion cyclic layer outputs a forward processing result; reversely inputting the normalized binary data into a second bidirectional recursion cyclic layer so that the second bidirectional recursion cyclic layer outputs a reverse processing result; the forward processing result and the reverse processing result are spliced to obtain a bidirectional recursion cycle result; inputting the bidirectional recursion cyclic result into a prediction layer to obtain the length of a predicted time sequence to be output; Inputting the predicted time sequence length to be output into an inverse normalization layer so that the inverse normalization layer outputs the predicted time sequence length.
  7. 7. The method of migrating a virtual machine of claim 1, further comprising, before migrating all virtual machines in the virtual machine queue to be migrated at the current time to each non-overloaded server in the server candidate queue at the current time according to the bandwidth utilization of each non-overloaded server in the server candidate queue at the current time: underload detection is carried out on each underload server at the current moment, and each underload server at the current moment is determined; And adding all virtual machines of each underrun server into a virtual machine queue to be migrated.
  8. 8. The virtual machine migration device is characterized by comprising a data acquisition module, a load detection module, a server candidate queue construction module, a virtual machine queue construction module to be migrated and a migration module; the data acquisition module is used for acquiring all servers to be decided at the current moment, wherein each server to be decided comprises a plurality of virtual machines; The load detection module is used for carrying out load detection on each server to be decided under the current time and determining each overload server under the current time and each non-overload server under the current time; the server candidate queue construction module is used for constructing a server candidate queue at the current moment according to each non-overloaded server at the current moment; The virtual machine queue construction module is used for calculating the CPU interference degree of each virtual machine in the current overload server according to the total number of CPU cores of the current overload server, the total number of virtual CPU cores of each virtual machine and the CPU utilization rate of each virtual machine, constructing a virtual machine CPU interference degree sequence of the current overload server according to the CPU interference degree of each virtual machine in the current overload server, constructing an initial virtual machine queue to be migrated, adding the virtual machines with the CPU interference degree meeting the threshold value in each overload server into the initial virtual machine queue to be migrated according to the virtual machine CPU interference degree sequence of each overload server, and obtaining the virtual machine queue to be migrated at the current time, wherein the CPU interference degree is the average value of the CPU utilization ratio of the virtual machine in a specified time interval and based on the self virtual CPU core number relative to the total CPU core number of the server; The migration module is configured to migrate all virtual machines in the virtual machine queue to be migrated at the current moment to target servers of each non-overloaded server in the server candidate queue at the current moment according to bandwidth utilization rates of each non-overloaded server in the server candidate queue at the current moment, where the target servers are obtained by calculating measurement indexes according to preset weight parameters and bandwidth utilization rates of the servers and screening according to the measurement indexes.
  9. 9. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a virtual machine migration method according to any one of claims 1 to 7 when the computer program is executed.
  10. 10. A storage medium comprising a stored computer program, wherein the computer program, when run, controls a device in which the storage medium is located to perform a virtual machine migration method according to any one of claims 1 to 7.

Description

Virtual machine migration method and device, terminal equipment and storage medium Technical Field The present invention relates to the field of virtual machine migration technologies, and in particular, to a virtual machine migration method, device, terminal equipment, and storage medium. Background With the rapid development of cloud computing technology, virtualization technology is increasingly widely applied to data centers. Virtual machine integration is an important resource management strategy, and has important significance for improving the resource utilization rate of a data center, reducing energy consumption and reducing operation and maintenance cost. By reasonable virtual machine integration, physical resources can be utilized to the maximum extent on the premise of ensuring the service quality, and the waste of the resources is avoided. The virtual machine integration technology realizes the efficient management of the physical resources of the data center mainly through dynamic migration and reallocation of virtual machine resources. The virtual machine migration process is involved in the virtual machine integration process, and in actual operation, the migration of the virtual machine can have a significant influence on the resource usage mode of the server, and when a plurality of virtual machines are frequently migrated, the resource usage of the server can be caused to fluctuate; in the prior art, whether the migrated target server is enough to support the virtual machine migration is not considered in the virtual machine migration, so that the target server is found to be in an overload condition or the target server is originally in overload after the virtual machine migration, and the virtual machine needs to be repeatedly migrated. Therefore, how to avoid frequent migration of virtual machines is a problem that needs to be solved. Disclosure of Invention The embodiment of the invention provides a virtual machine migration method, a device, terminal equipment and a storage medium, which can reduce the use fluctuation of server resources caused by virtual machine migration. An embodiment of the present invention provides a virtual machine migration method, including: Acquiring all servers to be decided at the current moment, wherein each server to be decided comprises a plurality of virtual machines; load detection is carried out on each server to be decided at the current moment, and each overload server at the current moment and each non-overload server at the current moment are determined; constructing a server candidate queue at the current moment according to each non-overload server at the current moment; For each overload server at the current moment, calculating the CPU interference degree of each virtual machine in the current overload server according to the total number of CPU cores of the current overload server, the total number of virtual CPU cores of each virtual machine and the CPU utilization rate of each virtual machine; according to the CPU interference degree of each virtual machine in the current overload server, constructing a virtual machine CPU interference degree sequence of the current overload server; an initial virtual machine queue to be migrated is constructed, each virtual machine of each overload server is added into the initial virtual machine queue to be migrated according to the virtual machine CPU interference degree sequence of each overload server, and the virtual machine queue to be migrated at the current moment is obtained; And according to the bandwidth utilization rate of each non-overload server in the candidate queue of the server at the current moment, all virtual machines in the virtual machine queue to be migrated at the current moment are migrated to each non-overload server in the candidate queue of the server at the current moment. Further, according to the bandwidth utilization ratio of each non-overloaded server in the candidate queue of the server at the current time, migrating all virtual machines in the virtual machine queue to be migrated at the current time to each non-overloaded server in the candidate queue of the server at the current time, including: repeatedly executing virtual machine migration operation until a virtual machine queue to be migrated is empty at the current moment; Wherein the virtual machine migration operation includes: Acquiring the bandwidth utilization rate of each non-overload server in a server candidate queue at the current moment, and selecting a target server according to the bandwidth utilization rate of each non-overload server; Selecting a target virtual machine from a virtual machine queue to be migrated, and migrating the target virtual machine to a target server; and removing the target virtual machine from the virtual machine queue to be migrated. Further, the method further comprises the following steps: when the virtual machine queue to be migrated is empty at the current time, generatin