Virtual machine migration method and device

By predicting and selecting the physical machine with the shortest response time for virtual machine migration, the problems of low efficiency and insufficient security of virtual machine migration in the cloud computing platform are solved, and efficient and secure virtual machine migration is achieved.

CN119396528AActive Publication Date: 2025-02-07DAWNING CLOUD COMPUTING TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411471547.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-07
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

In cloud computing platforms, how to efficiently migrate virtual machines, especially in the scenario where distributed lock mechanisms share storage resources, there are problems such as too long migration time, high risk of deadlock, and too long virtual machine resource sharing activation time.

Method used

By obtaining the performance parameters of K candidate physical machines, including the response time to the distributed lock command, input these parameters into the first model, predict the migration time of each candidate physical machine, and select the physical machine with the shortest predicted migration time as the migration Target.

Benefits of technology

It effectively reduces the risk of deadlocks during the migration process, reduces the problem of excessive activation time for virtual machine resource sharing, and improves the security and efficiency of virtual machines during the migration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396528A_ABST
    Figure CN119396528A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, in particular to a virtual machine migration method and device.The method comprises the steps that performance parameters corresponding to K candidate physical machines are obtained, and the performance parameters of the ith candidate physical machine comprise the response time of the ith candidate physical machine for a distributed lock command; the performance parameters corresponding to the K candidate physical machines are input into the first model, a first prediction result output by the first model is obtained, and the first prediction result comprises prediction migration time corresponding to the K candidate physical machines; determining a second physical machine according to the predicted migration time corresponding to the K candidate physical machines, wherein the second physical machine is the physical machine with the shortest predicted migration time in the K candidate physical machines; and migrating the virtual machine in the first physical machine to the second physical machine. According to the method, the virtual machine can be efficiently migrated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud computing, and in particular to a virtual machine migration method and device. Background Art

[0002] In modern cloud computing architecture, efficient and secure management of shared storage resources is an important indicator of the reliability of cloud computing platforms. To this end, a distributed lock mechanism such as Sanlock is generally used to manage the Logical Volume Manager (LVM).

[0003] In the scenario of shared storage resources using a distributed lock mechanism, how to efficiently migrate virtual machines is an issue worthy of attention. Summary of the invention

[0004] The embodiments of the present application provide a virtual machine migration method and device for achieving efficient migration of virtual machines.

[0005] In a first aspect, an embodiment of the present application provides a virtual machine migration method, the method comprising:

[0006] Obtain performance parameters corresponding to K candidate physical machines respectively, wherein the performance parameters of the i-th candidate physical machine include the response time of the i-th candidate physical machine to the distributed lock command, the i-th candidate physical machine is any one of the K candidate physical machines, i is less than or equal to K, and i and K are both positive integers;

[0007] Inputting the performance parameters corresponding to the K candidate physical machines into the first model, obtaining a first prediction result output by the first model, wherein the first prediction result includes the predicted migration times corresponding to the K candidate physical machines, wherein the predicted migration time of the i-th candidate physical machine refers to the predicted time for migrating the virtual machine in the first physical machine to the i-th candidate physical machine;

[0008] Determine a second physical machine according to the predicted migration times corresponding to the K candidate physical machines, where the second physical machine is a physical machine with the shortest predicted migration time among the K candidate physical machines;

[0009] Migrate the virtual machine in the first physical machine to the second physical machine.

[0010] In an embodiment of the present invention, the performance parameters corresponding to the K candidate physical machines respectively include the response time of each candidate physical machine to a distributed lock command, which reflects the response capability of each candidate physical machine in executing a distributed lock command, and can effectively evaluate the lock performance of each candidate physical machine; incorporating the response time of each candidate physical machine to a distributed lock command into the first model can effectively reduce the risk of deadlock during the migration process, and reduce the probability of the problem of long activation time for virtual machine resource sharing, while improving the security of the virtual machine during the migration process.

[0011] In a possible embodiment, the performance parameters of the i-th candidate physical machine also include: one or more of the available amount of the central processing unit (CPU) of the i-th candidate physical machine, the available amount of memory of the i-th candidate physical machine, the memory utilization rate of the i-th candidate physical machine, and the load of the i-th candidate physical machine.

[0012] In this embodiment, the performance parameters of the i-th candidate physical machine include not only the response time of the i-th candidate physical machine to the distributed lock command, but also the conventional performance indicators of the i-th candidate physical machine. By comprehensively considering indicators such as CPU, memory and load, a more comprehensive performance status evaluation of the candidate physical machine can be performed.

[0013] In a possible embodiment, inputting the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model includes:

[0014] The performance parameters corresponding to the K candidate physical machines and the performance parameters of the first physical machine are input into the first model to obtain the first prediction result, where the performance parameters of the first physical machine include the response time of the first physical machine to the distributed lock command.

[0015] In this embodiment, by inputting the performance parameters corresponding to the K candidate physical machines and the response time of the first physical machine to the distributed lock command into the first model, the first model can more accurately predict the migration time of each candidate physical machine.

[0016] In a possible embodiment, the performance parameters of the first physical machine also include: one or more of the available CPU of the first physical machine, the available memory of the first physical machine, the memory usage of the first physical machine, the load of the first physical machine, and the CPU usage and memory usage of the virtual machines in the first physical machine.

[0017] In this embodiment, the performance parameters of the first physical machine include not only the response time of the first physical machine to the distributed lock command, but also the conventional performance indicators of the first physical machine. By comprehensively considering indicators such as CPU, memory and load, a more comprehensive performance status evaluation of the first physical machine can be performed.

[0018] In a possible embodiment, inputting the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model includes:

[0019] The performance parameters and network indicators corresponding to the K candidate physical machines are respectively input into the first model to obtain the first prediction result, where the network indicators include network delay time and / or packet loss rate.

[0020] In this embodiment, network delay time and packet loss rate are basic factors affecting virtual machine migration performance. For example, high network delay or high packet loss rate may cause migration failure. By incorporating these indicators into the model, the impact of these network problems on migration time can be predicted, which is conducive to identifying the target physical machine with the shortest predicted migration time.

[0021] In a possible embodiment, the first model is obtained by training with a training data set, where the training data set includes a historical response time of a source physical machine to a distributed lock command and a historical response time of a target physical machine to a distributed lock command.

[0022] In this embodiment, the BPNN model is trained by using historical migration data, so that the first model can comprehensively consider the response time of the historical source physical machine and the historical target physical machine to execute the distributed lock command during the training process, which helps to train a first model with more accurate prediction results.

[0023] In a possible embodiment, the response time of the historical source physical machine to the distributed lock command includes a first response time and a second response time; wherein the first response time is the response time of the historical source physical machine to the distributed lock command of the shared activation type, and the second response time is the response time of the historical source physical machine to the distributed lock command of the deactivation type;

[0024] The response time of the historical target physical machine to the distributed lock command includes a third response time and a fourth response time; wherein, the third response time is the response time of the historical target physical machine to the distributed lock command of the shared activation type, and the fourth response time is the response time of the historical target physical machine to the distributed lock command of the exclusive activation type.

[0025] In this embodiment, by comprehensively considering the response time of the historical source physical machine and the historical target physical machine to the distributed lock command, including the first response time (used for the historical source physical machine to change the access status of the system volume and the data volume in the virtual machine from the exclusive activation state to the shared activation state), the second response time (used for the historical source physical machine to change the access status of the system volume and the data volume in the virtual machine from the shared activation state to the deactivated state), the third response time (used for the historical target physical machine to change the access status of the system volume and the data volume in the virtual machine from the deactivated state to the shared activation state) and the fourth response time (used for the historical target physical machine to change the access status of the system volume and the data volume in the virtual machine from the shared activation state to the exclusive activation state), the lock performance of the historical source physical machine and the historical target physical machine at different stages can be more comprehensively evaluated.

[0026] In a possible embodiment, the training data set also includes: one or more of the available CPU of the historical source physical machine, the available memory of the historical source physical machine, the memory usage of the historical source physical machine, the load of the historical source physical machine, the CPU usage and memory usage of the virtual machines in the historical source physical machine, the available CPU of the historical target physical machine, the available memory of the historical target physical machine, the memory usage of the historical target physical machine, the load of the historical target physical machine, historical network delay time and / or historical packet loss rate.

[0027] In this embodiment, the training data set also includes conventional performance indicators of the historical source physical machine and the historical target physical machine, as well as network indicators, which can improve the prediction accuracy of the first model.

[0028] In a possible embodiment, the response time of the i-th candidate physical machine to the distributed lock command is the response time of the i-th candidate physical machine to the distributed lock command of the detection type;

[0029] The response time of the first physical machine to the distributed lock command is the response time of the first physical machine to the distributed lock command of the detection type.

[0030] In this embodiment, by introducing the response time of the i-th candidate physical machine and the first physical machine to the detection type of distributed lock command, the ability of the candidate physical machine and the first physical machine to execute the distributed lock command during the actual migration process can be detected in advance.

[0031] In a third aspect, the present application provides a virtual machine migration device, including:

[0032] A memory for storing program instructions;

[0033] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.

[0034] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.

[0035] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A flowchart of a virtual machine migration method provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of obtaining a prediction result according to a first model provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of the structure of the virtual machine migration device provided in the embodiment of the present application Figure 1 ;

[0039] Figure 4 A schematic diagram of the structure of the virtual machine migration device provided in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0040] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] To facilitate understanding, the technical scenarios involved in the embodiments of the present application are first explained.

[0042] The embodiment of the present application relates to a cloud computing environment composed of multiple physical machines, in which the control node is responsible for centralized management and control of each physical machine. Take a virtual machine as an example, assuming that the virtual machine is deployed on a first physical machine, wherein the memory data of the virtual machine is stored in the memory of the virtual machine itself, and the system volume and data volume of the virtual machine are stored on a shared storage resource and can only be accessed by the first physical machine. When the virtual machine needs to be migrated from the first physical machine to the target physical machine, the memory data needs to be transferred to the target physical machine, and the system volume and data volume of the virtual machine can be accessed by the target physical machine.

[0043] For ease of understanding, the technical terms involved in the embodiments of the present application are explained.

[0044] Virtual machine: refers to a software-based computing environment that simulates the hardware system of a physical computer, allowing users to run multiple operating systems and applications on a physical server.

[0045] Distributed lock mechanism: a technology used in distributed systems to coordinate access to shared resources by multiple nodes, preventing data inconsistency and conflicts by synchronizing the lock status between different nodes.

[0046] Management and control node: also known as management server or control node. In the cloud computing and distributed system environment, the management and control node is the central node responsible for managing and coordinating the operation of the entire system. It usually undertakes key functions such as resource management and task scheduling to ensure the stable operation and performance optimization of the entire system.

[0047] Logical Volume Manager (LVM): is a disk management technology used in Linux environment, which can combine multiple physical hard disks into a logical volume for unified management. In addition, LVM supports dynamic adjustment of logical volume size without worrying about data loss, and provides flexible storage space management capabilities.

[0048] Distributed lock command: refers to the operation command used to implement and manage locks in a distributed system. For example, distributed lock commands can be divided into multiple types. The following takes the distributed lock command as an example to introduce several main types of Lvchange commands:

[0049] 1) Lvchange-asy command: a distributed lock command for shared activation type, used to change the access status of the physical machine to the system volume and data volume of the virtual machine from the exclusive activation state to the shared activation state;

[0050] 2) Lvchange-an command: a deactivation type distributed lock command used to change the access status of the physical machine to the system volume and data volume of the virtual machine from the shared activation state to the inactive state;

[0051] 3) Lvchange-ae command: a distributed lock command for exclusive activation type, used to change the access status of the physical machine to the system volume and data volume of the virtual machine from the shared activation state to the exclusive activation state;

[0052] 4) Lvchange-help command: It is a distributed lock command for detection type, which is used to test the response capability of the physical machine to execute the distributed lock command without changing the access status of the system volume and data volume of the virtual machine.

[0053] Currently, in operations involving node changes, such as virtual machine migration, there is a problem that the migration time is too long, which makes the shared activation time of the virtual machine's system volume and data volume too long, increasing the security risk of the virtual machine during the migration process and increasing the possibility of deadlock. In addition, the existing technology lacks intelligent migration strategies, which increases the total migration time and affects service availability; and the static or simplified decision-making mechanism used in the existing technology cannot fully utilize the dynamic resource status in the cloud environment, resulting in the selection of the target physical machine is not optimized, affecting the overall performance and stability.

[0054] Based on the above problems, Figure 1 As shown, an embodiment of the present invention provides a method for virtual machine migration, the method comprising:

[0055] Step 100: Obtain the performance parameters corresponding to K candidate physical machines respectively, wherein the performance parameters of the i-th candidate physical machine include the response time of the i-th candidate physical machine to the distributed lock command, the i-th candidate physical machine is any one of the K candidate physical machines, i is less than or equal to K, and i and K are both positive integers.

[0056] First, the control node will screen all physical machines in the cluster according to the resource usage and network status of the physical machines, and obtain K candidate physical machines with better performance.

[0057] In the specific implementation, all physical machines in the cluster will first be evaluated to see if they meet the basic requirements for virtual machine migration, where resource usage includes but is not limited to the available CPU and memory of the physical machine, and network conditions include but are not limited to network latency, bandwidth, etc. In addition, the control node will also consider factors such as the energy consumption and fault history of the physical machine to ensure that the selected candidate physical machines can not only provide the necessary resources, but also ensure that the migrated virtual machines run stably, efficiently, and have good maintainability.

[0058] After screening K candidate physical machines, the control node will also collect the performance parameters corresponding to the K candidate physical machines, where the performance parameters of the i-th candidate physical machine include the response time of the i-th candidate physical machine to the distributed lock command.

[0059] The response time of the i-th candidate physical machine to the distributed lock command is the response time of the i-th candidate physical machine to the detection type distributed lock command.

[0060] In a specific implementation, after screening K candidate physical machines, the control node can trigger the ith candidate physical machine to execute a distributed lock command, wherein the distributed lock command is a distributed lock command for the detection type, namely, the lvchange-help command, which is used to test the responsiveness of the ith candidate physical machine to execute the distributed lock command, and the command will not change any configuration or status of the ith candidate physical machine. After executing the lvchange-help command, the ith candidate physical machine will output a work log, recording the start timestamp and end timestamp of the command execution, wherein the difference between the start timestamp and the end timestamp is the response time of the ith candidate physical machine to the distributed lock command.

[0061] In addition, the performance parameters of the ith candidate physical machine also include one or more of the available CPU of the ith candidate physical machine, the available memory of the ith candidate physical machine, the memory usage of the ith candidate physical machine, and the load of the ith candidate physical machine.

[0062] Furthermore, the management and control node also collects performance parameters of the first physical machine, wherein the performance parameters of the first physical machine include a response time of the first physical machine to a distributed lock command.

[0063] The response time of the first physical machine to the distributed lock command is the response time of the first physical machine to the distributed lock command of the detection type.

[0064] In a specific implementation, the control node can trigger the first physical machine to execute a distributed lock command, wherein the distributed lock command is a distributed lock command for the detection type, namely, the lvchange-help command, which is used to test the response capability of the first physical machine to execute the distributed lock command, and the command will not change any configuration or state of the first physical machine. After the lvchange-help command is executed, the first physical machine will output a work log, recording the start timestamp and end timestamp of the command execution, wherein the difference between the start timestamp and the end timestamp is the response time of the first physical machine to the distributed lock command.

[0065] In addition, the performance parameters of the first physical machine also include one or more of the CPU availability of the first physical machine, the memory availability of the first physical machine, the memory usage of the first physical machine, the load of the first physical machine, and the CPU usage and memory usage of the virtual machines in the first physical machine.

[0066] Step 110: Input the performance parameters corresponding to the K candidate physical machines into the first model to obtain a first prediction result output by the first model, wherein the first prediction result includes the predicted migration times corresponding to the K candidate physical machines, wherein the predicted migration time of the i-th candidate physical machine refers to the predicted time for migrating the virtual machine in the first physical machine to the i-th candidate physical machine.

[0067] Exemplarily, before the performance parameters corresponding to the K candidate physical machines are respectively input into the first model, the first model is firstly trained.

[0068] Exemplarily, the first model can be trained in the following manner but not limited to:

[0069] 1. Obtaining a training data set. Exemplarily, the training data set includes the historical response time of the source physical machine to the distributed lock command and the historical response time of the target physical machine to the distributed lock command.

[0070] Among them, the response time of the historical source physical machine to the distributed lock command includes a first response time and a second response time; wherein the first response time is the response time of the historical source physical machine to the distributed lock command of the shared activation type, and the second response time is the response time of the historical source physical machine to the distributed lock command of the deactivation type. The response time of the historical target physical machine to the distributed lock command includes a third response time and a fourth response time; wherein the third response time is the response time of the historical target physical machine to the distributed lock command of the shared activation type, and the fourth response time is the response time of the historical target physical machine to the distributed lock command of the exclusive activation type.

[0071] In a specific implementation, the specific process of obtaining the historical source physical machine's response time to the distributed lock command and the historical target physical machine's response time to the distributed lock command is as follows:

[0072] The control node can trigger the historical source physical machine to execute a distributed lock command, wherein the distributed lock command is a distributed lock command for a shared activation type, namely, the lvchange-asy command, which is used to change the access status of the historical source physical machine to the system volume and data volume of the virtual machine from an exclusive activation state to a shared activation state. The historical source physical machine executes the lvchange-asy command, so that the system volume and data volume of the virtual machine are not only accessible to the current historical source physical machine, but also accessible to other physical machines whose access status has been changed to a shared activation state.

[0073] After the historical source physical machine completes the execution of the lvchange-asy command, the historical source physical machine outputs a work log that records the start timestamp and end timestamp of the command execution. The difference between the start timestamp and the end timestamp is the first response time.

[0074] After the historical source physical machine executes the lvchange-asy command, the historical source physical machine sends a first status update message to the historical target physical machine, indicating that the system volume and data volume of the virtual machine can be shared and accessed. After receiving the message, the historical target physical machine executes a distributed lock command, wherein the distributed lock command is a distributed lock command for a shared activation type, i.e., the lvchange-asy command, which is used to change the access status of the historical target physical machine to the system volume and data volume of the virtual machine in the historical source physical machine from an inactive state to a shared activation state, which means that the historical target physical machine can start accessing the system volume and data volume of the virtual machine.

[0075] After the historical target physical machine completes the execution of the lvchange-asy command, the historical target physical machine outputs a work log, recording the start timestamp and end timestamp of the command execution, wherein the difference between the start timestamp and the end timestamp is the third response time.

[0076] After the historical target physical machine executes the lvchange-asy command, the historical target physical machine sends a second status update message to the historical source physical machine, where the second status update message indicates that the current historical target physical machine can access the system volume and data volume of the virtual machine.

[0077] After receiving the information, the historical source physical machine starts to transfer the memory data of the virtual machine to the historical target physical machine. After all the memory data is transferred to the historical target physical machine, the historical source physical machine executes a distributed lock command, wherein the distributed lock command is a distributed lock command for the deactivation type, i.e., the lvchange-an command, which is used to change the access status of the historical source physical machine to the system volume and data volume from the shared activation state to the inactive state, so that the historical source physical machine cannot access the system volume and data volume of the virtual machine.

[0078] After the historical source physical machine completes the execution of the lvchange-an command, the historical source physical machine will output a work log, recording the start timestamp and end timestamp of the command execution, where the difference between the start timestamp and the end timestamp is the second response time.

[0079] After the historical source physical machine executes the lvchange-an command, the historical source physical machine sends a third status update message to the historical source physical machine, and the third status update message indicates that the historical source physical machine cancels access to the system volume and data volume in the virtual machine. After receiving the message, the historical target physical machine executes a distributed lock command, wherein the distributed lock command is a distributed lock command for an exclusive activation type, i.e., the lvchange-ae command, which is used to change the access status of the historical source physical machine to the system volume and data volume of the virtual machine from a shared activation state to an exclusive activation state, so that the historical source physical machine becomes the only physical machine that accesses the system volume and data volume of the virtual machine.

[0080] After the historical target physical machine completes the execution of the lvchange-ae command, the historical target physical machine will output a work log, recording the start timestamp and end timestamp of the command execution, wherein the difference between the start timestamp and the end timestamp is the fourth response time.

[0081] Furthermore, in addition to the historical source physical machine's response time to the distributed lock command (first response time and second response time) and the historical target physical machine's response time to the distributed lock command (third response time and fourth response time), the training data set also includes: one or more of the historical source physical machine's CPU availability, the historical source physical machine's memory availability, the historical source physical machine's memory usage, the historical source physical machine's load, the CPU usage and memory usage of the virtual machines in the historical source physical machine, the historical target physical machine's CPU availability, the historical target physical machine's memory availability, the historical target physical machine's memory usage, the historical target physical machine's load, historical network delay time and / or historical packet loss rate.

[0082] In a possible design, the training data set may also include the number of other distributed lock commands received by the historical source physical machine in the current migration task and the number of other distributed lock commands received by the historical target physical machine in the current migration task.

[0083] After obtaining the training data set, a normalization function is used to scale all data in the training data set to the interval [0, 1] to improve the distribution characteristics of the data, wherein the present application does not limit the specific normalization function.

[0084] 2. Train the first model based on the training data set.

[0085] In the specific implementation, first, the number of hidden layer neurons of the Back Propagation Neural Network (BPNN) is designed according to the empirical formula l = √n + m + a, where BPNN is a basic deep learning model consisting of multiple layers of neurons and connection weights. Among them, n is the number of input layer neurons, that is, the number of features in the training data set; m is the number of output layer neurons, that is, the number of model prediction targets; a is a constant, usually between 1 and 10, used to adjust the number of hidden layer neurons to obtain better network performance.

[0086] Secondly, a suitable activation function is selected for each neuron. For example, the Rulu function is used for the hidden layer and the Sigmoid function is used for the output layer. This application does not limit the specific activation function.

[0087] Third, the normalized training data set is input into the model. During the training process, a suitable loss function is used to improve the performance of the model, such as the cross entropy loss function. At the same time, parameters such as the learning rate, batch size, and number of training rounds are continuously adjusted to optimize the model. Through multiple iterative training, a first model with high prediction accuracy can be obtained.

[0088] After obtaining the trained first model, the performance parameters corresponding to the K candidate physical machines, the performance parameters of the first physical machine, and the network indicators are input into the first model to obtain the first prediction result output by the first model, and the first prediction result may include the predicted migration time corresponding to the K candidate physical machines. The performance parameters corresponding to the K candidate physical machines and the performance parameters of the first physical machine are the performance parameters corresponding to the K candidate physical machines and the performance parameters of the first physical machine collected by the control node in the above step 100, and the network indicators include network delay time and / or packet loss rate.

[0089] In a specific implementation, after the first model is obtained through BPNN model training, Figure 2 As shown, after inputting the performance parameters of the ith candidate physical machine, the performance parameters of the first physical machine and the network indicators respectively, the first model can output the predicted migration time corresponding to the ith candidate physical machine. The predicted migration time of the ith candidate physical machine refers to the predicted time for migrating the virtual machine in the first physical machine to the ith candidate physical machine.

[0090] Step 120: Determine a second physical machine according to the predicted migration times corresponding to the K candidate physical machines. The second physical machine is a physical machine with the shortest predicted migration time among the K candidate physical machines.

[0091] In the specific implementation, after the first model outputs the predicted migration times corresponding to the K candidate physical machines, the management and control node needs to compare the predicted migration times corresponding to the K candidate physical machines to identify which candidate physical machine has the shortest predicted migration time. At the same time, the shortest predicted migration time also means that the shared activation time of the virtual machine's system volume and data volume is the shortest, ensuring the security of the virtual machine migration process.

[0092] By comparing the predicted migration times, the candidate physical machine with the shortest predicted migration time is selected as the second physical machine. After confirming the second physical machine, the management and control node sends a migration instruction to the first physical machine and the second physical machine to start the migration process of the virtual machine.

[0093] Step 130: Migrate the virtual machine in the first physical machine to the second physical machine.

[0094] In a specific implementation, the control node sends a migration instruction to the first physical machine. After receiving the migration instruction, the first physical machine executes the lvchange-asy command to change the access status of the first physical machine to the system volume and data volume of the virtual machine from the exclusive activation state to the shared activation state. After the first physical machine executes the lvchange-asy command, the first physical machine sends a first status update message to the second physical machine, indicating that the system volume and data volume of the virtual machine can be shared. After receiving the message, the second physical machine executes the lvchange-asy command to change the access status of the second physical machine to the system volume and data volume of the virtual machine in the first physical machine from the inactive state to the shared activation state. After the second physical machine executes the lvchange-asy command, the second physical machine sends a second status update message to the first physical machine, indicating that the current second physical machine can access the system volume and data volume of the virtual machine. After receiving the message, the first physical machine starts to transfer the memory data of the virtual machine to the second physical machine. After all the memory data is transferred to the second physical machine, the first physical machine executes the lvchange-an command to change the access status of the first physical machine to the system volume and data volume from the shared activation state to the inactive state. After the first physical machine executes the lvchange-an command, the first physical machine sends a third status update message to the second physical machine, instructing the first physical machine to cancel access to the system volume and data volume of the virtual machine. After receiving the message, the second physical machine executes the lvchange-ae command to change the access status of the second physical machine to the system volume and data volume of the virtual machine from the shared activation state to the exclusive activation state, so as to ensure that the virtual machine can run independently on the second physical machine. At this point, the virtual machine in the first physical machine is successfully migrated to the second physical machine.

[0095] In summary, the present application provides a virtual machine migration method, in which the response time of the candidate physical machine to the distributed lock command and the response time of the first physical machine to the distributed lock command are input into the first model. These two response times reflect the response capabilities of the candidate physical machine and the first physical machine in executing the distributed lock command, which can help to more comprehensively evaluate the lock performance of the candidate physical machine and the first physical machine. By inputting the performance parameters including these two response times into the first model, the predicted migration time of each candidate physical machine can be obtained more accurately. This method can effectively reduce the risk of deadlock during the migration process, reduce the probability of the problem of too long activation time for virtual machine resource sharing, and at the same time improve the security of the virtual machine during the migration process.

[0096] Figure 3 and Figure 4 A schematic diagram of a possible virtual machine migration device provided in an embodiment of the present invention. The virtual machine migration device can be used to implement the function of the control node in the above method embodiment.

[0097] like Figure 3 As shown, the virtual machine migration device 300 includes a communication unit 310 and a processing unit 320 .

[0098] When the virtual machine migration device 300 is used to implement Figure 1 In the method embodiment shown, the functions of the control node are:

[0099] The communication unit 310 is used to obtain performance parameters corresponding to K candidate physical machines respectively, wherein the performance parameters of the i-th candidate physical machine include the response time of the i-th candidate physical machine to the distributed lock command, the i-th candidate physical machine is any one of the K candidate physical machines, i is less than or equal to K, and i and K are both positive integers.

[0100] The processing unit 320 is used to input the performance parameters corresponding to the K candidate physical machines into the first model to obtain a first prediction result output by the first model, wherein the first prediction result includes the predicted migration times corresponding to the K candidate physical machines, wherein the predicted migration time of the i-th candidate physical machine refers to the predicted time for migrating the virtual machine in the first physical machine to the i-th candidate physical machine.

[0101] The processing unit 320 is further configured to determine a second physical machine according to the predicted migration times respectively corresponding to the K candidate physical machines, where the second physical machine is a physical machine having the shortest predicted migration time among the K candidate physical machines.

[0102] The processing unit 320 is further configured to migrate the virtual machine in the first physical machine to the second physical machine.

[0103] In a possible design, the processing unit 320 is further configured to input the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model, including:

[0104] The performance parameters corresponding to the K candidate physical machines and the performance parameters of the first physical machine are input into the first model to obtain the first prediction result, where the performance parameters of the first physical machine include the response time of the first physical machine to the distributed lock command.

[0105] In a possible design, the performance parameters of the first physical machine also include: one or more of the available CPU of the first physical machine, the available memory of the first physical machine, the memory usage of the first physical machine, the load of the first physical machine, and the CPU usage and memory usage of the virtual machines in the first physical machine.

[0106] In a possible design, the processing unit 320 is further configured to input the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model, including:

[0107] The performance parameters and network indicators corresponding to the K candidate physical machines are respectively input into the first model to obtain the first prediction result, where the network indicators include network delay time and / or packet loss rate.

[0108] In a possible design, the first model is trained using a training data set, where the training data set includes a historical source physical machine's response time to a distributed lock command and a historical target physical machine's response time to a distributed lock command.

[0109] In a possible design, the response time of the historical source physical machine to the distributed lock command includes a first response time and a second response time; wherein the first response time is the response time of the historical source physical machine to the distributed lock command of the shared activation type, and the second response time is the response time of the historical source physical machine to the distributed lock command of the deactivation type;

[0110] The response time of the historical target physical machine to the distributed lock command includes a third response time and a fourth response time; wherein, the third response time is the response time of the historical target physical machine to the distributed lock command of the shared activation type, and the fourth response time is the response time of the historical target physical machine to the distributed lock command of the exclusive activation type.

[0111] In a possible design, the training data set also includes: one or more of the available CPU of the historical source physical machine, the available memory of the historical source physical machine, the memory usage of the historical source physical machine, the load of the historical source physical machine, the CPU usage and memory usage of the virtual machines in the historical source physical machine, the available CPU of the historical target physical machine, the available memory of the historical target physical machine, the memory usage of the historical target physical machine, the load of the historical target physical machine, historical network delay time and / or historical packet loss rate.

[0112] In a possible design, the response time of the i-th candidate physical machine to the distributed lock command is the response time of the i-th candidate physical machine to the detection type distributed lock command;

[0113] The response time of the first physical machine to the distributed lock command is the response time of the first physical machine to the distributed lock command of the detection type.

[0114] For a more detailed description of the communication unit 310 and the processing unit 320, please refer to Figure 1 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.

[0115] like Figure 4 As shown, the virtual machine migration device 400 includes a processor 410 and a communication interface 420. The processor 410 and the communication interface 420 are coupled to each other. It is understandable that the communication interface 420 can be a transceiver or an input-output interface. Optionally, the virtual machine migration device 400 may also include a memory 430 for storing instructions executed by the processor 410 or storing input data required by the processor 410 to run the instructions or storing data generated after the processor 410 runs the instructions.

[0116] When the virtual machine migration device 300 is used to implement Figure 1 When the method is shown, the processor 410 is used to implement the functions of the processing unit 320, and the communication interface 420 is used to implement the functions of the communication unit 310.

[0117] The division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0118] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, and a computer program product includes: a computer program code, when the computer program code is executed on a computer, the computer executes any of the virtual machine migration methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the virtual machine migration method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0119] Based on the same inventive concept, the embodiment of the present application further provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the virtual machine migration methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the virtual machine migration method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0120] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0121] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0123] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A virtual machine migration method, characterized in that: The method includes: Obtain performance parameters corresponding to K candidate physical machines respectively, wherein the performance parameters of the i-th candidate physical machine include the response time of the i-th candidate physical machine to the distributed lock command, the i-th candidate physical machine is any one of the K candidate physical machines, i is less than or equal to K, and i and K are both positive integers; Inputting the performance parameters corresponding to the K candidate physical machines into the first model, obtaining a first prediction result output by the first model, wherein the first prediction result includes the predicted migration times corresponding to the K candidate physical machines, wherein the predicted migration time of the i-th candidate physical machine refers to the predicted time for migrating the virtual machine in the first physical machine to the i-th candidate physical machine; Determine a second physical machine according to the predicted migration times corresponding to the K candidate physical machines, where the second physical machine is a physical machine with the shortest predicted migration time among the K candidate physical machines; Migrate the virtual machine in the first physical machine to the second physical machine.

2. The method according to claim 1, characterized in that The performance parameters of the i-th candidate physical machine also include: one or more of the available amount of the central processing unit (CPU) of the i-th candidate physical machine, the available amount of memory of the i-th candidate physical machine, the memory utilization rate of the i-th candidate physical machine, and the load of the i-th candidate physical machine.

3. The method according to claim 1, characterized in that Inputting the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model includes: The performance parameters corresponding to the K candidate physical machines and the performance parameters of the first physical machine are input into the first model to obtain the first prediction result, where the performance parameters of the first physical machine include the response time of the first physical machine to the distributed lock command.

4. The method according to claim 3, characterized in that The performance parameters of the first physical machine also include: one or more of the available CPU of the first physical machine, the available memory of the first physical machine, the memory usage of the first physical machine, the load of the first physical machine, and the CPU usage and memory usage of the virtual machines in the first physical machine.

5. The method according to claim 1, characterized in that Inputting the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model includes: The performance parameters and network indicators corresponding to the K candidate physical machines are respectively input into the first model to obtain the first prediction result, where the network indicators include network delay time and / or packet loss rate.

6. The method according to claim 1, characterized in that The first model is obtained by training with a training data set, where the training data set includes a historical response time of a source physical machine to a distributed lock command and a historical response time of a target physical machine to a distributed lock command.

7. The method according to claim 6, characterized in that The response time of the historical source physical machine to the distributed lock command includes a first response time and a second response time; wherein the first response time is the response time of the historical source physical machine to the distributed lock command of the shared activation type, and the second response time is the response time of the historical source physical machine to the distributed lock command of the deactivation type; The response time of the historical target physical machine to the distributed lock command includes a third response time and a fourth response time; wherein, the third response time is the response time of the historical target physical machine to the distributed lock command of the shared activation type, and the fourth response time is the response time of the historical target physical machine to the distributed lock command of the exclusive activation type.

8. The method according to claim 6, characterized in that The training data set also includes: one or more of the available CPU of the historical source physical machine, the available memory of the historical source physical machine, the memory usage of the historical source physical machine, the load of the historical source physical machine, the CPU usage and memory usage of the virtual machines in the historical source physical machine, the available CPU of the historical target physical machine, the available memory of the historical target physical machine, the memory usage of the historical target physical machine, the load of the historical target physical machine, historical network delay time and / or historical packet loss rate.

9. The method according to claim 1, characterized in that The response time of the i-th candidate physical machine to the distributed lock command is the response time of the i-th candidate physical machine to the distributed lock command of the detection type; The response time of the first physical machine to the distributed lock command is the response time of the first physical machine to the distributed lock command of the detection type.

10. A virtual machine migration device, characterized in that: The device comprises: a communication unit and a processing unit; The communication unit is used to obtain performance parameters corresponding to K candidate physical machines respectively; wherein the performance parameters of the i-th candidate physical machine include the response time of the i-th candidate physical machine to the distributed lock command, the i-th candidate physical machine is any one of the K candidate physical machines, i is less than or equal to K, and i and K are both positive integers; The processing unit is used to input the performance parameters corresponding to the K candidate physical machines into a first model to obtain a first prediction result output by the first model, wherein the first prediction result includes the predicted migration times corresponding to the K candidate physical machines, wherein the predicted migration time of the i-th candidate physical machine refers to the predicted time for migrating the virtual machine in the first physical machine to the i-th candidate physical machine; and determine a second physical machine according to the predicted migration times corresponding to the K candidate physical machines, the second physical machine being the physical machine with the shortest predicted migration time among the K candidate physical machines; and migrate the virtual machine in the first physical machine to the second physical machine.

11. A virtual machine migration device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods of claims 1-9 according to the obtained program instructions.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Virtual machine migration management method and device, electronic equipment and storage medium

    CN118132197A

  • Virtual machine live migration method and communication equipment

    CN118312284A

  • Method and system for migration

    KR101820269B1

  • Optimistic locking in virtual machine instance migration

    US10228969B1