A virtual machine scheduling method, device, equipment and medium

By determining multiple affinity type policies and server location topology relationships in virtual machine scheduling, the problem of inflexible virtual machine scheduling in the existing technology is solved, and more efficient and flexible virtual machine scheduling is achieved to meet diverse business needs. .

CN114020405BActive Publication Date: 2024-09-06ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111257262.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2024-09-06
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

Existing cloud platforms only support affinity and anti-affinity scheduling based on server node granularity in virtual machine scheduling, which lacks flexibility, resulting in inflexible virtual machine calls.

Method used

By creating the target virtual machine to be scheduled, determine the affinity strategy of multiple affinity types that need to be considered during the scheduling process, and combine the server location topology relationship to determine and schedule the target server node from all server nodes on the cloud platform. , supports multiple affinity types for server nodes, rack zones, and switch zones.

Benefits of technology

It improves the flexibility and efficiency of virtual machine calls, meets the diverse needs of business, and reduces complexity and resource conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020405B
    Figure CN114020405B
Patent Text Reader

Abstract

The present application discloses a virtual machine scheduling method, device, equipment and medium, which relates to the field of computer technology. The method is applied to a physical machine, including: creating a target virtual machine to be scheduled; determining an affinity strategy that uniquely corresponds to the affinity type that the target virtual machine needs to consider during the scheduling process, the affinity type being the type of affinity between the target virtual machine and the scheduling area, the type of the scheduling area including any two or three combinations of the server node area, the cabinet area and the switch area; using the affinity strategy and the pre-acquired server location topology relationship, determining the corresponding target server node from all server nodes of the cloud platform, and scheduling the target virtual machine to the target server node. Through the above technical solution of the present application, it is possible to avoid using a single type of scheduling area for virtual machine scheduling, thereby improving the diversity and security of business needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a virtual machine scheduling method, device, equipment and medium. Background Art

[0002] With the development of cloud computing technology, more and more businesses are being moved to the cloud, and their complexity is increasing. For example, to meet the needs of high-concurrency business, applications need to be deployed in multiple copies, which is reflected in the virtualized cloud platform, that is, a group of applications will be deployed on multiple virtual machines, and multiple business needs can be met through virtual machine scheduling. The current mainstream cloud platforms in the industry only support affinity scheduling based on the affinity and anti-affinity scheduling of server nodes, which lacks the flexibility of virtual machine scheduling.

[0003] As can be seen from the above, in the process of virtual machine scheduling, how to avoid the situation where the virtual machine call is inflexible due to the traditional affinity scheduling method is a problem to be solved in the art. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a virtual machine scheduling method, device, equipment and medium, which can effectively improve the flexibility of virtual machine calling. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a virtual machine scheduling method, comprising:

[0006] Create a target virtual machine to be scheduled;

[0007] Determine the affinity strategy that uniquely corresponds to the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the type of the scheduling area includes a combination of any two or three of the server node area, the cabinet area, and the switch area; the affinity strategy is a strategy for scheduling the target virtual machine based on the corresponding affinity type;

[0008] Utilizing the affinity strategy and the pre-acquired server location topology relationship, the corresponding target server node is determined from all server nodes of the cloud platform, and the target virtual machine is scheduled to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

[0009] Optionally, the determining the affinity policy that uniquely corresponds to the affinity type that needs to be considered during the scheduling of the target virtual machine includes:

[0010] Through the preset strategy selection interface, an affinity strategy uniquely corresponding to the affinity type that the target virtual machine needs to consider during the scheduling process is selected from a preset affinity strategy library; the preset affinity strategy library includes soft affinity strategy, hard affinity strategy, soft anti-affinity strategy and hard anti-affinity strategy.

[0011] Optionally, the determining the affinity policy that uniquely corresponds to the affinity type that needs to be considered during the scheduling of the target virtual machine includes:

[0012] Based on the scheduling area requirement of the target virtual machine, determining the affinity type that needs to be considered during the scheduling process of the target virtual machine;

[0013] Based on the affinity type and the scheduling area requirement, an affinity strategy uniquely corresponding to each affinity type is determined.

[0014] Optionally, before determining the affinity type to be considered in the scheduling process of the target virtual machine based on the scheduling area requirement of the target virtual machine, the method further includes:

[0015] Based on the business application requirements corresponding to the target virtual machine, the requirements of the target virtual machine for different types of scheduling areas are determined, or the requirements of different types of scheduling areas for the target virtual machine are determined to obtain the scheduling area requirements.

[0016] Optionally, the determining, based on the affinity type and the scheduling area requirement, an affinity strategy uniquely corresponding to each affinity type includes:

[0017] Based on the scheduling area requirements, an affinity strategy uniquely corresponding to each affinity type is screened out from a preset affinity strategy library; the preset affinity strategy library includes a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.

[0018] Optionally, before using the affinity strategy and the pre-acquired server location topology to determine the corresponding target server node from all server nodes of the cloud platform, the method further includes:

[0019] Determine the cabinet area where each server node is located and the uplink switch area corresponding to each of the server nodes, and record the area location information of the cabinet area and the uplink switch area where each server node is located to obtain the server location topology relationship.

[0020] Optionally, the using the affinity strategy and the pre-acquired server location topology relationship to determine a corresponding target server node from all server nodes of the cloud platform, and scheduling the target virtual machine to the target server node includes:

[0021] Determine the target server node group from all server nodes of the cloud platform by using the pre-created virtual machine scheduler and the affinity strategy and the pre-acquired server location topology relationship;

[0022] The target server node group is screened by the virtual machine scheduler based on a preset server node screening strategy to obtain a corresponding target server node, and then the target virtual machine is scheduled to the target server node.

[0023] In a second aspect, the present application discloses a virtual machine scheduling device, comprising:

[0024] A virtual machine creation module, used to create a target virtual machine to be scheduled;

[0025] An affinity policy determination module is used to determine the affinity policy uniquely corresponding to the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the type of the scheduling area includes a combination of any two or three of the server node area, the cabinet area and the switch area; the affinity policy is a policy for scheduling the target virtual machine based on the corresponding affinity type;

[0026] A virtual machine scheduling module is used to use the affinity strategy and the pre-acquired server location topology relationship to determine the corresponding target server node from all server nodes of the cloud platform and schedule the target virtual machine to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

[0027] In a third aspect, the present application discloses an electronic device, including:

[0028] Memory, used to store computer programs;

[0029] The processor is used to execute the computer program to implement the aforementioned virtual machine scheduling method.

[0030] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed virtual machine scheduling method are implemented.

[0031] In the present application, a target virtual machine to be scheduled is first created, and an affinity strategy uniquely corresponding to the affinity type that the target virtual machine needs to consider during the scheduling process is determined. The affinity type is the type of affinity between the target virtual machine and the scheduling area. The types of scheduling areas include any two or three combinations of server node areas, cabinet areas, and switch areas. The affinity strategy is a strategy for scheduling the target virtual machine based on the corresponding affinity type. Then, the affinity strategy and the pre-acquired server location topology are used to determine the corresponding target server node from all server nodes of the cloud platform and schedule the target virtual machine to the target server node. In this way, the method considers multiple affinity types such as server node areas, cabinet areas, and switch areas, and then selects corresponding affinity strategies for these affinity types to determine the corresponding server nodes from all server nodes of the cloud platform to achieve the scheduling of the target virtual machine to be scheduled. This virtual machine scheduling method can formulate more flexible virtual machine scheduling rules based on multiple affinity types and affinity strategies, improve the efficiency and security of virtual machine calls, and meet the diversified needs of the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0033] Figure 1 A flow chart of a virtual machine scheduling method disclosed in this application;

[0034] Figure 2 A schematic diagram of a server location topology relationship disclosed in this application;

[0035] Figure 3 A flowchart of a specific virtual machine scheduling method disclosed in this application;

[0036] Figure 4 A flowchart of a specific virtual machine scheduling method disclosed in this application;

[0037] Figure 5 A flowchart of a specific virtual machine scheduling method disclosed in this application;

[0038] Figure 6 A physical topology diagram provided for this application;

[0039] Figure 7 A data structure relationship diagram provided for this application

[0040] Figure 8 A schematic diagram of the structure of a virtual machine scheduling device disclosed in this application;

[0041] Fig. 9 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] In the current context, in the prior art, when scheduling virtual machines, only affinity scheduling and anti-affinity scheduling at the server node granularity are supported, which lacks the flexibility of virtual machine scheduling. As can be seen from the above, in the process of virtual machine scheduling, how to avoid the situation where virtual machine calling is inflexible due to affinity scheduling of a single affinity type is a problem to be solved in the field.

[0044] See also Figure 1 As shown, the embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine and may specifically include:

[0045] Step S11: Create a target virtual machine to be scheduled.

[0046] Step S12: Determine the affinity policy that uniquely corresponds to the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the types of scheduling areas include any two or three of the server node area, the cabinet area and the switch area; the affinity policy is a policy for scheduling the target virtual machine based on the corresponding affinity type.

[0047] In this embodiment, after creating the target virtual machine to be scheduled, according to the needs of the business application, the affinity policy uniquely corresponding to the affinity type that the target virtual machine needs to consider during the scheduling process is selected from the preset affinity policy library. For example, the relationship between the affinity type and the scheduling area type, such as Figure 2 The preset affinity strategy library includes a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.

[0048] The specific descriptions of the soft affinity strategy, hard affinity strategy, soft anti-affinity strategy and hard anti-affinity strategy described in this application are as follows:

[0049] Soft affinity strategy: Try to schedule the virtual machines to be scheduled to the same affinity type. However, if some virtual machines cannot be scheduled to the same affinity type due to insufficient resources or other reasons, they can still be successfully scheduled.

[0050] Hard affinity policy: The virtual machines to be scheduled must be scheduled to the same affinity type. If they cannot be scheduled to the same affinity type, the scheduling fails.

[0051] Soft anti-affinity strategy: Try not to schedule the VMs to be scheduled to the same affinity type. However, if some VMs need to be scheduled to the same affinity type due to insufficient resources or other reasons, they can be successfully scheduled.

[0052] Hard anti-affinity policy: The virtual machines to be scheduled must not be scheduled to the same affinity type. If the requirement cannot be met, the scheduling fails.

[0053] For example, there are two cabinets A and B. There are server nodes 1 and 2 in cabinet A, and server nodes 3 and 4 in cabinet B. According to business needs, a virtual machine to be scheduled needs to be scheduled to node 4. At this time, you can choose the hard affinity policy of cabinet B and the hard affinity policy of node 4 to achieve it. In addition, you can also choose the hard anti-affinity policy of cabinet A and the hard anti-affinity policy of node 4, the hard anti-affinity policy of cabinet A and the hard anti-affinity policy of node 3, and the hard affinity policy of cabinet B and the hard anti-affinity policy of node 3, all of which can achieve the above effects.

[0054] In the above strategy, the resource shortage situation may include: when the resource capacity of the virtual machine to be scheduled is greater than the resource capacity provided by the server node, or the number of virtual machines to be scheduled and the number of nodes conflict when satisfying the affinity strategy, etc. For example, five virtual machines to be scheduled are created, and there are four server nodes waiting to be scheduled in the same cabinet, and the resource capacity of each virtual machine to be scheduled and each node both meet the resource conditions for scheduling. At this time, if the server nodes are screened based on the cabinet soft affinity strategy and the server node soft anti-affinity strategy, there is a possibility that the scheduling result is: virtual machines 1-4 to be scheduled are sequentially assigned to the four server nodes, and virtual machine 5 to be scheduled is randomly assigned to one of the four nodes of the server; if the server nodes are screened based on the cabinet soft affinity strategy and the server node hard anti-affinity strategy, there is a possibility that the scheduling result is: virtual machines 1-4 to be scheduled are sequentially assigned to the four server nodes, and virtual machine 5 to be scheduled fails to be scheduled. This is a situation where the number of virtual machines to be scheduled and the number of nodes conflict when satisfying the affinity strategy.

[0055] Step S13: Utilize the affinity strategy and the pre-acquired server location topology relationship to determine the corresponding target server node from all server nodes of the cloud platform, and schedule the target virtual machine to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

[0056] In this embodiment, after determining the affinity policy that uniquely corresponds to the affinity type that needs to be considered during the scheduling process of the target virtual machine, the strategy for scheduling the target virtual machine based on the corresponding affinity type and the pre-acquired positional topological relationship between the server nodes and the cabinet area and the switch area are used to determine the corresponding target server node from all server nodes of the cloud platform, and schedule the target virtual machine to the target server node.

[0057] In this embodiment, after the target virtual machine to be scheduled is created, according to the needs of the business application, by selecting the affinity policy that uniquely corresponds to the affinity type that needs to be considered in the scheduling process of the target virtual machine from the preset affinity policy library, using the strategy for scheduling the target virtual machine based on the corresponding affinity type and the pre-acquired positional topological relationship between the server node and the cabinet area and the switch area, respectively, the corresponding target server node is determined from all server nodes of the cloud platform, and the target virtual machine is scheduled to the target server node. It can be seen that this embodiment effectively improves the efficiency of virtual machine scheduling and reduces the complexity by selecting the affinity policy that uniquely corresponds to the affinity type that needs to be considered in the scheduling process of the target virtual machine from the preset affinity policy library, and effectively improves the diversity of business needs by selecting the affinity policy that uniquely corresponds to the affinity type that needs to be considered in the scheduling process of the target virtual machine.

[0058] See also Figure 3 As shown, the embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine and may specifically include:

[0059] Step S21: Create a target virtual machine to be scheduled.

[0060] Step S22: through the preset policy selection interface, select the affinity policy that uniquely corresponds to the affinity type that the target virtual machine needs to consider during the scheduling process from the preset affinity policy library; the preset affinity policy library includes soft affinity policy, hard affinity policy, soft anti-affinity policy and hard anti-affinity policy.

[0061] In this embodiment, after creating the target virtual machine to be scheduled, the user can directly select the affinity policy that uniquely corresponds to the affinity type that needs to be considered during the scheduling process of the target virtual machine from the preset affinity policy library through the preset policy selection interface. In the affinity policy selection process, it is required that only one affinity policy can be selected for a single affinity type, and one affinity policy can correspond to multiple affinity types. A single affinity type and multiple policies cannot be selected at the same time.

[0062] Step S23: using the affinity strategy and the pre-acquired server location topology, a corresponding target server node is determined from all server nodes of the cloud platform, and the target virtual machine is scheduled to the target server node.

[0063] In this embodiment, after creating the target virtual machine to be scheduled, the user can directly select the affinity policy that uniquely corresponds to the affinity type that the target virtual machine needs to consider during the scheduling process from the preset affinity policy library through the preset policy selection interface, and use the affinity policy and the pre-acquired server location topology relationship to determine the corresponding target server node from all server nodes of the cloud platform, and schedule the target virtual machine to the target server node. It can be seen that selecting an affinity policy from the preset affinity policy library according to the preset policy selection interface can effectively meet the user's demand for business performance, improve the efficiency of virtual machine scheduling, and increase the diversity of business needs.

[0064] See also Figure 4 As shown, the embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine and may specifically include:

[0065] Step S31: Create a target virtual machine to be scheduled.

[0066] Step S32: Based on the scheduling area requirements of the target virtual machine, determine the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the type of scheduling area includes a combination of any two or three of the server node area, cabinet area and switch area.

[0067] Prior to this step, it also includes: based on the business application requirements corresponding to the target virtual machine, determining the requirements of the target virtual machine for different types of scheduling areas, or determining the requirements of different types of scheduling areas for the target virtual machine to obtain the scheduling area requirements.

[0068] In this embodiment, based on the business application requirements corresponding to the target virtual machine, the requirements of the target virtual machine for different types of the scheduling areas are determined, or the requirements of different types of the scheduling areas for the target virtual machine are determined to obtain the scheduling area requirements. For example, to prevent power failure of the cabinet, multiple virtual machines need to be dispersed to different cabinets; to prevent switch failure, multiple virtual machines need to be dispersed to different uplink switches; to reduce the internal east-west network latency bandwidth of the business and ensure the high availability of the business, multiple virtual machines need to be dispersed to different servers under the same switch.

[0069] In this embodiment, based on the scheduling area requirements of the target virtual machine, the affinity type that the target virtual machine needs to consider during the scheduling process is determined. It can be seen that, according to the scheduling area requirements of the target virtual machine, determining the type of affinity between the target virtual machine and any combination of two or three of the server node area, the cabinet area, and the switch area can effectively improve the diversity of business requirements and meet the performance requirements of the business.

[0070] Step S33: Based on the affinity type and the scheduling area requirements, an affinity policy uniquely corresponding to each affinity type is selected from a preset affinity policy library; the preset affinity policy library includes soft affinity policies, hard affinity policies, soft anti-affinity policies and hard anti-affinity policies; the affinity policy is a policy constructed based on the corresponding affinity type for scheduling the target virtual machine.

[0071] In this embodiment, after the affinity type that needs to be considered in the scheduling process of the target virtual machine is determined based on the scheduling area requirements of the target virtual machine, an affinity policy that uniquely corresponds to each affinity type is screened from a preset affinity policy library according to the affinity type and the scheduling area requirements. It can be seen that determining the affinity policy according to the scheduling area requirements and the affinity type can effectively improve the diversity of business requirements and improve the efficiency of virtual machine scheduling.

[0072] Step S34: Utilize the affinity strategy and the pre-acquired server location topology relationship to determine the corresponding target server node from all server nodes of the cloud platform, and schedule the target virtual machine to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

[0073] In this embodiment, after the target virtual machine to be scheduled is created, based on the business application requirements corresponding to the target virtual machine, the requirements of the target virtual machine for different types of the scheduling areas are determined, or the requirements of different types of the scheduling areas for the target virtual machine are determined to obtain the scheduling area requirements, and based on the scheduling area requirements of the target virtual machine, the affinity type that needs to be considered in the scheduling process of the target virtual machine is determined, and the affinity policy that uniquely corresponds to each affinity type is screened out from the preset affinity policy library, and the affinity policy and the pre-acquired server location topology relationship are used to determine the corresponding target server node from all server nodes of the cloud platform, and the target virtual machine is scheduled to the target server node. It can be seen that the process of determining the affinity type that needs to be considered in the scheduling process of the target virtual machine based on the scheduling area requirements of the target virtual machine effectively improves the diversity of business requirements and improves the efficiency of screening affinity policies, thereby improving the efficiency of virtual machine scheduling.

[0074] See also Figure 5 As shown, the embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine and may specifically include:

[0075] Step S41: Create a target virtual machine to be scheduled.

[0076] Step S42: Determine the affinity policy that uniquely corresponds to the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the types of scheduling areas include any two or three of the server node area, the cabinet area and the switch area; the affinity policy is a policy for scheduling the target virtual machine based on the corresponding affinity type.

[0077] Step S43: Determine the target server node group from all server nodes of the cloud platform through the pre-created virtual machine scheduler and by using the affinity strategy and the pre-acquired server location topology relationship.

[0078] In this embodiment, before determining the corresponding target server node from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server location topology relationship, it can also include: determining the cabinet area where each server node is located and the upstream switch area corresponding to each of the server nodes, and recording the regional location information of the cabinet area and the upstream switch area where each server node is located to obtain the server location topology relationship.

[0079] It is understandable that the server location topology relationship is obtained in advance. In a specific implementation, the topology relationship may include: Figure 6 The physical topological relationship is similar to Figure 7 The data structure relationship.

[0080] In a specific implementation of this embodiment, the screening result of the virtual machine scheduler for the server node is a mapping relationship in which one virtual machine to be scheduled corresponds to one server node as shown in Table 1.

[0081] Table 1

[0082] Virtual machine 1 to be scheduled Server Node A Virtual machine 2 to be scheduled Server Node B Virtual machine 3 to be scheduled Server Node C Virtual machine 4 to be scheduled Server Node D

[0083] It is understandable that the results obtained by screening using the virtual machine scheduler may be multiple groups, that is, there may be multiple achievable mapping relationships between server nodes and virtual machines to be scheduled in the target server node group. In actual situations, it can be expressed as follows: in the results screened by the scheduler, the first possible mapping relationship is that virtual machines 1, 2, 3, and 4 to be scheduled can correspond to server nodes A, B, C, and D respectively. Since the resource capacity compatibility of each server node and each virtual machine to be scheduled is high, there may also be multiple other mapping relationships, for example, virtual machine 1 to be scheduled can correspond to server node B, virtual machine 2 to be scheduled can correspond to server node C, virtual machine 3 to be scheduled can correspond to server node D, and virtual machine 4 to be scheduled can correspond to server node A. At this time, due to the possibility of multiple mapping relationships, a group that best meets business needs and has the most reasonable resource allocation can be screened out from these multiple groups of relationships, and the screened results are used as target server nodes for virtual machine scheduling.

[0084] In this embodiment, after determining the affinity strategy that uniquely corresponds to the affinity type that needs to be considered in the scheduling process of the target virtual machine, it is necessary to determine the cabinet area where each server node is located and the uplink switch area corresponding to each of the server nodes, and record the regional location information of the cabinet area and the uplink switch area where each server node is located to obtain the server location topology relationship. It can be seen that by determining and recording the regional location information of the cabinet area and the uplink switch area, the accuracy of the server location topology relationship can be effectively improved to meet the performance requirements of the business.

[0085] Step S44: The target server node group is screened by the virtual machine scheduler based on a preset server node screening strategy to obtain a corresponding target server node, and then the target virtual machine is scheduled to the target server node.

[0086] In this embodiment, after determining the cabinet area where each server node is located and the uplink switch area corresponding to each server node, and recording the regional location information of the cabinet area and the uplink switch area where each server node is located to obtain the server location topology relationship, it is necessary to use the pre-created virtual machine scheduler and the affinity strategy and the pre-acquired server location topology relationship to determine the target server node group from all server nodes of the cloud platform. It can be seen that by determining the target server node group from all server nodes of the cloud platform, the accuracy of virtual machine scheduling can be effectively improved, and the business demand for security performance can be improved.

[0087] In this embodiment, after the target server node group is determined from all server nodes of the cloud platform by using the pre-created virtual machine scheduler and the affinity strategy and the pre-acquired server location topology, the target server node group is screened by the virtual machine scheduler based on the preset server node screening strategy to obtain the corresponding target server node, and then the target virtual machine is scheduled to the target server node. It can be seen that the screening of server nodes of the target server node group by the preset server node screening strategy can effectively improve the diversity of business needs and increase the accuracy of virtual machine scheduling.

[0088] See also Figure 8 As shown, the embodiment of the present application discloses a virtual machine scheduling device, which may specifically include:

[0089] A virtual machine creation module 11, used to create a target virtual machine to be scheduled;

[0090] The affinity strategy determination module 12 is used to determine the affinity strategy uniquely corresponding to the affinity type that needs to be considered in the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the type of the scheduling area includes any two or three combinations of the server node area, the cabinet area and the switch area; the affinity strategy is a strategy for scheduling the target virtual machine based on the corresponding affinity type;

[0091] The virtual machine scheduling module 13 is used to use the affinity strategy and the pre-acquired server location topology relationship to determine the corresponding target server node from all server nodes of the cloud platform, and schedule the target virtual machine to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

[0092] In this embodiment, after the target virtual machine to be scheduled is created, the affinity type that needs to be considered in the scheduling process of the target virtual machine is determined based on the scheduling area requirements of the target virtual machine; based on the affinity type and the scheduling area requirements, the affinity strategy that uniquely corresponds to each affinity type is determined, and the affinity strategy that uniquely corresponds to the affinity type that needs to be considered in the scheduling process of the target virtual machine is determined, and the affinity strategy and the pre-acquired server location topology relationship are used to determine the corresponding target server node from all server nodes of the cloud platform, and the target virtual machine is scheduled to the target server node. It can be seen that determining the affinity strategy based on the needs of the scheduling area effectively improves the needs of business diversity, and virtual machine migration through affinity strategies and pre-acquired server location topology relationships can effectively improve the efficiency of virtual machine scheduling.

[0093] In some specific embodiments, the affinity strategy determination module 12 may specifically include:

[0094] A first affinity policy selection unit, configured to select, through a preset policy selection interface, an affinity policy uniquely corresponding to the affinity type to be considered by the target virtual machine during scheduling from a preset affinity policy library; the preset affinity policy library includes a soft affinity policy, a hard affinity policy, a soft anti-affinity policy, and a hard anti-affinity policy;

[0095] In some specific embodiments, the affinity strategy determination module 12 may specifically include:

[0096] A second affinity type selection unit, configured to determine an affinity type to be considered during the scheduling of the target virtual machine based on the scheduling region requirement of the target virtual machine;

[0097] The second affinity strategy selection unit is used to determine an affinity strategy uniquely corresponding to each affinity type based on the affinity type and the scheduling area requirement.

[0098] In some specific embodiments, the second affinity type selection unit may specifically include:

[0099] A demand determination unit is used to determine the demand of the target virtual machine for different types of scheduling areas based on the business application demand corresponding to the target virtual machine, or to determine the demand of different types of scheduling areas for the target virtual machine to obtain the scheduling area demand.

[0100] In some specific embodiments, the demand determination unit may specifically include:

[0101] The third affinity strategy selection unit is used to select an affinity strategy uniquely corresponding to each affinity type from a preset affinity strategy library based on the scheduling area requirements; the preset affinity strategy library includes a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.

[0102] In some specific embodiments, the virtual machine scheduling module 13 may specifically include:

[0103] The relationship determination unit is used to determine the cabinet area where each server node is located and the upstream switch area corresponding to each server node, and record the regional location information of the cabinet area and the upstream switch area where each server node is located to obtain the server location topology relationship.

[0104] In some specific embodiments, the virtual machine scheduling module 13 may specifically include:

[0105] A node group determination unit, configured to determine a target server node group from all server nodes of the cloud platform by using a pre-created virtual machine scheduler and the affinity strategy and a pre-acquired server location topology relationship;

[0106] The node screening unit is used to screen the server nodes of the target server node group through the virtual machine scheduler and based on a preset server node screening strategy to obtain the corresponding target server node, and then schedule the target virtual machine to the target server node.

[0107] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The virtual machine scheduling device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, a sensor 25, and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the virtual machine scheduling method performed by the virtual machine scheduling device disclosed in any of the aforementioned embodiments.

[0108] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the virtual machine scheduling device 20; the communication interface 24 can create a data transmission channel between the virtual machine scheduling device 20 and external devices, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the sensor 25 is used to obtain sensor data, and its specific sensor types include but are not limited to speed sensors, temperature sensors, infrared sensors, sound sensors, and image sensors.

[0109] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0110] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the virtual machine scheduling device 20, so as to realize the operation and processing of the processor 21 on the massive data 223 in the memory 22, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the virtual machine scheduling method performed by the virtual machine scheduling device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the virtual machine scheduling device, the data 223 can also include data collected by its own sensor 25, etc.

[0111] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0112] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0113] The above is a detailed introduction to a virtual machine scheduling method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A virtual machine scheduling method, characterized in that: Applied to physical machines, including: Create a target virtual machine to be scheduled; Determine the affinity strategy that uniquely corresponds to the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the type of the scheduling area includes a combination of any two or three of the server node area, the cabinet area, and the switch area; the affinity strategy is a strategy for scheduling the target virtual machine based on the corresponding affinity type; Utilizing the affinity strategy and the pre-acquired server location topology relationship, the corresponding target server node is determined from all server nodes of the cloud platform, and the target virtual machine is scheduled to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

2. The virtual machine scheduling method according to claim 1, characterized in that: The determining of the affinity strategy uniquely corresponding to the affinity type that needs to be considered during the scheduling of the target virtual machine includes: Through the preset strategy selection interface, an affinity strategy uniquely corresponding to the affinity type that the target virtual machine needs to consider during the scheduling process is selected from a preset affinity strategy library; the preset affinity strategy library includes soft affinity strategy, hard affinity strategy, soft anti-affinity strategy and hard anti-affinity strategy.

3. The virtual machine scheduling method according to claim 1, characterized in that: The determining of the affinity strategy uniquely corresponding to the affinity type that needs to be considered during the scheduling of the target virtual machine includes: Based on the scheduling area requirement of the target virtual machine, determining the affinity type that needs to be considered during the scheduling process of the target virtual machine; Based on the affinity type and the scheduling area requirement, an affinity strategy uniquely corresponding to each affinity type is determined.

4. The virtual machine scheduling method according to claim 3, characterized in that: Before determining the affinity type to be considered in the scheduling process of the target virtual machine based on the scheduling area requirement of the target virtual machine, the method further includes: Based on the business application requirements corresponding to the target virtual machine, the requirements of the target virtual machine for different types of scheduling areas are determined, or the requirements of different types of scheduling areas for the target virtual machine are determined to obtain the scheduling area requirements.

5. The virtual machine scheduling method according to claim 3, characterized in that: The determining, based on the affinity type and the scheduling area requirement, an affinity strategy uniquely corresponding to each affinity type includes: Based on the scheduling area requirements, an affinity strategy uniquely corresponding to each affinity type is screened out from a preset affinity strategy library; the preset affinity strategy library includes a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.

6. The virtual machine scheduling method according to claim 1, characterized in that: Before determining the corresponding target server node from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server location topology, the method further includes: Determine the cabinet area where each server node is located and the uplink switch area corresponding to each of the server nodes, and record the area location information of the cabinet area and the uplink switch area where each server node is located to obtain the server location topology relationship.

7. The virtual machine scheduling method according to any one of claims 1 to 6, characterized in that: The method of using the affinity strategy and the pre-acquired server location topology relationship to determine a corresponding target server node from all server nodes of the cloud platform, and scheduling the target virtual machine to the target server node includes: Determine the target server node group from all server nodes of the cloud platform by using the pre-created virtual machine scheduler and the affinity strategy and the pre-acquired server location topology relationship; The target server node group is screened by the virtual machine scheduler based on a preset server node screening strategy to obtain a corresponding target server node, and then the target virtual machine is scheduled to the target server node.

8. A virtual machine scheduling device, characterized in that: include: A virtual machine creation module, used to create a target virtual machine to be scheduled; An affinity policy determination module is used to determine the affinity policy uniquely corresponding to the affinity type that needs to be considered during the scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and the scheduling area, and the type of the scheduling area includes a combination of any two or three of the server node area, the cabinet area and the switch area; the affinity policy is a policy for scheduling the target virtual machine based on the corresponding affinity type; A virtual machine scheduling module is used to use the affinity strategy and the pre-acquired server location topology relationship to determine the corresponding target server node from all server nodes of the cloud platform and schedule the target virtual machine to the target server node; the server location topology relationship is the location topology relationship between the server node and the cabinet area and the switch area respectively.

9. A virtual machine scheduling device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the virtual machine scheduling method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the virtual machine scheduling method according to any one of claims 1 to 7 is implemented.