Virtual machine migration method, device and equipment, readable storage medium and program product
By acquiring and optimizing virtual machine migration strategies, the problem of poor migration accuracy in traditional migration methods is solved, and more efficient and accurate virtual machine migration is achieved.
Patent Information
- Application Number
- CN202411672566.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional virtual machine migration methods have poor migration accuracy, resulting in inaccurate virtual machine migration.
By obtaining the initial migration strategy of each physical machine in the target cluster, determining the first fitness of the physical machine, and determining the initial genetic parameters based on the first fitness, optimizing the migration strategy to determine the target migration strategy, and achieving high accuracy migration of the virtual machine .
Improve the accuracy of virtual machine migration and ensure that virtual machines can be migrated to appropriate physical machines more accurately, thereby improving the overall performance and reliability of the system.
Smart Images

Figure CN119473508A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtualization technology, and in particular to a virtual machine migration method, device, equipment, readable storage medium and program product. Background Art
[0002] With the development of virtualization technology, virtual machines are widely used. In order to ensure the elastic allocation and dynamic adjustment of computing resources, virtual machines are usually migrated to different physical machines according to the operation status of each physical machine to achieve load balancing.
[0003] Traditional virtual machine migration methods usually use a genetic algorithm with random parameters to determine the virtual machine migration strategy, and then migrate the virtual machine according to the strategy.
[0004] However, the above method has the problem of poor migration accuracy. Summary of the invention
[0005] Based on this, it is necessary to provide a virtual machine migration method, device, equipment, readable storage medium and program product that can improve migration accuracy in response to the above technical problems.
[0006] In a first aspect, the present application provides a virtual machine migration method, comprising:
[0007] Obtaining an initial migration strategy corresponding to each physical machine in the target cluster, and determining a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine;
[0008] Determine initial genetic parameters according to each first fitness, and determine a target migration strategy corresponding to each physical machine according to the initial genetic parameters and each initial migration strategy;
[0009] Migrate each virtual machine in the target cluster to the physical machine corresponding to each virtual machine according to each target migration strategy.
[0010] In one embodiment, determining the initial genetic parameters according to each first fitness includes:
[0011] Determine an initial crossover parameter corresponding to each physical machine according to each first fitness, and determine an initial mutation parameter corresponding to each physical machine according to each first fitness;
[0012] Each initial crossover parameter and each initial mutation parameter are determined as initial genetic parameters.
[0013] In one embodiment, determining a target migration strategy corresponding to each physical machine according to the initial genetic parameters and each initial migration strategy includes:
[0014] Determine a selection probability corresponding to the physical machine according to the first fitness, and determine a plurality of parent migration strategies from each initial migration strategy according to each selection probability;
[0015] According to the initial crossover parameters and initial mutation parameters corresponding to each parent migration strategy, each parent migration strategy is genetically iterated to determine each target migration strategy.
[0016] In one embodiment, each parent migration strategy is genetically iterated according to the initial crossover parameters and initial mutation parameters corresponding to each parent migration strategy to determine each target migration strategy, including:
[0017] According to the initial crossover parameters and initial mutation parameters corresponding to each parent migration strategy, each parent migration strategy is genetically processed to obtain a migration strategy after genetic processing;
[0018] Obtaining the second fitness corresponding to each migration strategy after genetic processing;
[0019] Each target migration strategy is determined according to each second fitness, the first fitness corresponding to other migration strategies, each migration strategy after genetic processing, and each other migration strategy. Other migration strategies are initial migration strategies in each initial migration strategy except the parent migration strategy.
[0020] In one embodiment, each target migration strategy is determined according to each second fitness, the first fitness corresponding to other migration strategies, each migration strategy after genetic processing, and each other migration strategy, including:
[0021] If the migration strategies after each genetic treatment and each other migration strategy meet the convergence condition, then the migration strategies after each genetic treatment and each other migration strategy are determined as the target migration strategies;
[0022] If the migration strategies after genetic processing and other migration strategies do not meet the convergence conditions, genetic iterative processing is continued based on the second fitness, the first fitness corresponding to other migration strategies, the migration strategies after genetic processing and other migration strategies until the target migration strategies are determined.
[0023] In one embodiment, determining a first fitness corresponding to a physical machine according to an initial migration strategy includes:
[0024] For each physical machine, determine the default virtual machine corresponding to the physical machine according to the initial migration strategy;
[0025] A first fitness corresponding to the physical machine is determined according to first attribute data corresponding to the default virtual machine and second attribute data corresponding to the physical machine.
[0026] In a second aspect, the present application also provides a virtual machine migration device, comprising:
[0027] An acquisition module is used to acquire an initial migration strategy corresponding to each physical machine in the target cluster, and determine a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine;
[0028] An adaptive strategy module, used to determine initial genetic parameters according to each first fitness, and determine a target migration strategy corresponding to each physical machine according to the initial genetic parameters and each initial migration strategy;
[0029] The migration module is used to migrate each virtual machine in the target cluster to the physical machine corresponding to each virtual machine according to each target migration strategy.
[0030] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of the first aspect when executing the computer program.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method of the first aspect described above.
[0032] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect are implemented.
[0033] The above-mentioned virtual machine migration method, device, equipment, readable storage medium and program product can obtain the initial migration strategy corresponding to each physical machine in the target cluster, determine the first fitness corresponding to the physical machine according to the initial migration strategy, and determine the initial genetic parameters according to each first fitness, and determine the target migration strategy corresponding to each physical machine according to the initial genetic parameters and each initial migration strategy. According to each target migration strategy, each virtual machine in the target cluster can be migrated to the physical machine corresponding to each virtual machine, wherein the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine. In this way, the default initial migration strategy corresponding to each physical machine is obtained, and the first fitness between each physical machine and the initial migration strategy is determined to determine the degree of adaptation between each physical machine and the initial migration strategy, and the initial genetic parameters for subsequent genetic processing are determined based on the first degree of adaptation, and the initial migration strategy is optimized according to the initial genetic parameters to obtain the optimal target migration strategy, thereby avoiding the problem of poor accuracy of the strategy for determining the strategy of virtual machine migration using a genetic algorithm with random parameters in the traditional technology, and migrating each virtual machine to the physical machine corresponding to each virtual machine based on the target migration strategy obtained by the technical solution provided by the present application, and the migration accuracy is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A diagram of an application environment of a virtual machine migration method in an embodiment;
[0036] Figure 2 A flowchart of a virtual machine migration method in one embodiment;
[0037] Figure 3 A schematic diagram of the structure of chromosome encoding in another embodiment;
[0038] Figure 4 is a flow chart of step 202 in another embodiment;
[0039] Figure 5 is a schematic flow chart of step 203 in another embodiment;
[0040] Figure 6 is a flow chart of step 502 in another embodiment;
[0041] Figure 7A flowchart of an exemplary virtual machine migration method in an embodiment;
[0042] Figure 8 is a structural block diagram of a virtual machine migration device in an embodiment;
[0043] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] With the continuous development of cloud computing technology, the high energy consumption problem it faces is becoming more and more serious. Virtualization technology can greatly improve the utilization of computing resources.
[0046] With the development of virtualization technology, virtual machines are widely used. In order to ensure the elastic allocation and dynamic adjustment of computing resources, virtual machines are usually migrated to different physical machines according to the operation status of each physical machine, so as to avoid single point overload and achieve load balancing.
[0047] Traditional virtual machine migration methods usually abstract the virtual machine migration process into a two-dimensional box packing problem, that is, the physical machine in each cluster is regarded as a box, and the virtual machine is the object that needs to be placed in these boxes. Different boxes have different available capacities, that is, the CPU, memory and other computing resources of the physical machine, and different objects have different volumes, that is, the computing resources required by the virtual machine; then, a genetic algorithm with random parameters is used to genetically optimize the migration strategy to determine the final migration strategy, and the virtual machine can be migrated according to the final migration strategy.
[0048] However, in genetic algorithms, parameter settings are very important, such as crossover probability, mutation probability, etc. Using random parameters for genetic optimization will lead to uneven quality of the newly determined migration strategies and easily fall into the problem of local optimality, resulting in poor migration accuracy.
[0049] In view of this, the present application provides a virtual machine migration method, device, equipment, readable storage medium and program product, by obtaining the initial migration strategy corresponding to each physical machine in the target cluster, determining the first fitness corresponding to the physical machine according to the initial migration strategy, and then determining the initial genetic parameters according to each first fitness, and determining the target migration strategy corresponding to each physical machine according to the initial genetic parameters and each initial migration strategy, and then migrating each virtual machine in the target cluster to the physical machine corresponding to each virtual machine according to each target migration strategy, wherein the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine. In this way, the default initial migration strategy corresponding to each physical machine is obtained, and the first fitness between each physical machine and the initial migration strategy is determined to determine the degree of adaptation between each physical machine and the initial migration strategy, and the initial genetic parameters for subsequent genetic processing are determined based on the first degree of adaptation, and the initial migration strategy is optimized according to the initial genetic parameters to obtain the optimal target migration strategy, thereby avoiding the problem of poor accuracy of the strategy for determining the strategy of virtual machine migration using a genetic algorithm with random parameters in the traditional technology, and migrating each virtual machine to the physical machine corresponding to each virtual machine based on the target migration strategy obtained by the technical solution provided by the present application, and the migration accuracy is higher.
[0050] The virtual machine migration method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The data storage system can store data that the server 101 needs to process. The data storage system can be integrated on the server 101, or it can be placed on the cloud or other network servers. The server 101 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud computing services. The server 101 can be communicatively connected with multiple physical machines 102 in the target cluster. In an embodiment of the present application, the server 101 can be any physical machine belonging to the target cluster, and the server 101 can also be a computer device independent of the target cluster and used only to manage data related to the target cluster.
[0051] In an exemplary embodiment, Figure 2 As shown, a virtual machine migration method is provided, which is applied to Figure 1 The server 101 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:
[0052] Step 201 : obtaining an initial migration strategy corresponding to each physical machine in the target cluster, and determining a first fitness corresponding to the physical machine according to the initial migration strategy.
[0053] The target cluster may be a device cluster including multiple physical machines. The target cluster may also include multiple virtual machines, and the virtual machines may run on each physical machine.
[0054] The server can obtain the initial migration policy corresponding to each physical machine in the target cluster. In the embodiment of the present application, the migration policy can represent the virtual machine migrating to the physical machine, and the initial migration policy is the default migration policy. Optionally, the server can determine the initial migration policy corresponding to the physical machine based on the virtual machine running on the physical machine at the current moment; optionally, the server can randomly generate the initial migration policy corresponding to each physical machine based on the attribute data of each physical machine and virtual machine; optionally, the server can obtain the initial migration policy input by the user through an external device.
[0055] Regarding the digital representation of the migration strategy, optionally, the server can digitally represent the migration strategy through multiple mapping relationships; optionally, the server can digitally represent the migration strategy through a preset encoding form. In the embodiment of the present application, since the virtual machine and the physical machine can be in a many-to-one relationship, the preset encoding form can be a chromosome encoding form.
[0056] In the embodiment of the present application, when the server digitally expresses the migration strategy in the form of chromosome encoding, the field corresponding to the gene position can be the physical machine identifier corresponding to each physical machine, and the field in each genome can be the virtual machine identifier corresponding to the virtual machine migrated to the physical machine. For example, refer to Figure 3 The target cluster includes three physical machines A, B and C, and 12 virtual machines 1 to 12. It is assumed that virtual machines 1 to 4 are migrated on A, 5 to 8 are migrated on B, and 9 to 12 are migrated on C. The chromosome encoding of the migration strategy corresponding to each physical machine can be A{1, 2, 3, 4}, B{5, 6, 7, 8}, and C{9, 10, 11, 12}.
[0057] After the server obtains the initial migration strategy corresponding to each physical machine, it can determine the first fitness corresponding to the physical machine according to each initial migration strategy, wherein the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine.
[0058] Regarding the process of determining the first fitness, optionally, the server may input each migration strategy into a pre-trained fitness output model, so that the fitness output model outputs the first fitness corresponding to each physical machine.
[0059] Optionally, for each physical machine, the server may determine a default virtual machine corresponding to the physical machine according to an initial migration strategy, and determine a first fitness corresponding to the physical machine according to first attribute data corresponding to the default virtual machine and second attribute data corresponding to the physical machine.
[0060] According to the initial migration strategy, the server can determine the default virtual machine to be migrated to each physical machine as indicated by the initial migration strategy. For each physical machine, the server can obtain first attribute data corresponding to each default virtual machine. The first attribute data may include CPU resources, memory resources, etc. required by the default virtual machine. The server can also obtain second attribute data corresponding to each physical machine. The second attribute data may include the currently available CPU capacity, memory capacity, etc. of each physical machine.
[0061] In an embodiment of the present application, the server can obtain a preset fitness formula for calculating fitness. The server can substitute the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine into the preset fitness formula to determine the first fitness corresponding to the physical machine.
[0062] The fitness formula can be specifically referred to the following formula:
[0063] (1)
[0064] Among them, k is the identifier corresponding to the physical machine, f k is the fitness, m k is the total number of virtual machines, i is the ID of the virtual machine, The CPU resources required for the virtual machine. The memory resources required by the virtual machine. is the CPU capacity currently available on the physical machine. The current available memory capacity of the physical machine.
[0065] Step 202 : determining initial genetic parameters according to each first fitness, and determining a target migration strategy corresponding to each physical machine according to the initial genetic parameters and each initial migration strategy.
[0066] The initial genetic parameters may be algorithm parameters used by the server when optimizing the initial migration strategy using a genetic algorithm. In an embodiment of the present application, the genetic parameters may include crossover probability, mutation probability, selection probability, etc. The initial genetic parameters may be parameters determined by the server based on the first fitness. The initial migration strategy is optimized based on the initial genetic parameters, and the migration accuracy of the target migration strategy obtained is higher.
[0067] Optionally, the server can input each first fitness into a pre-trained parameter determination model to obtain the initial genetic parameters output by the parameter determination model; optionally, for different genetic parameters, the server can obtain the corresponding parameter calculation formula, and the server can respectively bring each first fitness into the parameter calculation formula corresponding to each genetic parameter to obtain the initial genetic parameters.
[0068] Based on the initial genetic parameters, the server may perform iterative genetic processing on the initial migration strategy, thereby determining a target migration strategy corresponding to each physical machine.
[0069] Step 203 : Migrate each virtual machine in the target cluster to a physical machine corresponding to each virtual machine according to each target migration strategy.
[0070] In the embodiment of the present application, according to the target migration strategy corresponding to each physical machine, the server can determine the virtual machine to be migrated to each physical machine, and the server can migrate each virtual machine to the physical machine corresponding to each virtual machine.
[0071] In the above embodiment, the default initial migration strategy corresponding to each physical machine is obtained, and the first fitness between each physical machine and the initial migration strategy is determined to determine the degree of adaptation between each physical machine and the initial migration strategy. The initial genetic parameters for subsequent genetic processing are determined based on the first degree of adaptation, and the initial migration strategy is optimized according to the changed initial genetic parameters to obtain the optimal target migration strategy. This avoids the problem of poor strategy accuracy in traditional technologies that use genetic algorithms with random parameters to determine the strategy for virtual machine migration. Based on the target migration strategy obtained based on the technical solution provided in the present application, each virtual machine is migrated to the physical machine corresponding to each virtual machine, and the migration accuracy is higher.
[0072] In one embodiment, based on the above Figure 2 The embodiment shown, see Figure 4 , this embodiment relates to the process of determining the initial genetic parameters according to each first fitness. Figure 4 As shown, step 202 may include step 401 and step 402 .
[0073] Step 401, determining an initial crossover parameter corresponding to each physical machine according to each first fitness, and determining an initial mutation parameter corresponding to each physical machine according to each first fitness.
[0074] Step 402, determining each initial crossover parameter and each initial mutation parameter as initial genetic parameters.
[0075] In an embodiment of the present application, the genetic parameters may include crossover parameters corresponding to each physical machine used for crossover processing, and the crossover parameters may characterize the probability that each physical machine may perform crossover processing; the genetic parameters may also include mutation parameters corresponding to each physical machine used for mutation processing, and the mutation parameters may characterize the probability that each physical machine may mutate.
[0076] In an embodiment of the present application, the server can determine the initial crossover parameters and initial mutation parameters corresponding to each physical machine based on the first fitness. Optionally, the server can process each first fitness according to a preset crossover parameter determination model and a mutation parameter determination model to obtain the crossover parameters corresponding to each physical machine output by the cross parameter determination model and the mutation parameters corresponding to each physical machine output by the mutation parameter determination model.
[0077] Optionally, the server may obtain a cross parameter formula and a mutation parameter formula, and substitute each first fitness into the cross parameter formula and the mutation parameter formula, respectively, so as to determine the initial cross parameter and initial mutation parameter corresponding to each physical machine.
[0078] For the cross parameter formula, please refer to the following formula:
[0079] (2)
[0080] Among them, P C is the crossover parameter, is the preset minimum crossover parameter, is the preset maximum crossover parameter, f max is the first fitness with the largest value, f min is the first fitness with the smallest value, and f is the first fitness corresponding to the current physical machine.
[0081] The mutation parameter formula can refer to the following formula:
[0082] (3)
[0083] Among them, P m is the variation parameter, is the preset minimum variation parameter, is the preset maximum variation parameter.
[0084] After obtaining the initial crossover parameters and initial mutation parameters corresponding to each physical machine, the server may determine each initial crossover parameter and each initial mutation parameter as initial genetic parameters.
[0085] In one embodiment, based on the above Figure 4 The embodiment shown, see Figure 5 This embodiment involves a process of determining a target migration strategy corresponding to each physical machine based on initial genetic parameters and each initial migration strategy. Figure 5 As shown, step 203 may include step 501 and step 502 .
[0086] Step 501 : determining a selection probability corresponding to a physical machine according to a first fitness, and determining a plurality of parent migration strategies from each initial migration strategy according to each selection probability.
[0087] In an embodiment of the present application, for each physical machine, the server can determine the selection probability corresponding to the physical machine based on the first fitness corresponding to the physical machine. Regarding the method for determining the selection probability, optionally, there is a mapping relationship between different well-known first fitnesses and each selection probability. The server can determine the target mapping relationship corresponding to the first fitness from multiple candidate mapping relationships based on the first fitness, and determine the selection probability corresponding to the physical machine based on the target mapping relationship.
[0088] Optionally, the server may substitute the first fitness into a preset selection probability determination formula to obtain the selection probability corresponding to the physical machine. The selection probability determination formula may refer to the following formula:
[0089] (4)
[0090] Among them, x i is the physical machine identifier, p(x i ) is the physical machine x i The corresponding selection probability, f(x i ) represents physical machine x i The first fitness.
[0091] In the embodiment of the present application, the selection probability is used to characterize the probability that each physical machine may be selected for genetic processing.
[0092] After determining the selection probability corresponding to each physical machine, the server may determine a plurality of parent migration strategies for subsequent genetic processing according to each physical machine and the corresponding selection probability.
[0093] Regarding the determination method, in an embodiment of the present application, the server may adopt selection methods such as roulette selection, tournament selection, and ranking selection.
[0094] Step 502 : performing genetic iteration processing on each parent migration strategy according to the initial crossover parameters and initial mutation parameters corresponding to each parent migration strategy to determine each target migration strategy.
[0095] After determining multiple parent migration strategies, the server can perform genetic iterative processing on each parent migration strategy according to the initial crossover parameters and the initial mutation parameters. In the embodiment of the present application, for each iteration process, the server can perform genetic processing on the fitness corresponding to each physical machine in the current iteration process for each migration strategy to be iterated, and obtain the migration strategy after genetic processing corresponding to the current iteration process. Optionally, the server can preset a convergence condition. If the migration strategy after genetic processing corresponding to the current iteration process meets the preset convergence condition, the server can use the migration strategy after genetic processing corresponding to the current iteration process as the target migration strategy. If the migration strategy after genetic processing corresponding to the current iteration process meets the preset convergence condition, the server can use the migration strategy after genetic processing corresponding to the current iteration process as the target migration strategy. If the preset convergence condition is not met, the server may use the migration strategy after genetic processing corresponding to the current iterative process as the migration strategy to be processed in the next iterative process, and perform the next genetic iterative processing until the target migration strategy is determined; optionally, the server may preset a maximum number of iterations. If the current number of iterations reaches the maximum number of iterations, the server may use the migration strategy after genetic processing corresponding to the current iterative process as the target migration strategy. If the current number of iterations does not reach the maximum number of iterations, the server may use the migration strategy after genetic processing corresponding to the current iterative process as the migration strategy to be processed in the next iterative process, and perform the next genetic iterative processing until the target migration strategy is determined.
[0096] In one embodiment, based on the above Figure 5 The embodiment shown, see Figure 6 This embodiment involves a process of performing genetic iteration processing on each parent migration strategy according to the initial crossover parameters and initial mutation parameters corresponding to each parent migration strategy to determine each target migration strategy. Figure 6 As shown, step 502 may include steps 601 to 603 .
[0097] Step 601 , performing genetic processing on each parent generation migration strategy according to the initial crossover parameters and initial mutation parameters corresponding to each parent generation migration strategy, to obtain a migration strategy after genetic processing.
[0098] For each iteration process, the genetic processing process may include a crossover process according to an initial crossover parameter and a mutation process according to an initial mutation parameter.
[0099] Regarding the crossover process, in the embodiment of the present application, the server can determine the parent migration strategy to be crossover-processed according to the crossover probability corresponding to each parent migration strategy, and pair each parent migration strategy to be crossover-processed in pairs, thereby obtaining the parent migration strategy after the crossover process. Regarding the pairing process, optionally, the server can randomly pair each parent migration strategy to be crossover-processed in pairs; optionally, the server can pair each parent migration strategy to be crossover-processed in pairs according to the crossover probability corresponding to each parent migration strategy to be crossover-processed.
[0100] As for the parent migration strategy after cross processing, the server can mutate it according to its corresponding initial mutation parameters. In the embodiment of the present application, the server can determine the migration strategy to be mutated from the parent migration strategies after each cross processing according to the initial mutation parameters corresponding to each parent migration strategy after cross processing, and then mutate each migration strategy to be mutated to obtain the migration strategy after mutation processing.
[0101] It is understandable that each parent migration strategy may or may not be cross-processed, and the parent migration strategy after cross-processing may or may not be mutated. Therefore, the server can use the migration strategy that has been mutated, the migration strategy that has been cross-processed but not compiled, and the migration strategy that has not been cross-processed and mutated among the parent migration strategies as the migration strategy after inheritance processing.
[0102] Step 602, obtaining the second fitness corresponding to each migration strategy after genetic processing.
[0103] For each migration strategy after genetic processing, the server can determine the virtual machine indicated by the migration strategy after genetic processing to be migrated to its corresponding physical machine. The server can obtain the attribute data corresponding to each virtual machine and the attribute data corresponding to the physical machine, and input the attribute data corresponding to each virtual machine and the attribute data corresponding to the physical machine into the fitness output model, or substitute them into a preset fitness formula to obtain the second fitness corresponding to the migration strategy after genetic processing.
[0104] Step 603, determining each target migration strategy according to each second fitness, the first fitness corresponding to other migration strategies, each migration strategy after genetic processing, and each other migration strategy.
[0105] Among them, other migration strategies may be initial migration strategies other than the parent migration strategy among the initial migration strategies.
[0106] In a possible implementation, after the second fitness corresponding to each migration strategy after genetic processing is obtained, the server can calculate the statistical value of each second fitness and the first fitness corresponding to other migration strategies. If the statistical value satisfies the preset numerical range, the server can determine that the migration strategy after each genetic processing and each other migration strategy are target migration strategies; if the statistical value step satisfies the preset numerical range, the server can continue to perform genetic iterative processing based on each second fitness, the first fitness corresponding to other migration strategies, each migration strategy after genetic processing, and each other migration strategy until each target migration strategy is determined.
[0107] In another possible implementation, if each migration strategy after genetic processing and each other migration strategy meet the convergence condition, the server can determine each migration strategy after genetic processing and each other migration strategy as the target migration strategy; if each migration strategy after genetic processing and each other migration strategy do not meet the convergence condition, the server can continue to perform genetic iterative processing based on each second fitness, the first fitness corresponding to other migration strategies, each migration strategy after genetic processing and each other migration strategy until each target migration strategy is determined.
[0108] In the embodiment of the present application, for each migration strategy after genetic processing and each other migration strategy, the virtual machine migrated to the corresponding physical machine is indicated. For each physical machine, the server can determine the virtual machine to be migrated to it indicated by the migration strategy according to its corresponding migration strategy, and obtain the first attribute data corresponding to each virtual machine. The server can count the first attribute data to obtain the resource data occupied by the physical machine. Exemplarily, the attribute data corresponding to each virtual machine includes the CPU resources and memory resources required by each virtual machine. The server accumulates the CPU resources and memory resources required by each virtual machine to obtain the CPU resources and memory resources occupied by the physical machine; the server can also obtain the second attribute data corresponding to the physical world. In this way, the server can substitute the resource data occupied by each physical machine and the second attribute data into the preset policy adaptation formula to obtain the policy adaptation value corresponding to the current iteration process. The policy adaptation formula can refer to the following formula:
[0109] (5)
[0110] Among them, F1 is the strategy adaptation value, is the CPU resources occupied by physical machine i, is the memory resource occupied by physical machine i, and n is the total number of physical machines.
[0111] The server can determine that each migration strategy after genetic processing and each other migration strategy meet the convergence condition based on the policy adaptation value. The convergence condition can be a preset adaptation value range. If the policy adaptation value satisfies the adaptation value range, the server determines that each migration strategy after genetic processing and each other migration strategy meet the convergence condition. If the policy adaptation value does not satisfy the adaptation value range, the server determines that each migration strategy after genetic processing and each other migration strategy do not meet the convergence condition.
[0112] In one embodiment, referring to Figure 7 , provides an exemplary virtual machine migration method, which can be applied to Figure 1 In the implementation environment shown.
[0113] Step 701: Obtain the initial migration strategy corresponding to each physical machine in the target cluster.
[0114] Step 702: for each physical machine, determine a default virtual machine corresponding to the physical machine according to the initial migration policy.
[0115] Step 703: Determine a first fitness corresponding to the physical machine according to the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine.
[0116] The first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine.
[0117] Step 704 , determining an initial crossover parameter corresponding to each physical machine according to each first fitness, and determining an initial mutation parameter corresponding to each physical machine according to each first fitness.
[0118] Step 705: determine each initial crossover parameter and each initial mutation parameter as initial genetic parameters.
[0119] Step 706 , determining a selection probability corresponding to the physical machine according to the first fitness, and determining a plurality of parent migration strategies from the initial migration strategies according to the selection probabilities.
[0120] Step 707 , performing genetic processing on each parent generation migration strategy according to the initial crossover parameters and initial mutation parameters corresponding to each parent generation migration strategy, to obtain a migration strategy after genetic processing.
[0121] Step 708, obtaining the second fitness corresponding to each migration strategy after genetic processing.
[0122] Step 709: If the migration strategies after the genetic processing and the other migration strategies meet the convergence condition, then the migration strategies after the genetic processing and the other migration strategies are determined as the target migration strategies.
[0123] Step 710, if the migration strategies after genetic processing and other migration strategies do not meet the convergence conditions, then continue to perform genetic iteration processing based on the second fitness, the first fitness corresponding to other migration strategies, the migration strategies after genetic processing and other migration strategies until the target migration strategies are determined.
[0124] Among them, other migration strategies are initial migration strategies other than the parent migration strategy among the initial migration strategies.
[0125] Step 711 , according to each target migration strategy, migrate each virtual machine in the target cluster to a physical machine corresponding to each virtual machine.
[0126] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0127] Based on the same inventive concept, the embodiment of the present application also provides a virtual machine migration device for implementing the virtual machine migration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more virtual machine migration device embodiments provided below can refer to the limitations of the virtual machine migration method above, and will not be repeated here.
[0128] In an exemplary embodiment, Figure 8 As shown, a virtual machine migration device is provided, including: an acquisition module 801, an adaptive strategy module 802 and a migration module 803, wherein:
[0129] An acquisition module 801 is used to acquire an initial migration strategy corresponding to each physical machine in the target cluster, and determine a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine;
[0130] An adaptive strategy module 802, configured to determine an initial genetic parameter according to each of the first fitnesses, and determine a target migration strategy corresponding to each of the physical machines according to the initial genetic parameter and each of the initial migration strategies;
[0131] The migration module 803 is used to migrate each virtual machine in the target cluster to a physical machine corresponding to each virtual machine according to each target migration strategy.
[0132] In one embodiment, the adaptive strategy module 802 includes:
[0133] a crossover and mutation parameter determining unit, which determines an initial crossover parameter corresponding to each of the physical machines according to each of the first fitnesses, and determines an initial mutation parameter corresponding to each of the physical machines according to each of the first fitnesses;
[0134] The genetic parameter determination unit is used to determine each of the initial crossover parameters and each of the initial mutation parameters as the initial genetic parameters.
[0135] In one embodiment, the adaptive strategy module 802 further includes:
[0136] A selection unit, configured to determine a selection probability corresponding to the physical machine according to the first fitness, and determine a plurality of parent migration strategies from the initial migration strategies according to each of the selection probabilities;
[0137] The target determination unit is used to perform genetic iteration processing on each of the parent migration strategies according to the initial crossover parameters and the initial mutation parameters corresponding to each of the parent migration strategies, so as to determine each of the target migration strategies.
[0138] In one embodiment, the target determination unit is specifically configured to perform:
[0139] According to the initial crossover parameter and the initial mutation parameter corresponding to each parent migration strategy, each parent migration strategy is genetically processed to obtain a migration strategy after genetic processing;
[0140] Obtaining a second fitness corresponding to each migration strategy after the genetic processing;
[0141] Each of the target migration strategies is determined based on each of the second fitnesses, the first fitnesses corresponding to other migration strategies, each of the migration strategies after the genetic processing, and each of the other migration strategies. The other migration strategies are the initial migration strategies in each of the initial migration strategies except the parent migration strategy.
[0142] In one embodiment, the target determination unit is further configured to execute:
[0143] If the migration strategies after the genetic processing and the other migration strategies meet the convergence condition, then determining the migration strategies after the genetic processing and the other migration strategies as the target migration strategies;
[0144] If the migration strategies after the genetic processing and the other migration strategies do not meet the convergence condition, the genetic iterative processing is continued based on the second fitness, the first fitness corresponding to the other migration strategies, the migration strategies after the genetic processing and the other migration strategies until the target migration strategies are determined.
[0145] In one embodiment, the acquisition module 801 includes:
[0146] a default virtual machine determining unit, for each of the physical machines, determining a default virtual machine corresponding to the physical machine according to the initial migration strategy;
[0147] The fitness determination unit is used to determine the first fitness corresponding to the physical machine according to the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine.
[0148] Each module in the above-mentioned virtual machine migration device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0149] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store virtual machine migration data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a virtual machine migration method is implemented.
[0150] Those skilled in the art will understand that Fig. 9The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0151] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0152] Acquire an initial migration strategy corresponding to each physical machine in the target cluster, and determine a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine;
[0153] Determining initial genetic parameters according to each of the first fitnesses, and determining a target migration strategy corresponding to each of the physical machines according to the initial genetic parameters and each of the initial migration strategies;
[0154] According to each of the target migration strategies, each virtual machine in the target cluster is migrated to a physical machine corresponding to each of the virtual machines.
[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0156] Determine an initial crossover parameter corresponding to each of the physical machines according to each of the first fitnesses, and determine an initial mutation parameter corresponding to each of the physical machines according to each of the first fitnesses;
[0157] The initial crossover parameters and the initial mutation parameters are determined as the initial genetic parameters.
[0158] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0159] Determining a selection probability corresponding to the physical machine according to the first fitness, and determining a plurality of parent migration strategies from the initial migration strategies according to each of the selection probabilities;
[0160] According to the initial crossover parameters and the initial mutation parameters corresponding to each of the parent migration strategies, genetic iteration processing is performed on each of the parent migration strategies to determine each of the target migration strategies.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] According to the initial crossover parameter and the initial mutation parameter corresponding to each parent migration strategy, each parent migration strategy is genetically processed to obtain a migration strategy after genetic processing;
[0163] Obtaining a second fitness corresponding to each migration strategy after the genetic processing;
[0164] Each of the target migration strategies is determined based on each of the second fitnesses, the first fitnesses corresponding to other migration strategies, each of the migration strategies after the genetic processing, and each of the other migration strategies. The other migration strategies are the initial migration strategies in each of the initial migration strategies except the parent migration strategy.
[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0166] If the migration strategies after the genetic processing and the other migration strategies meet the convergence condition, then determining the migration strategies after the genetic processing and the other migration strategies as the target migration strategies;
[0167] If the migration strategies after the genetic processing and the other migration strategies do not meet the convergence condition, the genetic iterative processing is continued based on the second fitness, the first fitness corresponding to the other migration strategies, the migration strategies after the genetic processing and the other migration strategies until the target migration strategies are determined.
[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0169] For each of the physical machines, determining a default virtual machine corresponding to the physical machine according to the initial migration strategy;
[0170] A first fitness corresponding to the physical machine is determined according to the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine.
[0171] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0172] Acquire an initial migration strategy corresponding to each physical machine in the target cluster, and determine a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine;
[0173] Determining initial genetic parameters according to each of the first fitnesses, and determining a target migration strategy corresponding to each of the physical machines according to the initial genetic parameters and each of the initial migration strategies;
[0174] According to each of the target migration strategies, each virtual machine in the target cluster is migrated to a physical machine corresponding to each of the virtual machines.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] Determine an initial crossover parameter corresponding to each of the physical machines according to each of the first fitnesses, and determine an initial mutation parameter corresponding to each of the physical machines according to each of the first fitnesses;
[0177] The initial crossover parameters and the initial mutation parameters are determined as the initial genetic parameters.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] Determining a selection probability corresponding to the physical machine according to the first fitness, and determining a plurality of parent migration strategies from the initial migration strategies according to each of the selection probabilities;
[0180] According to the initial crossover parameters and the initial mutation parameters corresponding to each of the parent migration strategies, genetic iteration processing is performed on each of the parent migration strategies to determine each of the target migration strategies.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] According to the initial crossover parameter and the initial mutation parameter corresponding to each parent migration strategy, each parent migration strategy is genetically processed to obtain a migration strategy after genetic processing;
[0183] Obtaining a second fitness corresponding to each migration strategy after the genetic processing;
[0184] Each of the target migration strategies is determined based on each of the second fitnesses, the first fitnesses corresponding to other migration strategies, each of the migration strategies after the genetic processing, and each of the other migration strategies. The other migration strategies are the initial migration strategies in each of the initial migration strategies except the parent migration strategy.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] If the migration strategies after the genetic processing and the other migration strategies meet the convergence condition, then determining the migration strategies after the genetic processing and the other migration strategies as the target migration strategies;
[0187] If the migration strategies after the genetic processing and the other migration strategies do not meet the convergence condition, the genetic iterative processing is continued based on the second fitness, the first fitness corresponding to the other migration strategies, the migration strategies after the genetic processing and the other migration strategies until the target migration strategies are determined.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] For each of the physical machines, determining a default virtual machine corresponding to the physical machine according to the initial migration strategy;
[0190] A first fitness corresponding to the physical machine is determined according to the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine.
[0191] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0192] Acquire an initial migration strategy corresponding to each physical machine in the target cluster, and determine a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine;
[0193] Determining initial genetic parameters according to each of the first fitnesses, and determining a target migration strategy corresponding to each of the physical machines according to the initial genetic parameters and each of the initial migration strategies;
[0194] According to each of the target migration strategies, each virtual machine in the target cluster is migrated to a physical machine corresponding to each of the virtual machines.
[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0196] Determine an initial crossover parameter corresponding to each of the physical machines according to each of the first fitnesses, and determine an initial mutation parameter corresponding to each of the physical machines according to each of the first fitnesses;
[0197] The initial crossover parameters and the initial mutation parameters are determined as the initial genetic parameters.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0199] Determining a selection probability corresponding to the physical machine according to the first fitness, and determining a plurality of parent migration strategies from the initial migration strategies according to each of the selection probabilities;
[0200] According to the initial crossover parameters and the initial mutation parameters corresponding to each of the parent migration strategies, genetic iteration processing is performed on each of the parent migration strategies to determine each of the target migration strategies.
[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0202] According to the initial crossover parameter and the initial mutation parameter corresponding to each parent migration strategy, each parent migration strategy is genetically processed to obtain a migration strategy after genetic processing;
[0203] Obtaining a second fitness corresponding to each migration strategy after the genetic processing;
[0204] Each of the target migration strategies is determined based on each of the second fitnesses, the first fitnesses corresponding to other migration strategies, each of the migration strategies after the genetic processing, and each of the other migration strategies. The other migration strategies are the initial migration strategies in each of the initial migration strategies except the parent migration strategy.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0206] If the migration strategies after the genetic processing and the other migration strategies meet the convergence condition, then determining the migration strategies after the genetic processing and the other migration strategies as the target migration strategies;
[0207] If the migration strategies after the genetic processing and the other migration strategies do not meet the convergence condition, the genetic iterative processing is continued based on the second fitness, the first fitness corresponding to the other migration strategies, the migration strategies after the genetic processing and the other migration strategies until the target migration strategies are determined.
[0208] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0209] For each of the physical machines, determining a default virtual machine corresponding to the physical machine according to the initial migration strategy;
[0210] A first fitness corresponding to the physical machine is determined according to the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine.
[0211] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0212] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0213] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0214] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A virtual machine migration method, characterized in that: The method comprises: Obtaining an initial migration strategy corresponding to each physical machine in the target cluster, and determining a first fitness corresponding to the physical machine according to the initial migration strategy, where the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine; Determining initial genetic parameters according to each of the first fitnesses, and determining a target migration strategy corresponding to each of the physical machines according to the initial genetic parameters and each of the initial migration strategies; According to each of the target migration strategies, each virtual machine in the target cluster is migrated to a physical machine corresponding to each of the virtual machines.
2. The method according to claim 1, characterized in that The determining of initial genetic parameters according to each of the first fitnesses comprises: Determine an initial crossover parameter corresponding to each of the physical machines according to each of the first fitnesses, and determine an initial mutation parameter corresponding to each of the physical machines according to each of the first fitnesses; The initial crossover parameters and the initial mutation parameters are determined as the initial genetic parameters.
3. The method according to claim 2, characterized in that The step of determining the target migration strategy corresponding to each of the physical machines according to the initial genetic parameters and each of the initial migration strategies includes: Determining a selection probability corresponding to the physical machine according to the first fitness, and determining a plurality of parent migration strategies from the initial migration strategies according to each of the selection probabilities; According to the initial crossover parameters and the initial mutation parameters corresponding to each of the parent migration strategies, genetic iteration processing is performed on each of the parent migration strategies to determine each of the target migration strategies.
4. The method according to claim 3, characterized in that The step of performing genetic iteration processing on each of the parent migration strategies according to the initial crossover parameters and the initial mutation parameters corresponding to each of the parent migration strategies to determine each of the target migration strategies includes: According to the initial crossover parameter and the initial mutation parameter corresponding to each parent migration strategy, each parent migration strategy is genetically processed to obtain a migration strategy after genetic processing; Obtaining a second fitness corresponding to each migration strategy after the genetic processing; Each of the target migration strategies is determined based on each of the second fitnesses, the first fitnesses corresponding to other migration strategies, each of the migration strategies after the genetic processing, and each of the other migration strategies. The other migration strategies are the initial migration strategies in each of the initial migration strategies except the parent migration strategy.
5. The method according to claim 4, characterized in that Determining each of the target migration strategies according to each of the second fitnesses, the first fitnesses corresponding to other migration strategies, each of the migration strategies after genetic processing, and each of the other migration strategies includes: If the migration strategies after the genetic processing and the other migration strategies meet the convergence condition, then determining the migration strategies after the genetic processing and the other migration strategies as the target migration strategies; If the migration strategies after the genetic processing and the other migration strategies do not meet the convergence condition, the genetic iterative processing is continued based on the second fitness, the first fitness corresponding to the other migration strategies, the migration strategies after the genetic processing and the other migration strategies until the target migration strategies are determined.
6. The method according to claim 1, characterized in that The determining, according to the initial migration strategy, a first fitness corresponding to the physical machine includes: For each of the physical machines, determining a default virtual machine corresponding to the physical machine according to the initial migration strategy; A first fitness corresponding to the physical machine is determined according to the first attribute data corresponding to the default virtual machine and the second attribute data corresponding to the physical machine.
7. A virtual machine migration device, characterized in that: The device comprises: An acquisition module, used to acquire an initial migration strategy corresponding to each physical machine in the target cluster, and determine a first fitness corresponding to the physical machine according to the initial migration strategy, wherein the first fitness is used to characterize the degree of adaptation between the initial migration strategy and the physical machine; An adaptive strategy module, used to determine initial genetic parameters according to each of the first fitnesses, and determine a target migration strategy corresponding to each of the physical machines according to the initial genetic parameters and each of the initial migration strategies; The migration module is used to migrate each virtual machine in the target cluster to a physical machine corresponding to each virtual machine according to each target migration strategy.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.