Virtual machine migration method and device, storage medium and equipment
By identifying the collection of service nodes and determining the migration priority, the matching migration between multiple virtual machines and service nodes is achieved, and the problem of integrating fragmented resources in the public cloud service system is solved, and resource utilization and stability are improved.
Patent Information
- Application Number
- CN202410183446.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-19
- Publication Date
- 2025-08-19
AI Technical Summary
There is a phenomenon of fragmented cloud resources in public cloud service systems, resulting in low usage rates of physical machines. It is difficult for the existing technology to effectively integrate fragmented resources during virtual machines migration.
By identifying the set of migratory and non-migratory service nodes, the migration priority is determined based on the virtual machine attributes and service node operation information, a migration matching relationship is established, and the simultaneous matching migration between multiple virtual machines and service nodes is realized.
It improves the accuracy of virtual machine migration scheduling and the utilization rate of cloud service resources, and ensures the stability of physical machine of cloud service resources.
Smart Images

Figure CN120508346A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a virtual machine migration method, apparatus, storage medium, and device. Background Art
[0002] In public cloud service scenarios, vendors typically deploy a large number of physical server resources to build public cloud services to meet daily operations. Customers can purchase public cloud resources from vendors to deploy virtual machines that meet their business needs. However, due to the uncertainty of customer demand for cloud resources, public cloud service systems experience a large number of creation and destruction (return of cloud resources), resulting in a large amount of fragmented cloud resources. Therefore, it is necessary to consolidate these fragmented cloud resources.
[0003] During the research and practice of related technologies, the inventors of this application discovered that when integrating fragmented cloud resources, the related technologies manually select a physical machine with a fragmented resource amount that meets the virtual machine's requirements for migration for a single virtual machine that needs to be migrated. However, there is generally a gap between the amount of fragmented resources and the amount required by the virtual machine, which easily leads to the phenomenon that the physical machine may still have small fragmented resources, which is not conducive to the subsequent migration and utilization of other virtual machines, resulting in a low utilization rate of physical machines in the cloud service resource disk. Summary of the Invention
[0004] The present application provides a virtual machine migration method, apparatus, storage medium and equipment, which can improve the accuracy of virtual machine migration scheduling, increase the utilization rate of cloud service resources, and ensure the stability of cloud service resource physical machines.
[0005] To solve the above technical problems, this application provides the following technical solutions:
[0006] This embodiment of the present application provides a virtual machine migration method, including:
[0007] Identify, from the service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated;
[0008] For each target virtual machine on each first service node in the first service node set, create a corresponding scheduling task;
[0009] Arranging a migration priority order between the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operating information of each second service node in the set of second service nodes;
[0010] Based on the migration priority, establishing a migration matching relationship between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set;
[0011] Migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship.
[0012] Accordingly, an embodiment of the present application provides a virtual machine migration device, including:
[0013] an identification unit, configured to identify, from the service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated;
[0014] a creating unit, configured to create corresponding scheduling tasks for each target virtual machine on each first service node in the first service node set;
[0015] an arranging unit, configured to arrange, for each target virtual machine, a migration priority order between the second service nodes based on the attribute information of each target virtual machine and the operation information of each second service node in the set of second service nodes;
[0016] a matching unit, configured to establish, based on the migration priority, a migration matching relationship between a target virtual machine corresponding to each scheduling task and a target service node in the second service node set;
[0017] The processing unit is configured to migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship.
[0018] In some embodiments, the matching unit is further configured to:
[0019] Traversing each scheduling task, for a target virtual machine corresponding to each scheduling task, selecting a candidate service node with a higher ranking from the second service node set for the corresponding target virtual machine according to the corresponding migration priority order, wherein the candidate service node is the corresponding second service node;
[0020] If it is confirmed that there is no migration matching relationship with the candidate service node, the candidate service node is determined as the target service node to be migrated by the corresponding target virtual machine, and a migration matching relationship is established between the target service node and the corresponding target virtual machine.
[0021] In some embodiments, the matching unit is further configured to:
[0022] If it is confirmed that the candidate service node already has a migration matching relationship, then determining a virtual machine to be confirmed that has a migration matching relationship with the candidate service node;
[0023] Obtaining the candidate service nodes and sorting them to determine the admission priority order for each target virtual machine;
[0024] If it is determined according to the admission priority order that the current target virtual machine has priority over the to-be-confirmed virtual machine, then canceling the migration matching relationship between the candidate service node and the to-be-confirmed virtual machine, and using the candidate service node with the canceled migration matching relationship as the target service node of the current target virtual machine to establish a migration matching relationship;
[0025] If it is determined according to the acceptance priority that the virtual machine to be confirmed has priority over the current target virtual machine, the next candidate service node with a higher ranking is selected for the corresponding target virtual machine from the second service node set according to the corresponding migration priority, until the current target virtual machine establishes a migration matching relationship with the target service node in the second service node set.
[0026] In some embodiments, the virtual machine migration apparatus further includes a sorting unit configured to:
[0027] According to the attribute information of each target virtual machine and the operation information of each second service node, an admission priority order for each target virtual machine is sorted for each second service node.
[0028] In some embodiments, the sorting unit is further configured to:
[0029] Determine a first indicator parameter of a target indicator on each target virtual machine according to the attribute information of each target virtual machine;
[0030] Determining a second indicator parameter of the target indicator on each second service node according to the operation information of each second service node;
[0031] For each second service node, an admission priority order for each target virtual machine is sorted for the second service node according to a difference between the first indicator parameter of the target virtual machine and the second indicator parameter of each second service node.
[0032] In some implementations, the target indicator is one of a resource quantity indicator, a load indicator, and a virtual machine creation duration indicator, and the sorting unit is further configured to:
[0033] Traverse each second service node;
[0034] According to at least one dimension of the resource quantity indicator, the load indicator and the virtual machine creation time indicator, and based on the difference value between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine, the second service node is sorted out with an acceptance priority order for each target virtual machine.
[0035] In some embodiments, the processing unit is configured to:
[0036] For each target virtual machine on the first service node, determining a target service node corresponding to the target virtual machine from the second service node set according to the corresponding migration matching relationship;
[0037] Mounting the data storage space of the target virtual machine on the target service node, creating a candidate virtual machine consistent with the target virtual machine on the target service node, and copying the target memory data corresponding to the target virtual machine from the current first service node for the candidate virtual machine;
[0038] If the copy progress of the target memory data is completed, the candidate virtual machine is confirmed as the business virtual machine of the target virtual machine on the current first service node after the migration is completed, the target virtual machine on the first service node and the business virtual machine are suspended, and the target virtual machine on the current first service node is deleted.
[0039] In some implementations, the attribute information includes an operating resource type and operating parameters, and the arrangement unit is configured to:
[0040] Based on the running resource type of each target virtual machine, filtering from the second service node set to obtain a set of candidate service nodes corresponding to each target virtual machine;
[0041] For each target virtual machine, according to the operating parameters of the target virtual machine and the operating information of each second service node in the set of candidate service nodes, a migration priority order for each second service node in the set of candidate service nodes is arranged for the current target virtual machine.
[0042] In some embodiments, the identification unit is further configured to:
[0043] For each service node in the service node cluster, obtain the total load of the virtual machines deployed on the service node;
[0044] Determine the service node whose total load of the virtual machine is less than or equal to a preset load threshold as the first service node from which the virtual machine can be migrated, to obtain a first service node set;
[0045] Determine the service nodes whose total load of the virtual machines is greater than a preset load threshold as second service nodes from which the virtual machines cannot be migrated, and obtain a second service node set;
[0046] The number of the first service nodes is less than or equal to the number of the second service nodes.
[0047] In some embodiments, the virtual machine migration apparatus further includes a determining unit configured to:
[0048] Identifying the total number of scheduled tasks;
[0049] The arrangement unit is also used to arrange the migration priority between each second service node for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node in the second service node set if the total number of the scheduled tasks is greater than the preset task quantity threshold.
[0050] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for loading by a processor to execute the above-mentioned virtual machine migration method.
[0051] In addition, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the above-mentioned virtual machine migration method when executing the computer program.
[0052] In addition, embodiments of the present application further provide a computer program product or computer program, the computer program product or computer program including computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions to implement the aforementioned virtual machine migration method.
[0053] The embodiment of the present application identifies a first service node set of virtual machines that can be migrated and a second service node set of virtual machines that cannot be migrated from a service node cluster; creates corresponding scheduling tasks for the target virtual machines on each first service node in the first service node set; arranges a migration priority between each second service node for each target virtual machine based on the attribute information of each target virtual machine and the operating information of each second service node in the second service node set; establishes a migration matching relationship between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set based on the migration priority; and migrates the target virtual machine on the corresponding first service node to the target service node in the second service node set according to the migration matching relationship. In this way, by determining the migration priority of each target virtual machine among multiple target virtual machines relative to the second service nodes to be migrated, migration matching is performed between multiple target virtual machines and multiple second service nodes at the same time according to each migration priority. Multiple target virtual machines can be matched to a more suitable second service node at the same time to complete the migration, and the optimal scheduling solution can be matched for multiple target virtual machines from a global perspective in the same scheduling round, thereby improving the accuracy of virtual machine migration scheduling, accelerating the integration of fragmented resources in the cloud service node cluster, and improving the utilization rate of cloud service resources.
[0054] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be achieved and obtained through the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 A schematic diagram of a scenario of a virtual machine migration system provided in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of the steps of the virtual machine migration method provided in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of another step flow of the virtual machine migration method provided in an embodiment of the present application;
[0059] Figure 4Schematic diagram of the first and second scheduling scenarios of virtual machines provided in an embodiment of the present application;
[0060] Figure 5 This is a diagram illustrating a scenario of a virtual machine migration method provided in an embodiment of the present application;
[0061] Figure 6 A schematic diagram of a process for creating a virtual machine scheduling task provided in an embodiment of the present application;
[0062] Figure 7 A schematic diagram of the pre-scheduling process of a virtual machine provided in an embodiment of the present application;
[0063] Figure 8 A schematic diagram of a matching process between multiple virtual machines and multiple service nodes provided in an embodiment of the present application;
[0064] Figure 9 A schematic diagram of the virtual machine hot migration process provided in an embodiment of the present application;
[0065] Figure 10 A schematic diagram of the structure of a virtual machine migration device provided in an embodiment of the present application;
[0066] Figure 11 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0067] Figure 12 A schematic diagram of the structure of the server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to enable those skilled in the art to better understand the solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of this application.
[0069] It is understandable that in the specific implementation of this application, when privacy data and other related data are involved, when the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0070] In addition, when the embodiment of the present application needs to obtain privacy data and other related data, it will obtain separate permission or separate consent for the company logo and administrator logo and other related data through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent for the company logo and administrator logo and other related data, it will obtain the necessary privacy data and other related data for the normal operation of the embodiment of the present application.
[0071] It should be noted that some processes described in the specification, claims, and figures above include multiple steps that appear in a specific order. However, it should be understood that these steps may be executed in a different order than the order in which they appear herein or in parallel. The step numbers are used solely to distinguish between the different steps and do not themselves represent any order of execution. Furthermore, terms such as "first," "second," or "target" are used herein to distinguish similar objects and are not necessarily used to describe a specific order or precedence.
[0072] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0073] The embodiments of the present application provide a virtual machine migration method, apparatus, computer-readable storage medium, and computer equipment. Specifically, the embodiments of the present application will be described from the dimension of a virtual machine migration apparatus, which can be specifically integrated into a computer device, which can be a server or a user terminal or other device. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The user terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart home appliance, car terminal, intelligent voice interaction device, aircraft, etc., but is not limited to this.
[0074] It should be noted that the virtual machine migration method provided in the embodiments of the present application can be applied to resource recovery scenarios of cloud services, such as storage, computing power and other resource recovery scenarios. These scenarios are not limited to being implemented through cloud technology or other methods, and are specifically described through the following embodiments:
[0075] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to enable data computing, storage, processing, and sharing. Specifically, cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that can be used on demand, providing flexibility and convenience. Cloud computing technology will become a crucial support. Backend services for technical network systems, such as those for video sites, image sites, and more portals, require significant computing and storage resources. With the rapid development and application of the internet industry, every item will likely have its own unique identification mark in the future, requiring transmission to backend systems for logical processing. Data of varying levels will be processed separately, and all types of industry data will require a strong system backend, which can only be achieved through cloud computing.
[0076] Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides resources is called a "cloud." To users, the resources in the "cloud" appear to be infinitely scalable and can be accessed at any time, used on demand, expanded at any time, and paid for on a per-use basis. As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established. Various types of virtual resources will be deployed in the resource pool for external customers to choose from. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0077] Based on logical functional divisions, the PaaS (Platform as a Service) layer can be deployed on top of the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. SaaS can also be deployed directly on top of IaaS. PaaS is a platform for software execution, such as databases and web containers. SaaS is a variety of business software, such as web portals and text messaging tools. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0078] The virtual machine migration service involved in the embodiments of this application can be implemented through cloud computing. The virtual machine migration service can be applied to cloud technology, smart transportation, assisted driving, and map fields, and is specifically illustrated by the following embodiments:
[0079] Currently, cloud service platforms can build multiple physical machines to form a cloud server. This cloud server can be a distributed system to constitute cloud service resources, which are used to support / provide services such as the operation of software applications and data storage. For example, customers such as enterprises and individuals can lease cloud resources from cloud service platforms and build virtual machines corresponding to their business needs on the cloud servers to support the operation of business applications. It should be noted that due to the ambiguity of customer business needs, the resource usage of each physical machine in the cloud service resource system is inconsistent, and it is easy to cause one or more physical machines in the cloud service resource system to have fragmented resources, that is, a physical machine may have a low amount of remaining available resources, which makes the fragmented resources of the physical machine unusable.
[0080] To address the aforementioned issues, the embodiments of the present application require simultaneous scheduling of multiple virtual machines. Prior to scheduling, migration matching is performed between the multiple virtual machines and multiple physical machine service nodes. Specifically, the migration relationships can be matched based on the real-time attribute information of each virtual machine and the current operating status of each physical machine node. This allows each virtual machine to be subsequently migrated according to the matching migration relationships. This improves the accuracy of virtual machine migration scheduling, ensures the stability of the physical machines of cloud service resources, and improves cloud resource utilization. Please refer to the following specific embodiments for details.
[0081] For example, see Figure 1 , which is a scenario diagram of the virtual machine migration system provided in an embodiment of the present application. The device in the scenario system may include a server. The server can directly execute the virtual machine migration method of the embodiment of the present application to migrate the virtual machine on the service node, and migrate the virtual machine on the service node to the target service node to make full use of the resources on the service node and realize the integration of fragmented resources of the service node.
[0082] Specifically, the system includes a server and a cloud service system. The server in the system can be understood as a central control server. The cloud service system can be a distributed system composed of multiple service nodes (physical machines). The central control server can be used to manage the resources of each service node in the cloud service system, such as migrating virtual machines deployed on the service nodes between service nodes. For example, the (central control) server can identify a first service node set from the service node cluster from which virtual machines can be migrated and a second service node set from which virtual machines cannot be migrated; for each target virtual machine on the first service node in the first service node set, a corresponding scheduling task is created; based on the attribute information of each target virtual machine and the operating information of each second service node in the second service node set, a migration priority order between each second service node is arranged for each target virtual machine; based on the migration priority order, a migration matching relationship is established between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set; and the target virtual machine on the corresponding first service node is migrated to the target service node in the second service node set according to the migration matching relationship.
[0083] For example, taking the business virtual machine migration scenario in the leasing of cloud computing resources as an example, it is assumed that platform A has built a cloud service (such as a public cloud) resource system, and each customer is collectively referred to as enterprise B. In order to meet business operation needs, enterprise B can purchase the right to use cloud resources from platform A and deploy virtual machines on at least one service node in the cloud service resource system built by platform A. In this way, virtual machines for multiple customer businesses can be deployed in the cloud service resource system; when there is a "fragmented resource" phenomenon among multiple service nodes in the cloud service resource system, the central control server of platform A can schedule the virtual machines in the service nodes to integrate the resources of the service nodes. Specifically, the central control server can first divide the service nodes in the cloud service resource system (i.e., the service node cluster) into a first service node set from which virtual machines can be migrated and a second service node set from which virtual machines cannot be migrated according to the standard of whether the service nodes can migrate virtual machines; then, it can determine whether the virtual machines need to be migrated according to the size of the virtual machines of each customer contained on each first service node and the load size (or the size of the occupied resources) of the virtual machines, so as to select the target virtual machines that need to be migrated on each first service node; in addition, the target virtual machines on the first service node can also be selected according to the accumulated running time of the virtual machines, or the target virtual machines on the first service node can be determined according to one or more factors; however, for the target virtual machines that need to be scheduled on each first service node in the first service node set, For each target virtual machine, corresponding scheduling tasks are created in the queue of tasks to be scheduled. It should be noted that only one target virtual machine is scheduled in the same migration batch in each first service node. Then, the attribute information of each target virtual machine and the operation information of each second service node in the second service node set are combined to arrange the migration priority order for each target virtual machine when facing each second service node, that is, to determine which second service node is more suitable as the migration destination for a certain target virtual machine. Furthermore, based on the migration priority order, a migration matching relationship is established between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set. Finally, the target virtual machine on the corresponding first service node is migrated to the corresponding target service node in the second service node set according to the migration matching relationship.
[0084] It should be noted that the above is only an example and can also be applied to other virtual machine migration scenarios, which are not described in detail here.
[0085] For ease of understanding, each step of the virtual machine migration method will be described in detail below. It should be noted that the order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0086] In the embodiment of the present application, the virtual machine migration device will be described from the perspective of the virtual machine migration device, which can be integrated into a computer device, such as a server. Figure 2 , Figure 2 This is a flowchart of the steps of the virtual machine migration method provided in an embodiment of the present application. In this embodiment of the present application, the virtual machine migration device is specifically integrated into a server as an example. When the processor on the server executes the program instructions corresponding to the virtual machine migration method, the specific process is as follows:
[0087] 101. Identify, from a service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated.
[0088] In an embodiment of the present application, in order to integrate the fragmented resources in the service node cluster, the virtual machine on a certain service node can be migrated to the corresponding target service node to realize the use of the fragmented resources in the target service node, so as to improve the utilization rate of the resources in the target service node cluster, and at the same time increase the available resources of the service node from which the target virtual machine is migrated, thereby realizing the resource integration of the service node cluster.
[0089] It should be noted that, in the same migration batch, a service node can only migrate one virtual machine in or out, that is, in the service node set, there is at least one service node that migrates out a virtual machine and one service node that migrates in a virtual machine in the same batch. It is understandable that the number of service nodes that migrate out virtual machines is less than or equal to the number of service nodes that migrate in virtual machines. In the embodiment of the present application, when integrating fragmented resources in the service node set, it is necessary to identify the service node set from which virtual machines can be migrated out and the service node set from which virtual machines cannot be migrated out from the service node cluster.
[0090] The service node cluster can be a collection of multiple service nodes, which together form a cloud service resource system, such as a public cloud system. These multiple service nodes can communicate with each other to implement data interaction processes such as virtual machine migration between service nodes. For example, a cloud service provider builds a public cloud system based on multiple physical machines (computer devices with processors). Each physical machine can be considered a service node. In addition, each service node can also be composed of multiple physical machines. For example, service nodes can be differentiated by geographic location, with one or more physical machines at the same latitude and longitude or world coordinates being considered a service node. Multiple service nodes (i.e., a service node cluster) constitute a distributed public cloud system.
[0091] Among them, a virtual machine can be a simulated independent computer system. Specifically, a virtual machine can be understood as a complete computer system simulated by software, with complete hardware system functions, and running in a completely isolated environment. Its main independent computing power can be used to deploy related business programs to run corresponding business processes. For example, assuming that there are many hardware resources on a service node, in order to improve the utilization of the service node resources, the service node can be divided into multiple isolated environment spaces, each of which can deploy a virtual machine. In this way, multiple virtual machines can be deployed on a service node, so that a service node has multiple independent computer systems. It should be noted that when dividing into multiple isolated environment spaces, the hardware resources of the service node need to be divided, such as dividing part of the hard disk and part of the memory of the physical machine of the service node. The size of the hard disk and memory can be determined according to actual conditions, such as the resources required by the customer's business virtual machine, or according to the usage rights purchased by the customer. This is not limited here.
[0092] The first service node set is a service node set from which virtual machines can be migrated, and may include one or more first service nodes. Each first service node has at least one virtual machine deployed thereon, and the virtual machines deployed on each first service node can be migrated.
[0093] Among them, the second service node set is a service node set that cannot migrate virtual machines, and the second service node set includes one or more second service nodes. Each second service node can also be deployed with a virtual machine or container group, which is not limited here. It should be noted that each second service node cannot be vacated due to certain factors. For example, the virtual machine deployed by the service node is overloaded, or the service node contains non-migratable system components. The presence of the above factors may cause the components or virtual machines deployed on the corresponding service node to be unable to be vacated; in addition, if the amount of available resources on the service node is zero or less than the preset resource amount threshold, it means that the resource utilization rate on the current service node is high, and generally there is no "fragmented resource". In order to reduce the workload during scheduling, the virtual machines, components, etc. on the service node do not need to be migrated, so that the service node with an available resource amount of zero or less than the preset resource amount threshold is used as the second service node to keep the service node running. In the embodiment of the present application, the above service node that cannot be vacated, does not need to migrate out the virtual machine, or cannot migrate out the virtual machine is determined as the second service node.
[0094] In an embodiment of the present application, when dividing a service node cluster, it is possible to determine whether the service node contains a virtual machine, whether the service node contains a system operation component, whether the load of the target virtual machine in the service node meets the expected load conditions, and whether the available resources on the service node are zero or less than a preset resource threshold, etc. According to one or more of the above combined judgment conditions, the service node cluster is divided into a first service node set from which virtual machines can be migrated and a second service node set from which virtual machines cannot be migrated. It should be noted that the division of the service node cluster can have a time limit. For example, the service node cluster can be divided once before each migration batch / migration round, which is not limited here.
[0095] In some implementations, to improve the success rate of virtual machine migration, the service node cluster can be divided according to a simulated evacuation method. For example, step 101 may include: performing a simulated evacuation on each service node in the service node cluster to obtain a simulated evacuation result corresponding to each service node; and based on the simulated evacuation result corresponding to each service node, dividing each service node in the service node cluster to obtain a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated.
[0096] Among them, simulated evacuation refers to predicting the evacuation of a service node through simulation, which mainly predicts whether the service node can be evacuated, for example, predicting whether the components and virtual machines installed / deployed on the service node can be migrated.
[0097] Specifically, the simulated evacuation process can be as follows: first, for each service node in the service node cluster, the business type of the target business deployed on the service node can be identified, and based on the business type, a set of to-be-confirmed service nodes consistent with the preset business type can be screened from the service node cluster. Then, a compatibility prediction of the virtual machine is performed on each service node in the to-be-confirmed service node set; the purpose of the compatibility prediction is mainly to predict whether the virtual machine on the current service node can be compatible with other service nodes after migration. For example, the compatibility prediction process can be as follows: identifying the resource category of each to-be-confirmed service node in the to-be-confirmed service node set that has a virtual machine deployed thereon; for each resource category, determining other service nodes in the to-be-confirmed service node set that have the same resource category as the resource category, and determining the available resources on the other service nodes; and determining the simulated evacuation results of the to-be-confirmed service nodes of the corresponding resource category based on the available resources of the other service nodes. Among them, the process of determining the simulation evacuation result is: other service nodes whose available resource amount is greater than the preset resource amount threshold are determined as candidate service nodes. If the number of candidate service nodes is greater than the preset number threshold, then the simulation evacuation result of the current candidate service node corresponding to the resource category of the candidate service node is confirmed to be simulation passed; otherwise, the simulation evacuation result of the current candidate service node corresponding to the resource category of the candidate service node is confirmed to be simulation failed.
[0098] Furthermore, the service node cluster is divided based on the simulation evacuation results. Specifically, the service node in the service node cluster with a simulation pass result is confirmed as the first service node from which the virtual machine can be migrated, thereby obtaining a first service node set. The service node in the service node cluster with a simulation fail result is confirmed as the second service node from which the virtual machine cannot be migrated, thereby obtaining a second service node set.
[0099] In some embodiments, in the case where the amount of remaining available resources on a service node is low (i.e., fragmented resources), if migrating virtual machines with a large running load is not conducive to the integration of fragmented resources, the service node set can be divided according to the load of the deployed virtual machines. For example, step 101 may include: for each service node in the service node cluster, detecting the running load of each virtual machine on the service node, if it is detected that the running load of at least one virtual machine on the service node is less than or equal to a preset load threshold, then determining the service node with the running load of at least one virtual machine less than or equal to the preset load threshold as the first service node from which the virtual machine can be migrated, thereby obtaining a first service node set, and determining the service node with the running load of any virtual machine greater than the preset load threshold as the second service node from which the virtual machine cannot be migrated, thereby obtaining a first service node set and a second service node set.
[0100] In some embodiments, in order to maximize the integration of fragmented resources in a service node cluster, some service nodes may be vacated as much as possible during the cloud resource integration process to be used for the subsequent deployment of virtual machines with high resource requirements. To this end, the service node cluster may be classified based on the total load of the virtual machines currently on each service node. For example, step 101 may include: for each service node in the service node cluster, obtaining the total load of the virtual machines deployed on the service node; determining the service node whose total load of the virtual machine is less than or equal to a preset load threshold as the first service node from which the virtual machine can be migrated, thereby obtaining a first service node set; determining the service node whose total load of the virtual machine is greater than the preset load threshold as the second service node from which the virtual machine cannot be migrated, thereby obtaining a second service node set; wherein the number of first service nodes is less than or equal to the number of second service nodes.
[0101] It should be noted that if the total load of the virtual machines deployed on the service nodes is too large, it will increase the difficulty of vacating the service nodes. In order to improve the resource utilization of the service node cluster, service nodes that can be vacated can be selected for virtual machine scheduling to migrate the virtual machines on the vacated service nodes to the target service nodes with "fragmented resources". On the one hand, the "fragmented resources" on the target service nodes can be fully utilized, and on the other hand, the vacated service nodes can be better used for the deployment of subsequent business virtual machines, thereby improving the resource utilization of the entire service node cluster.
[0102] Among them, when classifying the service node cluster, the total load of all virtual machines deployed in each service node can be calculated, and the total load of the virtual machines in each service node can be compared with the preset load threshold. On the one hand, if the total load of the virtual machines in the service node is less than or equal to the preset load threshold, it means that the service node is relatively easy to vacate. The service node with the total load of such virtual machines less than or equal to the preset load threshold can be determined as a vacated node, which can participate in the subsequent virtual machine migration. That is, this type of service node is defined as the first service node that can migrate virtual machines in the embodiment of the present application, and the first service node set is obtained in the above manner; on the other hand, if the total load of the virtual machines in the service node is greater than the preset load threshold, it means that the service node is relatively easy to vacate. The service node with the total load of such virtual machines greater than the preset load threshold can be determined as an unvacated node, which can be used as the migration destination of the virtual machine in the scheduling process. That is, this type of service node is defined as the second service node that cannot migrate virtual machines in the embodiment of the present application, and the second service node set is obtained in the above manner. It should be noted that, since the concurrent scheduling unit of each service node is one virtual machine in the same scheduling round, that is, one virtual machine is migrated in or out, for each virtual machine migrated out of the first service node, a second service node must be found for migration. Therefore, the number of second service nodes must be greater than or at least equal to the number of first service nodes to ensure the feasibility of the scheduling process.
[0103] Through the above method, the service nodes in the service node cluster can be divided to determine the first service node set that needs to migrate out the virtual machine and the second service node set that does not need to migrate out the virtual machine. Subsequently, the second service node set is used as the service node set for migrating into the virtual machine, so as to achieve resource integration by executing virtual machine scheduling.
[0104] 102. Create corresponding scheduling tasks for each target virtual machine on each first service node in the first service node set.
[0105] In an embodiment of the present application, after the service node set is divided into a first service node set to which virtual machines can be migrated and a second service node set to which virtual machines cannot be migrated, in order to be able to subsequently perform the integration of fragmented resources on the service nodes, it is necessary to first create a scheduling task for the target virtual machine that needs to be migrated to add it to the queue of tasks to be scheduled. Specifically, in the queue of tasks to be scheduled, corresponding scheduling tasks are created for each target virtual machine that needs to be scheduled in the first service node, so that the migration of the target virtual machine can be performed subsequently for the scheduling task.
[0106] Among them, the queue of tasks to be scheduled can be a virtual machine task queue, which is used to store the scheduling tasks of one or more virtual machines in each scheduling round / migration batch, representing the amount of scheduling tasks involved in a scheduling round / migration batch, that is, the number of migrations of virtual machines.
[0107] Among them, the scheduling task is a task for the target virtual machine that needs to be scheduled / migrated, which is used to indicate the migration requirements of the target virtual machine and subsequently instruct the scheduling of the target virtual machine. Each scheduling task is not limited to including the business type of the corresponding target virtual machine, the operating load, the identifier of the first service node currently deployed (before scheduling) (such as the physical machine address, the service node number), and the resource configuration identifier of the currently deployed first service node (such as the number of the occupied CPU, the code of the hard disk, the address number of the memory, etc.), which is used to indicate / indicate the relevant situation of the target virtual machine that needs to be scheduled, so that the migration scheduling work can be performed on the corresponding target virtual machine according to the instruction information of the scheduling task.
[0108] In some embodiments, for each first service node in the set of first service nodes, a target virtual machine to be migrated may be selected from each first service node based on the size of the running load, and then a corresponding scheduling task may be created for the target virtual machine in the queue of tasks to be scheduled. For example, step 102 may include: for each first service node in the set of first service nodes, reading the running load of each virtual machine deployed on the first service node, and selecting the virtual machine with the smallest running load from each first service node as the target virtual machine; and creating a corresponding scheduling task in the queue of tasks to be scheduled for the target virtual machine on each first service node.
[0109] The running load may refer to the load of the target virtual machine when it runs on the first service node. Specifically, the load may be the load of running resources such as CPU, memory, storage, etc. when the virtual machine is running.
[0110] It should be noted that the embodiments of the present application are mainly aimed at integrating fragmented resources on the service nodes in the service node cluster. The fragmented resources refer to the small amount of available resources remaining on the corresponding service nodes. Integrating the fragmented resources can be understood as making the most of the remaining available resources on the service nodes. In this regard, when selecting a virtual machine for migration, a virtual machine with a smaller load on the service node can be selected as the target virtual machine to be migrated. On the one hand, this allows the target service node to be subsequently migrated to meet the load requirements of the target virtual machine. On the other hand, it improves the efficiency of the subsequent migration of the target virtual machine.
[0111] Through the above method, a corresponding scheduling task can be created in the to-be-scheduled task queue for each target virtual machine determined to be scheduled in the first service node, wherein the scheduling task may include relevant status information and scheduling instructions of the target virtual machine, so that the target virtual machine can be subsequently migrated from the corresponding first service node to other service nodes based on the instructions of the scheduling task, thereby realizing the adjustment of resource utilization in the service node cluster.
[0112] In an embodiment of the present application, in order to improve the operational stability of the service nodes of the service node cluster before and after scheduling, a delayed scheduling strategy can be adopted. The delayed scheduling strategy can be understood as starting the scheduling process for the number of scheduled tasks in the task queue to be scheduled, and only when the number of scheduled tasks is greater than or equal to the preset task volume threshold. When the number of scheduled tasks is too small, the scheduling of the target virtual machine is delayed. Specifically, in the same migration batch / scheduling round, when the number of scheduled tasks reaches the expected task volume, the attribute information of each target virtual machine and the operating information of multiple service nodes can be measured to match the migration relationship based on the status of each target virtual machine and the status of each service node, thereby improving the accuracy and feasibility of virtual machine scheduling, so that the service node cluster can run as stably as possible after subsequent scheduling.
[0113] In some embodiments, the initiation of scheduled tasks is determined by a delayed matching strategy. For example, after step 102 or before step 103, the process may further include: identifying the total number of scheduled tasks; then step 103 may include: if the total number of scheduled tasks is greater than a preset task quantity threshold, arranging a migration priority order between each second service node for each target virtual machine based on the attribute information of each target virtual machine and the operating information of each second service node in the set of second service nodes.
[0114] The preset task volume threshold can be understood as the starting threshold for a scheduling round, used to determine whether the number of scheduled tasks in the task queue to be scheduled meets the scheduling quantity. The preset task volume threshold can be set based on the number of service nodes in the service node cluster. For example, the preset task volume threshold can be set based on the percentage of the total number of service nodes in the service node cluster. For example, assuming that the service node cluster contains 100 service nodes and the task volume threshold is set at 10%, the preset task volume threshold is 10; it should be noted that the preset task volume threshold must be less than 50% of the total number of service nodes. In addition, the preset task volume threshold can also be determined based on the number of service nodes that can be vacated in the service node cluster. For example, assuming that the first service node that can migrate a virtual machine is a vacated service node, the number of first service nodes is determined, and the preset task volume threshold is determined based on the percentage of the number of first service nodes. In addition, the historical operation records of the service nodes can be obtained, and the target operation period with the longest operation time after scheduling of the service node cluster can be determined from the historical operation records. The number of historical scheduled tasks associated with the target operation period is determined, and the preset task volume threshold is determined based on the number of historical scheduled tasks. The above is only an example and is not intended to be a specific limitation for the implementation of this application.
[0115] It should be noted that the scheduling work will only be started when the number of scheduling tasks meets the task volume threshold. For example, the priority of each second service node is sorted from the perspective of the target virtual machine, and the priority of each target virtual machine is sorted at the second service node, so that multiple target virtual machines can be matched with a service node to be migrated from a global perspective, laying the foundation for the stable operation of the subsequent service node cluster.
[0116] 103. Arrange a migration priority order among the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node in the second service node set.
[0117] In an embodiment of the present application, after starting the scheduling process, first, it is necessary to evaluate the advantages and disadvantages of each second service node relative to each target virtual machine after migration, that is, to evaluate the advantages and disadvantages of migrating to each second service node for each target virtual machine. Specifically, according to the attribute information of each target virtual machine and the operation information of each second service node, the migration priority between each target virtual machine and each second service node can be arranged, so that a more suitable target second service node can be selected / matched for each target virtual machine based on the migration priority.
[0118] The attribute information may include the target virtual machine's service type, operating load, operating resource type / resource configuration specifications (e.g., CPU, hard disk, memory, and other configuration parameters, such as model and size), and operating duration. This attribute information may indicate the operating status of the corresponding target virtual machine. This attribute information may be determined based on the scheduling task or directly obtained from the first service node where the corresponding target virtual machine is currently located, and is not limited here.
[0119] Among them, the operating information can be the operating parameters of the corresponding second service node, which is not limited to information such as the number of virtual machines originally deployed on the second service node, the operating load, the amount of available resources (the number of CPUs, memories or hard disks), etc. The operating information can reflect the operating status of the corresponding second service node.
[0120] Among them, the migration priority includes the arrangement relationship between multiple second service nodes, and the sorting order is relative to the corresponding target virtual machine, that is, each target virtual machine has an independent migration priority, which represents the priority of each second service node in the second service node set relative to the target virtual machine when making a migration decision. Subsequently, the migration matching relationship can be executed for the corresponding target virtual machine according to the migration priority.
[0121] In some embodiments, when sorting the migration priority order for each target virtual machine to migrate to a node, in order to ensure that the resource type (or resource configuration specification) on the service node matches the operating conditions of the target virtual machine, the second service node set can be filtered according to the dimension of resource type, and the multiple service nodes obtained after filtering are prioritized. For example, if the attribute information of each target virtual machine includes the operating resource type and operating parameters, step 103 may include:
[0122] (a.1) Based on the running resource type of each target virtual machine, filter the second service node set to obtain a set of candidate service nodes;
[0123] (a.2) For each target virtual machine, according to the operating parameters of the target virtual machine and the operating information of each second service node in the set of candidate service nodes, a migration priority order for each second service node in the set of candidate service nodes is arranged for the current target virtual machine.
[0124] Among them, the running resource type can be the resource configuration specification allocated to the target virtual machine by the first service node where the corresponding target virtual machine is located. The running resource type is not limited to including resource model, resource configuration size, resource configuration number, etc. Exemplarily, the running resource type can include the model of CPU, memory and hard disk, operating system, the number of allocated CPU cores, memory space, hard disk storage capacity and other configurations, as well as the number of allocated CPU computing cores, memory address number and hard disk address number. The service nodes in the second service node set are filtered according to the above resource configuration specifications to obtain a set of candidate service nodes that meet the resource configuration specifications; the above is only an example and is not intended to be a limitation of this application.
[0125] The operating parameters are the operating data of the target virtual machine, which can reflect the operating status of the corresponding target virtual machine on the deployed first service node. The operating parameters are not limited to the operating load and operating duration of the corresponding target virtual machine. The operating load can be the load of any resource (such as the CPU) configured for the corresponding target virtual machine. The operating duration refers to the continuous operating time of the target virtual machine after deployment. The operating duration can represent the duration of the corresponding customer's demand for cloud resources as of the current moment.
[0126] Specifically, when ranking each target virtual machine to determine a migration priority among the second service nodes, for each target virtual machine, the operating resource type of the current target virtual machine can be first determined, and the service nodes in the set of second service nodes can be filtered according to the operating resource type to obtain a set of candidate service nodes that meet the operating resource type of the target virtual machine. This ensures that the second service nodes participating in the subsequent ranking meet the resource type requirements of the target virtual machine. It should be noted that the second service nodes in the set of candidate service nodes corresponding to each target virtual machine are different. Thereafter, a migration priority is determined for each target virtual machine among the second service nodes in the set of candidate service nodes. It should be noted that since the priority ranking of each second service node is relative to the corresponding target virtual machine, the ranking can be performed by weighing the operating parameters of the current target virtual machine and the operating information of each second service node in the set of candidate service nodes. Specifically, the priority score of each second service node in the set of candidate service nodes relative to the corresponding target virtual machine can be calculated, and then the second service nodes in the set of candidate service nodes can be ranked based on the priority score of each second service node.
[0127] Among them, the priority score of each second service node relative to the corresponding target virtual machine is calculated, and the process is as follows: on the one hand, the state score of the target virtual machine is determined based on the operating parameters of the target virtual machine. For example, taking the operating parameters including the operating load and the operating duration as an example, the resource load score is determined according to the size of the operating load, and the operating score is determined according to the operating duration. It should be noted that, the longer the operating duration, the higher the operating score. The resource load score and the operating score of the target virtual machine are accumulated to obtain the state score; on the other hand, the operating information of the second service node includes information such as the number of deployed target virtual machines and the amount of available resources. The resource protection score is determined according to the size of the available resources, and the corresponding resource evacuation score is determined according to the number of deployed target virtual machines. The node state score of the second service node is determined according to the resource protection score and the resource evacuation score; further, the priority score of the current second service node relative to the target virtual machine is determined according to the state score and node state score of the current target virtual machine. According to the above method, for each target virtual machine, a priority score is calculated for each second service node in the set of candidate service nodes, and each second service node in the set of candidate service nodes is sorted according to the respective priority scores to obtain the migration priority order of the target virtual machine for each second service node in the set of candidate service nodes. In this way, a respective migration priority order can be obtained for each target virtual machine, so that a migration matching relationship can be established between each target virtual machine and the corresponding second service node based on the migration priority order of each target virtual machine.
[0128] In some embodiments, the target virtual machines may be prioritized for migration to each second service node based on target indicators of one or more dimensions. For example, step (103) may include: determining a first indicator parameter of the target indicator on each target virtual machine based on attribute information of each target virtual machine; determining a second indicator parameter of the target indicator on each second service node based on operation information of each second service node; traversing each target virtual machine; and when the target indicator is one of a resource quantity indicator, a load indicator, and an operation duration indicator, sorting the target virtual machines according to the difference between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine based on at least one dimension of the resource quantity indicator, the load indicator, and the operation duration indicator, to determine the admission priority order for each second service node.
[0129] Among them, the target indicator can be any characteristic item on the target virtual machine or the second service node. For example, it can be the resource quantity indicator of the target virtual machine and the second service node itself, such as the resource demand (configuration) quantity indicator of the target virtual machine, and the available resource quantity indicator of the second service node; for example, it can be the load indicator of the target virtual machine and the second service node; in addition, it can be the creation time indicator of the virtual machine.
[0130] Among them, the first indicator parameter and the second indicator parameter are specifically related to the characteristic item referred to by the target indicator, and they can be understood as the characteristic values referred to by the target indicator respectively. For example, when the target indicator is a resource quantity indicator, the first indicator parameter can be the resource configuration quantity of the target virtual machine, and the second indicator parameter can be the available resource quantity of the second service node; for another example, when the target indicator is a load indicator, the first indicator parameter can be the operating load quantity of the target virtual machine, and the second indicator parameter can be the operating load quantity of the second service node; for another example, if the target indicator is a virtual machine creation duration indicator, the first indicator parameter can be the creation duration of the target virtual machine in the current first service node, and the second indicator parameter can be the average creation duration of all virtual machines currently deployed in the second service node.
[0131] In an embodiment of the present application, since each target virtual machine has its own migration priority, the migration priorities of different target virtual machines may be partially the same, which may affect the migration matching between the target virtual machine and the second service node, for example, multiple target virtual machines are matched to one second service node. For example, assume that there are two target virtual machines, a and b, and three second service nodes, A, B and C. Assume that the migration priority of target virtual machine a for the second service nodes A, B and C is A>C>B, and the migration priority of target virtual machine b for the second service nodes A, B and C is A>B>C. Then the first priority in the migration priority of target virtual machine a and target virtual machine b is the second service node A. It should be noted that when the second service node to be migrated is matched for each target virtual machine according to the migration priority of each target virtual machine, target virtual machine a and target virtual machine b will be matched to the second service node A at the same time. Since the service nodes are concurrently scheduled in the same scheduling round, that is, the concurrent amount of migration in or out is 1 virtual machine, the phenomenon that "target virtual machine a and target virtual machine b will be matched to the second service node A at the same time" may cause the migration of the two target virtual machines to fail, or cause system disorder, crash, etc. In order to eliminate the above problems, when matching the target virtual machine with the second service node to be migrated, the embodiment of the present application, in addition to referring to the migration priority of each target virtual machine for each second service node, can also further refer to the acceptance priority of each second service node for each target virtual machine. After matching each target virtual machine with the second service node to be migrated in combination with the migration priority of each target virtual machine, when multiple target virtual machines are matched to the same second service node at the same time, the target virtual machines are further reallocated in combination with the acceptance priority of each second service node for each target virtual machine, so as to achieve a comprehensive assessment of multi-dimensional priorities to match each target virtual machine with a second service node, and ensure that each target virtual machine is separately matched with a second service node to be migrated, thereby improving the accuracy of virtual machine scheduling.
[0132] Based on this, in addition to determining the migration priority of each target virtual machine, it is also necessary to determine the admission priority of each second service node for each target virtual machine. Specifically, based on the attribute information of each target virtual machine and the operating information of each second service node, each second service node is ranked to determine the admission priority for each target virtual machine. The description of attribute information and operating information can be found above, and the admission priority can be the priority ranking of the second service node's admission permission for each target virtual machine, reflecting the second service node's acceptance level for each target virtual machine.
[0133] In some embodiments, when ranking the admission priority order for each target virtual machine for each second service node, the total score of each target virtual machine relative to the current second service node can be determined at the level of each second service node by combining the status score of each target virtual machine and the node status score of the current second service node. Thus, the target virtual machines are prioritized at the level of the current second service node according to the magnitude of each total score. For example, the step of "ranking the admission priority order for each target virtual machine for each second service node based on the attribute information of each target virtual machine and the operating information of each second service node" may include: determining the status score of each target virtual machine based on the attribute information of each target virtual machine; determining the node status score of each second service node based on the operating information of each second service node; determining a simulated matching score for each second service node when performing a simulated match with each target virtual machine based on the status score of each target virtual machine and the node status score of each second service node; and ranking each target virtual machine along each second service node dimension according to the magnitude of the simulated matching score of each second service node when performing a simulated match with each target virtual machine, thereby obtaining the admission priority order for each second service node for each target virtual machine.
[0134] The status score can be the operating status score of the corresponding target virtual machine, which is mainly determined based on multiple indicators included in the attribute information of the target virtual machine. For example, the attribute information can include three characteristics: the operating time, operating load, and resource allocation of the corresponding target virtual machine. The corresponding score can be determined based on each characteristic separately, and the operating status score can be determined by combining the scores corresponding to each of the three characteristics. The specific process is as follows: based on the resource allocation of each target virtual machine, the stability score of each target virtual machine is determined; based on the operating load of each target virtual machine, the resource load score of each target virtual machine during operation is determined; based on the operating time of each target virtual machine, the operating score of each target virtual machine is determined; and the stability score, resource load score, and operating score of each target virtual machine are weighted and summed to obtain the status score of each target virtual machine. In this way, by combining multiple indicators / characteristics of the target virtual machine to evaluate its status, the target virtual machine can be subsequently combined with its status score to participate in the matching score of each second service node for the target virtual machine, thereby participating in the scheduling decision for the target virtual machine through the score.
[0135] Among them, the node status score can be the operating status score of the corresponding second service node, which is determined based on the operating information of the corresponding second service node. For example, the operating information includes at least two information indicators: the number of virtual machines currently deployed by the second service node and the amount of available resources of the second service node. First, determine the score corresponding to each information indicator, and then perform weighted summation based on the scores of the two information indicators to obtain the node status score of the second service node. Subsequently, the score can be combined to participate in the calculation of the score of the second service node for each target virtual machine.
[0136] The simulated matching score can be a matching score between the corresponding second service node and the corresponding target virtual machine, which can measure the matching or compatibility between the corresponding second service node and the target virtual machine. When there are multiple target virtual machines, the simulated matching score can be used to represent the current second service node's admission priority for the corresponding target virtual machine, so as to determine the merits of each target virtual machine at the second service node level. The simulated matching score can be determined by combining the sub-scores of the target virtual machine's status score and the second service node's node status score, so as to comprehensively evaluate the second service node's admission priority for the target virtual machine based on the status of both the second service node and the target virtual machine.
[0137] Among them, the admission priority order can be the ranking relationship of the admission priority of the corresponding second service node for each target virtual machine, that is, the admission priority order can include the priority ranking between multiple target virtual machines corresponding to all scheduled tasks in the task queue to be scheduled, and can also include the priority ranking between multiple target virtual machines corresponding to some scheduled tasks in the task queue to be scheduled, which is not limited here. The admission priority order can be confirmed in a variety of ways. For example, when determining the admission priority order, a simulated matching score can be constructed between each second service node level and each target virtual machine, and the target virtual machines can be ranked according to the size relationship between the simulated matching scores to determine the admission priority ranking relationship. For example, assume there are three second service nodes and two target virtual machines to be scheduled. The node status scores of these two second service nodes are 35 and 43, respectively. Assume the status score of the first target virtual machine is 63, and the status score of the second target virtual machine is 76. At the level of the first second service node, the simulated matching score between the first second service node and the first target virtual machine is 98, and the simulated matching score between the first second service node and the second target virtual machine is 111. Therefore, the admission priority order is that the second target virtual machine has a higher priority than the first target virtual machine. Similarly, for the second second service node, based on the score sorting, the admission priority order is that the second target virtual machine has a higher priority than the first target virtual machine. The above is only an example.
[0138] In some embodiments, a matching comparison can be performed based on the characteristic indicator values of the same dimension on the target virtual machine and the service node, and the second service node can be sorted to determine the admission priority order for each target virtual machine based on the difference value obtained from the matching comparison. For example, the step of "sorting the admission priority order for each target virtual machine for each second service node based on the attribute information of each target virtual machine and the operating information of each second service node" can include:
[0139] (b.1) determining a first indicator parameter of a target indicator on each target virtual machine based on attribute information of each target virtual machine;
[0140] (b.2) determining a second indicator parameter of the target indicator on each second service node based on the operation information of each second service node;
[0141] (b.3) For each second service node, sort the admission priority order for each target virtual machine according to the difference between the first indicator parameter of the target virtual machine and the second indicator parameter of each second service node.
[0142] Among them, the target indicator can be any characteristic item on the target virtual machine or the second service node. For example, it can be the resource quantity indicator of the target virtual machine and the second service node itself, such as the resource demand (configuration) quantity indicator of the target virtual machine, and the available resource quantity indicator of the second service node; for example, it can be the load indicator of the target virtual machine and the second service node; in addition, it can be the creation time indicator of the virtual machine.
[0143] Among them, the first indicator parameter and the second indicator parameter are specifically related to the characteristic item referred to by the target indicator, and they can be understood as the characteristic values referred to by the target indicator respectively. For example, when the target indicator is a resource quantity indicator, the first indicator parameter can be the resource configuration quantity of the target virtual machine, and the second indicator parameter can be the available resource quantity of the second service node; for another example, when the target indicator is a load indicator, the first indicator parameter can be the operating load quantity of the target virtual machine, and the second indicator parameter can be the operating load quantity of the second service node; for another example, if the target indicator is a virtual machine creation duration indicator, the first indicator parameter can be the creation duration of the target virtual machine in the current first service node, and the second indicator parameter can be the average creation duration of all virtual machines currently deployed in the second service node.
[0144] Specifically, in order to determine the acceptance priority of the second service node for each target virtual machine, for any target virtual machine and any second service node, it is necessary to determine the indicator parameters of the target virtual machine and the second service node on the target indicator of the same dimension, that is, the first indicator parameter of the target virtual machine and the second indicator parameter of the second service node; then, the difference value between the first indicator parameter of any target virtual machine and the second indicator parameter of any second service node can be determined on the target indicator of the same dimension; finally, at the same second service node level, the acceptance priority for the target virtual machine is arranged according to the size of the difference value.
[0145] It should be noted that if there are multiple target virtual machines with the same difference value on the same target indicator as the same second service node, that is, for the same second service node, it is impossible to complete the admission priority ranking between these multiple (at least two) target virtual machines on the same target indicator, then it is determined that the current ranking needs to be improved, and the current ranking is defined as the initial ranking. At this time, on the basis of the initial ranking, the ranking relationship of other target virtual machines in the initial ranking is kept unchanged, and for multiple target virtual machines whose admission priority cannot be distinguished from the second service node, the multiple target virtual machines whose admission priority cannot be distinguished are ranked according to the first indicator parameter and the second indicator parameter of another target indicator dimension, and the partial ranking relationship for the multiple target virtual machines is updated to the initial ranking to determine the admission priority order of the second service node for each target virtual machine.
[0146] In some embodiments, the second service node can be sorted for admission priority for each target virtual machine based on target indicators of one or more dimensions. For example, if the target indicators are not limited to resource quantity indicators, load indicators, and operating time indicators, step (b.3) may include: traversing each second service node; according to at least one dimension of the resource quantity indicator, load indicator, and operating time indicator, and based on the difference value between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine, sorting the admission priority for each target virtual machine for the second service node.
[0147] Among them, the meanings of the first indicator parameter and the second indicator parameter are different in different target indicator dimensions. For the first indicator parameter and the second indicator parameter, please refer to the above and will not be repeated here.
[0148] It should be noted that when the second service node performs admission priority sorting for each target virtual machine based on target indicators of multiple dimensions, the embodiment of the present application does not limit the order of polling use between the target indicators of these multiple dimensions. For example, the target indicator can be one of the resource quantity indicator, load indicator and running time indicator. Any target indicator can be used as the first sorting, and another target indicator can be used on the basis of the first sorting to further sort some target virtual machines that cannot be sorted, and so on, until the admission priority sorting is completed for each target virtual machine for the second service node.
[0149] For example, the target virtual machines are sorted in the order of resource quantity index, load index, and operation time index. Specifically, for each second service node, the difference value between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine is determined in terms of resource quantity index, load index, and operation time index respectively; if the difference values corresponding to any two target virtual machines in terms of resource quantity index are different, the first sorting is obtained according to the size relationship between the difference values in terms of resource quantity index, and the first sorting is determined as the acceptance priority order of the second service node for each target virtual machine; if multiple target virtual machines with the same difference value in terms of resource quantity index are detected, the multiple target virtual machines with the same difference value in terms of resource quantity index are respectively determined as virtual machines to be confirmed, and the multiple virtual machines to be confirmed are respectively determined as virtual machines to be confirmed in terms of load index. The difference values are compared; if the difference values corresponding to the load indicators of multiple virtual machines to be confirmed are different, the second service node is sorted according to the difference values corresponding to the load indicators of the multiple virtual machines to be confirmed to obtain a second sorting for the multiple virtual machines to be confirmed, the first sorting is updated according to the second sorting to obtain a third sorting, and the third sorting is confirmed as the admission priority of the second service node for each target virtual machine; if it is detected that the difference values corresponding to the load indicators of at least two virtual machines to be confirmed are the same, then for the virtual machines to be confirmed with the same difference value in the load indicators, they are sorted according to the difference value in the running time indicator to obtain a fourth sorting, and the third sorting is updated according to the fourth sorting to obtain the admission priority of the second service node for each target virtual machine.
[0150] In this way, when the migration matching between multiple target virtual machines and multiple second service nodes cannot be completed based on each migration priority, the acceptance priority of each second service node for each target virtual machine can be further referred to to reallocate the target virtual machines, so as to achieve a comprehensive assessment of multi-dimensional priorities to match the second service node for each target virtual machine, and ensure that each target virtual machine is individually matched with a second service node to be migrated, effectively avoiding scheduling disorder of the service node cluster and improving the accuracy of virtual machine scheduling.
[0151] Through the above method, the migration priority between each second service node can be arranged for each target virtual machine according to the attribute information of each target virtual machine and the operation information of each second service node. In addition, the acceptance priority for each target virtual machine can be arranged for each second service node, so that a more suitable target second service node can be selected / matched for each target virtual machine based on the determined priority, and a migration matching relationship can be established to facilitate the subsequent concurrent migration of virtual machines.
[0152] 104. Based on the migration priority, establish a migration matching relationship between the target virtual machine corresponding to each scheduling task and a target service node in the second service node set.
[0153] In an embodiment of the present application, in order to ensure that multiple target virtual machines are not disordered during the subsequent concurrent migration, it is necessary to establish a mapping relationship between each target virtual machine and the second service node before the migration. Specifically, after determining the priority ranking between the multiple target virtual machines and the multiple second service nodes, the second step of the scheduling process can be entered. For the multiple target virtual machines, a target service node can be matched separately for the target virtual machine corresponding to each scheduling task from the multiple second service nodes from a global perspective, so that the target virtual machine corresponding to each scheduling task creates a migration matching relationship with a target service node separately, so that each target virtual machine is subsequently accurately scheduled to the corresponding target service node according to the migration matching relationship, effectively avoiding the mutual interference of multiple target virtual machines during concurrent migration during the scheduling process, and having reliability.
[0154] The target service node is a second service node in the second service node set.
[0155] Among them, the migration matching relationship can be a migration binding relationship between a target virtual machine and a target service node in the second service node set, which is used to indicate the migration direction or destination of the corresponding target virtual machine, so as to migrate the target virtual machine to the second service node mapped by the migration matching relationship in accordance with the indication of the migration matching relationship.
[0156] It should be noted that, since each target virtual machine has its own migration priority for multiple second service nodes, the migration priorities of different target virtual machines may be different or partially the same. In this regard, the matching of a target virtual machine with a second service node to be migrated to may include the following two situations: First, when matching a second service node to be migrated to for each target virtual machine, each target virtual machine is polled and a second service node to be migrated to is matched for the target virtual machine at the target virtual machine level according to its corresponding migration priority. In this case, if each target virtual machine is matched to an independent second service node according to the migration priority of each target virtual machine, the migration matching of the target virtual machine is completed. Furthermore, if the matching is performed only based on the migration priority of each target virtual machine, at least two target virtual machines may be repeatedly matched to the same second service node to be migrated to. In this case, it is necessary to combine the admission priority of the second service node for matching. Specifically, the admission priority of the second service node is obtained. For at least two target virtual machines that are repeatedly matched to the same second service node, these at least two target virtual machines are re-matched according to the obtained admission priority. The target virtual machine with a higher priority in the admission priority is selected and matched to the current second service node. The remaining target virtual machines are matched to the second service node with the next lower priority in the migration priority of the target virtual machine in the "first situation" for migration relationship. According to the above method, until all target virtual machines are individually matched to a second service node to be migrated, the migration matching between multiple target virtual machines and multiple second service nodes is completed from the global optimal solution, ensuring the feasibility of subsequent concurrent migration of multiple target virtual machines, effectively avoiding the phenomenon of virtual machine migration failure, and allocating each target virtual machine to the most suitable second service node to be migrated from a global perspective, which is beneficial to the resource integration efficiency of the service node cluster and the overall stability of the service node cluster during operation.
[0157] (A) For the first case, only the migration priorities are used to create a migration matching relationship for each target virtual machine.
[0158] In some embodiments, the migration priority of each target virtual machine is completely different, and a second service node to be migrated is matched separately for each target virtual machine based on the migration priority of each target virtual machine. For example, step 104 may include: traversing each scheduling task, and for each target virtual machine corresponding to the scheduling task, selecting a candidate service node with a higher ranking from the set of second service nodes for the corresponding target virtual machine according to the corresponding migration priority, wherein the candidate service node is the corresponding second service node; if it is determined that no migration matching relationship exists between the candidate service node, then determining the candidate service node as the target service node to be migrated for the corresponding target virtual machine, and establishing a migration matching relationship between the target service node and the corresponding target virtual machine.
[0159] When the migration priorities of the target virtual machines are completely different, it indicates that the second service nodes ranked first in the migration priorities of the target virtual machines are different. In this case, a second service node to be migrated can be individually matched for each target virtual machine based on the migration priority of each target virtual machine. Specifically, each scheduling task in the to-be-scheduled task queue is polled according to the order in which the scheduling tasks in the to-be-scheduled task queue were created. For the target virtual machine corresponding to the scheduling task, the second service node ranked first in the migration priority of the current target virtual machine is used as a candidate service node for the current target virtual machine. Then, it is detected whether the candidate service node already has a migration match relationship, that is, it is confirmed whether the current candidate service node has been matched to another target virtual machine in the current scheduling round / migration match. If it is confirmed that the current candidate service node has not been matched to another target virtual machine, the current candidate service node is used as the target service node to be migrated to establish a migration match relationship between the target virtual machine and the target virtual machine. This method is repeated until each target virtual machine corresponding to the scheduling task in the to-be-scheduled task queue is individually matched to a target service node to be migrated to, and a migration match relationship is established.
[0160] (B) For the second case, it is necessary to create a migration matching relationship for each target virtual machine based on the migration priority and the admission priority.
[0161] In some embodiments, when it is impossible to match a target service node to be migrated for the current target virtual machine based on the migration priority of the target virtual machine, a migration matching relationship can be established between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set in combination with each migration priority and each acceptance priority. For example, if the candidate service node matched for the current target virtual machine according to the migration priority has established a migration matching relationship with other previous target virtual machines in the current scheduling round, the virtual machine migration method may also include: if it is confirmed that the candidate service node already has a migration matching relationship, then determining the virtual machine to be confirmed that has a migration matching relationship with the candidate service node; obtaining the admission priority order for each target virtual machine by sorting the candidate service nodes; if it is determined that the current target virtual machine has priority over the virtual machine to be confirmed according to the admission priority order, then releasing the migration matching relationship between the candidate service node and the virtual machine to be confirmed, and using the candidate service node with the released migration matching relationship as the target service node of the current target virtual machine to establish a migration matching relationship; if it is determined that the virtual machine to be confirmed has priority over the current target virtual machine according to the admission priority order, then selecting the next candidate service node with a higher ranking from the second service node set for the corresponding target virtual machine according to the corresponding migration priority order, until the current target virtual machine establishes a migration matching relationship with the target service node in the second service node set.
[0162] Specifically, the scheduling tasks in the queue of tasks to be scheduled are polled, and for the target virtual machine corresponding to the scheduling task of the current polling progress, when a candidate service node with a higher ranking is determined from the second service node set according to the migration priority of the target virtual machine, it is confirmed whether the candidate service node has been matched by the target virtual machine corresponding to the scheduling task with a higher ranking in the queue of tasks to be scheduled, that is, it is confirmed whether the candidate service node has established a migration matching relationship with other target virtual machines before. When it is detected that the candidate service node has established a migration matching relationship with the target virtual machines corresponding to other scheduling tasks with a higher ranking in the queue of tasks to be scheduled, the target virtual machine that has established a migration matching relationship with the candidate service node is first determined, and it is defined as a virtual machine to be confirmed. Further, the acceptance priority corresponding to the candidate service node is obtained, and the acceptance priority between the virtual machine to be confirmed and the target virtual machine corresponding to the current scheduling task is queried according to the acceptance priority. On the one hand, if it is determined that the target virtual machine corresponding to the current scheduling task takes precedence over the virtual machine to be confirmed according to the acceptance priority order, the migration matching relationship between the candidate service node and the virtual machine to be confirmed is released, and after the candidate service node releases the migration matching relationship, a migration matching relationship is established between the candidate service node and the target virtual machine corresponding to the current scheduling task to match the target virtual machine corresponding to the scheduling task to the candidate service node. In addition, the virtual machine to be confirmed is returned to the queue of tasks to be scheduled, that is, a scheduling task corresponding to the virtual machine to be confirmed is created in the queue of tasks to be scheduled, so as to re-match the current virtual machine to be confirmed. On the other hand, if it is determined that the virtual machine to be confirmed has priority over the target virtual machine corresponding to the current scheduling task according to the acceptance priority order, the migration matching relationship between the current candidate service node and the virtual machine to be confirmed will continue to be maintained. Further, according to the migration priority order of the target virtual machine of the current scheduling task, the candidate service node with the next migration priority order that is ranked first is selected from the second service node set, and according to the above method, it is confirmed whether the "candidate service node with the next migration priority order" has been bound to the migration matching relationship of the scheduling round before. If not, a migration matching relationship is established between the target virtual machine corresponding to the scheduling task and the "candidate service node with the next migration priority order". If there is a migration matching relationship bound, it is confirmed whether to abandon the original migration matching relationship according to the acceptance priority order of the "candidate service node with the next migration priority order" and whether to establish a migration matching relationship with the target virtual machine corresponding to the current scheduling task. And so on, until a migration matching relationship is established between the target virtual machine corresponding to the current scheduling task and the target service node. According to the above method, the target virtual machine corresponding to each scheduling task in the scheduling task queue is individually matched with a second service node to be migrated, that is, the target service node, so that the target virtual machine of the corresponding scheduling task can be subsequently migrated to the corresponding target service node according to the migration matching relationship.
[0163] Through the above method, for multiple target virtual machines, a migration matching relationship can be created between the target virtual machine corresponding to each scheduling task and a target service node from a global perspective, so as to facilitate the accurate scheduling of each subsequent target virtual machine and ensure that multiple target virtual machines are not disordered during subsequent concurrent migration and are reliable.
[0164] 105. Migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship.
[0165] In an embodiment of the present application, after creating a migration matching relationship between the target virtual machine of each scheduling task and the corresponding target service node, the corresponding target virtual machine can be accurately migrated to the corresponding target service node based on each migration matching relationship to schedule each target virtual machine. During this scheduling process, the migration of multiple target virtual machines can be carried out concurrently until all target virtual machines are accurately migrated to their respective corresponding target service nodes, completing the scheduling of all target virtual machines, and realizing the use of fragmented resources of the second service node in the service node cluster to carry and run the target virtual machine, so as to integrate the fragmented resources on the service nodes in the service node cluster and improve the resource utilization on the service nodes.
[0166] In some embodiments, in order to prevent the virtual machine migration project from affecting the normal operation of the customer's business, for each target virtual machine, the corresponding business virtual machine can be first copied on the corresponding target service node, so that after the copied business virtual machine is created and running, the original target virtual machine can be deleted to achieve the migration of the target virtual machine. For example, step 105 may include: for each target virtual machine on the first service node, determine the target service node corresponding to the target virtual machine from the second service node set according to the corresponding migration matching relationship; mount the data storage space of the target virtual machine on the target service node, and create a candidate virtual machine consistent with the target virtual machine on the target service node, and copy the target memory data corresponding to the target virtual machine from the current first service node for the candidate virtual machine; if the copy progress of the target memory data is complete, then confirm the candidate virtual machine as the business virtual machine of the target virtual machine on the current first service node after the migration is completed, suspend the operation of the target virtual machine on the first service node and the running of the business virtual machine, and delete the target virtual machine on the current first service node.
[0167] Among them, the data storage space can be a virtual storage space, which can be understood as an online storage space for data, or a network storage space for data. For example, the data storage space can be a "cloud disk", which is provided by the corresponding service node and is used to store the data generated by the corresponding target virtual machine during operation.
[0168] The candidate virtual machine may be a virtual machine corresponding to the corresponding target virtual machine. Specifically, when the target virtual machine is migrated, a candidate virtual machine corresponding to the target virtual machine is replicated on the target service node, and all memory data stored by the target virtual machine on the corresponding first service node is replicated to the target service node.
[0169] Specifically, scheduling a virtual machine on a service node means creating a virtual machine identical to the virtual machine on another service node, and deleting the virtual machine on the original service node after the creation is complete. This process includes setting up a cloud disk (i.e., data storage space) for the virtual machine on the target service node, establishing a corresponding business virtual machine, copying the memory data of the virtual machine on the original service node to the target service node, starting the business virtual machine and stopping the target virtual machine on the original service node after the copy is complete, and deleting the target virtual machine on the original service node. After completing the above process, the virtual machine migration is complete.
[0170] Through the above method, the corresponding target virtual machine can be accurately migrated from the original first service node to the corresponding target service node where the fragmented resources need to be integrated according to each migration matching relationship, thereby realizing the utilization of the fragmented resources on the service nodes in the service node cluster, so that the original first service node of the migrated virtual machine can free up more resource space, which is conducive to the subsequent deployment of new virtual machines and improves the resource utilization of the service node cluster.
[0171] As can be seen from the above, the embodiment of the present application identifies a first service node set of virtual machines that can be migrated and a second service node set of virtual machines that cannot be migrated from a service node cluster; creates corresponding scheduling tasks for the target virtual machines on each first service node in the first service node set; arranges a migration priority between each second service node for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node in the second service node set; establishes a migration matching relationship between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set based on the migration priority; and migrates the target virtual machine on the corresponding first service node to the target service node in the second service node set according to the migration matching relationship. In this way, by determining the migration priority of each target virtual machine among multiple target virtual machines relative to the second service nodes to be migrated, migration matching is performed between multiple target virtual machines and multiple second service nodes at the same time according to each migration priority. Multiple target virtual machines can be matched to a more suitable second service node at the same time to complete the migration, and the optimal scheduling solution can be matched for multiple target virtual machines from a global perspective in the same scheduling round, thereby improving the accuracy of virtual machine migration scheduling, accelerating the integration of fragmented resources in the cloud service node cluster, and improving the utilization rate of cloud service resources.
[0172] In combination with the method described in the above embodiment, the following examples are given to further illustrate the method in detail.
[0173] Figure 3 This is another step flow chart of the virtual machine migration method provided by the embodiment of the present application. Figure 3 Provide a description.
[0174] In the embodiments of the present application, the virtual machine migration method will be described from the perspective of a virtual machine migration device, which can be integrated into a computer device such as a terminal or server. For example, when a processor on the computer device executes a program corresponding to the virtual machine migration method, the specific process of the virtual machine migration method is as follows:
[0175] 201. Identify, from a service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated.
[0176] In an embodiment of the present application, in order to integrate the fragmented resources in the service node cluster, the virtual machine on a certain service node can be migrated to the corresponding target service node to realize the use of the fragmented resources in the target service node, so as to improve the utilization rate of the resources in the target service node cluster, and at the same time increase the available resources of the service node from which the target virtual machine is migrated, thereby realizing the resource integration of the service node cluster.
[0177] The service node cluster can be a collection of multiple service nodes, which together form a cloud service resource system, such as a public cloud system. These multiple service nodes can communicate with each other to implement data interaction processes such as virtual machine migration between service nodes. For example, a cloud service provider builds a public cloud system based on multiple physical machines (computer devices with processors). Each physical machine can be considered a service node. In addition, each service node can also be composed of multiple physical machines. For example, service nodes can be differentiated by geographic location, with one or more physical machines at the same latitude and longitude or world coordinates being considered a service node. Multiple service nodes (i.e., a service node cluster) constitute a distributed public cloud system.
[0178] Among them, a virtual machine can be a simulated independent computer system. Specifically, a virtual machine can be understood as a complete computer system simulated by software, with complete hardware system functions, and running in a completely isolated environment. Its main independent computing capability can deploy related business programs to run corresponding business processes.
[0179] The first service node set is a service node set from which virtual machines can be migrated, and may include one or more first service nodes, each of which has at least one virtual machine deployed thereon, and each of which has at least one virtual machine that can be migrated.
[0180] Among them, the second service node set is a service node set that cannot migrate out virtual machines. The second service node set includes one or more second service nodes. Each second service node can also be deployed with a virtual machine or container group. The embodiment of the present application determines the service node that cannot be vacated, does not need to be migrated out of the virtual machine, or cannot be migrated out of the virtual machine as the second service node.
[0181] 202. For the target virtual machine on each first service node in the first service node set, create a corresponding scheduling task in a to-be-scheduled task queue.
[0182] In an embodiment of the present application, after the service node set is divided into a first service node set to which virtual machines can be migrated and a second service node set to which virtual machines cannot be migrated, in order to be able to subsequently perform the integration of fragmented resources on the service nodes, it is necessary to first create a scheduling task for the target virtual machine that needs to be migrated to add it to the queue of tasks to be scheduled. Specifically, a corresponding scheduling task is created in the queue of tasks to be scheduled for each target virtual machine that needs to be scheduled in the first service node, so that the migration of the target virtual machine can be performed subsequently for the scheduling task.
[0183] Among them, the queue of tasks to be scheduled can be a virtual machine task queue, which is used to store the scheduling tasks of one or more virtual machines in each scheduling round / migration batch, representing the amount of scheduling tasks involved in a scheduling round / migration batch, that is, the number of virtual machine migrations.
[0184] The scheduling task is a task for a target virtual machine that needs to be scheduled / migrated, and is used to indicate a migration requirement of the target virtual machine and subsequently instruct to schedule the target virtual machine.
[0185] Specifically, the migratable virtual machines on the first service node can be detected, and the target virtual machines that need to be migrated in the current scheduling round can be selected on the first service node. Then, for each target virtual machine selected on the first service node, a corresponding scheduling task needs to be created for it in the task queue to be scheduled, so that the migration work of the corresponding target virtual machine can be started in accordance with the instructions of each scheduling task.
[0186] 203. When the number of scheduled tasks in the to-be-scheduled task queue is greater than a preset task amount threshold, based on the running resource type of each target virtual machine, filter the second service node set to obtain a set of to-be-selected service nodes corresponding to each target virtual machine.
[0187] In an embodiment of the present application, the number of scheduled tasks in the task queue to be scheduled is detected in real time, and the scheduling work is started only when the number of scheduled tasks meets the task volume threshold. For example, the priority of each second service node is subsequently sorted from the perspective of each target virtual machine, and the priority of each target virtual machine is sorted at each second service node. In this way, the preference of the target virtual machine to the second service node and the preference of the second service node to the target virtual machine are determined from a global perspective.
[0188] Among them, the preset task volume threshold can be understood as the starting threshold of a scheduling round, which is used to determine whether the scheduling task volume in the task queue to be scheduled meets the scheduling quantity. The preset task volume threshold can be set according to the number of service nodes in the service node cluster. For example, the preset task volume threshold can be set according to the percentage of the total number of service nodes in the service node cluster. For example, assuming that the service node cluster contains 100 service nodes, the task volume threshold is set according to a ratio of 10%, then the preset task volume threshold is 10; it should be noted that the preset task volume threshold must be less than 50% of the total number of service nodes. In addition, the preset task volume threshold can also be determined according to the number of service nodes that can be vacated in the service node cluster. For example, assuming that the first service node that can migrate the virtual machine is a vacated service node, the number of the first service node is determined, and the preset task volume threshold is determined according to the percentage of the number of the first service node.
[0189] The running resource type may be a resource configuration specification allocated to the target virtual machine by the first service node where the target virtual machine is located. The running resource type is not limited to resource model, resource configuration size, resource configuration number, etc.
[0190] Specifically, when sorting the migration priority between each second service node for each target virtual machine, the operating resource type of the current target virtual machine can be determined for each target virtual machine, and the service nodes in the second service node set can be filtered according to the operating resource type to obtain a set of candidate service nodes that meet the operating resource type of the target virtual machine, thereby ensuring that the second service nodes participating in the subsequent sorting meet the resource type requirements of the target virtual machine; it should be noted that the second service nodes in the set of candidate service nodes corresponding to each target virtual machine are different. Exemplarily, the operating resource type may include the model of the CPU, memory and hard disk, operating system, the number of allocated CPU cores, memory space, hard disk storage capacity and other configurations, as well as the number of the allocated CPU computing cores, memory address number and hard disk address number. According to the above resource configuration specifications, the service nodes in the second service node set are filtered to obtain a set of candidate service nodes that meet the resource configuration specifications.
[0191] 204. For each target virtual machine, arrange a migration priority order for each second service node in the set of candidate service nodes for the current target virtual machine according to the operating parameters of the current target virtual machine and the operating information of each second service node in the set of candidate service nodes.
[0192] In an embodiment of the present application, after filtering for each target virtual machine to obtain the corresponding set of candidate service nodes, the migration priority between the second service nodes in the set of candidate service nodes is arranged for each target virtual machine. It can be understood that the priority ranking of each second service node is relative to the corresponding target virtual machine. When sorting, the operating parameters of the current target virtual machine and the operating information of each second service node in the corresponding set of candidate service nodes can be measured for sorting.
[0193] The operating parameters are operating data of the target virtual machine, which may reflect the operating status of the corresponding target virtual machine when deployed on the first service node. For example, the operating parameters may include indicators of corresponding dimensions of the corresponding target virtual machine, such as the target virtual machine's resource quantity indicator, load indicator, virtual machine creation time indicator, etc., and each of the above indicators of the target virtual machine is defined as a first indicator.
[0194] The operation information may be an operation parameter of the corresponding second service node. For example, the operation information may include but is not limited to the number of virtual machines originally deployed on the second service node, the average creation time of the deployed virtual machines, the operation load, the amount of available resources (CPU, memory, or hard disk), etc. The operation information may reflect the operation status of the corresponding second service node. Each indicator of the above second service node is defined as a second indicator.
[0195] Specifically, the first indicator parameter of the target indicator on each target virtual machine is determined according to the attribute information of each target virtual machine; the second indicator parameter of the target indicator on each second service node is determined according to the operation information of each second service node; each target virtual machine is traversed; when the target indicator is one of the resource quantity indicator, load indicator and operation time indicator, according to at least one dimension of the resource quantity indicator, load indicator and operation time indicator, according to the difference value between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine, the target virtual machines are sorted according to the acceptance priority order for each second service node.
[0196] 205 . Based on the attribute information of each target virtual machine and the operation information of each second service node, sort the admission priority order for each target virtual machine for each second service node.
[0197] In the embodiment of the present application, since each target virtual machine has its own migration priority, the migration priorities of different target virtual machines may be partially the same, which may affect the subsequent migration matching between multiple target virtual machines and multiple second service nodes. For example, it is impossible to establish a one-to-one migration matching between the target virtual machine and the second service node. In this regard, in addition to referring to the migration priority of each target virtual machine for each second service node, it is also possible to further refer to the admission priority of each second service node for each target virtual machine, so as to comprehensively measure the multi-dimensional priority to match the second service node for each target virtual machine, and ensure that each target virtual machine is matched with a second service node to be migrated. Therefore, in addition to arranging the migration priority for each second service node for each target virtual machine, it is also necessary to arrange the admission priority for each target virtual machine for each second service node.
[0198] Specifically, in order to determine the admission priority of the second service node for each target virtual machine, for any target virtual machine and any second service node, it is necessary to determine the indicator parameters of the target virtual machine and the second service node on the target indicator of the same dimension, that is, the first indicator parameter of the target virtual machine and the second indicator parameter of the second service node; then, the difference value between the first indicator parameter of any target virtual machine and the second indicator parameter of any second service node can be determined on the target indicator of the same dimension; finally, at the same second service node level, the admission priority of the target virtual machines is arranged according to the size of the difference value. It should be noted that if there are multiple target virtual machines with the same second service node having the same difference value on the same target indicator, that is, for the same second service node, it is impossible to complete the admission priority ranking between these multiple (at least two) target virtual machines on the same target indicator, then it is determined that the current ranking needs to be improved, and the current ranking is defined as the initial ranking. At this time, on the basis of the initial sorting, the sorting relationship of other target virtual machines in the initial sorting is kept unchanged, and for multiple target virtual machines whose admission priority of the second service node cannot be distinguished, the multiple target virtual machines whose admission priority cannot be distinguished are sorted according to the first indicator parameter and the second indicator parameter of another target indicator dimension, and the partial sorting relationship for the multiple target virtual machines is updated to the initial sorting to determine the admission priority of the second service node for each target virtual machine.
[0199] 206. Based on the migration priority of each target virtual machine and the admission priority of each second service node, establish a migration matching relationship between the target virtual machine corresponding to each scheduling task and a target service node in the second service node set.
[0200] In an embodiment of the present application, in order to ensure that multiple target virtual machines are not disordered during the subsequent concurrent migration, it is necessary to establish a mapping relationship between each target virtual machine and the second service node before the migration. Specifically, for multiple target virtual machines, a target service node can be matched separately for the target virtual machine corresponding to each scheduling task from multiple second service nodes from a global perspective, so that the target virtual machine corresponding to each scheduling task creates a migration matching relationship with a target service node separately. Thus, each target virtual machine is subsequently accurately scheduled to the corresponding target service node according to the migration matching relationship, effectively avoiding the mutual interference of multiple target virtual machines during concurrent migration during the scheduling process, and having reliability.
[0201] Specifically, since each target virtual machine has its own migration priority for multiple second service nodes, the migration priorities of different target virtual machines may be different or partially the same. In this regard, the matching of a target virtual machine with a second service node to be migrated to may include the following two situations: First, when matching a second service node to be migrated to for each target virtual machine, each target virtual machine is polled and a second service node to be migrated to is matched for the target virtual machine at the target virtual machine level according to its corresponding migration priority. In this case, if each target virtual machine is matched to an independent second service node according to the migration priority of each target virtual machine, the migration matching of the target virtual machine is completed. Furthermore, if the matching is performed only based on the migration priority of each target virtual machine, at least two target virtual machines may be repeatedly matched to the same second service node to be migrated to. In this case, it is necessary to combine the admission priority of the second service node for matching. Specifically, the admission priority of the second service node is obtained. For at least two target virtual machines that are repeatedly matched to the same second service node, these at least two target virtual machines are re-matched according to the obtained admission priority. The target virtual machine with a higher priority in the admission priority is selected and matched to the current second service node. The remaining target virtual machines are matched to the second service node with the next lower priority in the migration priority of the target virtual machine in the "first situation" for migration relationship. According to the above method, until all target virtual machines are individually matched to a second service node to be migrated, the migration matching between multiple target virtual machines and multiple second service nodes is completed from the global optimal solution, ensuring the feasibility of subsequent concurrent migration of multiple target virtual machines, effectively avoiding the phenomenon of virtual machine migration failure, and allocating each target virtual machine to the most suitable second service node to be migrated from a global perspective, which is beneficial to the resource integration efficiency of the service node cluster and the overall stability of the service node cluster during operation.
[0202] 207 . Migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to each migration matching relationship.
[0203] In an embodiment of the present application, after creating a migration matching relationship between the target virtual machine of each scheduling task and the corresponding target service node, the corresponding target virtual machine can be accurately migrated to the corresponding target service node based on each migration matching relationship to schedule each target virtual machine. During this scheduling process, the migration of multiple target virtual machines can be carried out concurrently until all target virtual machines are accurately migrated to their respective corresponding target service nodes, completing the scheduling of all target virtual machines, and realizing the use of fragmented resources of the second service node in the service node cluster to carry and run the target virtual machine, so as to integrate the fragmented resources on the service nodes in the service node cluster and improve the resource utilization on the service nodes.
[0204] Exemplarily, scheduling a virtual machine on a service node means creating a virtual machine identical to the virtual machine on another service node, and deleting the virtual machine on the original service node after the creation is completed on the other service node. This process includes setting up a cloud disk (i.e., data storage space) for the virtual machine on the target service node, establishing a corresponding business virtual machine, copying the memory data of the virtual machine on the original service node to the target service node, starting the business virtual machine and stopping the target virtual machine on the original service node after the copy is completed, and deleting the target virtual machine on the original service node. After completing the above process, the virtual machine migration is completed.
[0205] To facilitate understanding of the embodiments of the present application, the embodiments of the present application will be described using a specific application scenario example. Specifically, the application scenario example is described by executing the above steps 201-207.
[0206] It should be noted that this virtual machine migration method is applicable to virtual machine migration instances in cloud technology, smart transportation, assisted driving, map fields, online shopping, etc. For example, the specific scenario example is as follows:
[0207] 1. The virtual machine migration scenario example is briefly described as follows:
[0208] In public cloud scenarios, to meet daily operations, vendors typically deploy a large number of physical machines to form server resources. These server resources can be considered cloud service resources. Figure 4 As shown, one or more physical machines can form a master machine (service node), and the cloud service resource is a master machine cluster. To meet the customer's business needs, a virtual machine can be deployed on a corresponding service node in the master machine cluster (service node cluster) to meet the customer's business operations. This process can be understood as the initial scheduling and packaging of the virtual machine.
[0209] It should be noted that customers’ demand for cloud resources is often unclear, and there is a tidal pattern of purchase and return. When deploying virtual machines for customers’ first purchase needs, the first scheduling and packaging cannot perceive the load and usage of the virtual machines. Due to the unclear demand and the large number of virtual machines created and destroyed, it is easy for a large number of fragmented resources to appear in the cloud service resource system. To this end, the fragmented resources of the cloud service resource system can be integrated by migrating virtual machines. Specifically, combined with Figure 4 As shown, a set of mother machines (first service nodes) in a mother machine cluster (service node cluster) that can be vacated and migrated virtual machines, as well as a set of mother machines (second service nodes) that cannot be vacated, are determined. Furthermore, target virtual machines that need to be migrated on each first service node in the set of mother machines (first service nodes) that can be vacated and migrated virtual machines are screened out, and the target virtual machines that need to be migrated are added to a queue of tasks to be scheduled. When the queue contains a sufficient number of scheduling tasks, that is, when there are multiple target virtual machines that need to be scheduled, a set / list of candidate mother machines is filtered out from the set of non-vacated mother machines (second service nodes) for each target virtual machine that needs to be migrated. The mother machine sorting result (migration priority) and the virtual machine sorting result (acceptance priority) are combined to perform migration matching between the multiple target virtual machines and multiple mother machines in the set of non-vacated mother machines. In this way, a many-to-many matching between child machines (virtual machines) and mother machines (service nodes) is achieved through delayed selection, thereby improving the accuracy of secondary scheduling and greatly reducing the generation of fragmented resources caused by refunds, thereby significantly improving resource utilization.
[0210] 2. Specific implementation process of this virtual machine migration scenario instance:
[0211] Combine Figure 5 As shown, it is a scenario example diagram of the virtual machine migration method provided by an embodiment of the present application. The scenario in the figure includes a scheduling task for creating a virtual machine in a task queue to be scheduled, a pre-scheduler that sorts each other at the virtual machine and host machine levels, a secondary delay matcher that matches the virtual machine and host machine according to the sorting at the two levels, and a task trigger that issues tasks and executes virtual machine migration based on the matching results. Based on this, the virtual machine migration scenario mainly demonstrates the optimized secondary scheduling algorithm of the virtual machine, which mainly adopts a many-to-many matching algorithm between multiple target virtual machines to be migrated and multiple host machines (service nodes) that can be migrated, so as to achieve migration matching between multiple virtual machines and multiple service nodes in a global perspective, achieve a global optimal solution, and improve the operation stability of the service node cluster.
[0212] (1) Create a scheduling task for a virtual machine in the task queue to be scheduled:
[0213] Combine Figure 5 and Figure 6As shown, the scheduling task of creating a virtual machine in the to-be-scheduled task queue is as follows: obtain the list of mother machines, determine whether the virtual machine (i.e., child machine) on a certain mother machine in the list can be migrated; if it can be migrated, simulate the release of the resources of the current mother machine, and determine whether the current mother machine can be vacated. If the current mother machine can be vacated, the current mother machine is divided into a set of vacable and migratable virtual machines (i.e., the first service node set), and the target virtual machine that can be migrated on the current mother machine is added to the to-be-scheduled task queue, that is, the corresponding scheduling task is created; if the virtual machine cannot be migrated, and / or the current mother machine cannot be vacated, the current mother machine is divided into a set of non-vacable and non-migratable virtual machines (i.e., the second service node set), and the current process is directly terminated, and the judgment of the next mother machine in the mother machine list is entered. Until each mother machine in the mother machine list is judged, the to-be-scheduled task queue is obtained, so that the next step is to pre-schedule the scheduling tasks in the to-be-scheduled task queue.
[0214] (2) The pre-scheduler performs mutual sorting at the virtual machine and host machine levels:
[0215] Combine Figure 5 and Figure 7 When the pre-scheduler sorts the virtual machines and the host machine respectively, it takes out the scheduling tasks of each child machine (target virtual machine) from the task queue to be scheduled, and performs pre-scheduling operations on the child machines corresponding to each scheduling task in turn. The specific process is as follows:
[0216] First, determine whether the scheduling task in the task queue to be scheduled is empty. On the one hand, if it is (the scheduling task is empty), the pre-scheduling process is ended. On the other hand, if it is not (there is a scheduling task), the scheduling task in the task queue to be scheduled is polled (one scheduling task is taken out in sequence), and for the current scheduling task, the child machine (virtual machine) corresponding to the scheduling task is simulated and packed. The simulated packing process is: poll each mother machine in the mother machine list (the second service node set), and determine whether the resources on the mother machine meet the child machine corresponding to the current scheduling task. If the resources meet, the mother machine is added to the packing result list (the set of service nodes to be selected). Exemplarily, the specification information, load information, running time and other information of the child machine corresponding to the taken out scheduling task are obtained; for the set of virtual machines that cannot be vacated or migrated, the specification information of the current child machine is used as a hard constraint to filter them, so as to eliminate the physical machines that do not meet the child machine specifications in the set of physical machines with fragmented resources (the second service node), and retain the set of physical machines (the set of service nodes to be selected) that meet the resource level of the current child machine's schedulable migration (i.e., migration).
[0217] Then, the packing results in the packing result list of the current child machine are sorted, and the child machines are scored at the child machine matching parent machine level. At the same time, the parent machine is scored at the parent machine matching child machine level according to the same logic, so that the parent machine that can be migrated to each child machine to be scheduled is sorted (i.e., the migration priority), and the child machines that can be migrated to each parent machine are sorted (i.e., the acceptance priority). Among them, the scoring logic may include: a full empty scorer is used to determine whether the mother machine is empty (that is, whether a virtual machine is deployed), a fragmented resource scorer is used to determine the gap between the fragmented resources (available resources) on the mother machine and the current child machine, a load scorer is used to determine the load matching between the mother machine and the current child machine, a stability scorer is used to evaluate the stability of the current child machine when it is migrated to the current mother machine, and a running time scorer is used to evaluate the gap between the creation time of the current child machine and the average creation time of all virtual machines currently on the mother machine; according to the above logic, the child machines are scored step by step at the child machine matching mother machine level to arrange the order of child machines that can be migrated to each mother machine (that is, the acceptance priority), and the mother machine is scored step by step at the mother machine matching child machine level to arrange the order of child machines that can be migrated to the mother machine (that is, the migration priority) of each child machine to be scheduled.
[0218] Finally, when all the scheduled tasks in the to-be-scheduled task queue are polled, the pre-scheduling process for all the to-be-migrated child machines (target virtual machines) is completed.
[0219] (3) The secondary delay matcher matches the virtual machine and the host machine based on their order, i.e., a many-to-many matching strategy:
[0220] The process of this many-to-many matching strategy is as follows: Create an initial matching result template. Select the first child machine to be scheduled, take out the parent machine that the child machine can migrate to, and obtain the parent machine with the largest score. Determine whether the parent machine already has a matching child machine based on the matching result template; on the one hand, if the parent machine does not have a matching child machine yet, match the child machine with the parent machine on the matching result template; on the other hand, if the parent machine already has a matching child machine, obtain the priority list of the child machines that can be migrated to the matched child machine and the parent machine (acceptance priority order). If the priority of the current child machine in the priority list of the child machines that can be migrated to is less than that of the matched child machine, skip the current parent machine and continue matching for the current child machine. If the priority of the current child machine is greater than that of the matched child machine, put the matched child machine into the list of virtual machines to be matched (such as the queue of tasks to be scheduled), establish a migration match between the current child machine and the parent machine, and update the matching result template.
[0221] For example, combined Figure 5 and Figure 8As shown, the many-to-many matching process is: first, obtain the list of virtual machines to be scheduled, which can be understood as a queue of tasks to be scheduled, or as a list of virtual machines corresponding to all scheduled tasks in the queue of tasks to be scheduled, poll the list of virtual machines to be scheduled, and for the first child machine (target virtual machine) that needs to be scheduled in the queue, obtain the first mother machine (second service node) ranked first in the mother machine priority queue (migration priority) of the target virtual machine. Then, determine whether the mother machine has a matching result; on the one hand, if the first mother machine has no matching result, match the current child machine to the first mother machine, and record the matching result between the two; on the other hand, if the first mother machine has been matched with other child machines (defined as "virtual machines to be confirmed"), obtain the virtual machines to be confirmed that the first mother machine has matched, and determine whether the priority of the current child machine is higher than the virtual machine to be confirmed; if the priority of the current child machine is not higher than the virtual machine to be confirmed, remove the current mother machine from the priority queue (migration priority order) of the current child machine that can be migrated into the mother machine, and continue to traverse the next order mother machine in the priority queue (migration priority order) that can be migrated into the mother machine according to the above process. If the priority of the current child machine is higher than the virtual machine to be confirmed, put the originally matched child machine (virtual machine to be confirmed) on the mother machine back into the list of virtual machines to be scheduled, and match the current child machine with the mother machine to replace the original matching result. Finally, the matched sub-machine is removed from the list of virtual machines to be scheduled, and it is determined whether the list of virtual machines to be scheduled is empty. If not (not empty), the above process is continued. If it is empty, it means that the migration of all sub-machines to be migrated has been completed, and the many-to-many matching process ends.
[0222] (4) The task trigger issues tasks based on the matching results and executes virtual machine migration. When the migration operation is completed, the source host machine resources are released and the fragmented resources are effectively filled, while improving the stability of the overall physical machine cluster.
[0223] Combine Figure 5 and Figure 9 As shown, for example, according to the migration matching relationship on the matching result template, hot migration of each sub-machine (target virtual machine) is started. The virtual machine migration process is as follows: for each sub-machine, double-mount the cloud disk, and mount the sub-machine's cloud disk on the target mother machine; memory iterative transmission, hot migration mainly creates a sub-machine on the target mother machine with the same specifications as the sub-machine to be migrated, and then copies the memory data to the target mother machine, and performs copy transmission in an iterative manner; judges whether the memory transmission is completed, if not, continues the transmission, if it has been completed, then suspends the operation of the source end sub-machine; then, starts the currently created sub-machine (i.e., business virtual machine) on the target mother machine, thereby destroying the sub-machine on the source end (i.e., the original target virtual machine), and at this point, the virtual machine migration is completed.
[0224] By executing the above virtual machine migration scenario example, the following effects can be achieved: Through the delayed matching algorithm, the stability of the entire disk's main machine can be improved during the secondary scheduling process by taking into account factors such as the child machine load, child machine running time, and the stability of the main machine. Through the delayed matching strategy, the original one-to-many scheduling algorithm is improved to a many-to-many scheduling algorithm, which significantly improves scheduling accuracy and makes it easier to reach the global optimal solution. Moreover, through migration scheduling, the resource utilization rate of the entire disk is maximized, for example, 100% utilization.
[0225] From the above, it can be seen that the embodiment of the present application determines the migration priority of each target virtual machine in multiple target virtual machines relative to the second service nodes to be migrated, and simultaneously performs migration matching between multiple target virtual machines and multiple second service nodes according to each migration priority. It can simultaneously match multiple target virtual machines to a more suitable second service node to complete the migration, and achieve the optimal scheduling solution for multiple target virtual machines from a global perspective in the same scheduling round, thereby improving the accuracy of virtual machine migration scheduling, accelerating the integration of fragmented resources in the cloud service node cluster, and improving the utilization rate of cloud service resources.
[0226] The specific implementation of the above steps can be found in the previous embodiments and will not be repeated here.
[0227] To facilitate better implementation of the virtual machine migration method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above virtual machine migration method. The meanings of the terms are the same as those in the above virtual machine migration method, and the specific implementation details can be referred to the description in the method embodiment.
[0228] See also Figure 10 , Figure 10 A structural diagram of a virtual machine migration device provided in an embodiment of the present application, wherein the virtual machine migration device is integrated into the computer device of the present application, wherein the virtual machine migration device may include an identification unit 401, a creation unit 402, an arrangement unit 403, a matching unit 404 and a processing unit 405.
[0229] An identification unit 401 is configured to identify, from a service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated;
[0230] A creating unit 402 is configured to create a corresponding scheduling task for each target virtual machine on each first service node in the first service node set;
[0231] an arranging unit 403 for arranging a migration priority order among the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node in the set of second service nodes;
[0232] A matching unit 404 is configured to establish a migration matching relationship between a target virtual machine corresponding to each scheduling task and a target service node in the second service node set based on a migration priority order;
[0233] The processing unit 405 is configured to migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship.
[0234] In some embodiments, the matching unit 404 is further used to: traverse each scheduling task in the task queue to be scheduled, and for the target virtual machine corresponding to each scheduling task, select a candidate service node with a higher ranking from the second service node set for the corresponding target virtual machine according to the corresponding migration priority, wherein the candidate service node is the corresponding second service node; if it is confirmed that there is no migration matching relationship for the candidate service node, the candidate service node is determined as the target service node to be migrated for the corresponding target virtual machine, and a migration matching relationship is established between the target service node and the corresponding target virtual machine.
[0235] In some embodiments, the matching unit 404 is further used to: if it is confirmed that a migration matching relationship already exists with the candidate service node, determine the virtual machine to be confirmed that has a migration matching relationship with the candidate service node; obtain the admission priority order for each target virtual machine by sorting the candidate service nodes; if it is determined that the current target virtual machine has priority over the virtual machine to be confirmed according to the admission priority order, release the migration matching relationship between the candidate service node and the virtual machine to be confirmed, and use the candidate service node with the released migration matching relationship as the target service node of the current target virtual machine to establish a migration matching relationship; if it is determined that the virtual machine to be confirmed has priority over the current target virtual machine according to the admission priority order, select the next candidate service node with a higher ranking from the second service node set for the corresponding target virtual machine according to the corresponding migration priority order, until the current target virtual machine establishes a migration matching relationship with the target service node in the second service node set.
[0236] In some embodiments, the virtual machine migration apparatus further includes a sorting unit configured to sort the admission priority order for each target virtual machine for each second service node based on the attribute information of each target virtual machine and the operation information of each second service node.
[0237] In some embodiments, the sorting unit is further used to: determine the first indicator parameter of the target indicator on each target virtual machine based on the attribute information of each target virtual machine; determine the second indicator parameter of the target indicator on each second service node based on the operation information of each second service node; for each second service node, sort the acceptance priority order for each target virtual machine for the second service node based on the difference value between the first indicator parameter of the target virtual machine and the second indicator parameter of each second service node.
[0238] In some embodiments, the target indicator is one of a resource quantity indicator, a load indicator, and a virtual machine creation time indicator, and the sorting unit is further used to: traverse each second service node; according to at least one dimension of the resource quantity indicator, the load indicator, and the virtual machine creation time indicator, according to the difference value between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine, sort the acceptance priority for each target virtual machine for the second service node.
[0239] In some embodiments, the processing unit 405 is used to: for each target virtual machine on the first service node, determine the target service node corresponding to the target virtual machine from the second service node set according to the corresponding migration matching relationship; mount the data storage space of the target virtual machine on the target service node, and create a candidate virtual machine consistent with the target virtual machine on the target service node, and copy the target memory data corresponding to the target virtual machine for the candidate virtual machine from the current first service node; if the copy progress of the target memory data is complete, confirm the candidate virtual machine as the business virtual machine of the target virtual machine on the current first service node after the migration is completed, suspend the operation of the target virtual machine on the first service node and the operation of the business virtual machine, and delete the target virtual machine on the current first service node.
[0240] In some embodiments, the attribute information includes an operating resource type and operating parameters, and the arrangement unit 403 is used to: based on the operating resource type of each target virtual machine, filter from the second service node set to obtain a set of candidate service nodes corresponding to each target virtual machine; for each target virtual machine, arrange the migration priority of each second service node in the set of candidate service nodes for the current target virtual machine according to the operating parameters of the target virtual machine and the operating information of each second service node in the set of candidate service nodes.
[0241] In some embodiments, the identification unit 401 is further used to: obtain the total load of the virtual machines deployed on each service node in the service node cluster; determine the service node whose total load of the virtual machines is less than or equal to a preset load threshold as the first service node from which the virtual machine can be migrated, to obtain a first service node set; determine the service node whose total load of the virtual machine is greater than the preset load threshold as the second service node from which the virtual machine cannot be migrated, to obtain a second service node set; wherein the number of first service nodes is less than or equal to the number of second service nodes.
[0242] In some embodiments, the virtual machine migration apparatus further includes a determining unit configured to: identify the number of scheduled tasks in the to-be-scheduled task queue;
[0243] The arrangement unit 403 is also used to arrange the migration priority between each second service node for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node in the second service node set if the number of scheduled tasks is greater than the preset task quantity threshold.
[0244] From the above, it can be seen that the embodiment of the present application determines the migration priority of each target virtual machine in multiple target virtual machines relative to the second service nodes to be migrated, and simultaneously performs migration matching between multiple target virtual machines and multiple second service nodes according to each migration priority. It can simultaneously match multiple target virtual machines to a more suitable second service node to complete the migration, and achieve the optimal scheduling solution for multiple target virtual machines from a global perspective in the same scheduling round, thereby improving the accuracy of virtual machine migration scheduling, accelerating the integration of fragmented resources in the cloud service node cluster, and improving the utilization rate of cloud service resources.
[0245] The specific implementation of each of the above units can be found in the previous embodiments and will not be described again here.
[0246] See also Figure 11 , Figure 11 The schematic diagram of the structure of the terminal provided in the embodiment of the present application includes a structural frame of part of the terminal 140 that implements the embodiment of the present application. The terminal 140 includes: a radio frequency (RF) circuit 510, a memory 515, an input unit 530, a display unit 540, a sensor 550, an audio circuit 560, a wireless fidelity (WiFi) module 570, a processor 580, and a power supply 590. Those skilled in the art will understand that Figure 11 The illustrated structure of the terminal 140 does not limit the structure of a mobile phone or a computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0247] The RF circuit 510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving downlink information from the base station, it is sent to the processor 580 for processing. In addition, the uplink data is sent to the base station.
[0248] The memory 515 may be used to store software programs and modules. The processor 580 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the memory 515 .
[0249] The input unit 530 may be configured to receive input digital or character information and generate key signal input related to terminal settings and function control. Specifically, the input unit 530 may include a touch panel 531 and other input devices 532 .
[0250] The display unit 540 may be configured to display input information or provided information and various menus of the terminal. The display unit 540 may include a display panel 541 .
[0251] The audio circuit 560 , the speaker 561 , and the microphone 562 may provide an audio interface.
[0252] In this embodiment, the processor 580 included in the terminal 140 can execute the virtual machine migration method of the previous embodiment.
[0253] The terminal 140 in the embodiment of the present application includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiment of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0254] Figure 12 A structural diagram of a server provided for an embodiment of the present application includes a structural frame of a portion of the server 110 for implementing an embodiment of the present application. The server 110 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 622 (for example, one or more processors) and a memory 632, and one or more storage media 630 (for example, one or more mass storage devices) for storing application programs 642 or data 644. Among them, the memory 632 and the storage medium 630 may be temporary storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server 600. Furthermore, the central processing unit 622 may be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the server 600.
[0255] The server 600 may also include one or more power supplies 626, one or more wired or wireless network interfaces 650, one or more input and output interfaces 658, and / or one or more operating systems 641, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0256] The central processing unit 622 in the server 600 can be used to execute the virtual machine migration method of the embodiment of the present application, specifically as follows:
[0257] A first service node set of virtual machines that can be migrated and a second service node set of virtual machines that cannot be migrated are identified from the service node cluster; corresponding scheduling tasks are created for the target virtual machines on each first service node in the first service node set; based on the attribute information of each target virtual machine and the operating information of each second service node in the second service node set, a migration priority between each second service node is arranged for each target virtual machine; based on the migration priority, a migration matching relationship is established between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set; and the target virtual machine on the corresponding first service node is migrated to the target service node in the second service node set according to the migration matching relationship.
[0258] The present application also provides a computer-readable storage medium for storing program code, which is used to execute the virtual machine migration method of each of the aforementioned embodiments, specifically as follows:
[0259] A first service node set of virtual machines that can be migrated and a second service node set of virtual machines that cannot be migrated are identified from the service node cluster; corresponding scheduling tasks are created for the target virtual machines on each first service node in the first service node set; based on the attribute information of each target virtual machine and the operating information of each second service node in the second service node set, a migration priority between each second service node is arranged for each target virtual machine; based on the migration priority, a migration matching relationship is established between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set; and the target virtual machine on the corresponding first service node is migrated to the target service node in the second service node set according to the migration matching relationship.
[0260] The embodiment of the present application further provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned virtual machine migration method.
[0261] In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or apparatus that comprises a series of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, product or apparatus.
[0262] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0263] It should be understood that in the description of the embodiments of the present application, multiple (or multiple items) means more than two, greater than, less than, exceed, etc. are understood to exclude the number itself, and above, below, within, etc. are understood to include the number itself.
[0264] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0265] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0266] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0267] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0268] It should also be understood that the various implementation methods provided in the embodiments of the present application can be combined arbitrarily to achieve different technical effects.
[0269] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0270] The above is a specific description of the implementation methods of the present application, but the present application is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A virtual machine migration method, characterized in that: include: Identify, from the service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated; For each target virtual machine on each first service node in the first service node set, create a corresponding scheduling task; Arranging a migration priority order between the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operating information of each second service node in the set of second service nodes; Based on the migration priority, establishing a migration matching relationship between the target virtual machine corresponding to each scheduling task and the target service node in the second service node set; Migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship.
2. The virtual machine migration method according to claim 1, wherein: The establishing, based on the migration priority, a migration matching relationship between a target virtual machine corresponding to each scheduling task and a target service node in the second service node set includes: Traversing each scheduling task, for a target virtual machine corresponding to each scheduling task, selecting a candidate service node with a higher ranking from the second service node set for the corresponding target virtual machine according to the corresponding migration priority order, wherein the candidate service node is the corresponding second service node; If it is confirmed that there is no migration matching relationship with the candidate service node, the candidate service node is determined as the target service node to be migrated by the corresponding target virtual machine, and a migration matching relationship is established between the target service node and the corresponding target virtual machine.
3. The virtual machine migration method according to claim 2, wherein: The method further comprises: If it is confirmed that the candidate service node already has a migration matching relationship, then determining a virtual machine to be confirmed that has a migration matching relationship with the candidate service node; Obtaining the candidate service nodes and sorting them to determine the admission priority order for each target virtual machine; If it is determined according to the admission priority order that the current target virtual machine has priority over the to-be-confirmed virtual machine, then canceling the migration matching relationship between the candidate service node and the to-be-confirmed virtual machine, and using the candidate service node with the canceled migration matching relationship as the target service node of the current target virtual machine to establish a migration matching relationship; If it is determined according to the acceptance priority that the virtual machine to be confirmed has priority over the current target virtual machine, the next candidate service node with a higher ranking is selected for the corresponding target virtual machine from the second service node set according to the corresponding migration priority, until the current target virtual machine establishes a migration matching relationship with the target service node in the second service node set.
4. The virtual machine migration method according to any one of claims 1 to 3, characterized in that: Before establishing a migration matching relationship between a target virtual machine corresponding to each scheduling task and a target service node in the second service node set based on the migration priority, the method further includes: According to the attribute information of each target virtual machine and the operation information of each second service node, an admission priority order for each target virtual machine is sorted for each second service node.
5. The virtual machine migration method according to claim 4, characterized in that: The step of sorting, for each second service node, an admission priority order for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node includes: Determine a first indicator parameter of a target indicator on each target virtual machine according to the attribute information of each target virtual machine; Determining a second indicator parameter of the target indicator on each second service node according to the operation information of each second service node; For each second service node, an admission priority order for each target virtual machine is sorted for the second service node according to a difference between the first indicator parameter of the target virtual machine and the second indicator parameter of each second service node.
6. The virtual machine migration method according to claim 5, characterized in that: The target indicator is one of a resource quantity indicator, a load indicator, and a virtual machine creation duration indicator. The step of sorting, for each second service node, an admission priority order for each target virtual machine based on a difference between a first indicator parameter of the second service node and a second indicator parameter of each target virtual machine includes: Traverse each second service node; According to at least one dimension of the resource quantity indicator, the load indicator and the virtual machine creation time indicator, and based on the difference value between the second indicator parameter corresponding to the second service node and the first indicator parameter corresponding to each target virtual machine, the second service node is sorted out with an acceptance priority order for each target virtual machine.
7. The virtual machine migration method according to claim 1, wherein: Migrating the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship includes: For each target virtual machine on the first service node, determining a target service node corresponding to the target virtual machine from the second service node set according to the corresponding migration matching relationship; Mounting the data storage space of the target virtual machine on the target service node, creating a candidate virtual machine consistent with the target virtual machine on the target service node, and copying the target memory data corresponding to the target virtual machine from the current first service node for the candidate virtual machine; If the copy progress of the target memory data is completed, the candidate virtual machine is confirmed as the business virtual machine of the target virtual machine on the current first service node after the migration is completed, the target virtual machine on the first service node and the business virtual machine are suspended, and the target virtual machine on the current first service node is deleted.
8. The virtual machine migration method according to claim 1, wherein: The attribute information includes an operating resource type and operating parameters. The step of arranging a migration priority between the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operating information of each second service node in the set of second service nodes includes: Based on the running resource type of each target virtual machine, filtering from the second service node set to obtain a set of candidate service nodes corresponding to each target virtual machine; For each target virtual machine, according to the operating parameters of the target virtual machine and the operating information of each second service node in the set of candidate service nodes, a migration priority order for each second service node in the set of candidate service nodes is arranged for the current target virtual machine.
9. The virtual machine migration method according to claim 1, wherein: The step of identifying, from the service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated comprises: For each service node in the service node cluster, obtain the total load of the virtual machines deployed on the service node; Determine the service node whose total load of the virtual machine is less than or equal to a preset load threshold as the first service node from which the virtual machine can be migrated, to obtain a first service node set; Determine the service nodes whose total load of the virtual machines is greater than a preset load threshold as second service nodes from which the virtual machines cannot be migrated, to obtain a second service node set; The number of the first service nodes is less than or equal to the number of the second service nodes.
10. The virtual machine migration method according to claim 1, wherein: Before arranging a migration priority order between the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operating information of each second service node in the set of second service nodes, the method further includes: Identifying the total number of scheduled tasks; Then, arranging a migration priority order between the second service nodes for each target virtual machine based on the attribute information of each target virtual machine and the operation information of each second service node in the second service node set includes: If the total number of the scheduled tasks is greater than the preset task amount threshold, based on the attribute information of each target virtual machine and the operation information of each second service node in the second service node set, a migration priority order between each second service node is arranged for each target virtual machine.
11. A virtual machine migration device, characterized in that: include: an identification unit, configured to identify, from the service node cluster, a first set of service nodes from which virtual machines can be migrated and a second set of service nodes from which virtual machines cannot be migrated; a creating unit, configured to create corresponding scheduling tasks for each target virtual machine on each first service node in the first service node set; an arranging unit, configured to arrange, for each target virtual machine, a migration priority order between the second service nodes based on the attribute information of each target virtual machine and the operation information of each second service node in the set of second service nodes; a matching unit, configured to establish, based on the migration priority, a migration matching relationship between a target virtual machine corresponding to each scheduling task and a target service node in the second service node set; The processing unit is configured to migrate the target virtual machine on the corresponding first service node to a target service node in the second service node set according to the migration matching relationship.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the virtual machine migration method according to any one of claims 1 to 10.
13. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the virtual machine migration method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the virtual machine migration method according to any one of claims 1 to 10 is implemented.