Virtual machine migration method and device, scheduler and computer system
By formulating multiple migration plans and using genetic algorithms to optimize migration paths and sequences, the problems of low bandwidth utilization and long migration time during virtual machine migration are solved, achieving more efficient migration efficiency and flexibility.
Patent Information
- Application Number
- CN202310166102.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-09-03
AI Technical Summary
The existing technology has low network bandwidth utilization, long migration time, and low migration efficiency during the virtual machine migration process, and cannot adapt to different migration scenarios, resulting in a long migration time.
Provide a virtual machine migration method. By formulating multiple migration plans, selecting the shortest plan according to the migration time for parallel migration, using genetic algorithms to generate migration paths and sequences, and dynamically adjusting the degree of parallelism to ensure that virtual machines make full use of the network during the migration process. bandwidth.
It shortens the virtual machine migration time, improves the migration efficiency and bandwidth utilization, adapts to different migration scenarios, and improves the flexibility and efficiency of virtual machine migration.
Smart Images

Figure CN118585283A
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a virtual machine migration method, device, scheduler and computer system. Background Art
[0002] In order to achieve load balancing in cloud computing data centers, it is necessary to migrate virtual machines in the server, moving virtual machines from the source server to the destination server. Usually, the virtual machines to be migrated and the migration path are determined based on expert experience, and then the virtual machines to be migrated are divided into multiple groups for migration. After all virtual machines in a group are migrated in parallel, the next group of migrations begins. However, since the migration time required to migrate each virtual machine is different, the total migration time of each group depends on the migration time of the slowest virtual machine in the group, and the destination server corresponding to the virtual machine that has completed the migration is in an idle waiting state. Therefore, the network bandwidth utilization rate is low, the virtual machine migration time is long, and the virtual machine migration efficiency is low during the virtual machine migration process. Summary of the invention
[0003] The present application provides a virtual machine migration method, device, scheduler and computer system, thereby improving network bandwidth utilization, shortening virtual machine migration time and improving virtual machine migration efficiency during virtual machine migration.
[0004] In a first aspect, a virtual machine migration method is provided, the method comprising: formulating multiple migration schemes for multiple virtual machines to be migrated, performing the migration time required for parallel migration according to the migration paths and migration sequences indicated by the multiple migration schemes, and selecting one scheme from the multiple migration schemes as the migration scheme for the multiple virtual machines to be migrated; and controlling the physical machine where the virtual machine is located to perform parallel migration of the multiple virtual machines to be migrated according to the migration paths and migration sequences indicated by the migration schemes.
[0005] Compared with the migration path pre-configured according to expert experience, virtual machine migration based on the traditional virtual machine migration method cannot adapt to different migration scenarios, resulting in a longer migration time for virtual machine migration. Since the virtual machine migration method provided by the present application provides a variety of migration schemes, each of which has a different migration path and migration order, and a different migration time. A migration scheme is dynamically selected from a variety of migration schemes based on the migration time, that is, not only the destination physical machine for multiple virtual machines to be migrated is considered, but also how to reach the destination physical machine and the migration time of the virtual machine to be migrated are considered, and a migration scheme with the shortest possible migration time is selected. In this way, the virtual machine migration time is shortened and the efficiency of virtual machine migration is improved.
[0006] In conjunction with the first aspect, in a possible implementation, determining migration schemes for multiple virtual machines to be migrated according to the migration times of multiple migration schemes includes: determining the migration scheme with the shortest migration time among the multiple migration schemes as the migration scheme for the multiple virtual machines to be migrated. Selecting the shortest migration time from the multiple migration times and using the migration scheme with the shortest migration time as the final scheme when performing virtual machine migration can shorten the virtual machine migration time and improve virtual machine migration efficiency.
[0007] In combination with the first aspect, in another possible implementation method, migration schemes for multiple virtual machines to be migrated are determined according to the migration times of the multiple migration schemes, including: obtaining multiple migration schemes according to at least one intermediate migration scheme; when a termination condition is met, the migration schemes for multiple virtual machines to be migrated are determined according to the migration times of the multiple migration schemes, and the termination condition includes the number of iterations.
[0008] At least one intermediate migration plan can be obtained in any iteration, and as many migration plans as possible can be obtained according to at least one intermediate migration plan through multiple iterations. When the number of iterations is met, the migration plan with the shortest migration time can be better selected from as many migration plans as possible, which improves the accuracy of the migration plan, so as to shorten the virtual machine migration time and improve the virtual machine migration efficiency when performing virtual machine migration.
[0009] In combination with the first aspect, in another possible implementation, multiple migration schemes are obtained according to at least one intermediate migration scheme, including: generating migration paths of multiple virtual machines to be migrated in multiple migration schemes based on a genetic algorithm according to multiple intermediate migration paths of multiple virtual machines to be migrated.
[0010] In combination with the first aspect, in another possible implementation method, multiple migration schemes are obtained based on at least one intermediate migration scheme, including: determining the parallelism based on the migration paths of multiple virtual machines to be migrated in the migration scheme, and the parallelism is used to indicate the number of virtual machines to be migrated in parallel at a moment; determining the migration order of multiple virtual machines to be migrated in the migration scheme based on the parallelism.
[0011] Based on the genetic algorithm, multiple migration paths can be quickly generated. The migration paths can determine the parallel migration order, thereby obtaining multiple migration plans. The migration plan takes into account both the migration locations of multiple virtual machines to be migrated and how to reach the migration locations. Optimizing these two aspects can save virtual machine migration time.
[0012] In combination with the first aspect, in another possible implementation, before determining the migration scheme of multiple virtual machines to be migrated according to the migration time of multiple migration schemes, the method also includes: collecting virtual machine configuration information, the virtual machine configuration information including the virtual machine type, the priority of the virtual machine, the memory specification of the virtual machine and the mapping relationship between the virtual machine and the source physical machine; determining the physical machine type of the source physical machine to which each virtual machine is mapped according to at least one item in the virtual machine configuration information; and determining multiple virtual machines to be migrated according to the physical machine type of the source physical machine.
[0013] In this way, the type of physical machine can be determined by pre-classifying the source physical machine according to the virtual machine configuration information. According to the type of the physical machine, the virtual machine of the same type as the physical machine is retained, and the virtual machine of a different type from the physical machine is migrated, which can reduce the number of virtual machines to be migrated, thereby reducing the amount of calculation when the genetic algorithm determines the migration plan, so as to shorten the virtual machine migration time and improve the efficiency of virtual machine migration when performing virtual machine migration. For example, the physical machine type is determined with reference to the memory specification of the virtual machine, and the physical machine type is the same as the type of the virtual machine with a larger memory specification. The virtual machine to be migrated is determined with reference to the physical machine type, and the virtual machine of the same type as the physical machine is retained, and the virtual machine of a different type from the physical machine is migrated, which can shorten the virtual machine migration time. For another example, the physical machine type is determined with reference to the priority of the virtual machine, and the physical machine type is the same as the type of the virtual machine with a higher priority. The virtual machine to be migrated is determined with reference to the physical machine type, and the virtual machine of the same type as the physical machine is retained, and the virtual machine of a different type from the physical machine is migrated, which can meet the user's demand for virtual machines and improve the quality of virtualization technology services.
[0014] In combination with the first aspect, in another possible implementation method, multiple virtual machines to be migrated are migrated in parallel according to the migration path and migration order indicated by the migration plan, including: determining at least two virtual machines to be migrated in parallel from the multiple virtual machines to be migrated according to the migration path and migration order indicated by the migration plan; when the migration of any virtual machine to be migrated is completed, selecting the virtual machine to be migrated in parallel at the current moment from the multiple virtual machines to be migrated, until the parallel migration of all the multiple virtual machines to be migrated is completed.
[0015] In this way, during the parallel migration of multiple virtual machines to be migrated, the parallelism at each moment in the migration process is adjusted dynamically in real time based on the maximum parallelism learned by the migration plan, ensuring that the virtual machines that can be migrated in parallel at each moment are migrated in parallel, so that the destination physical machine where the migrated virtual machines have been migrated will not be in an idle waiting state. In this way, the virtual machine migration time is shortened and the virtual machine migration efficiency is improved.
[0016] In a second aspect, a virtual machine migration device is provided, the device comprising operation steps for executing the virtual machine migration method in the first aspect or any possible implementation manner of the first aspect.
[0017] In a third aspect, a scheduler is provided, which includes a memory and a processor, the memory being used to store a set of computer instructions; when the processor executes the set of computer instructions as an execution device in the first aspect or any possible implementation of the first aspect, the operating steps of the virtual machine migration method in the first aspect or any possible implementation of the first aspect are executed.
[0018] In a fourth aspect, a computer system is provided, which includes a scheduler and multiple computing devices, multiple virtual machines are deployed in the computing devices, and when the scheduler executes the set of computer instructions as an execution device in the first aspect or any possible implementation of the first aspect, the operating steps of the virtual machine migration method in the first aspect or any possible implementation of the first aspect are executed.
[0019] In a fifth aspect, a computer-readable storage medium is provided, which includes computer software instructions; when the computer software instructions are executed in a computing device, the computing device executes the operating steps of the virtual machine migration method in the first aspect or any possible implementation of the first aspect.
[0020] In a sixth aspect, a computer program product is provided. When the computer program product is run on a computer, the computing device executes the operating steps of the virtual machine migration method in the first aspect or any possible implementation of the first aspect.
[0021] In a seventh aspect, a chip system is provided, the chip system comprising a processor and a power supply circuit, the power supply circuit supplies power to the processor, and the processor is used to implement the operation steps of the virtual machine migration method in the first aspect or any possible implementation of the first aspect. In a possible design, the chip system also includes a memory for storing program instructions and / or data. The chip system can be composed of a chip, or it can include a chip and other discrete devices.
[0022] The technical effects brought about by any design method in the second to seventh aspects can refer to the technical effects brought about by the first aspect or different design methods in the first aspect, and will not be repeated here.
[0023] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of a computer system provided for this application;
[0025] Figure 2 A flowchart of a virtual machine migration method provided in this application;
[0026] Figure 3 A schematic diagram of a source physical machine pre-classification provided by this application;
[0027] Figure 4 A schematic diagram of a parallel migration of multiple virtual machines to be migrated provided in this application;
[0028] Figure 5 A schematic diagram of a genetic algorithm process provided for this application;
[0029] Figure 6 A schematic diagram of a migration solution provided for this application;
[0030] Figure 7 A schematic diagram of the structure of a virtual machine migration device provided in this application;
[0031] Figure 8 A schematic diagram of the structure of a computing device provided in this application. DETAILED DESCRIPTION
[0032] Virtual machine migration refers to migrating a virtual machine (VM) from one computing resource or storage location to another computing resource or storage location. For example, migrating a virtual machine from a source physical machine to a destination physical machine.
[0033] In cloud computing scenarios, user business loads are highly dynamic, and cloud service providers need to dynamically deploy and adjust multiple virtual machines through virtual machine migration to achieve load balancing in cloud computing data centers. During the dynamic migration of virtual machines, applications on the virtual machines can run normally and are not affected by the migration.
[0034] A cluster is a group of loosely or tightly connected computing devices that work together, usually to perform large operations. Cluster computing devices are usually more efficient than single computing devices of comparable speed or availability. By running multiple computing devices in parallel and using multiple computing resources to solve problems, the computing speed and processing speed of the cluster system can be improved, thereby improving the overall performance of the cluster system. Each computing device is connected to each other through a network, and each computing device runs its own operating system instance.
[0035] In the distributed power management (DPM) scenario, there are multiple computing devices in a cluster, and multiple virtual machines can be deployed in each computing device. The number of virtual machines deployed in some computing devices may be small, and the small number of virtual machines deployed in these computing devices can be migrated to free up the computing resources of these computing devices to achieve resource fragmentation integration, or temporarily shut down these computing devices to save energy.
[0036] When performing virtual machine migration, usually, the virtual machines to be migrated and the migration path are determined based on expert experience, and the virtual machines to be migrated are divided into multiple groups, each group includes multiple virtual machines that can be migrated in parallel, and the next group of migrations needs to wait for the completion of the parallel migration of all virtual machines in the current group. However, with this intra-group parallel and inter-group serial migration method, since the migration time required for migrating each virtual machine is different, the total migration time of each group depends on the migration time of the slowest virtual machine in the group, and the destination physical machine corresponding to the completed migrated virtual machine is in an idle waiting state, and the network bandwidth cannot be fully utilized during the virtual machine migration process. Alternatively, a serial migration plan is formulated based on expert experience, and multiple virtual machines to be migrated are serially migrated from the source physical machine to the destination physical machine. However, with this serial migration method, only two physical machines perform virtual machine migration, and the remaining physical machines are in an idle waiting state. As a result, the virtual machine migration time is long and the virtual machine migration efficiency is low.
[0037] In order to solve the problems of long virtual machine migration time and low virtual machine migration efficiency. The present application provides a virtual machine migration method, that is, formulating multiple migration plans for multiple virtual machines to be migrated, performing the migration time required for parallel migration according to the migration paths and migration sequences indicated by the multiple migration plans, selecting one plan from the multiple migration plans as the migration plan for the multiple virtual machines to be migrated; and performing parallel migration of the multiple virtual machines to be migrated according to the migration paths and migration sequences indicated by the migration plans.
[0038] Compared with the migration path pre-configured according to expert experience, virtual machine migration based on the traditional virtual machine migration method cannot adapt to different migration scenarios, resulting in a longer migration time for virtual machine migration. Since the virtual machine migration method provided by the present application provides a variety of migration schemes, each of which has a different migration path and migration order, and a different migration time. A migration scheme is dynamically selected from a variety of migration schemes based on the migration time, that is, not only the destination physical machine for multiple virtual machines to be migrated is considered, but also how to reach the destination physical machine and the migration time of the virtual machine to be migrated are considered, and a migration method with the shortest possible migration time is selected. In this way, the virtual machine migration time is shortened and the efficiency of virtual machine migration is improved.
[0039] The virtual machine migration method provided by the present application is described in detail below with reference to the accompanying drawings. Figure 1 A schematic diagram of a computer system provided in this application. Figure 1 As shown, computer system 100 includes computer cluster 110 .
[0040] The computer cluster 110 includes a plurality of computing devices. For example, Figure 1 As shown, there are computing devices 111, 112, 113, 114, 115, and 116. These computing devices are used to provide computing resources. For a computing device, it may include multiple processors or processor cores, each of which may be a computing resource, so a physical computing device may provide multiple computing resources. Computing devices 111, 112, 113, 114, 115, and 116 are interconnected via a network 117. Network 117 may be the Internet, or other networks.
[0041] In some embodiments, multiple virtual machines may be deployed in a computing device. For example, VM1, VM2 and other virtual machines are deployed in computing device 111, and VM3, VM4 and other virtual machines are deployed in computing device 112. A virtual machine is a complete computer system that is simulated by software and has hardware system functions and runs in a computing device. Deploying virtual machines can enable computing devices to give full play to their performance and improve the utilization of the central processing unit (CPU). The load of the computing device is in dynamic change, and migrating the virtual machines in the computing device can ensure the load balancing of the computing device.
[0042] The computer system 100 further includes a scheduler 120. The scheduler 120 can be interconnected with multiple computing devices via a network 117, control the execution of virtual machine migration, and send migration instructions to computing devices in the computer cluster 110. For example, VM1 in computing device 111 is migrated to computing device 112, and VM9 in computing device 115 is migrated to computing device 116.
[0043] In some embodiments, the scheduler 120 can allocate a computing device to perform virtual machine migration, control the computing device to perform virtual machine migration, and monitor the execution status of virtual machine migration in real time. In an embodiment of the present application, the scheduler 120 can pre-classify the source physical machine according to the virtual machine configuration information, and determine multiple virtual machines to be migrated according to the type of the source physical machine. Determine the migration schemes of multiple virtual machines to be migrated according to the migration time of multiple migration schemes, and migrate multiple virtual machines to be migrated in parallel according to the migration path and migration order indicated by the migration scheme. This embodiment does not limit the type and number of virtual machines to be migrated.
[0044] Optionally, the scheduler 120 may obtain a migration instruction from any suitable source to instruct the computing devices in the computer cluster 110 to migrate the virtual machine. This embodiment does not limit the location for submitting the migration instruction, nor does it limit the specific mechanism for the user to submit the migration instruction. For example, the operation and maintenance staff sends a migration instruction for migrating VM1 to the scheduler 120 through the human-computer interaction platform, instructing the computing devices 111 and 112 to migrate VM1 out of the computing device 111 and into the computing device 112.
[0045] Next, combine Figures 2 to 6 , the virtual machine migration method provided in this application is described in detail. Figure 2 A flow chart of a virtual machine migration method provided in this application. Figure 1 The scheduler 120 is taken as an example for explanation. Figure 2 As shown, the virtual machine migration method provided in the embodiment of the present application includes the following steps.
[0046] Before determining the migration plan, it is necessary to pre-classify the source physical machine according to the collected virtual machine configuration information, determine the physical machine type of the source physical machine, and determine multiple virtual machines to be migrated according to the physical machine type. The method of determining multiple virtual machines to be migrated is described in the following steps 210 to 230.
[0047] Step 210: The scheduler 120 collects virtual machine configuration information.
[0048] Multiple virtual machines can be deployed in the source physical machine to collect virtual machine configuration information. Optionally, the source physical machine can periodically report virtual machine configuration information to the scheduler, or the source physical machine reports virtual machine configuration information to the scheduler each time it completes a virtual machine migration task, or the scheduler sends a configuration information request to the source physical machine and receives virtual machine configuration information fed back by the source physical machine.
[0049] The virtual machine configuration information includes the virtual machine type, the priority of the virtual machine, the memory specification of the virtual machine, and the mapping relationship between the virtual machine and the source physical machine. Optionally, the virtual machine configuration information may also include a virtual machine user blacklist and the isolation relationship between virtual machine users.
[0050] There are multiple types of virtual machines, which may include a first type of virtual machine and a second type of virtual machine. For example, the first type of virtual machine may be an elastic virtual machine, and the second type of virtual machine may be a non-elastic virtual machine.
[0051] Elastic virtual machines respond to load changes by automatically scaling computing resources to ensure reliable performance under any load. Computing resources can be quickly expanded or reduced as needed to adapt to different load levels. Virtual machines can also be stopped or restarted at any time to save costs.
[0052] Non-elastic virtual machines can be used to adjust computing resources, storage resources, network resources, etc. according to application requirements and load changes.
[0053] The higher the priority of a virtual machine, the more important the service it provides to the user. The virtual machine is more likely not to be migrated, in order to avoid poor service quality and poor user experience caused by frequent migration.
[0054] The larger the memory specification of the virtual machine, the longer the virtual machine migration time is, and the more likely it is that the virtual machine will not migrate.
[0055] The mapping relationship between the virtual machine and the source physical machine may be a corresponding relationship between the virtual machine and the source physical machine, and the corresponding relationship may reveal the source physical machine to which the virtual machine belongs and the virtual machine deployed in the source physical machine.
[0056] The virtual machines in the virtual machine user blacklist will not be considered in the migration decision, that is, they will not be used as virtual machines to be migrated.
[0057] The isolation relationship between virtual machine users may be that some users have an isolation relationship, and deploying the virtual machines of these users in the same physical machine will cause service conflicts and security risks. Therefore, if some users have an isolation relationship, the virtual machines of these users cannot be migrated to the same destination physical machine.
[0058] Optionally, after collecting the virtual machine configuration information, it is also necessary to perform data normalization processing on the virtual machine configuration information to unify the data type and data unit, so as to facilitate the calculation of the source physical machine pre-classification. The rules for data normalization processing are presented in the form of a table, as shown in Table 1.
[0059] Table 1
[0060]
[0061]
[0062] It should be noted that Table 1 only illustrates the storage form of the corresponding relationship in the storage device in the form of a table, and does not limit the storage form of the corresponding relationship in the storage device. Of course, the storage form of the corresponding relationship in the storage device can also be stored in other forms, and this embodiment does not limit this.
[0063] Step 220: The scheduler 120 determines the physical machine type of the source physical machine to which each virtual machine is mapped according to at least one item of the virtual machine configuration information.
[0064] The scheduler 120 may pre-classify the source physical machine according to at least one item of configuration information in the virtual machine configuration information, and determine the physical machine type of the source physical machine to which each virtual machine is mapped.
[0065] Multiple types of virtual machines can be deployed in the source physical machine, and this application does not limit the type of virtual machine. Take the virtual machine types including elastic virtual machines and non-elastic virtual machines as an example for explanation, Figure 3 A schematic diagram of a source physical machine pre-classification provided in this application. Figure 3 As shown, elastic virtual machines and non-elastic virtual machines are mixedly deployed in each source physical machine. After the source physical machines are pre-classified, the physical machine type of the source physical machine mapped by each virtual machine is divided into an elastic physical machine and a non-elastic physical machine.
[0066] The embodiment of the present application provides two possible implementation methods for pre-classifying source physical machines and determining the physical machine type of the source physical machine to which each virtual machine is mapped.
[0067] In a possible implementation, source physical machines are pre-classified based on a priority hierarchical comparison criterion.
[0068] According to the priority of the virtual machine in the virtual machine configuration information, compare the priorities of the two types of virtual machines (elastic virtual machines / non-elastic virtual machines) deployed on the source physical machine. According to the type of the virtual machine with the highest priority, determine the physical machine type of the source physical machine to which the virtual machine is mapped. If the highest priorities of the two types of virtual machines are the same, compare the number of the two types of virtual machines with the highest priority. If the number of the two types of virtual machines with the highest priority is the same, determine the physical machine type of the source physical machine to which the virtual machine is mapped according to the type of the virtual machine with the second highest priority. If the second highest priorities of the two types of virtual machines are the same, compare the number of the two types of virtual machines with the second highest priority, and so on.
[0069] If the physical machine type of the source physical machine to which the virtual machine is mapped cannot be determined based on the priority of the virtual machine in the virtual machine configuration information, the physical machine type is determined based on the memory specifications of the two types of virtual machines. The physical machine type of the source physical machine to which the virtual machine is mapped is determined based on the type of the virtual machine with a larger memory specification. If the physical machine type cannot be determined based on the memory specification, the source physical machine is randomly set to an elastic physical machine or a non-elastic physical machine.
[0070] To facilitate understanding of the source physical machine pre-classification based on the above priority hierarchical comparison criteria, the following three cases are given as examples: As shown in Table 1 in step 210, the priority of the virtual machine can be embodied in the form of a priority label (0-1-2, the larger the value, the higher the priority).
[0071] Case 1: In a source physical machine, the highest priority of the elastic virtual machine is 2, and the highest priority of the non-elastic virtual machine is 1. The highest priority of the elastic virtual machine is higher, so the physical machine type of this source physical machine is determined to be the type of the elastic physical machine.
[0072] Case 2: In a source physical machine, deploy an elastic VM with the highest priority of 2, two elastic VMs with the second highest priority of 1, a non-elastic VM with the highest priority of 2, and a non-elastic VM with the second highest priority of 1. The elastic VM and the non-elastic VM have the same highest priority, the same number of the two types of VMs with the highest priority, and the same second highest priority for the elastic VM and the non-elastic VM. However, the number of elastic VMs with the second highest priority is greater, so the physical machine type of this source physical machine is determined to be an elastic physical machine.
[0073] Case 3: In a source physical machine, the elastic VM and the non-elastic VM have the same priority and the same number of priorities. However, the total memory specification of the elastic VM is 2 GB, and the total memory specification of the non-elastic VM is 1 GB. The memory specification of the elastic VM is larger, so the source physical machine is determined to be an elastic physical machine.
[0074] In another possible implementation, source physical machines are pre-classified based on a priority average comparison criterion.
[0075] According to the priority of the virtual machine in the virtual machine configuration information, compare the average priority of the two types of virtual machines (elastic virtual machines / non-elastic virtual machines) deployed on the source physical machine, and determine the physical machine type of the source physical machine to which the virtual machine is mapped based on the type of the virtual machine with a higher average priority. Calculate the average priority by first summing the priorities of each virtual machine and then dividing it by the number of virtual machines. If the average priority cannot be determined, it is determined based on the memory specifications in the virtual machine configuration information.
[0076] For example, in a source physical machine, the priorities of five elastic virtual machines are 2, 0, 0, 0, 0, respectively, and the priorities of three non-elastic virtual machines are 1, 1, 0, respectively. The average priority of the non-elastic virtual machines is 0.66, which is higher than the average priority of the elastic virtual machines, 0.4. Therefore, the physical machine type of this source physical machine is determined to be a non-elastic physical machine.
[0077] Step 230 : The scheduler 120 determines a plurality of virtual machines to be migrated according to the physical machine type of the source physical machine.
[0078] After the source physical machine is pre-classified, the physical machine type of the source physical machine can be divided into an elastic physical machine and a non-elastic physical machine. In order to shorten the total migration time of the virtual machine migration process, it is necessary to reduce the number of virtual machines to be migrated. Migrate the non-elastic virtual machines in the elastic physical machine and retain the elastic virtual machines therein; migrate the elastic virtual machines in the non-elastic physical machine and retain the non-elastic virtual machines therein. In this way, multiple virtual machines to be migrated are determined, and the multiple virtual machines to be migrated include non-elastic virtual machines and elastic virtual machines.
[0079] The method of determining multiple virtual machines to be migrated in steps 210 to 230 is optional, and this method can reduce the number of virtual machines to be migrated, so as to improve the efficiency when performing virtual machine migration. This application is not limited to the use of this solution, and multiple virtual machines to be migrated can also be specified by the user.
[0080] After multiple virtual machines to be migrated are determined, a migration plan needs to be formulated for the multiple virtual machines to be migrated, and the virtual machines to be migrated are migrated in parallel according to the migration plan. The method is described in the following steps 240 to 250.
[0081] Step 240: The scheduler 120 determines migration schemes for multiple virtual machines to be migrated according to the migration times of the multiple migration schemes.
[0082] The scheduler 120 can formulate multiple migration plans for multiple virtual machines to be migrated, and the migration plans include migration paths and migration orders of multiple virtual machines to be migrated. Among them, the migration path can be used to indicate the migration of the virtual machine to be migrated from the source physical machine to the destination physical machine. The migration order can be used to indicate the order in which multiple virtual machines to be migrated are migrated in parallel.
[0083] Among the multiple migration schemes, since each migration scheme has a different migration path and migration order, the total time required for parallel migration of the multiple virtual machines to be migrated is different based on the migration path and migration order indicated by each migration scheme, that is, the migration time is different.
[0084] In some embodiments, the scheduler 120 can generate multiple migration plans based on a genetic algorithm, determine the migration time of the multiple migration plans, and select the migration plan with the shortest migration time from the multiple migration plans as the migration plan for multiple virtual machines to be migrated, so as to shorten the virtual machine migration time and improve the virtual machine migration efficiency.
[0085] The genetic algorithm may include a population initialization phase, an evolution phase, an evaluation phase, and an environment selection phase.
[0086] In the population initialization stage, multiple destination physical machines corresponding to multiple virtual machines to be migrated can be used as gene sequences, and the gene sequences can be encoded. The encoded genes become an individual, and N individuals are randomly generated to form the initial population. For example, the individual [3,4,6,3,7,7,6] means that the first virtual machine to be migrated is migrated to destination physical machine No. 3, the second virtual machine to be migrated is migrated to destination physical machine No. 4, the third virtual machine to be migrated is migrated to destination physical machine No. 6, and so on.
[0087] In the evolution stage, in order to generate as many new individuals as possible, the N individuals in the initial population are subjected to crossover and mutation operations, so that the genetic algorithm has both global and local search capabilities. Among them, the crossover operation can be to randomly set a crossover point in the individual code string, and exchange part of the chromosomes of the two individuals based on this crossover point. The mutation operation can be to randomly select one or more gene positions in the individual code string based on the mutation probability P, and mutate the gene value of the gene position.
[0088] In this stage, the crossover and mutation operations are repeated i times, and M new individuals are generated in the population. The population in the evolution stage includes N individuals in the initial population and M new individuals.
[0089] In the evaluation phase, multiple migration plans are formulated for multiple virtual machines to be migrated based on multiple individuals in the population, and the migration time of each migration plan is determined according to the migration path and migration sequence indicated by the migration plan.
[0090] The scheduler 120 can determine the migration path according to the source physical machines of the multiple virtual machines to be migrated and the individuals (destination physical machines) in the population. The parallelism is determined according to the migration paths of the multiple virtual machines to be migrated, and the parallelism can be used to indicate the number of virtual machines to be migrated in parallel at a time. The migration order of the multiple virtual machines to be migrated in the migration scheme is determined according to the parallelism, that is, the virtual machines that can be migrated in parallel are selected from the multiple virtual machines to be migrated based on the parallelism. After each virtual machine is migrated, the virtual machines that can be migrated in parallel at the current moment are selected from the remaining virtual machines to be migrated until all the virtual machines to be migrated are migrated. In this way, the migration time of the migration scheme is calculated, and the individual fitness is evaluated according to the migration time.
[0091] The calculation formulas for the migration time and individual fitness of the scheme to be migrated are as follows.
[0092] The migration time T of the solution to be migrated satisfies formula (1).
[0093]
[0094] Among them, memory is the memory specification of the virtual machine to be migrated, and bandwidth is the network bandwidth.
[0095] In some embodiments, the individual fitness can be determined according to the migration time of the scheme to be migrated. The individual fitness is inversely proportional to the migration time of the scheme to be migrated. The shorter the migration time, the better the individual fitness, indicating that the individual is more excellent.
[0096] The individual fitness f and the migration time T of the migration scheme are reciprocals of each other and satisfy formula (2).
[0097]
[0098] Wherein, T is the migration time of the solution to be migrated.
[0099] In the environmental selection stage, the principle of survival of the fittest is maintained. The probability of each individual being selected is the ratio of the individual fitness to the sum of the fitness of all individuals in the population. Based on the probability, the best individual in the evaluation stage can be determined, and the migration plan corresponding to this individual is the final migration plan with the shortest migration time.
[0100] In some embodiments, the probability of an individual being selected can be determined based on the individual fitness. The probability of each individual in the population being selected is proportional to its individual fitness f. The probability of an individual being selected P(x i ), satisfying formula (3).
[0101]
[0102] Among them, f(x i ) is individual x i The fitness of N is the total number of individuals in the population. is the sum of the fitness of all individuals in the population.
[0103] Step 250: The scheduler 120 performs parallel migration on multiple virtual machines to be migrated according to the migration path and migration order indicated by the migration plan.
[0104] After the migration schemes of the multiple virtual machines to be migrated are determined, the scheduler 120 implements the migration schemes, schedules the multiple virtual machines to be migrated in parallel, and realizes parallel migration.
[0105] In one possible implementation, the scheduler 120 can determine at least two virtual machines to be migrated in parallel from multiple virtual machines to be migrated based on the migration path and migration order indicated by the migration plan; when the migration of any virtual machine to be migrated is completed, the virtual machine to be migrated that is currently being migrated is selected from the multiple virtual machines to be migrated until all the multiple virtual machines to be migrated are migrated in parallel.
[0106] The above parallel migration scheduling process is understood below with reference to the accompanying drawings.
[0107] Figure 4 A schematic diagram of a parallel migration of multiple virtual machines to be migrated provided in this application. Figure 4 As shown in the figure, in order to distinguish each virtual machine to be migrated, they are numbered (T1 to T53), the horizontal axis is the migration time, and the vertical axis is the parallelism. The scheduler knows that the maximum parallelism is 7 according to the migration plan, so it starts 7 concurrent threads.
[0108] Compared with the following scheme, at the beginning, the first group of virtual machines to be migrated that can be migrated in parallel (T1, T2, T3, T4, T20, T38 and T47) are placed in their respective threads to perform parallel migration. After the migration of virtual machine T47 in this group is completed, the second group of virtual machines to be migrated that can be migrated in parallel (T12, T25, T37, T8, T9, T34 and T35) can start to be placed in their respective threads to perform parallel migration, and so on, until the remaining groups complete parallel migration. However, this method has a long idle waiting time between groups, and the waiting time depends on the difference between the longest migration time and the shortest migration time in the group, resulting in a long virtual machine migration time and low virtual machine migration efficiency.
[0109] In the present application, at the beginning, a group of virtual machines to be migrated that can be migrated in parallel (for example, T1, T2, T3, T4, T20, T38 and T47) are placed in their respective threads to perform parallel migration. If the virtual machine to be migrated (T1) on the first thread is migrated, the thread automatically selects the virtual machine to be migrated (T12) that can be migrated in parallel with multiple virtual machines of the remaining threads at the current moment. If the virtual machine to be migrated (T2) on the second thread is migrated, the virtual machine to be migrated (T25) on the thread continues to migrate. If the virtual machine to be migrated (T3) on the third thread is migrated, the virtual machine to be migrated (T37) on the thread continues to migrate, and so on. However, at this time, the virtual machine to be migrated (T47) on the seventh thread has not yet been migrated, so that while T47 is performing migration, multiple virtual machines to be migrated (for example, T12, T25, T37, T8, T9, T34, T22, T16, etc.) are migrated until all virtual machines to be migrated are migrated in parallel.
[0110] In this application, the scheduler controls the parallel migration of multiple virtual machines to be migrated, and dynamically adjusts the parallelism at each moment in the migration process based on the maximum parallelism learned from the migration plan, ensuring that the virtual machines that can be migrated in parallel at each moment are migrated in parallel, so that the destination physical machine where the migrated virtual machines have been migrated will not be in an idle waiting state. In this way, the virtual machine migration time is shortened and the virtual machine migration efficiency is improved.
[0111] In other embodiments, if the number of virtual machines to be migrated is large, the number of migration solutions obtained at one time based on the genetic algorithm in step 240 may be small, which is not conducive to determining the migration solution with the shortest migration time. The scheduler 120 can perform multiple iterations on the steps in the genetic algorithm to obtain as many migration solutions as possible, and select the migration solution with the shortest migration time after multiple iterations. The method for determining the migration solution in step 240 is refined, and the method is described by the following steps 241 to 242.
[0112] Step 241: The scheduler 120 obtains multiple to-be-migrated solutions according to at least one intermediate migration solution.
[0113] During multiple iterations, at least one intermediate migration scheme may be a scheme to be migrated obtained during the i-th iteration. Based on at least one intermediate migration scheme obtained during the i-th iteration, a scheme to be migrated obtained during the i+1-th iteration may be generated, where i is an integer greater than or equal to 1. The number of schemes to be migrated obtained in each iteration may be the same or different. When the number of schemes to be migrated meets a preset number threshold and the time for generating the schemes to be migrated meets a preset time threshold, the number of schemes to be migrated obtained is the same; when the time for generating the schemes to be migrated meets the preset time threshold, the number of schemes to be migrated obtained is different.
[0114] The intermediate migration scheme includes an intermediate migration path. The scheduler 120 can generate migration paths of multiple virtual machines to be migrated in multiple migration schemes based on a genetic algorithm according to multiple intermediate migration paths of multiple virtual machines to be migrated.
[0115] As can be seen from step 240, the genetic algorithm includes a population initialization stage, an evolution stage, an evaluation stage, and an environment selection stage. In the population initialization stage, multiple initial migration paths can be obtained. According to the multiple initial migration paths, the evolution stage, the evaluation stage, and the environment selection stage are iterated for the first time to generate multiple intermediate migration paths. According to the multiple intermediate migration paths, based on multiple iterations of the evolution stage, the evaluation stage, and the environment selection stage in the genetic algorithm, migration paths of multiple virtual machines to be migrated in multiple migration schemes are generated.
[0116] In the environmental selection stage, the principle of survival of the fittest is still maintained. The probability of each individual being selected to enter the next evolutionary stage, evaluation stage and environmental selection stage iteration is the ratio of the individual fitness to the sum of the fitness of all individuals in the population. Based on the probability, multiple individuals with better performance in the evaluation stage, that is, multiple migration plans with shorter migration time, can be determined, and these individuals can be selected from the population to enter the next iteration.
[0117] Step 242: When the termination condition is met, the scheduler 120 determines migration schemes for multiple virtual machines to be migrated according to the migration times of the multiple migration schemes.
[0118] By performing multiple iterations of the evolution phase, the evaluation phase, and the environment selection phase in the genetic algorithm, multiple migration schemes can be obtained, and the scheduler 120 determines the migration time of each migration scheme according to the migration path and the migration sequence. When the termination condition is met, the termination condition may include the number of iterations, and the scheduler 120 determines the shortest migration time, and determines the migration scheme of this time as the migration scheme of the multiple virtual machines to be migrated.
[0119] Figure 5 A flow chart of a genetic algorithm provided in this application. Figure 5 As shown, step 510 is the population initialization stage, step 520 is the evolution stage, step 530 is the evaluation stage, step 540 is the environment selection stage, and step 550 is to determine whether the number of iterations is greater than or equal to N. When the number of iterations is less than N, the next iteration from step 520 to step 540 is entered. Otherwise, when the number of iterations is greater than or equal to N, the to-be-migrated solution with the shortest migration time is output, and this solution is used as the migration solution for multiple to-be-migrated virtual machines.
[0120] It can be seen from the above step 240 that the migration time of the to-be-migrated virtual machine is inversely proportional to the individual fitness. In some embodiments, when the termination condition is met, the scheduler 120 can determine the migration plans of multiple to-be-migrated virtual machines according to the individual fitness.
[0121] The virtual machine migration method provided by the present application has different migration paths and migration orders for each of the multiple migration schemes, and thus different migration times. A migration scheme is dynamically selected from the multiple migration schemes according to the migration time, that is, not only the destination physical machines for the multiple virtual machines to be migrated are considered, but also how to reach the destination physical machines is considered, so as to select a migration method with the shortest possible migration time. In this way, the virtual machine migration time is shortened and the virtual machine migration efficiency is improved.
[0122] The following is an example of how to implement the virtual machine migration in steps 220 to 250.
[0123] First, the source physical machine is pre-classified according to the virtual machine configuration information, and a plurality of virtual machines to be migrated are determined according to the result of the pre-classification of the source physical machine.
[0124] For example, there are four source physical machines in the source physical machine cluster, namely source physical machine 1, source physical machine 2, source physical machine 3 and source physical machine 4. Elastic virtual machines and non-elastic virtual machines are mixedly deployed in each source physical machine, and the virtual machine configuration information is presented in the form of a table, as shown in Table 2.
[0125] Table 2
[0126]
[0127]
[0128] As shown in Table 2, non-elastic VM 1 (priority: 2, memory specification: 4GB) and elastic VM 2 (priority: 1, memory specification: 8GB) are deployed in source physical machine 1. Non-elastic VM 3 (priority: 2, memory specification: 4GB), elastic VM 4 (priority: 2, memory specification: 4GB), and elastic VM 5 (priority: 1, memory specification: 4GB) are deployed in source physical machine 2. Non-elastic VM 6 (priority: 2, memory specification: 8GB) and elastic VM 7 (priority: 2, memory specification: 4GB) are deployed in source physical machine 3. Non-elastic VM 8 (priority: 1, memory specification: 8GB), elastic VM 9 (priority: 1, memory specification: 4GB), and elastic VM 10 (priority: 1, memory specification: 4GB) are deployed in source physical machine 4.
[0129] According to the virtual machine configuration information in the source physical machine, the source physical machine is pre-classified using the priority hierarchical comparison criteria described in the above step 220.
[0130] As can be seen from Table 2, in the source physical machine 1, because the highest priority of the non-elastic virtual machine 1 is higher than the highest priority of the elastic virtual machine 2 (priority 2>priority 1), the physical machine type of the source physical machine 1 is the non-elastic physical machine 1.
[0131] In source physical machine 2, since non-elastic virtual machine 3 and elastic virtual machine 4 have the same highest priority (both are 2) and the same number of virtual machines with the highest priority (both are 1), the second highest priority is determined. Since the number of elastic virtual machines with the second highest priority is 1 and non-elastic virtual machines do not have a second highest priority, the physical machine type of source physical machine 2 is elastic physical machine 2.
[0132] In source physical machine 3, since non-elastic virtual machine 6 and elastic virtual machine 7 have the same highest priority and the same number of virtual machines with the highest priority, the memory specification is determined. Since the memory specification of non-elastic virtual machine 6 is greater than the memory specification of elastic virtual machine 7 (memory specification 8GB> memory specification 4GB), elastic virtual machine 7 with a smaller memory specification is migrated out, and non-elastic virtual machine 6 with a larger memory specification is retained, so the physical machine type of source physical machine 3 is non-elastic physical machine 3.
[0133] In source physical machine 4 , because the number of elastic virtual machines with the highest priority is greater than the number of non-elastic virtual machines with the highest priority (the number of the highest priority is 2> the number of the highest priority is 1), the physical machine type of source physical machine 4 is elastic physical machine 4 .
[0134] In order to reduce the number of virtual machines to be migrated, the amount of calculation and search space when the genetic algorithm determines the migration plan can be reduced, and the migration time can be shortened. Optionally, the non-elastic virtual machines in the elastic physical machine are migrated out, and the elastic virtual machines therein are retained; the elastic virtual machines in the non-elastic physical machine are migrated out, and the non-elastic virtual machines therein are retained. In this way, a combination of retained virtual machines and a combination of virtual machines to be migrated are generated, and the combination of virtual machines to be migrated includes multiple virtual machines to be migrated.
[0135] According to the pre-classification result of the source physical machines: non-elastic physical machine 1, elastic physical machine 2, non-elastic physical machine 3, elastic physical machine 4, it can be concluded that the virtual machines to be migrated are: elastic virtual machine 2, non-elastic virtual machine 3, elastic virtual machine 7, non-elastic virtual machine 8.
[0136] Next, after determining multiple virtual machines to be migrated, a migration plan is formulated. A genetic algorithm is used to determine the migration path and migration sequence with the shortest migration time. The specific process includes the following steps:
[0137] Step 1: Population initialization phase, encoding individuals and initializing the population.
[0138] In the population initialization phase, N individuals are randomly generated, and N individuals can form a population. For example, individuals [2,1,4,3] and individuals [4,3,2,1] are randomly generated. Among them, individual [2,1,4,3] means that elastic virtual machine 2 migrates to elastic physical machine 2, non-elastic virtual machine 3 migrates to non-elastic physical machine 1, elastic virtual machine 7 migrates to elastic physical machine 4, and non-elastic virtual machine 8 migrates to non-elastic physical machine 3. For another example, individual [4,3,2,1] means that elastic virtual machine 2 migrates to elastic physical machine 4, non-elastic virtual machine 3 migrates to non-elastic physical machine 3, elastic virtual machine 7 migrates to elastic physical machine 2, and non-elastic virtual machine 8 migrates to non-elastic physical machine 1.
[0139] Step 2: In the evolution stage, crossover and mutation operations are performed on the N individuals in the population.
[0140] In the evolution stage, the N individuals in the population are subjected to i cycles of crossover and mutation operations, and M new individuals are generated in the population. During the crossover operation, any two individuals from the N individuals are selected for crossover, and the crossover point can be randomly generated. For example, individuals [2,1,4,3] and [4,3,2,1] are crossovered with the middle point of the individuals as the crossover point, and new individuals [2,1,2,1] and new individuals [4,3,4,3] are obtained. During the mutation operation, one or more gene positions in the individual are randomly mutated. For example, the first gene of individual [2,1,4,3] is mutated to obtain a new individual [4,1,4,3].
[0141] Step 3: In the evaluation phase, a migration plan is formulated for the virtual machine to be migrated corresponding to each individual in the population, the migration time of each migration plan is calculated, and the individual fitness is evaluated.
[0142] The migration path is determined according to the source physical machines of the multiple virtual machines to be migrated and the individuals in the population (destination physical machines). For example, the multiple virtual machines to be migrated migrate from the source physical machines to the destination physical machines, and the migration path is presented in the form of a table, as shown in Table 3.
[0143] Table 3
[0144] Virtual machines to be migrated Source physical machine Destination physical machine Elastic VM 2 (T2) Inelastic physical machine 1 Elastic Physical Machine 2 Non-elastic VM 3 (T3) Elastic Physical Machine 2 Inelastic physical machine 1 Elastic VM 7 (T7) Inelastic physical machine 3 Elastic Physical Machine 4 Non-elastic VM 8 (T8) Elastic Physical Machine 4 Inelastic physical machine 3
[0145] As shown in Table 3, elastic virtual machine 2 migrates from non-elastic physical machine 1 to elastic physical machine 2. Non-elastic virtual machine 3 migrates from elastic physical machine 2 to non-elastic physical machine 1. Elastic virtual machine 7 migrates from non-elastic physical machine 3 to elastic physical machine 4. Non-elastic virtual machine 8 migrates from elastic physical machine 4 to non-elastic physical machine 3.
[0146] Based on the migration path, the degree of parallelism can be determined for the virtual machines to be migrated, and based on the degree of parallelism, the migration order can be determined for the virtual machines to be migrated. In this way, a migration plan can be formulated for the virtual machines to be migrated. Figure 6 A schematic diagram of a migration solution provided for this application. Figure 6 As shown, the horizontal axis is the migration time and the vertical axis is the parallelism. First, select the virtual machines that can be migrated in parallel at the start time from the virtual machines to be migrated, such as elastic virtual machine 2 and elastic virtual machine 7. Because the migration degree of the physical machine is set to 1, the migration degree of 1 means that each physical machine carries 1 virtual machine to migrate in or out. Understandably, different virtual machines cannot migrate in or out of the same physical machine at the same time. Elastic virtual machine 2 migrates from non-elastic physical machine 1 to non-elastic physical machine 2, and elastic virtual machine 7 migrates from non-elastic physical machine 3 to elastic physical machine 4. The migration paths of elastic virtual machine 2 and elastic virtual machine 7 do not intersect, so they can migrate in parallel with a parallelism of 2.
[0147] Because the memory specification of elastic virtual machine 7 is smaller than that of elastic virtual machine 2, elastic virtual machine 7 completes the migration first. After elastic virtual machine 7 completes the migration, non-elastic virtual machine 8 is selected to continue parallel migration at the current moment. When elastic virtual machine 2 completes the migration, non-elastic virtual machine 3 continues to be migrated in parallel at the current moment, so that the migration of the virtual machine to be migrated is completed.
[0148] According to formula (1) and formula (2) in step 240, the migration time of each migration scheme and the fitness of each individual can be calculated.
[0149] Step 4: Environmental selection stage, based on the principle of survival of the fittest, individuals with better fitness are selected from multiple individuals in the population to enter the next iteration starting from step 2. According to formula (3) in step 240, the probability of each individual in the population being selected can be calculated.
[0150] Step 5: Take steps 2, 3 and 4 as an iterative process. After each iteration, determine whether the genetic algorithm meets the iteration number threshold. If the iteration number threshold is not met, repeat the iterative process of steps 2, 3 and 4 until the iteration number threshold is met. Finally, the genetic algorithm outputs the individual with the best fitness, that is, the migration plan with the shortest migration time, and this migration plan is used as the migration plan of the virtual machine to be migrated.
[0151] Finally, the scheduler controls the physical machine to implement the migration plan.
[0152] Assuming that individual [2,3,4,1] has the best fitness, the specific process of executing the migration plan on the physical machine where the virtual machine is located includes the following steps.
[0153] Step 6: Observe the degree of parallelism and start multi-threaded parallel scheduling.
[0154] like Figure 6 From the migration scheme shown, it can be seen that the parallelism of this migration scheme is 2. The scheduler will start two threads (thread 1 and thread 2) to control the physical machines where the virtual machines on the two threads are located to perform parallel migration of multiple virtual machines to be migrated.
[0155] Step 7: The physical machine where the virtual machine on each thread is located executes its own migration task and returns its own migration time.
[0156] For example, at the beginning, thread 1 sends a migration instruction for elastic virtual machine 7 to migrate from non-elastic physical machine 3 to elastic physical machine 4 to the virtual resource manager of the source physical machine cluster. The virtual resource manager will execute the migration instruction and return a completion signal when the migration is completed. After receiving the completion signal of the migration of elastic virtual machine 7, thread 1 continues to send a migration instruction for non-elastic virtual machine 8 to migrate from elastic physical machine 4 to non-elastic physical machine 3. Thread 2 also performs the migration task in this way.
[0157] Step 8: After the physical machines where the virtual machines on all threads are located complete the migration task, close all threads.
[0158] It is understandable that in order to implement the functions in the above embodiments, the computing device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0159] Combined with the above Figures 1 to 6 , describes in detail the virtual machine migration method provided according to this embodiment, and will now be combined with Figure 7 , describes the virtual machine migration device provided according to this embodiment.
[0160] Figure 7 This is a schematic diagram of the structure of a virtual machine migration device provided by the present application. These virtual machine migration devices can be used to implement the function of the scheduler in the above method embodiment, and thus can also achieve the beneficial effects possessed by the above method embodiment.
[0161] like Figure 7 As shown, the virtual machine migration device 700 includes a collection module 710 , a classification module 720 , a plan formulation module 730 , a scheduling module 740 and a storage module 750 .
[0162] The acquisition module 710 is used to acquire virtual machine configuration information, which includes the virtual machine type, the priority of the virtual machine, the memory specification of the virtual machine, and the mapping relationship between the virtual machine and the source physical machine. Figure 2 Step 210.
[0163] The classification module 720 is used to determine the physical machine type of the source physical machine to which each virtual machine is mapped according to at least one item of the virtual machine configuration information, and is also used to determine multiple virtual machines to be migrated according to the physical machine type of the source physical machine. Figure 2 Step 220 and step 230.
[0164] The plan formulation module 730 is used to determine the migration plans of multiple virtual machines to be migrated according to the migration time of multiple migration plans. The migration plan includes the migration paths and migration order of multiple virtual machines to be migrated, the migration path is used to indicate the migration of the virtual machine to be migrated from the source physical machine to the destination physical machine, the migration order is used to indicate the order in which the multiple virtual machines to be migrated are migrated in parallel, and the migration time is used to indicate the total time required for the multiple virtual machines to be migrated to migrate in parallel based on the migration path and migration order indicated by the migration plan. For example, the plan formulation module 730 is used to execute Figure 2 Step 240.
[0165] The scheduling module 740 is used to perform parallel migration of multiple virtual machines to be migrated according to the migration path and migration order indicated by the migration plan. Figure 2 Step 250.
[0166] The storage module 750 may correspond to the above method embodiment and be used to store the virtual machines to be migrated and the migration plan, etc.
[0167] It should be understood that the virtual machine migration device 700 according to the embodiment of the present application may correspond to the method described in the embodiment of the present application, and the above and other operations and / or functions of each unit in the virtual machine migration device 700 are respectively to achieve Figure 2 For the sake of brevity, the corresponding processes of each method in are not repeated here.
[0168] Figure 8 The present application provides a schematic diagram of the structure of a computing device 800. As shown in the figure, the computing device 800 includes a processor 810, a bus 820, a memory 830, a memory unit 850 (also referred to as a main memory unit), and a communication interface 840. The processor 810, the memory 830, the memory unit 850, and the communication interface 840 are connected via a bus 820.
[0169] It should be understood that in this embodiment, the processor 810 may be a CPU, and the processor 810 may also be other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0170] The communication interface 840 is used to implement communication between the computing device 800 and an external device or component. In this embodiment, the communication interface 840 is used to perform data exchange with other computing devices.
[0171] The bus 820 may include a path for transmitting information between the above components (such as the processor 810, the memory unit 850, and the memory 830). In addition to the data bus, the bus 820 may also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus 820 in the figure. The bus 820 may be a Peripheral Component Interconnect Express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc.
[0172] As an example, the computing device 800 may include multiple processors. The processor may be a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions). The processor 810 may call the virtual machines to be migrated stored in the memory 830, and determine the migration schemes of the multiple virtual machines to be migrated according to the migration times of the multiple migration schemes.
[0173] It is worth mentioning that Figure 8 In the example, a computing device 800 including one processor 810 and one memory 830 is taken. Here, the processor 810 and the memory 830 are respectively used to indicate a type of device or equipment. In a specific embodiment, the number of each type of device or equipment can be determined according to business requirements.
[0174] The memory unit 850 may correspond to the storage medium for storing information such as virtual machine configuration information, virtual machines to be migrated, and migration schemes in the above method embodiments. The memory unit 850 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0175] The memory 830 is used to store virtual machine configuration information, virtual machines to be migrated, and migration plans, and may be a solid state drive or a mechanical hard disk.
[0176] It should be understood that the computing device 800 according to this embodiment may correspond to the virtual machine migration device 700 in this embodiment, and may correspond to the device for executing the virtual machine migration according to Figure 2 The corresponding subjects in the virtual machine migration device 700, and the above and other operations and / or functions of each module are respectively implemented Figure 2 For the sake of brevity, the corresponding process in will not be repeated here.
[0177] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist as discrete components in a network device or a terminal device.
[0178] The present application also provides a chip system, which includes a processor for implementing the functions of the data processing unit in the above method. In one possible design, the chip system also includes a memory for storing program instructions and / or data. The chip system can be composed of a chip, or can include a chip and other discrete devices.
[0179] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).
[0180] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A virtual machine migration method, characterized in that: include: Determine migration schemes for multiple virtual machines to be migrated according to the migration times of multiple migration schemes, wherein the migration schemes include migration paths and migration sequences for the multiple virtual machines to be migrated, the migration paths are used to indicate the migration of the virtual machines to be migrated from a source physical machine to a destination physical machine, the migration sequences are used to indicate the sequence in which the multiple virtual machines to be migrated are migrated in parallel, and the migration time is used to indicate the total duration required for the multiple virtual machines to be migrated to be migrated in parallel based on the migration paths and migration sequences indicated by the migration schemes; The multiple virtual machines to be migrated are migrated in parallel according to the migration path and migration order indicated by the migration scheme.
2. The method according to claim 1, characterized in that Determining the migration schemes of the multiple virtual machines to be migrated according to the migration times of the multiple migration schemes includes: A migration scheme with the shortest migration time among the multiple migration schemes is determined as the migration scheme for the multiple virtual machines to be migrated.
3. The method according to claim 1 or 2, characterized in that: Determine migration plans for multiple virtual machines to be migrated according to the migration times of the multiple migration plans, including: Acquire the plurality of to-be-migrated solutions according to at least one intermediate migration solution; When a termination condition is met, migration schemes of multiple virtual machines to be migrated are determined according to the migration times of the multiple migration schemes, and the termination condition includes the number of iterations.
4. The method according to claim 3, characterized in that Acquiring the multiple to-be-migrated solutions according to at least one intermediate migration solution includes: The migration paths of the multiple virtual machines to be migrated in the multiple migration schemes are generated based on a genetic algorithm according to the multiple intermediate migration paths of the multiple virtual machines to be migrated.
5. The method according to claim 3 or 4, characterized in that: Acquiring the multiple to-be-migrated solutions according to at least one intermediate migration solution includes: Determine the degree of parallelism according to the migration paths of the multiple virtual machines to be migrated in the migration scheme, where the degree of parallelism is used to indicate the number of virtual machines to be migrated that are migrated in parallel at a time; The migration order of the multiple virtual machines to be migrated in the migration scheme is determined according to the parallelism.
6. The method according to any one of claims 1 to 5, characterized in that Before determining the migration schemes of the multiple virtual machines to be migrated according to the migration times of the multiple migration schemes, the method further includes: Collecting virtual machine configuration information, wherein the virtual machine configuration information includes the virtual machine type, the priority of the virtual machine, the memory specification of the virtual machine, and the mapping relationship between the virtual machine and the source physical machine; Determine the physical machine type of the source physical machine mapped to each virtual machine according to at least one item of the virtual machine configuration information; The multiple virtual machines to be migrated are determined according to the physical machine type of the source physical machine.
7. The method according to claim 6, characterized in that The virtual machine types include a first type of virtual machine and a second type of virtual machine. The first type of virtual machine is used to respond to load changes by automatically scaling computing resources, and the second type of virtual machine is used to adjust resources based on application requirements and load changes. The resources include computing resources, storage resources and network resources.
8. The method according to any one of claims 1 to 7, characterized in that The multiple virtual machines to be migrated are migrated in parallel according to the migration path and migration order indicated by the migration scheme, including: Determining at least two virtual machines to be migrated in parallel from the multiple virtual machines to be migrated according to the migration path and the migration order indicated by the migration scheme; When any virtual machine to be migrated is migrated, a virtual machine to be migrated that is currently migrated in parallel is selected from the multiple virtual machines to be migrated until all the multiple virtual machines to be migrated are migrated in parallel.
9. A virtual machine migration device, characterized in that: The device comprises: A scheme formulation module, used to determine a migration scheme for multiple virtual machines to be migrated according to the migration times of multiple migration schemes, wherein the migration scheme includes a migration path and a migration order of the multiple virtual machines to be migrated, wherein the migration path is used to indicate the migration of the virtual machines to be migrated from a source physical machine to a destination physical machine, the migration order is used to indicate the order in which the multiple virtual machines to be migrated are migrated in parallel, and the migration time is used to indicate the total time required for the multiple virtual machines to be migrated to be migrated in parallel based on the migration path and the migration order indicated by the migration scheme; The scheduling module is used to perform parallel migration of the multiple virtual machines to be migrated according to the migration path and migration order indicated by the migration plan.
10. The device according to claim 9, characterized in that When the scheme formulation module determines the migration schemes of the multiple virtual machines to be migrated according to the migration times of the multiple schemes to be migrated, it is specifically used to: A migration scheme with the shortest migration time among the multiple migration schemes is determined as the migration scheme for the multiple virtual machines to be migrated.
11. The device according to claim 9 or 10, characterized in that When the plan formulation module determines the migration plans of multiple virtual machines to be migrated according to the migration times of multiple plans to be migrated, it is specifically used to: Acquire the plurality of to-be-migrated solutions according to at least one intermediate migration solution; When a termination condition is met, migration schemes of multiple virtual machines to be migrated are determined according to the migration times of the multiple migration schemes, and the termination condition includes the number of iterations.
12. The device according to claim 11, characterized in that When the solution formulation module obtains the multiple solutions to be migrated according to at least one intermediate migration solution, it is specifically used to: The migration paths of the multiple virtual machines to be migrated in the multiple migration schemes are generated based on a genetic algorithm according to the multiple intermediate migration paths of the multiple virtual machines to be migrated.
13. The device according to claim 11 or 12, characterized in that When the solution formulation module obtains the multiple solutions to be migrated according to at least one intermediate migration solution, it is specifically used to: Determine the degree of parallelism according to the migration paths of the multiple virtual machines to be migrated in the migration scheme, where the degree of parallelism is used to indicate the number of virtual machines to be migrated that are migrated in parallel at a time; The migration order of the multiple virtual machines to be migrated in the migration scheme is determined according to the parallelism.
14. The device according to any one of claims 9 to 13, characterized in that The device also includes: A collection module, used to collect virtual machine configuration information, wherein the virtual machine configuration information includes the virtual machine type, the priority of the virtual machine, the memory specification of the virtual machine, and the mapping relationship between the virtual machine and the source physical machine; A classification module, used to determine the physical machine type of the source physical machine mapped to each virtual machine according to at least one item of the virtual machine configuration information; The classification module is further used to determine the multiple virtual machines to be migrated according to the physical machine type of the source physical machine.
15. The device according to claim 14, characterized in that The virtual machine types include a first type of virtual machine and a second type of virtual machine. The first type of virtual machine is used to respond to load changes by automatically scaling computing resources, and the second type of virtual machine is used to adjust resources based on application requirements and load changes. The resources include computing resources, storage resources and network resources.
16. The device according to any one of claims 9 to 15, characterized in that When the scheduling module performs parallel migration of the multiple virtual machines to be migrated according to the migration path and migration order indicated by the migration scheme, it is specifically used to: Determining at least two virtual machines to be migrated in parallel from the multiple virtual machines to be migrated according to the migration path and the migration order indicated by the migration scheme; When any virtual machine to be migrated is migrated, a virtual machine to be migrated that is currently migrated in parallel is selected from the multiple virtual machines to be migrated until all the multiple virtual machines to be migrated are migrated in parallel.
17. A scheduler, characterized in that: The scheduler includes a memory and a processor, wherein the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions, the operation steps of the method described in any one of claims 1 to 8 are performed.
18. A computer system, characterized in that: The computer system includes a scheduler and multiple computing devices, multiple virtual machines are deployed in the computing devices, and when the scheduler executes the set of computer instructions, the operation steps of the method described in any one of claims 1 to 8 are performed.
Citation Information
Cited By
Virtual machine live migration method and device, electronic equipment and storage medium
CN119127399A
