CN114020405A - Virtual machine scheduling method, device, equipment and medium - Google Patents

Virtual machine scheduling method, device, equipment and medium Download PDF

Info

Publication number
CN114020405A
CN114020405A CN202111257262.2A CN202111257262A CN114020405A CN 114020405 A CN114020405 A CN 114020405A CN 202111257262 A CN202111257262 A CN 202111257262A CN 114020405 A CN114020405 A CN 114020405A
Authority
CN
China
Prior art keywords
affinity
virtual machine
scheduling
strategy
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111257262.2A
Other languages
Chinese (zh)
Inventor
李栋梁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN202111257262.2A priority Critical patent/CN114020405A/en
Publication of CN114020405A publication Critical patent/CN114020405A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for scheduling a virtual machine, which relate to the technical field of computers, and the method is applied to a physical machine and comprises the following steps: creating a target virtual machine to be scheduled; determining an affinity policy uniquely corresponding to an affinity type to be considered in a scheduling process of the target virtual machine, wherein the affinity type is the type of affinity between the target virtual machine and a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; and determining corresponding target server nodes from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes. Through the technical scheme, the virtual machine scheduling can be avoided by adopting a single scheduling region type, so that the diversity and the safety of service requirements are improved.

Description

Virtual machine scheduling method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for scheduling a virtual machine.
Background
With the development of cloud computing technology, more and more services and higher complexity are provided to the cloud, and if the high concurrent service requirements are met, multiple copies of applications need to be deployed, which is reflected in a virtualized cloud platform, that is, a group of applications can be deployed on multiple virtual machines, and multiple service requirements are realized through virtual machine scheduling. Currently, the mainstream cloud platform in the industry only supports affinity scheduling and inverse affinity scheduling according to the granularity of server nodes, and lacks flexibility of virtual machine scheduling.
Therefore, how to avoid the situation that the virtual machine is not flexible to be called due to the traditional affinity scheduling method in the virtual machine scheduling process is a problem to be solved in the field.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a device, and a medium for scheduling a virtual machine, which can effectively improve the flexibility of virtual machine scheduling. The specific scheme is as follows:
in a first aspect, the present application discloses a virtual machine scheduling method, including:
creating a target virtual machine to be scheduled;
determining an affinity strategy which is only corresponding to the affinity type 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 a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity strategy is a strategy which is constructed based on the corresponding affinity type and is used for scheduling the target virtual machine;
determining corresponding target server nodes from all server nodes of a cloud platform by using the affinity strategy and a pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
Optionally, the determining an affinity policy uniquely corresponding to an affinity type to be considered by the target virtual machine in the scheduling process includes:
selecting an affinity strategy which is uniquely corresponding to the affinity type to be considered in the scheduling process of the target virtual machine from a preset affinity strategy library through a preset strategy selection interface; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.
Optionally, the determining an affinity policy uniquely corresponding to an affinity type to be considered by the target virtual machine in the scheduling process includes:
determining an affinity type which needs to be considered in the scheduling process of the target virtual machine based on the scheduling region requirement of the target virtual machine;
and determining an affinity strategy uniquely corresponding to each affinity type based on the affinity types and the requirements of the scheduling region.
Optionally, before determining the affinity type that needs to be considered in the scheduling process of the target virtual machine based on the requirement of the scheduling area of the target virtual machine, the method further includes:
and determining the requirements of the target virtual machine on different types of the scheduling areas based on the business application requirements corresponding to the target virtual machine, or determining the requirements of the different types of the scheduling areas on the target virtual machine to obtain the requirements of the scheduling areas.
Optionally, the determining, based on the affinity types and the requirement of the scheduling area, an affinity policy uniquely corresponding to each of the affinity types includes:
based on the requirement of the scheduling area, screening out an affinity strategy which is uniquely corresponding to each affinity type from a preset affinity strategy library; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.
Optionally, before determining a corresponding target server node from all server nodes of the cloud platform by using the affinity policy and the pre-obtained server location topological relation, the method further includes:
and determining a cabinet area where each server node is located and an uplink switch area corresponding to each server node, and recording area position information of the cabinet area where each server node is located and the uplink switch area to obtain the server position topological relation.
Optionally, the determining, by using the affinity policy and the pre-obtained server location topological relation, 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:
determining a target server node group from all server nodes of the cloud platform by using a pre-established virtual machine scheduler and by using the affinity strategy and a pre-acquired server position topological relation;
and screening the server nodes of the target server node group through the virtual machine scheduler based on a preset server node screening strategy to obtain corresponding target server nodes, and then scheduling the target virtual machine to the target server nodes.
In a second aspect, the present application discloses a virtual machine scheduling apparatus, including:
the virtual machine creating module is used for creating a target virtual machine to be scheduled;
the affinity strategy determining module is used for determining an affinity strategy which is only corresponding to the affinity type 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 a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity strategy is a strategy which is constructed based on the corresponding affinity type and is used for scheduling the target virtual machine;
the virtual machine scheduling module is used for determining corresponding target server nodes from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server position topological relation, and scheduling the target virtual machines to the target server nodes; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the virtual machine scheduling method.
In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the virtual machine scheduling method disclosed in the foregoing.
According to the method, a target virtual machine to be scheduled is created first, an affinity strategy which is uniquely corresponding to an affinity type to be considered in the scheduling process of the target virtual machine is determined, the affinity type is the type of the affinity between the target virtual machine and a scheduling area, the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area, the affinity strategy is a strategy which is constructed based on the corresponding affinity type and is used for scheduling the target virtual machine, and then the corresponding target server node is determined from all server nodes of a cloud platform and the target virtual machine is scheduled to the target server node by utilizing the affinity strategy and a pre-acquired server position topological relation. Therefore, according to the virtual machine scheduling method, multiple affinity types such as the server node area, the cabinet area and the switch area are considered, and then corresponding affinity strategies are selected for the affinity types, so that the corresponding server nodes are determined from all server nodes of the cloud platform to achieve scheduling of the target virtual machine to be scheduled.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a scheduling method for a virtual machine according to the present disclosure;
FIG. 2 is a schematic diagram of a server location topology disclosed in the present application;
FIG. 3 is a flowchart of a specific virtual machine scheduling method disclosed herein;
FIG. 4 is a flowchart of a specific virtual machine scheduling method disclosed herein;
FIG. 5 is a flowchart of a specific virtual machine scheduling method disclosed herein;
FIG. 6 is a diagram of a physical topology provided herein;
FIG. 7 is a data structure diagram provided in the present application
Fig. 8 is a schematic structural diagram of a virtual machine scheduling apparatus disclosed in the present application;
fig. 9 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, in the current background, when virtual machine scheduling is performed, affinity scheduling and inverse affinity scheduling according to server node granularity are only supported, and flexibility of virtual machine scheduling is lacked. From the above, how to avoid the situation that the virtual machine is not flexible due to affinity scheduling performed by a single affinity type in the virtual machine scheduling process is a problem to be solved in the art.
Referring to fig. 1, an embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine, and specifically may include:
step S11: and creating a target virtual machine to be scheduled.
Step S12: determining an affinity strategy which is only corresponding to the affinity type 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 a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity policy is a policy for scheduling the target virtual machine, which is constructed based on the corresponding affinity type.
In this embodiment, after a target virtual machine to be scheduled is created, an affinity policy uniquely corresponding to an affinity type that needs to be considered by the target virtual machine in a scheduling process is selected from a preset affinity policy library according to a requirement of a service application. For example, the relationship between the affinity type and the type of scheduling region, as shown in FIG. 2. Wherein, the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.
The soft affinity strategy, hard affinity strategy, soft anti-affinity strategy, and hard anti-affinity strategy described herein are specifically described as follows:
soft affinity strategy: the virtual machines to be scheduled are scheduled to the same affinity type as much as possible, but the virtual machines can be successfully scheduled when part of the virtual machines cannot be scheduled to the same affinity type due to insufficient resources and the like;
hard affinity strategy: the virtual machines to be scheduled must be scheduled to the same affinity type, and if the virtual machines cannot be scheduled to the same affinity type, the scheduling fails;
soft anti-affinity strategy: the virtual machines to be scheduled are not scheduled to the same affinity type as much as possible, but the virtual machines can be successfully scheduled when part of the virtual machines need to be scheduled to the same affinity type due to insufficient resources and the like;
hard anti-affinity strategy: the virtual machines to be scheduled must not be scheduled under the same affinity type, and the scheduling fails if the requirements cannot be met.
For example, in the existing two cabinets A, B, there are server nodes 1 and 2 in the cabinet a, and there are server nodes 3 and 4 in the cabinet B, and one virtual machine to be scheduled is scheduled to the node 4 according to the service requirement, then the cabinet B hard affinity policy and the node 4 hard affinity policy may be selected to be implemented, and in addition, the cabinet a hard anti-affinity policy and the node 4 hard affinity policy, the cabinet a hard anti-affinity policy and the node 3 hard anti-affinity policy, and the cabinet B hard affinity policy and the node 3 hard anti-affinity policy may also be selected to implement the above effects.
In the above policy, the resource shortage condition may include: and when the resource capacity of the virtual machines to be scheduled is larger than the resource capacity provided by the server node, or the number of the virtual machines to be scheduled and the number of the nodes conflict when the affinity strategy is met, and the like. For example, five virtual machines to be scheduled are created, four server nodes wait for scheduling in the same cabinet, and the resource capacities of the virtual machines to be scheduled and the nodes all satisfy the resource condition of scheduling, and if the server nodes are screened based on the cabinet soft affinity policy and the server node soft anti-affinity policy, then there is a possibility that the scheduling result is: the virtual machines to be scheduled 1-4 are sequentially distributed to four server nodes, and the virtual machine to be scheduled 5 is randomly distributed 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, the scheduling result has a possibility that: the virtual machines to be scheduled 1-4 are sequentially distributed to the four server nodes, and the virtual machine to be scheduled 5 fails in scheduling. At this time, the number of virtual machines to be scheduled and the number of nodes are in conflict when the affinity policy is satisfied.
Step S13: determining corresponding target server nodes from all server nodes of a cloud platform by using the affinity strategy and a pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
In this embodiment, after determining an affinity policy uniquely corresponding to an affinity type that needs to be considered in a scheduling process of the target virtual machine, a policy for scheduling the target virtual machine, which is constructed based on the corresponding affinity type, and a position topological relationship between a server node, which is obtained in advance, and the cabinet area and the switch area, respectively, are used to determine a corresponding target server node from all server nodes of a cloud platform, and schedule the target virtual machine to the target server node.
In this embodiment, after a target virtual machine to be scheduled is created, according to a requirement of a service application, an affinity policy uniquely corresponding to an affinity type that needs to be considered in a scheduling process of the target virtual machine is selected from a preset affinity policy library, a policy for scheduling the target virtual machine is established based on the corresponding affinity type, and a position topological relation between a server node that is established in advance and the cabinet area and a position topological relation between the server node and the switch area are obtained in advance, so that a corresponding target server node is determined from all server nodes of a cloud platform, and the target virtual machine is scheduled to the target server node. Therefore, in the embodiment, the affinity policy uniquely corresponding to the affinity type to be considered in the scheduling process of the target virtual machine is selected from the preset affinity policy library, so that the scheduling efficiency of the virtual machine is effectively improved, the complexity is reduced, and the diversity of service requirements is effectively improved by selecting the affinity policy uniquely corresponding to the affinity type to be considered in the scheduling process of the target virtual machine.
Referring to fig. 3, an embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine, and specifically may include:
step S21: and creating a target virtual machine to be scheduled.
Step S22: selecting an affinity strategy which is uniquely corresponding to the affinity type to be considered in the scheduling process of the target virtual machine from a preset affinity strategy library through a preset strategy selection interface; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.
In this embodiment, after creating a target virtual machine to be scheduled, a user may directly select, through a preset policy selection interface, an affinity policy uniquely corresponding to an affinity type that needs to be considered by the target virtual machine in a scheduling process from a preset affinity policy library, in the selection process of the affinity policy, only one affinity policy may be selected if a single affinity type is required, one affinity policy may correspond to multiple affinity types, and a single affinity type and multiple policies may not be selected at the same time.
Step S23: and determining corresponding target server nodes from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes.
In this embodiment, after creating a target virtual machine to be scheduled, a user may directly select, through a preset policy selection interface, an affinity policy uniquely corresponding to an affinity type that needs to be considered by the target virtual machine in a scheduling process from a preset affinity policy library, determine, by using the affinity policy and a pre-obtained server location topological relation, a corresponding target server node from all server nodes of a cloud platform, and schedule the target virtual machine to the target server node. Therefore, the affinity strategy is selected from the preset affinity strategy library according to the preset strategy selection interface, so that the requirement of a user on the service performance can be effectively met, the virtual machine scheduling efficiency is improved, and the diversity of service requirements is increased.
Referring to fig. 4, an embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine, and specifically may include:
step S31: and creating a target virtual machine to be scheduled.
Step S32: determining an affinity type which needs to be considered in the scheduling process of the target virtual machine based on the scheduling region requirement of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area.
Before this step, also include: and determining the requirements of the target virtual machine on different types of the scheduling areas based on the business application requirements corresponding to the target virtual machine, or determining the requirements of the different types of the scheduling areas on the target virtual machine to obtain the requirements of the scheduling areas.
In this embodiment, based on a service application requirement corresponding to the target virtual machine, requirements of the target virtual machine on different types of the scheduling areas are determined, or requirements of the different types of the scheduling areas on the target virtual machine are determined, so as to obtain the requirements of the scheduling areas. For example, to prevent a cabinet from being powered off, multiple virtual machines need to be distributed to different cabinets; in order to prevent the switch from failure, a plurality of virtual machines are required to be dispersed to different uplink switches; in order to reduce the network delay bandwidth in the business and ensure the high availability of the business, a plurality of virtual machines are required to be dispersed under different servers under the same switch.
In this embodiment, based on the requirement of the scheduling area of the target virtual machine, the affinity type that needs to be considered in the scheduling process of the target virtual machine is determined. Therefore, according to the dispatching area requirement of the target virtual machine, the type of the affinity between the target virtual machine and any two or three combinations of the server node area, the cabinet area and the switch area can be determined, the diversity of service requirements can be effectively improved, and the requirement of service on performance can be met.
Step S33: screening out an affinity strategy uniquely corresponding to each affinity type from a preset affinity strategy library based on the affinity type and the requirement of the scheduling area; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy; the affinity policy is a policy for scheduling the target virtual machine, which is constructed based on the corresponding affinity type.
In this embodiment, after determining an affinity type that needs to be considered in a scheduling process of the target virtual machine based on a scheduling area requirement of the target virtual machine, an affinity policy uniquely corresponding to each affinity type is screened from a preset affinity policy library according to the affinity type and the scheduling area requirement. Therefore, the affinity strategy is determined according to the dispatching area requirement and the affinity type, so that the diversity of service requirements can be effectively improved, and the dispatching efficiency of the virtual machine can be improved.
Step S34: determining corresponding target server nodes from all server nodes of a cloud platform by using the affinity strategy and a pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
In this embodiment, after a target virtual machine to be scheduled is created, based on a service application requirement corresponding to the target virtual machine, requirements of the target virtual machine for different types of scheduling areas are determined, or, determining the requirements of different types of the scheduling regions on the target virtual machine to obtain the requirements of the scheduling regions, and determining affinity types to be considered in the scheduling process of the target virtual machine based on the scheduling region requirement of the target virtual machine, screening an affinity strategy uniquely corresponding to each affinity type from a preset affinity strategy library, determining corresponding target server nodes from all server nodes of a cloud platform by using the affinity strategies and a pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes. Therefore, the process of determining the affinity type to be considered in the scheduling process of the target virtual machine based on the scheduling region requirement of the target virtual machine effectively improves the diversity of service requirements and the efficiency of screening affinity strategies, thereby improving the scheduling efficiency of the virtual machine.
Referring to fig. 5, an embodiment of the present invention discloses a virtual machine scheduling method, which is applied to a physical machine, and specifically may include:
step S41: and creating a target virtual machine to be scheduled.
Step S42: determining an affinity strategy which is only corresponding to the affinity type 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 a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity policy is a policy for scheduling the target virtual machine, which is constructed based on the corresponding affinity type.
Step S43: and determining a target server node group from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server position topological relation through a pre-created virtual machine scheduler.
In this embodiment, before determining the corresponding target server node from all the server nodes of the cloud platform by using the affinity policy and the pre-obtained server location topological relation, the method may further include: and determining a cabinet area where each server node is located and an uplink switch area corresponding to each server node, and recording area position information of the cabinet area where each server node is located and the uplink switch area to obtain the server position topological relation.
It is understood that the server location topological relation is obtained in advance, and in a specific embodiment, the topological relation may include a physical topological relation as in fig. 6 and a data structure relation as in fig. 7.
In a specific implementation manner in this embodiment, a screening result of the virtual machine scheduler on the server node is a mapping relationship of one server node corresponding to one virtual machine to be scheduled in table 1.
TABLE 1
Virtual machine to be scheduled 1 Server node A
Virtual machine to be scheduled 2 Server node B
Virtual machine 3 to be scheduled Server node C
Virtual machine to be scheduled 4 Server node D
It can be understood that the result obtained by using the virtual machine scheduler screening may be multiple groups, that is, there may be multiple mapping relationships between the server nodes to be scheduled and the virtual machine to be scheduled in the target server node group, which may be expressed as: in the result obtained by the scheduler screening, the first possible mapping relationship is that the virtual machines 1, 2, 3, and 4 to be scheduled may respectively correspond to the server node A, B, C, D, and since the resource capacity compatibility of each server node and each virtual machine to be scheduled is high, other mapping relationships may also exist, for example, the virtual machine 1 to be scheduled may correspond to the server node B, the virtual machine 2 to be scheduled may correspond to the server node C, the virtual machine 3 to be scheduled may correspond to the server node D, and the virtual machine 4 to be scheduled may correspond to the server node a. At this time, because of the possibility of multiple mapping relationships, one group which is most suitable for service requirements and most reasonable in resource allocation can be screened out from the multiple groups of relationships, and the screened result is used as a target server node to schedule the virtual machine.
In this embodiment, after determining the only affinity policy corresponding 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 server node, and record the area location information of the cabinet area where each server node is located and the uplink switch area, so as to obtain the server location topological relation. Therefore, the accuracy of the topological relation of the positions of the servers can be effectively improved by determining and recording the regional position information of the cabinet region and the uplink switch region, and the requirements of services on performance are met.
Step S44: and screening the server nodes of the target server node group through the virtual machine scheduler based on a preset server node screening strategy to obtain corresponding target server nodes, and then scheduling the target virtual machine to the target server nodes.
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 area location information of the cabinet area where each server node is located and the uplink switch area to obtain the server location topological relation, a target server node group is determined from all server nodes of the cloud platform by using the affinity policy and the server location topological relation obtained in advance through the virtual machine scheduler created in advance. Therefore, the accuracy of virtual machine scheduling can be effectively improved by determining the target server node group in all the server nodes of the cloud platform, and the requirement of the service on the safety performance is improved.
In this embodiment, after a target server node group is determined from all server nodes of a cloud platform by using a pre-created virtual machine scheduler and by using the affinity policy and a pre-obtained server location topological relation, the target server node group is screened by the virtual machine scheduler based on a preset server node screening policy to obtain a corresponding target server node, and then the target virtual machine is scheduled to the target server node. Therefore, server nodes are screened for the target server node group through a preset server node screening strategy, the diversity of service requirements can be effectively improved, and the accuracy of virtual machine scheduling is improved.
Referring to fig. 8, an embodiment of the present application discloses a virtual machine scheduling apparatus, which may specifically include:
a virtual machine creating module 11, configured to create a target virtual machine to be scheduled;
an affinity policy determining module 12, configured to determine an affinity policy uniquely corresponding to an affinity type that needs to be considered in a scheduling process of the target virtual machine; the affinity type is the type of affinity between the target virtual machine and a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity strategy is a strategy which is constructed based on the corresponding affinity type and is used for scheduling the target virtual machine;
the virtual machine scheduling module 13 is configured to determine a corresponding target server node from all server nodes of the cloud platform by using the affinity policy and a pre-obtained server location topological relation, and schedule the target virtual machine to the target server node; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
In this embodiment, after a target virtual machine to be scheduled is created, based on a scheduling area requirement of the target virtual machine, an affinity type that needs to be considered in a scheduling process of the target virtual machine is determined; and determining an affinity strategy uniquely corresponding to each affinity type based on the affinity type and the requirement of the scheduling area, determining an affinity strategy uniquely corresponding to the affinity type which needs to be considered in the scheduling process of the target virtual machine, determining corresponding target server nodes from all server nodes of the cloud platform by using the affinity strategy and a pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes. Therefore, the affinity strategy is determined according to the requirements of the scheduling area, the requirements of service diversity are effectively improved, the virtual machine is migrated according to the affinity strategy and the pre-acquired server position topological relation, and the virtual machine scheduling efficiency can be effectively improved.
In some embodiments, the affinity policy determining module 12 may specifically include:
the first affinity strategy selection unit is used for selecting an affinity strategy which is only corresponding to the affinity type to be considered in the scheduling process of the target virtual machine from a preset affinity strategy library through a preset strategy selection interface; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy;
in some embodiments, the affinity policy determining module 12 may specifically include:
the second affinity type selection unit is used for determining an affinity type which needs to be considered in the scheduling process of the target virtual machine based on the scheduling region requirement of the target virtual machine;
and the second affinity strategy selection unit is used for determining an affinity strategy uniquely corresponding to each affinity type based on the affinity type and the requirement of the scheduling region.
In some embodiments, the second affinity type selection unit may specifically include:
and a requirement determining unit, configured to determine, based on a service application requirement corresponding to the target virtual machine, requirements of the target virtual machine on different types of the scheduling areas, or determine requirements of the different types of the scheduling areas on the target virtual machine, so as to obtain the requirements of the scheduling areas.
In some specific embodiments, the requirement determining unit may specifically include:
the third affinity strategy selection unit is used for screening out an affinity strategy which is uniquely corresponding to each affinity type from a preset affinity strategy library based on the requirement of the scheduling area; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.
In some specific embodiments, the virtual machine scheduling module 13 may specifically include:
and the relationship determining unit is used for determining the cabinet area where each server node is located and the uplink switch area corresponding to each server node, and recording the area position information of the cabinet area where each server node is located and the uplink switch area to obtain the server position topological relationship.
In some specific embodiments, the virtual machine scheduling module 13 may specifically include:
the node group determining unit is used for determining a target server node group from all server nodes of the cloud platform through a pre-established virtual machine scheduler and by utilizing the affinity strategy and a pre-acquired server position topological relation;
and the node screening unit is used for screening the server nodes of the target server node group through the virtual machine scheduler based on a preset server node screening strategy to obtain corresponding target server nodes, and then scheduling the target virtual machine to the target server nodes.
Fig. 9 is a schematic structural diagram of an electronic device according to 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, sensors 25, and a communication bus 26. Wherein the memory 22 is used for storing 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 executed by the virtual machine scheduling apparatus disclosed in any one of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide a 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 an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; sensor 25 for acquiring sensor data, specific sensor types including, but not limited to, speed sensor, temperature sensor, infrared sensor, sound sensor, image sensor, and the like.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., the resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage may be a transient storage or a permanent storage.
The operating system 221 is configured to manage and control each hardware device and the computer program 222 on the virtual machine scheduling device 20, so as to implement the operation and processing of the mass data 223 in the memory 22 by the processor 21, and may be Windows, Unix, Linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the virtual machine scheduling method performed by the virtual machine scheduling apparatus 20 disclosed in any of the foregoing embodiments. The data 223 may include data received by the virtual machine scheduling device and transmitted by an external device, or may include data collected by the sensor 25 itself.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing describes in detail a method, an apparatus, a device, and a storage medium for scheduling a virtual machine according to the present invention, and a specific example is applied in the description to explain the principles and embodiments of the present invention, and the description of the foregoing embodiments is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A virtual machine scheduling method is applied to a physical machine and comprises the following steps:
creating a target virtual machine to be scheduled;
determining an affinity strategy which is only corresponding to the affinity type 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 a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity strategy is a strategy which is constructed based on the corresponding affinity type and is used for scheduling the target virtual machine;
determining corresponding target server nodes from all server nodes of a cloud platform by using the affinity strategy and a pre-acquired server position topological relation, and scheduling the target virtual machine to the target server nodes; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
2. The virtual machine scheduling method according to claim 1, wherein the determining an affinity policy uniquely corresponding to an affinity type to be considered by the target virtual machine in the scheduling process comprises:
selecting an affinity strategy which is uniquely corresponding to the affinity type to be considered in the scheduling process of the target virtual machine from a preset affinity strategy library through a preset strategy selection interface; the preset affinity strategy library comprises a soft affinity strategy, a hard affinity strategy, a soft anti-affinity strategy and a hard anti-affinity strategy.
3. The virtual machine scheduling method according to claim 1, wherein the determining an affinity policy uniquely corresponding to an affinity type to be considered by the target virtual machine in the scheduling process comprises:
determining an affinity type which needs to be considered in the scheduling process of the target virtual machine based on the scheduling region requirement of the target virtual machine;
and determining an affinity strategy uniquely corresponding to each affinity type based on the affinity types and the requirements of the scheduling region.
4. The virtual machine scheduling method according to claim 3, wherein before determining the affinity type to be considered by the target virtual machine in the scheduling process based on the scheduling area requirement of the target virtual machine, the method further comprises:
and determining the requirements of the target virtual machine on different types of the scheduling areas based on the business application requirements corresponding to the target virtual machine, or determining the requirements of the different types of the scheduling areas on the target virtual machine to obtain the requirements of the scheduling areas.
5. The virtual machine scheduling method according to claim 3, wherein the determining an affinity policy uniquely corresponding to each of the affinity types based on the affinity type and the scheduling region requirement comprises:
based on the requirement of the scheduling area, screening out an affinity strategy which is uniquely corresponding to each affinity type from a preset affinity strategy library; the preset affinity strategy library comprises 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, wherein before determining a corresponding target server node from all server nodes of a cloud platform by using the affinity policy and the pre-obtained server location topological relation, the method further comprises:
and determining a cabinet area where each server node is located and an uplink switch area corresponding to each server node, and recording area position information of the cabinet area where each server node is located and the uplink switch area to obtain the server position topological relation.
7. The virtual machine scheduling method according to any one of claims 1 to 6, wherein the determining, by using the affinity policy and a pre-obtained server location topological relation, a corresponding target server node from all server nodes of a cloud platform and scheduling the target virtual machine to the target server node includes:
determining a target server node group from all server nodes of the cloud platform by using a pre-established virtual machine scheduler and by using the affinity strategy and a pre-acquired server position topological relation;
and screening the server nodes of the target server node group through the virtual machine scheduler based on a preset server node screening strategy to obtain corresponding target server nodes, and then scheduling the target virtual machine to the target server nodes.
8. A virtual machine scheduling apparatus, comprising:
the virtual machine creating module is used for creating a target virtual machine to be scheduled;
the affinity strategy determining module is used for determining an affinity strategy which is only corresponding to the affinity type 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 a scheduling area, and the type of the scheduling area comprises any two or three combinations of a server node area, a cabinet area and a switch area; the affinity strategy is a strategy which is constructed based on the corresponding affinity type and is used for scheduling the target virtual machine;
the virtual machine scheduling module is used for determining corresponding target server nodes from all server nodes of the cloud platform by using the affinity strategy and the pre-acquired server position topological relation, and scheduling the target virtual machines to the target server nodes; the server position topological relation is a position topological relation between a server node and the cabinet area and between the server node and the switch area respectively.
9. A virtual machine scheduling apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the virtual machine scheduling method of any of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the virtual machine scheduling method of any of claims 1 to 7.
CN202111257262.2A 2021-10-27 2021-10-27 Virtual machine scheduling method, device, equipment and medium Pending CN114020405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111257262.2A CN114020405A (en) 2021-10-27 2021-10-27 Virtual machine scheduling method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111257262.2A CN114020405A (en) 2021-10-27 2021-10-27 Virtual machine scheduling method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114020405A true CN114020405A (en) 2022-02-08

Family

ID=80058298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111257262.2A Pending CN114020405A (en) 2021-10-27 2021-10-27 Virtual machine scheduling method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114020405A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233255A (en) * 2023-05-06 2023-06-06 工业富联(佛山)创新中心有限公司 Scheduling policy chain generation and scheduling method and related equipment
CN116938943A (en) * 2023-09-15 2023-10-24 北京城建智控科技股份有限公司 Cloud host scheduling method, device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233255A (en) * 2023-05-06 2023-06-06 工业富联(佛山)创新中心有限公司 Scheduling policy chain generation and scheduling method and related equipment
CN116233255B (en) * 2023-05-06 2023-07-04 工业富联(佛山)创新中心有限公司 Scheduling policy chain generation and scheduling method and related equipment
CN116938943A (en) * 2023-09-15 2023-10-24 北京城建智控科技股份有限公司 Cloud host scheduling method, device, equipment and storage medium
CN116938943B (en) * 2023-09-15 2024-01-12 北京城建智控科技股份有限公司 Cloud host scheduling method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US9720724B2 (en) System and method for assisting virtual machine instantiation and migration
US20200364608A1 (en) Communicating in a federated learning environment
EP3419247B1 (en) Method and device for storage resource allocation for video cloud storage
EP3507692B1 (en) Resource oversubscription based on utilization patterns in computing systems
US11297130B2 (en) Cluster resource management in distributed computing systems
US9807159B2 (en) Allocation of virtual machines in datacenters
US8732699B1 (en) Migrating virtual machines between physical machines in a define group
US8185905B2 (en) Resource allocation in computing systems according to permissible flexibilities in the recommended resource requirements
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
JP2008541213A (en) Autonomous storage provisioning to improve the availability of storage virtualization infrastructure [i1]
CN103533063A (en) Method and device capable of realizing dynamic expansion of WEB (World Wide Web) application resource
CN114020405A (en) Virtual machine scheduling method, device, equipment and medium
EP3432132B1 (en) Data storage method and device
CN111399970A (en) Reserved resource management method, device and storage medium
CN112269661B (en) Partition migration method and device based on Kafka cluster
CN110580198A (en) Method and device for adaptively switching OpenStack computing node into control node
Mollamotalebi et al. Multi-objective dynamic management of virtual machines in cloud environments
US9594596B2 (en) Dynamically tuning server placement
EP4006725A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
CN109005071B (en) Decision deployment method and scheduling equipment
Keller et al. Dynamic management of applications with constraints in virtualized data centres
CN112468458B (en) Scheduling method based on neutron layering mechanism
KR101654969B1 (en) Method and apparatus for assigning namenode in virtualized cluster environments
CN110347473B (en) Method and device for distributing virtual machines of virtualized network elements distributed across data centers
JP6669807B2 (en) Computer system and computer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination