WO2023221844A1 - Resource scheduling method, device, and storage medium - Google Patents

Resource scheduling method, device, and storage medium Download PDF

Info

Publication number
WO2023221844A1
WO2023221844A1 PCT/CN2023/093401 CN2023093401W WO2023221844A1 WO 2023221844 A1 WO2023221844 A1 WO 2023221844A1 CN 2023093401 W CN2023093401 W CN 2023093401W WO 2023221844 A1 WO2023221844 A1 WO 2023221844A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
machine
type
physical
virtual
Prior art date
Application number
PCT/CN2023/093401
Other languages
French (fr)
Chinese (zh)
Inventor
邓荔文
仇烨亮
彭飞
钟剑
Original Assignee
阿里巴巴(中国)有限公司
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 阿里巴巴(中国)有限公司 filed Critical 阿里巴巴(中国)有限公司
Publication of WO2023221844A1 publication Critical patent/WO2023221844A1/en

Links

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of cloud computing technology, and in particular, to a resource scheduling method, equipment and storage medium.
  • Server virtualization technology is a key technology based on the infrastructure layer in cloud computing. This technology virtualizes physical servers to deploy multiple virtual machines (VMs) on a single physical machine.
  • VMs virtual machines
  • a certain type of physical machine can only produce virtual machines of certain specifications, and the resources required by the virtual machine specifications may not be exactly equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine.
  • the resource ratio of memory to CPU in the physical machine is 192GB memory:104vCPU.
  • 104vCPU means that the number of cores of the virtual CPU is 104 cores.
  • the resource ratio required for the virtual machine specifications deployed on this physical machine is 4GB memory:1vCPU, which undoubtedly results in at least 58 vCPU resources remaining.
  • Various aspects of this application provide a resource processing and scheduling method, device, and storage medium to reduce resource fragmentation of physical machines and improve resource utilization of physical machines.
  • This embodiment of the present application provides a resource scheduling method, including:
  • the first type of virtual machine is an exclusive virtual machine or a shared virtual machine
  • the virtual machine deployment mode of the first physical machine When the first resource is less than the total resources of the physical machine, set the virtual machine deployment mode of the first physical machine to a hybrid deployment mode that supports exclusive virtual machines and shared virtual machines;
  • simulation scheduling is performed on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine to determine the physical machine's total resources.
  • the target resource specifications and quantities of the first type of virtual machine and the second type of virtual machine supported by the machine; the second type of virtual machine is the same as the first type of the exclusive virtual machine and the shared virtual machine. Different types of virtual machines;
  • the target resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the first physical machine perform a mixed deployment of exclusive virtual machines and shared virtual machines on the physical machine;
  • the exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of the physical machine;
  • the shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
  • This embodiment of the present application also provides a resource scheduling method, including:
  • the virtual machine inventory level is less than the set first water level threshold, select a second physical machine with idle resources that meets the resource requirements of the first type virtual machine from the physical machines where the second type virtual machine is deployed separately.
  • the second type virtual machine is a type different from the first type virtual machine among the exclusive virtual machine and the shared virtual machine;
  • Utilizing the idle resources of the second physical machine deploy the first type virtual machine in the second physical machine
  • the exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of the physical machine;
  • the shared virtual machine refers to a virtual machine in which a virtual processor shares the physical processor resources.
  • An embodiment of the present application also provides a computing device, including: a memory and a processor; wherein the memory is used to store a computer program;
  • the processor is coupled to the memory and is configured to execute the computer program for performing the steps in each of the above resource scheduling methods.
  • Embodiments of the present application also provide a computer-readable storage medium storing computer instructions.
  • the computer instructions are executed by one or more processors, the one or more processors are caused to execute each of the above resource scheduling methods. A step of.
  • the mixed deployment of exclusive virtual machines and shared virtual machines is realized, which is helpful to To reduce the amount of natural resource fragmentation caused by limited virtual machine specifications.
  • the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
  • Figure 1 is a schematic structural diagram of a computing system provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of a separate deployment mode provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of the workflow of the computing system provided by the embodiment of the present application.
  • Figure 4 is a schematic diagram of the effects of the individual deployment mode and the mixed deployment mode provided by the embodiment of the present application;
  • Figure 5 is a schematic diagram of resource scheduling in the hybrid deployment mode provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of the weak mixing part mode and the strong mixing part mode provided by the embodiment of the present application.
  • Figure 7 is a schematic flow chart of virtual machine deployment by the computing system provided by the embodiment of the present application.
  • FIGS 8 and 9 are schematic diagrams of the virtual machine deployment mode switching process provided by the embodiment of the present application.
  • FIGS 10 and 11 are flowcharts of the resource scheduling method provided by the embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • mixed deployment of exclusive virtual machines and shared virtual machines can be realized by pre-planning the specifications and quantities of exclusive virtual machines and shared virtual machines that can be mixed deployed on the physical machine. Helps reduce the amount of natural resource fragmentation caused by limited virtual machine specifications.
  • the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
  • Figure 1 is a schematic structural diagram of a computing system provided by an embodiment of the present application.
  • the computing system includes: a management node 10 and a computing cluster 11.
  • the computing cluster 11 includes: one or more physical machines 20.
  • the number of physical machines 20 is multiple.
  • the physical machine 20 refers to a computing device that provides resources.
  • the amount of resources contained in each physical machine 20 may be the same or different.
  • the same amount of resources contained in the physical machines 20 means that the amount of resources of each resource type of the physical machines is the same;
  • the different amounts of resources contained in the physical machines 20 means that different physical machines have resources of a certain dimension or certain dimensions.
  • the amount is different.
  • the resources of the physical machine include but are not limited to: processor resources (such as CPU, GPU, etc.), storage resources (such as memory, etc.) and network resources (bandwidth, etc.).
  • the management and control node 10 refers to a computing device that performs resource management and resource scheduling on the physical machine 20 .
  • the management and control node 10 can be a single server device, a cloud server array, or a virtual machine (Virtual Machine, VM) running in a cloud server array.
  • VM Virtual Machine
  • the management and control node 10 may also refer to other computing devices with corresponding service capabilities, such as computers and other terminal devices (running service programs).
  • the connection between the management node 10 and the physical machine 20 may be wireless or wired.
  • the management and control node 10 can be connected to the physical machine 20 through a mobile network.
  • the network standard of the mobile network can be 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS). ), 4G(LTE), 4G+(LTE+), 5G, WiMax, etc.
  • the management node 10 and the physical machine 20 can also be communicated and connected through Bluetooth, WiFi, infrared, etc.
  • cloud vendors can use virtualization technology to deploy an exclusive virtual machine 201 or a shared virtual machine 202 on the physical machine 20 to achieve exclusive or shared use of the processor resources of the physical machine 20 .
  • the processor of the physical machine 20 includes but is not limited to: CPU, GPU, etc.
  • the processor resources of the physical machine 20 may be represented by the number of physical cores of the processor.
  • the core of the processor of the physical machine is called the physical core
  • the core of the processor used by the virtual machine is called the logical core.
  • the processor of the virtual machine is called a virtual processor; the processor of the physical machine 20 is called Physical processor.
  • an exclusive virtual machine refers to a virtual machine in which a virtual processor (such as a vCPU) exclusively occupies the physical processor resources of a physical machine. That is, one physical core can only be mapped to one logical core or one virtual machine. At this time, the virtual processor resources of the physical machine are relatively low, and the virtual processors of the virtual machines will not compete for physical processor resources. Therefore, the performance index of the Service Level Agreement (SLA) of an exclusive virtual machine is relatively high. Exclusive virtual machines have higher service performance.
  • SLA Service Level Agreement
  • the virtual ratio of processor resources refers to the ratio of the number of logical cores obtained by virtualizing a physical core to the number of physical cores, and is used to reflect the number of logical cores that can be virtualized by one physical core. For example, if the virtual ratio of processor resources is 4 (number of logical cores): 1 (number of physical cores), it means that one physical core is virtualized into 4 logical cores.
  • a shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources, that is, one physical core can be mapped to multiple logical cores or multiple virtual machines. At this time, one physical core is virtualized into multiple logical cores. The virtualization ratio of the physical machine's processor resources is high, and the utilization rate of the physical machine's processor resources is high. However, because multiple virtual processors in a shared virtual machine share the same physical processor resource, multiple virtual machines compete for processor resources in a shared virtual machine. Therefore, the performance index of the SLA of a shared virtual machine is relatively low. Low. Shared virtual machines have lower service performance.
  • the exclusive virtual machine 201 and the shared virtual machine 202 are not deployed on the same physical machine 20. That is, the exclusive virtual machine 201 and the shared virtual machine 202 do not coexist on the same physical machine 20, but are physically isolated, and their resources are not shared at all. Users can apply for shared virtual machines or dedicated virtual machines according to their own needs.
  • the management and control node 10 can respond to the user's virtual machine deployment request, obtain the virtual machine demand information, and perform resource scheduling in the physical machine 20 based on the virtual machine demand information, and deploy a virtual machine adapted to the virtual machine deployment request.
  • the management and control node 10 can schedule adapted resources from the physical machine used to deploy the shared virtual machine; and use the scheduled resources to Deploy shared virtual machines on physical machines.
  • the management and control node 10 can schedule adapted resources from the physical machine used for the exclusive virtual machine, and use the scheduled resources to in the physical machine Deploy dedicated virtual machines.
  • the specifications of the virtual machines provided by cloud vendors are certain.
  • the resource specifications of the virtual machine include: the resource type of the virtual machine and the amount of resources of each resource type.
  • the resource specifications of the virtual machine may include: the number of virtual processors, the amount of memory, bandwidth, the number of network cards, the number of packets per second (Packets Per Second, PPS), etc., but are not limited to this. Users can select appropriate specifications to apply for virtual machine resources based on resource requirements. Since the specifications of virtual machines provided by cloud vendors are certain and limited, the resources required by the virtual machine specifications may not be completely equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine.
  • the resource specifications of exclusive virtual machines produced by cloud vendors are: vCPU and memory ratios are: 1vCPU: 2GB memory, 1vCPU: 4GB memory and 1vCPU: 8GB memory; but the physical machine 20
  • the specifications are: 104vCPU: 192GB memory, 104vCPU: 384GB memory and 104vCPU: 768GB memory.
  • the ratio of vCPU to memory is not strictly 1vCPU: 2GB memory, 1vCPU: 4GB memory, or 1vCPU: 8GB. This results in resources appearing in the physical machine no matter how it is deployed or scheduled. Fragmentation causes this part of resources to be idle and the resource utilization rate is low.
  • virtual machine hybrid deployment refers to supporting the deployment of dedicated virtual machines and shared virtual machines on the same physical machine.
  • virtual machine co-location method provided by the embodiment of the present application in conjunction with Figure 3.
  • the management and control node 10 can manage and schedule the resources of the physical machine 20.
  • the identity of the physical machine 20 and the resources of the physical machine 20 can be registered in the management and control section.
  • Point 10 the management and control node 10 can obtain the total resources of the physical machine.
  • the management and control node 10 in order to improve resource utilization, can schedule and plan the resource usage of the physical machine 20, that is, predetermine the type and specification of the virtual machine deployed on the physical machine 20, so that the resources of the physical machine 20 can Maximize utilization.
  • the virtual machine type is used to indicate whether the virtual machine is a shared virtual machine or an exclusive virtual machine.
  • the management and control node 10 can obtain the resources required by the physical machine to separately deploy the first type of virtual machine.
  • the first type of virtual machine is an exclusive virtual machine or a shared virtual machine.
  • the specific implementation manner in which the management and control node 10 obtains the resources required by the physical machine to deploy the first type of virtual machine is not limited.
  • the management and control node 10 can greedily box the total resources of the physical machine 20 based on the preset resource specifications of the first type of virtual machine to determine the resources occupied by the greedy boxed first type of virtual machine. And determine the resources occupied by the greedy boxed first-type virtual machine, and deploy the resources occupied by the first-type virtual machine for the physical machine.
  • the preset resource specification of the first type of virtual machine may be one specification or multiple specifications. Multiple means 2 or more types. The amount of resources in at least one dimension is different in different resource specifications.
  • the management and control node 10 can simulate deployment based on the preset resource specifications of the first type of virtual machine, in descending order of resource specifications, and in accordance with the target specifications of the first type of virtual machine that the physical machine can currently deploy.
  • the free resources of the physical machine do not meet the specification requirements of any first-type virtual machine.
  • the resources occupied by the first-type virtual machine that has been simulated and deployed to the physical machine are obtained, which is greedy boxing.
  • the resource specifications of the first type of virtual machines in greedy boxing may be all the same, partially the same, or completely different.
  • the total resources of the physical machine 20 can be greedily boxed based on the preset resource specifications of the exclusive virtual machine to determine the greedy boxed exclusive type.
  • the resources occupied by the virtual machine Assume that as shown in Figure 4, the resource specification of the exclusive virtual machine is 1vCPU:2GB memory; the total resource ratio of the physical machine is 104vCPU:192GB memory, then the total resource ratio of the exclusive virtual machine to the physical machine with this resource specification After greedy boxing of resources, the physical machine can deploy up to 96 exclusive virtual machines with resource specifications of 1vCPU:2GB memory. That is, the resources occupied by the exclusive virtual machine with greedy boxing are 96 vCPUs and 192GB of memory.
  • the resources required by the virtual machine specifications may not be completely equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine.
  • the virtual machine will generate resource fragments of 8 vCPUs. Based on this, when it is determined that the resources occupied by the first type of virtual machine alone are deployed on the physical machine, it can also be determined whether resource fragmentation will occur if the physical machine alone deploys the first type of virtual machine.
  • the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine; if the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine, it can be determined that the resources occupied by the physical machine alone are less than the total resources of the physical machine. Deploying the first type of virtual machine will create resource fragmentation.
  • the management and control node 10 can change the virtual machine deployment mode of the physical machine. Set to support mixed deployment mode of dedicated virtual machines and shared virtual machines.
  • the resources occupied by the virtual machine are equal to the total resources of the physical machine.
  • the virtual machine deployment mode of the virtual machine can be set to support independent deployment of the first type of virtual machine.
  • the management and control node 10 can aim at maximizing the total resource utilization of the physical machine, and perform simulated scheduling on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine to determine the physical machine's total resource utilization.
  • the above-mentioned second type of virtual machine is a type different from the first type of virtual machine among exclusive virtual machines and shared virtual machines.
  • the first type of virtual machine is a dedicated virtual machine
  • the second type of virtual machine is a shared virtual machine.
  • the second type of virtual machine is an exclusive virtual machine.
  • the management and control node 10 can combine the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine according to the total resource allocation of the physical machine to obtain multiple first type virtual machines and second type virtual machines.
  • a combination of virtual machines; at least one type of virtual machine in each combination has different resource specifications, and the amount of resources required by each combination is less than or equal to the total resources of the physical machine.
  • the combination with the smallest difference between the amount of resources required and the total resources of the physical machine can be obtained as the target combination.
  • the resource specifications and quantity of the first type virtual machine and the second type virtual machine in the target combination may be determined as the resource specifications and quantity of the first type virtual machine and the second type virtual machine in the simulation scheduling result.
  • the management and control node 10 can greedily box the total resources of the physical machine based on the preset resource specifications of the first type of virtual machine to determine the resources occupied by the greedy boxed first type of virtual machine. ; And determine the resource fragments of the physical machine based on the total resources of the physical machine and the resources occupied by the greedy boxed first-type virtual machine. Afterwards, the management and control node 10 aims at maximizing the utilization of the resource fragments and performs simulation scheduling on the resource fragments according to the resource specifications of the second type virtual machine to determine the resource specifications and quantity of the second type virtual machines deployed in the resource fragments.
  • the management and control node 10 can also determine the resource specifications and quantity of the first type of virtual machine for greedy boxing. Further, determine the resource specifications and quantity of the second type of virtual machines deployed in the resource fragments, and the resource specifications and quantity of the first type of virtual machines in greedy boxing, as the first type of virtual machines and the third type of virtual machines in the simulation scheduling results. Resource specifications and quantity of type 2 virtual machines.
  • the resources required by the first type virtual machine and the second type virtual machine supported by the physical machine 20 are equal to the total resources of the physical machine 20 .
  • the resource specifications of the dedicated virtual machine are 1vCPU: 2GB memory, and the quantity is 88; the resource specifications of the shared virtual machine are 2vCPU :0.5GB memory, the quantity is 32, and the virtual ratio corresponding to the shared virtual machine is 4:1, that is, one physical core virtualizes 4 logical cores.
  • the determined resources occupied by the dedicated virtual machine and the shared virtual machine are equal to the total resources of the physical machine.
  • the physical machine 20 can be configured according to the resource specifications and quantity of the first type virtual machine and the second type virtual machine. Mixed deployment of dedicated virtual machines and shared virtual machines.
  • the mixed deployment of exclusive virtual machines and shared virtual machines is realized, which is helpful to To reduce the amount of natural resource fragmentation caused by limited virtual machine specifications.
  • the physical machine supports the first type of virtual machine and the second type
  • the resource specifications and quantity of type virtual machines are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. Therefore, the simulated quantity and specifications are deployed in the physical machine.
  • Virtual machines and shared virtual machines can reduce resource fragmentation during actual resource scheduling of physical machines and help improve resource utilization of physical machines.
  • the resources occupied by the dedicated virtual machines and shared virtual machines can also be isolated.
  • the management and control node 10 may divide the total resources into a first resource pool and a second resource pool according to the resource specifications and quantities of the first type virtual machines and the second type virtual machines supported by the physical machine.
  • the first resource pool is used to support the deployment of a first type of virtual machine
  • the second resource pool is used to support the deployment of a second type of virtual machine.
  • the resource pool that supports the deployment of shared virtual machines can be called a shared resource pool
  • the resource pool that supports the deployment of exclusive virtual machines can be called an exclusive resource pool.
  • the management and control node 10 can isolate the first resource pool and the second resource pool for subsequent deployment of the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively. In this way, a weak mixture of shared virtual machines and exclusive virtual machines is achieved. That is, as shown in Figure 5 and Figure 6, dedicated virtual machines and shared virtual machines have separate and independent resource pools respectively. Each type of virtual machine can only schedule resource pools that support the deployment of that type of virtual machine for virtualization. machine deployment.
  • a forced mixing of shared virtual machines and exclusive virtual machines can also be implemented.
  • the resources of the physical machine 20 are dynamically divided in real time rather than physically isolated, and the scheduler can be used to ensure the SLA requirements of the exclusive virtual machine.
  • the physical cores in the shared resource pool can be virtualized to obtain Multiple logical cores are used for shared virtual machines that are subsequently deployed in the shared resource pool to share the physical cores in the shared resource pool.
  • the specific implementation manner of virtualizing the physical cores in the shared resource pool is not limited.
  • the number M of logical cores that need to be virtualized can be determined based on the set virtualization ratio. M ⁇ 2, and is an integer.
  • the corresponding relationship between the model of the physical machine and the virtual scale can be preset. Based on this corresponding relationship, in this embodiment, the management and control node 10 can determine the virtual proportion corresponding to the physical machine 20 according to the model of the machine.
  • the number M of logical cores that need to be virtualized can be determined according to the virtual ratio corresponding to the machine model. Further, as shown in FIG.
  • the management and control node 10 can use hyper-threading technology to virtualize each physical core in the second resource into M logical cores. In this way, for the shared virtual machine in the future, the number of logical cores required by the shared virtual machine can be determined based on the resource specifications of the shared virtual machine; and the corresponding number of logical cores can be used to deploy the shared virtual machine in the shared resource pool.
  • the number of shared resource pools may be one or more. Multiple means 2 or more. Multiple shared resource pools correspond to different virtual ratios, that is, the number M of logical cores virtualized from physical cores in different shared resource pools is different.
  • the number of shared resource pools in the same physical machine and the virtual ratio supported by each shared resource pool can be flexibly set according to actual needs. For example, the number of shared resource pools and the virtual ratio corresponding to each shared resource pool can be set according to the specifications of the shared virtual machine that the user actually applies to deploy.
  • the above embodiment predetermines the virtual machine deployment method of the physical machine, aiming at supporting shared virtual machines and exclusive virtual machines.
  • the resource specifications and quantity of shared virtual machines supported by the physical machine can also be determined in advance, as well as the resource specifications and quantity of exclusive virtual machines.
  • the subsequent management and control node 10 can perform resource scheduling on the physical machine 20 according to the virtual machine deployment request, so as to deploy a virtual machine that satisfies the virtual machine deployment request in the physical machine 20 .
  • the following is an exemplary description of the resource scheduling method in the virtual machine deployment process provided by the embodiments of this application.
  • the client 30 can provide a virtual machine deployment request to the management and control node 10.
  • the virtual machine deployment request may include the type of virtual machine to be deployed (exclusive virtual machine or shared virtual machine), target resource specifications and quantity, etc.
  • the management and control node 10 can obtain a virtual machine deployment request. Further, the management and control node 10 can obtain the target type and target resource specifications of the virtual machine to be deployed from the virtual machine deployment request; and then select a physical machine from the physical machines 20 that supports the target type and target resource specifications.
  • the management and control node 10 can select a target physical machine whose idle resources meet the target resource specification requirements based on the idle resources in the target resource pool in the physical machine that supports the target type and target resource specification; and deploy the target physical machine in the target resource pool of the target physical machine.
  • the target resource pool is a resource pool that supports the deployment of virtual machines of the target type.
  • the target type is an exclusive virtual machine and the target resource pool is an exclusive resource pool. If the target type is a shared virtual machine, the target resource pool is a shared resource pool.
  • the target type is a shared virtual machine.
  • the target resource pool is a shared resource pool.
  • the resource specifications of shared virtual machines supported by different physical machines may be the same or different.
  • the virtual ratios corresponding to the shared resource pools of different physical machines may be the same or different.
  • the correspondence between the resource specifications and the virtual ratio of the shared virtual machine may be preset. Based on the corresponding relationship, the management and control node 10 can determine the target virtual ratio corresponding to the target resource specification included in the virtual machine deployment request, and select a shared resource pool that supports the target virtual ratio from the shared resource pool as the target resource pool.
  • the target logical core that meets the processor core number requirement of the target resource specification can be determined from the logical cores of the shared resource pool as the target resource pool; and other resources that meet the target resource specification can be obtained from other resources in the shared resource pool.
  • the target type is a dedicated virtual machine.
  • the target resource pool is an exclusive resource pool.
  • the management and control node 10 can select a target physical machine whose idle resources meet the target resource specification requirements from the idle resources in the exclusive resource pool among the physical machines that support the target type and target resource specifications; and in the exclusive resource pool of the target physical machine Deploy the virtual machine to be deployed in a resource pool.
  • the management and control node 10 can determine the target physical core that meets the core number requirement of the processor in the target resource specification from the exclusive resource pool; and obtain other resources that meet the target resource specification from other resources in the shared resource pool. Other types of resources according to resource requirements; then, the target logical core and other types of resources mentioned above can be used to deploy exclusive virtual machines in the exclusive resource pool.
  • the management and control node 10 in addition to pre-setting the virtual machine deployment mode of the physical machine, can also flexibly switch the virtual machine deployment mode of the physical machine according to the online real-time load condition of the physical machine.
  • the following is an exemplary description of the specific implementation manner in which the management and control node 10 switches the virtual machine deployment mode of the physical machine.
  • the management and control node 10 can monitor the calculation set Inventory levels of dedicated virtual machines and shared virtual machines in group 11.
  • the inventory level of the exclusive virtual machine is used to represent the idle resources in the computing cluster 11 that can still deploy the exclusive virtual machine. It can be calculated that the idle resources of the exclusive resource pool in the cluster 11 account for the total number of exclusive resource pools. Expressed in proportion to resources.
  • the inventory level of exclusive virtual machines can also be calculated by calculating the number of exclusive virtual machines that can be deployed in the exclusive resource pool in cluster 11, and the total number of exclusive virtual machines that can be deployed in the exclusive resource pool.
  • the inventory level of the shared virtual machine is used to indicate that the computing cluster 11 can still deploy the idle resources of the shared virtual machine.
  • the ratio of the idle resources of the shared resource pool in the cluster 11 to the total resources of the shared resource pool can be calculated.
  • the inventory level of shared virtual machines can also be calculated as the ratio between the number of shared virtual machines that can still be deployed in the shared resource pool of cluster 11 and the total number of shared virtual machines that can be deployed in the shared resource pool. Express etc.
  • the management and control node 10 can select a target physical machine whose current virtual machine deployment mode is the virtual machine hybrid deployment mode from the computing cluster 11 .
  • the number of target physical machines is less than or equal to some or all of the physical machines in the current virtual machine deployment mode in the computing cluster 11 .
  • the number of target physical machines can be 1 or multiple. Multiple units refers to 2 or more units.
  • the specific number of target physical machines can be determined based on the actual needs of the target type virtual machines and the idle resources of each virtual machine in the computing cluster 11 .
  • the management and control node 10 can obtain the physical machines whose current virtual machine deployment mode is the virtual machine hybrid deployment mode from the computing cluster; and select the supported target type from the physical machines whose current virtual machine deployment mode is the virtual machine hybrid deployment mode.
  • a physical machine with the resource specifications of the virtual machine; then, a physical machine with idle resources can be selected from the physical machines that support the resource specifications of the target type virtual machine as the target physical machine, and so on.
  • the virtual machine deployment mode of the target physical machine can be switched to the separate deployment mode of the target type virtual machine.
  • the first water level threshold is smaller than the second water level threshold.
  • the first water level threshold is less than 50%; the second water level threshold is greater than 50%.
  • Another type of virtual machine refers to another type of virtual machine other than the target type virtual machine among exclusive virtual machines and shared virtual machines. For example, if the target type of virtual machine is an exclusive virtual machine, the other type of virtual machine is a shared virtual machine. If the target type of virtual machine is a shared virtual machine, the other type of virtual machine is an exclusive virtual machine.
  • the target type virtual machine can be deployed separately on the target physical machine.
  • the management node 10 may migrate the other type of virtual machine to support the deployment of the other type of virtual machine. physical machine.
  • the target physical machine in which the above-mentioned virtual machine deployment mode is switched to a separate deployment of the target type virtual machine is defined as the first physical machine; and another type of the first physical machine will be received.
  • the physical machine to which the virtual machine is migrated is defined as the second physical machine.
  • the other type refers to another virtual machine type between the exclusive virtual machine and the shared virtual machine except the target type virtual machine.
  • the management node 10 can select a physical machine that supports the deployment of another type of virtual machine from other physical machines in the computing cluster 11 according to the resource specifications of another type of virtual machine deployed on the first physical machine; and select a physical machine that supports the deployment of another type of virtual machine; Among the physical machines deployed for another type of virtual machine, select a physical machine that supports the resource specifications of the other type of virtual machine; after that, select the physical machine that supports the resource specifications of the other type of virtual machine. Among the physical machines supporting the resource specifications of another type of virtual machine, a physical machine whose idle resources can meet the resource requirements supporting the resource specifications of another type of virtual machine is selected as the second physical machine. Further, resource specifications of another type of virtual machine deployed on the first physical machine may be migrated from the first physical machine to the second physical machine.
  • the management node 10 may not process another type of virtual machine deployed on the first physical machine.
  • the management and control node 10 can use the idle resources of the first physical machine to deploy the virtual machine of the target type, and configure the target type virtual machine on the first physical machine. Deployed virtual machines of another type are not processed.
  • the virtual machine deployment method currently supported by the physical machine 20 may be a mixed deployment of the above-mentioned shared virtual machines and dedicated virtual machines, or may be separate deployment of any type of virtual machine.
  • the management and control node 10 can obtain the virtual machine inventory level of the third physical machine in which the first type of virtual machine is separately deployed.
  • the first type of virtual machine is an exclusive virtual machine or a shared virtual machine.
  • the third physical machine may be: some or all physical machines in which the current virtual machine deployment mode in the computing cluster 11 is to separately deploy the first type of virtual machine.
  • the virtual machine inventory level of the third physical machine can be the ratio of the number of first-type virtual machines that can still be deployed on the third physical machine to the total number of first-type virtual machines supported by the third physical machine, etc.
  • a third physical machine with idle resources that meets the resource requirements of the first type virtual machine can be selected from the physical machines that separately deploy the second type virtual machine.
  • the second type of virtual machine is an exclusive virtual machine or a shared virtual machine, which is different from the first type of virtual machine.
  • the specific value of the first lower water level threshold is not limited. Generally, the first water level threshold is less than 50%.
  • the management and control node 10 may select a fifth physical machine whose model supports the first type of virtual machine from the physical machines where the second type of virtual machine is separately deployed; and select idle resources from the fifth physical machine that satisfy the requirements.
  • the resource requirements of the first type of virtual machine are the fourth physical machine.
  • the management and control node 10 can switch the virtual machine deployment mode of the fourth physical machine to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines; after that, the management and control node 10 can use the idle resources of the fourth physical machine, in The first type of virtual machine is deployed in the fourth physical machine to realize mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine.
  • the virtual machine deployment mode of the fourth physical machine is switched to support
  • the mixed deployment mode of exclusive virtual machines and shared virtual machines realizes the mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine, which helps to reduce idle resources in the fourth physical machine and improve the efficiency of the fourth physical machine. Resource utilization of four physical machines.
  • the management and control node 10 may respond to the deployment request for the first type of virtual machine from the fourth physical machine.
  • the target resource that satisfies the resources required by the deployment request is scheduled from the idle resources of the computer; further, the target resource can be used to deploy the first type of virtual machine in the fourth physical machine.
  • the management and control node 10 deploys the virtual machine of the fourth physical machine.
  • the idle resources of the fourth physical machine can also be used to build the first resource pool; and the second type of virtual machines can be deployed in the fourth physical machine.
  • the occupied resources are used to construct a second resource pool; after that, the first resource pool and the second resource pool can be isolated for deployment of the first type of virtual machine and the second type of virtual machine in the first resource pool and the second resource pool respectively.
  • Type virtual machine For specific implementation methods of respectively deploying the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool, please refer to the relevant content of the above embodiments, and will not be described again here.
  • the inventory level of the first type virtual machine corresponding to the third physical machine is less than or equal to the set second water level threshold continuously. If the duration is greater than or equal to the set duration threshold, the virtual machine deployment mode of the third physical machine can also be switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines. Further, the resource specification and quantity of the second type of virtual machines supported by the third physical machine can be determined with the goal of maximizing the resource utilization of the third physical machine. After that, the second type virtual machine can be deployed in the third physical machine in response to the deployment request for the second type virtual machine, thereby realizing the mixed deployment of the exclusive virtual machine and the shared virtual machine in the third physical machine. Reducing idle resources in the third physical machine helps improve resource utilization of the third physical machine.
  • embodiments of the present application also provide resource scheduling methods.
  • the following is an exemplary description of the resource scheduling method provided by the embodiment of the present application.
  • Figure 10 is a schematic flowchart of a resource scheduling method provided by an embodiment of the present application. As shown in Figure 10, the method includes:
  • the resource usage of the physical machine can be scheduled and planned, that is, the type and specification of the virtual machine deployed on the physical machine can be determined in advance to maximize the resource utilization of the physical machine.
  • the virtual machine type is used to indicate whether the virtual machine is a shared virtual machine or an exclusive virtual machine.
  • the resources required by the physical machine to separately deploy the first type of virtual machine can be obtained.
  • the first type of virtual machine is an exclusive virtual machine or a shared virtual machine.
  • the specific implementation method of obtaining the resources required to deploy the first type of virtual machine on a physical machine is not limited.
  • greedy boxing can be performed on the total resources of the physical machine to determine the resources occupied by the greedy boxed first type virtual machine, and determine the greedy boxing.
  • the preset resource specification of the first type of virtual machine may be one specification or multiple specifications. Multiple means 2 or more types. The amount of resources in at least one dimension is different in different resource specifications.
  • the resources required by the virtual machine specifications may not be completely equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine. Based on this, when it is determined that the resources occupied by the first type of virtual machine alone are deployed on the physical machine, it can also be determined whether resource fragmentation will occur if the physical machine alone deploys the first type of virtual machine.
  • the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine; if the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine, it can be determined that the resources occupied by the physical machine alone are less than the total resources of the physical machine. Deploying the first type of virtual machine will create resource fragmentation.
  • the virtual machines of the physical machine can be The deployment mode is set to support a mixed deployment mode of dedicated virtual machines and shared virtual machines.
  • the virtual machine deployment mode of the virtual machine can be set to support the independent deployment of the first type of virtual machine.
  • step S103 with the goal of maximizing the total resource utilization of the physical machine, simulation scheduling is performed on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine, so as to Determine the target resource type and quantity of the first type of virtual machine and the second type of virtual machine supported by the physical machine.
  • the above-mentioned second type of virtual machine is a type different from the first type of virtual machine among exclusive virtual machines and shared virtual machines.
  • the specific implementation method of determining the target resource type and quantity of the first type virtual machine and the second type virtual machine supported by the physical machine please refer to the relevant content of the above system embodiment, and will not be described again here.
  • step S104 After determining the resource specifications and quantity of the first type virtual machine and the second type virtual machine supported by the physical machine, in step S104, the resource specification and quantity of the first type virtual machine and the second type virtual machine can be determined.
  • Physical machines are deployed with a mixture of dedicated virtual machines and shared virtual machines.
  • the mixed deployment of exclusive virtual machines and shared virtual machines is realized, which is helpful to To reduce the amount of natural resource fragmentation caused by limited virtual machine specifications.
  • the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
  • the total resources may be divided into a first resource pool and a second resource pool according to the resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the physical machine.
  • the first resource pool is used to support the deployment of a first type of virtual machine
  • the second resource pool is used to support the deployment of a second type of virtual machine.
  • the first resource pool and the second resource pool may be isolated for subsequent deployment of the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively.
  • a forced mixing of shared virtual machines and exclusive virtual machines can also be implemented.
  • the resources of physical machines are dynamically divided in real time rather than physically isolated, and the scheduler can be used to ensure the SLA requirements of exclusive virtual machines.
  • the physical cores in the shared resource pool can be virtualized to obtain Multiple logical cores are used for shared virtual machines that are subsequently deployed in the shared resource pool to share the physical cores in the shared resource pool.
  • the specific implementation manner of virtualizing the physical cores in the shared resource pool is not limited.
  • the number M of logical cores that need to be virtualized can be determined based on the set virtualization ratio. M ⁇ 2, and is an integer.
  • the corresponding relationship between the model of the physical machine and the virtual scale can be preset. Based on this corresponding relationship, in this embodiment, the virtual proportion corresponding to the physical machine model can be determined according to the model of the physical machine.
  • the number M of logical cores that need to be virtualized can be determined according to the virtual ratio corresponding to the machine model.
  • hyper-threading technology can be used to virtualize each physical core in the second resource into M logical cores.
  • the number of logical cores required by the shared virtual machine can be determined based on the resource specifications of the shared virtual machine; and the corresponding number of logical cores can be used to deploy the shared virtual machine in the shared resource pool.
  • the number of shared resource pools can be one or more. Multiple means 2 or more. Multiple shared resource pools correspond to different virtual ratios, that is, the number M of logical cores virtualized from physical cores in different shared resource pools is different.
  • the above embodiment predetermines the virtual machine deployment method of the physical machine.
  • the resource specifications and quantity of the shared virtual machines supported by the physical machine can also be predetermined.
  • the resource specifications and quantity of exclusive virtual machines can be determined.
  • resource scheduling can be performed on the physical machine according to the virtual machine deployment request, so that virtual machines that meet the virtual machine deployment request can be deployed in the physical machine.
  • the following is an exemplary description of the resource scheduling method in the virtual machine deployment process provided by the embodiments of this application.
  • the client can provide a virtual machine deployment request to the management and control node.
  • the virtual machine deployment request may include the type of virtual machine to be deployed (exclusive virtual machine or shared virtual machine), target resource specifications and quantity, etc.
  • virtual machine deployment requests can be obtained.
  • the target type and target resource specifications of the virtual machine to be deployed can be obtained from the virtual machine deployment request; then, a physical machine that supports the target type and target resource specifications can be selected from the physical machines of the computing system.
  • the target resource pool in the physical machine that supports the target type and target resource specifications can be of idle resources, select a target physical machine whose idle resources meet the target resource specification requirements; and deploy the virtual machine to be deployed in the target resource pool of the target physical machine.
  • the target resource pool is a resource pool that supports the deployment of virtual machines of the target type.
  • the target type is an exclusive virtual machine and the target resource pool is an exclusive resource pool.
  • the target type is a shared virtual machine, the target resource pool is a shared resource pool.
  • the management and control node in addition to pre-setting the virtual machine deployment mode of the physical machine, can also flexibly switch the virtual machine deployment mode of the physical machine according to the online real-time load condition of the physical machine.
  • the following is an exemplary description of the specific implementation method of the management and control node switching the virtual machine deployment mode of the physical machine.
  • the computing cluster there are physical machines in the computing cluster whose current virtual machine deployment mode is a mixed deployment mode of dedicated virtual machines and shared virtual machines. Accordingly, the inventory levels of dedicated virtual machines and shared virtual machines in the computing cluster can be monitored.
  • the inventory water level please refer to the relevant content of the above embodiments, and will not be described again here.
  • the first water level threshold is smaller than the second water level threshold.
  • the first water level threshold is less than 50%; the second water level threshold is greater than 50%.
  • Another type of virtual machine refers to another type of virtual machine other than the target type virtual machine among exclusive virtual machines and shared virtual machines. For example, if the target type of virtual machine is an exclusive virtual machine, the other type of virtual machine is a shared virtual machine. If the target type of virtual machine is a shared virtual machine, the other type of virtual machine is an exclusive virtual machine.
  • the target type virtual machine can be deployed separately on the target physical machine.
  • the virtual machine of the other type may be migrated to support the other type of virtual machine.
  • a virtual machine of one type is deployed on another physical machine (defined as the second physical machine).
  • a physical machine that supports the deployment of another type of virtual machine can be selected from other physical machines in the computing cluster; and from other physical machines that support the deployment of another type of virtual machine; Among the physical machines for virtual machine deployment, select a physical machine that supports the resource specifications of another type of virtual machine; then, select idle resources from the physical machines that support the resource specifications of another type of virtual machine to meet the above requirements of supporting another type of virtual machine.
  • the resource specifications of the type of virtual machine are the resource requirements of the physical machine, as the second physical machine. Further, resource specifications of another type of virtual machine deployed on the first physical machine may be migrated from the first physical machine to the second physical machine.
  • another type of virtual machine deployed on the first physical machine may not be processed.
  • the idle resources of the first physical machine can be used to deploy the target type virtual machine, and another virtual machine deployed on the first physical machine can be deployed.
  • One type of virtual machine is not processed.
  • the virtual machine deployment methods currently supported by physical machines may be a mixed deployment of the above shared virtual machines and dedicated virtual machines, or they may be deployed separately for either type of virtual machine.
  • the following is an exemplary description of the resource scheduling method of a physical machine in which a certain type of virtual machine is separately deployed in the current virtual machine deployment mode with reference to Figure 11.
  • FIG 11 is a schematic flowchart of another resource scheduling method provided by an embodiment of the present application. As shown in Figure 11, the method includes:
  • the second type of virtual machine is a type of exclusive virtual machine or shared virtual machine that is different from the first type of virtual machine.
  • the virtual machine inventory level of the physical machine (defined as the third physical machine) on which the first type of virtual machine is deployed separately can be obtained.
  • the first type of virtual machine is an exclusive virtual machine or a shared virtual machine.
  • the third physical machine is all or part of the physical machine on which the first type of virtual machine is separately deployed in the computing cluster.
  • step S112 idle resources can be selected from physical machines that separately deploy the second type virtual machine to satisfy the requirements of the first type virtual machine.
  • the resource requirements of the fourth physical machine are included in the second type of virtual machine.
  • the second type of virtual machine is an exclusive virtual machine or a shared virtual machine, which is different from the first type of virtual machine.
  • the specific value of the first lower water level threshold is not limited. Generally, the first water level threshold is less than 50%.
  • a fifth physical machine whose model supports the first type of virtual machine can be selected from the physical machines that separately deploy the second type of virtual machine; and from the fifth physical machine, select idle resources that meet the requirements of the first type of virtual machine.
  • the resource requirements of a virtual machine are those of a fourth physical machine.
  • the fifth physical machine includes: the fourth physical machine.
  • step S113 the virtual machine deployment mode of the fourth physical machine can be switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines; and then, in step S114, the virtual machine deployment mode of the fourth physical machine can be used. Use idle resources to deploy the first type of virtual machine in the fourth physical machine to achieve mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine.
  • the virtual machine deployment mode of the fourth physical machine is switched to support
  • the mixed deployment mode of exclusive virtual machines and shared virtual machines realizes the mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine, which helps to reduce idle resources in the fourth physical machine and improve the efficiency of the fourth physical machine. Resource utilization of four physical machines.
  • the idle state of the fourth physical machine can be Target resources that meet the resources required by the deployment request are scheduled among the resources; further, the target resources can be used to deploy the first type of virtual machine in the fourth physical machine.
  • the fourth physical machine can also be used. Idle resources are used to construct a first resource pool; and the resources occupied by the second type of virtual machine deployed in the fourth physical machine are used to construct a second resource pool; after that, the first resource pool and the second resource pool can be isolated to The first type virtual machine and the second type virtual machine are respectively deployed in the first resource pool and the second resource pool.
  • Idle resources are used to construct a first resource pool; and the resources occupied by the second type of virtual machine deployed in the fourth physical machine are used to construct a second resource pool; after that, the first resource pool and the second resource pool can be isolated to The first type virtual machine and the second type virtual machine are respectively deployed in the first resource pool and the second resource pool.
  • the inventory level of the first type virtual machine in the third physical machine is less than or equal to the duration of the set second water level threshold. If the duration is greater than or equal to the set duration threshold, the virtual machine deployment mode of the third physical machine can also be switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines. Further, the resource specification and quantity of the second type of virtual machines supported by the first physical machine can be determined with the goal of maximizing the resource utilization of the third physical machine.
  • the second type virtual machine can be deployed in the third physical machine in response to the deployment request for the second type virtual machine, thereby realizing the mixed deployment of the exclusive virtual machine and the shared virtual machine in the third physical machine. Reducing idle resources in the third physical machine helps improve resource utilization of the third physical machine.
  • the execution subject of each step of the method provided in the above embodiments may be the same device, or the method may also be executed by different devices.
  • the execution subject of steps S101 and S102 may be device A; for another example, the execution subject of step S101 may be device A, the execution subject of step S102 may be device B; and so on.
  • embodiments of the present application also provide a computer-readable storage medium storing computer instructions.
  • the computer instructions are executed by one or more processors, the one or more processors are caused to execute each of the above resource scheduling methods. step.
  • Figure 12 is a schematic structural diagram of a computing device provided by an embodiment of the present application. As shown in Figure 12, the computing device includes: a memory 12a and a processor 12b; wherein the memory 12a is used to store computer programs.
  • the processor 12b is coupled to the memory 12a and is used to execute a computer program for: obtaining the first resource occupied by the first physical machine to separately deploy the first type of virtual machine; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. machine; when the first resource is less than the total resources of the physical machine, set the virtual machine deployment mode of the first physical machine In order to support the mixed deployment mode of dedicated virtual machines and shared virtual machines; with the goal of maximizing total resource utilization, the physical machine is configured based on the resource specifications of the first type of virtual machine and the resource specifications of the second type of virtual machine.
  • the total resources are simulated and scheduled to determine the target resource specifications and quantities of the first type of virtual machine and the second type of virtual machine supported by the physical machine; the second type of virtual machine is an exclusive virtual machine and a shared virtual machine that are the same as the first type.
  • Different types of virtual machines according to the target resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the first physical machine, perform a mixed deployment of exclusive virtual machines and shared virtual machines on the physical machine;
  • an exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of a physical machine
  • a shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
  • the processor 12b when acquiring the first resources required by the first physical machine to deploy the first type virtual machine, is specifically configured to: based on the preset resource specifications of the first type virtual machine, configure the first physical machine based on the preset resource specifications of the first type virtual machine.
  • the total resources are greedily boxed to determine the resources occupied by the first type of virtual machine in greedy boxing; the resources occupied by the first type of virtual machine in greedy boxing are determined as the first resources.
  • the processor 12b is also configured to: divide the total resources into a first resource pool and a second resource pool according to the target resource specifications and quantity of the first type of virtual machine supported by the first physical machine; Perform isolation processing with the second resource pool to deploy the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively.
  • the physical processor resources are physical cores of the physical processor.
  • the processor 12b is also configured to perform virtualization processing on the physical cores in the shared resource pool in which the shared virtual machine is deployed in the first resource pool and the second resource pool to obtain multiple logical cores for use. Shared virtual machines deployed in a shared resource pool share the physical cores in the shared resource pool.
  • the processor 12b when the processor 12b performs virtualization processing on the physical cores in the shared resource pool, it is specifically used to: determine the number M of logical cores that need to be virtualized according to the set virtual ratio; the virtual ratio represents 1 physical core.
  • the ratio of cores to virtualized logical cores; hyper-threading technology is used to virtualize each physical core in the second resource into M logical cores; M ⁇ 2, and is an integer.
  • the number of shared resource pools is 1 or more. Multiple means 2 or more. Multiple shared resource pools correspond to different virtual ratios.
  • the processor 12b is also configured to: monitor the inventory levels of exclusive virtual machines and shared virtual machines in the computing cluster; When the inventory water level is less than the set first water level threshold and the inventory level of another type of virtual machine is greater than the set second water level threshold, select the target of the current virtual machine deployment mode as the virtual machine hybrid deployment mode from the computing cluster Physical machine; switch the virtual machine deployment mode of the target physical machine to the virtual machine independent deployment mode of the first target type.
  • the processor 12b is also configured to: in the process of switching the virtual machine deployment mode of the target physical machine to the virtual machine independent deployment mode of the first target type, migrate another type of virtual machine deployed on the target physical machine. to a second physical machine that supports the deployment of another type of virtual machine; or, after switching the virtual machine deployment mode of the target physical machine to a separate virtual machine deployment mode of any type, use the idle resources of the target physical machine to deploy the first Target type of virtual machine.
  • the processor 12b is also used to: obtain a virtual machine deployment request; obtain the second target type and target resource specification of the virtual machine to be deployed from the virtual machine deployment request; obtain the second target type and target resource specifications of the virtual machine to be deployed; and obtain the target resource specification from the physical machine of the computing cluster. Determine that there is a target resource pool that supports the second target type and a target physical machine that supports the target resource specifications; and deploy the to-be-deployed virtual machine of the second target type in the target resource pool of the target physical machine according to the target resource specifications.
  • the computing device provided in this embodiment realizes the mixed deployment of exclusive virtual machines and shared virtual machines by pre-planning the specifications and quantities of exclusive virtual machines and shared virtual machines that can be mixedly deployed on the physical machine. Helps reduce the amount of natural resource fragmentation caused by limited virtual machine specifications.
  • the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
  • the processor 12b is also used to: obtain the virtual machine inventory level of the first physical machine in the computing cluster where the first type of virtual machine is separately deployed; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. type of virtual machine; when the virtual machine inventory level is less than the set first water level threshold, select a second physical machine with idle resources that meets the resource requirements of the first type of virtual machine from the physical machines that separately deploy the second type of virtual machine.
  • the second type of virtual machine is a type of exclusive virtual machine and shared virtual machine that is different from the first type of virtual machine; switch the virtual machine deployment mode of the second physical machine to support exclusive virtual machines and shared virtual machines Hybrid deployment mode of virtual machines; utilizing the idle resources of the second physical machine, deploying the first type of virtual machine in the second physical machine; wherein, the exclusive virtual machine refers to a virtual processor that exclusively occupies the physical processor resources of the physical machine.
  • Virtual machine; a shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
  • the processor 12b when selecting a second physical machine whose idle resources meet the resource requirements of the first type of virtual machine, is specifically configured to: select a model that supports the first type of physical machine from the physical machines that separately deploy the second type of virtual machine. a third physical machine of type virtual machine; and select a second physical machine whose idle resources meet the resource requirements of the first type virtual machine from the third physical machine.
  • the processor 12b when the processor 12b deploys the first type of virtual machine in the second physical machine, it is specifically configured to: in response to a deployment request for the first type of virtual machine, schedule from idle resources of the second physical machine that satisfies the requirements. Deploy the target resource required by the requested resource; use the target resource to deploy the first type of virtual machine in the second physical machine.
  • the processor 12b is also configured to: utilize the idle resources of the second physical machine to construct a first resource pool;
  • a second resource pool is constructed; the first resource pool and the second resource pool are isolated for use in the first resource pool and the second resource pool respectively. Deploy the first type of virtual machine and the second type of virtual machine.
  • the second The virtual machine deployment mode of the physical machine is switched to a mixed deployment mode that supports dedicated virtual machines and shared virtual machines. This enables mixed deployment of dedicated virtual machines and shared virtual machines in the second physical machine, which helps reduce the cost of the second physical machine.
  • the idle resources in the second physical machine improve the resource utilization of the second physical machine.
  • the computing device may also include: a communication component 12c, a power supply component 12d and other optional components. Only some components are schematically shown in FIG. 12 , which does not mean that the computing device must include all the components shown in FIG. 12 , nor does it mean that the computing device can only include the components shown in FIG. 12 .
  • the memory is used to store computer programs, and can be configured to store various other data to support operations on the device where it is located.
  • the processor can execute the computer program stored in the memory to implement the corresponding The logic should be controlled.
  • Memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable memory Read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable programmable memory Read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory
  • flash memory magnetic or optical disk.
  • the processor may be any hardware processing device that can execute the logic of the above method.
  • the processor can be a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) or a microcontroller unit (Microcontroller Unit, MCU); it can also be a field programmable gate array (Field -Programmable Gate Array (FPGA), Programmable Array Logic (PAL), General Array Logic (GAL), Complex Programmable Logic Device (CPLD) and other programmable devices ; Or advanced reduced instruction set (RISC) processors (Advanced RISC Machines, ARM) or system on chip (System on Chip, SoC), etc., but are not limited to this.
  • RISC advanced reduced instruction set
  • the communication component is configured to facilitate wired or wireless communication between the device where it is located and other devices.
  • the device where the communication component is located can access a wireless network based on communication standards, such as WiFi, 2G or 3G, 4G, 5G or their combination.
  • the communication component receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component may also be based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology or other technologies to achieve this.
  • NFC near field communication
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the power supply component is configured to provide power to various components of the device where it is located.
  • a power component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power component resides.
  • embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • the storage medium of a computer is a readable storage medium, which can also be called a readable medium.
  • Readable storage media includes permanent and non-permanent, removable and non-removable media and can be implemented by any method or technology to store information. Information may be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cassettes disk storage or other magnetic storage devices, or any other non-transmission medium, can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiments of the present application provide a resource scheduling method, a device, and a storage medium. In the embodiments of the present application, by pre-planning, for a physical machine, the specifications and the quantity of exclusive virtual machines and shared virtual machines which can be deployed in a hybrid manner, hybrid deployment of exclusive virtual machines and shared virtual machines is realized, thereby facilitating the reduction in the quantity of natural resource fragments caused by the limitation to the specifications of virtual machines. In addition, since the resource specifications and quantity of first-type virtual machines and second-type virtual machines supported by a physical machine are obtained by performing simulation and scheduling on the total resources of the physical machine in advance with the maximization of the resource utilization rate of the physical machine as a target, the deployment of exclusive virtual machines and shared virtual machines in the simulated quantity and specifications in the physical machine can reduce resource fragments during actual resource scheduling of the physical machine, thereby facilitating the improvement of the resource utilization rate of the physical machine.

Description

资源调度方法、设备及存储介质Resource scheduling methods, equipment and storage media
本申请要求于2022年05月16日提交中国专利局、申请号为202210530246.4、申请名称为“资源调度方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 16, 2022, with the application number 202210530246.4 and the application name "Resource Scheduling Method, Equipment and Storage Medium", the entire content of which is incorporated into this application by reference. middle.
技术领域Technical field
本申请涉及云计算技术领域,尤其涉及一种资源调度方法、设备及存储介质。The present application relates to the field of cloud computing technology, and in particular, to a resource scheduling method, equipment and storage medium.
背景技术Background technique
服务器虚拟化技术是云计算中基于基础设施层的关键技术。该技术通过对物理服务器进行虚拟化,实现在单台物理机上部署多台虚拟机(Virtual Machine,VM)。Server virtualization technology is a key technology based on the infrastructure layer in cloud computing. This technology virtualizes physical servers to deploy multiple virtual machines (VMs) on a single physical machine.
在实际应用中,某种型号的物理机只能生产某几种规格的虚拟机,而虚拟机规格所需资源可能不能与物理机的资源完全相等,这就导致物理机产生资源碎片。例如,假设物理机中内存与CPU的资源配比为192GB内存:104vCPU。其中,104vCPU是指虚拟CPU的核数为104核。该物理机部署的虚拟机规格所需的资源配比为4GB内存:1vCPU,无疑导致至少58个vCPU的资源剩余。In practical applications, a certain type of physical machine can only produce virtual machines of certain specifications, and the resources required by the virtual machine specifications may not be exactly equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine. For example, assume that the resource ratio of memory to CPU in the physical machine is 192GB memory:104vCPU. Among them, 104vCPU means that the number of cores of the virtual CPU is 104 cores. The resource ratio required for the virtual machine specifications deployed on this physical machine is 4GB memory:1vCPU, which undoubtedly results in at least 58 vCPU resources remaining.
发明内容Contents of the invention
本申请的多个方面提供一种资源处理和调度方法、设备及存储介质,用以降低物理机的资源碎片,提高物理机的资源利用率。Various aspects of this application provide a resource processing and scheduling method, device, and storage medium to reduce resource fragmentation of physical machines and improve resource utilization of physical machines.
本申请实施例提供一种资源调度方法,包括:This embodiment of the present application provides a resource scheduling method, including:
获取第一物理机单独部署第一类型虚拟机占用的第一资源;所述第一类型虚拟机为独享型虚拟机或共享型虚拟机;Obtaining the first resources occupied by the first physical machine for separately deploying the first type of virtual machine; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine;
在所述第一资源小于所述物理机的总资源的情况下,设置所述第一物理机的虚拟机部署模式为支持独享型虚拟机和共享型虚拟机的混合部署模式;When the first resource is less than the total resources of the physical machine, set the virtual machine deployment mode of the first physical machine to a hybrid deployment mode that supports exclusive virtual machines and shared virtual machines;
以所述总资源利用率最大化为目标,根据所述第一类型虚拟机的资源规格及第二类型虚拟机的资源规格,对所述物理机的总资源进行模拟调度,以确定所述物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量;所述第二类型虚拟机为所述独享型虚拟机和所述共享型虚拟机中与所述第一类型虚拟机不同的类型;With the goal of maximizing the total resource utilization, simulation scheduling is performed on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine to determine the physical machine's total resources. The target resource specifications and quantities of the first type of virtual machine and the second type of virtual machine supported by the machine; the second type of virtual machine is the same as the first type of the exclusive virtual machine and the shared virtual machine. Different types of virtual machines;
根据所述第一物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量,对所述物理机进行独享型虚拟机和共享型虚拟机的混合部署;According to the target resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the first physical machine, perform a mixed deployment of exclusive virtual machines and shared virtual machines on the physical machine;
其中,所述独享型虚拟机是指虚拟处理器独占所述物理机的物理处理器资源的虚拟机;所述共享型虚拟机是指虚拟处理器共享物理处理器资源的虚拟机。The exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of the physical machine; the shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
本申请实施例还提供一种资源调度方法,包括:This embodiment of the present application also provides a resource scheduling method, including:
获取单独部署第一类型虚拟机的第一物理机的虚拟机库存水位;所述第一类型虚 拟机为独享型虚拟机或共享型虚拟机;Obtain the virtual machine inventory level of the first physical machine where the first type of virtual machine is separately deployed; the first type of virtual machine The virtual machine is an exclusive virtual machine or a shared virtual machine;
在所述虚拟机库存水位小于设定的第一水位阈值的情况下,从单独部署第二类型虚拟机的物理机中,选择空闲资源满足所述第一类型虚拟机的资源需求的第二物理机;所述第二类型虚拟机为所述独享型虚拟机和所述共享型虚拟机中与所述第一类型虚拟机不同的类型;When the virtual machine inventory level is less than the set first water level threshold, select a second physical machine with idle resources that meets the resource requirements of the first type virtual machine from the physical machines where the second type virtual machine is deployed separately. machine; the second type virtual machine is a type different from the first type virtual machine among the exclusive virtual machine and the shared virtual machine;
将所述第二物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式;Switch the virtual machine deployment mode of the second physical machine to a hybrid deployment mode that supports exclusive virtual machines and shared virtual machines;
利用所述第二物理机的空闲资源,在所述第二物理机中部署所述第一类型虚拟机;Utilizing the idle resources of the second physical machine, deploy the first type virtual machine in the second physical machine;
其中,所述独享型虚拟机是指虚拟处理器独占所述物理机的物理处理器资源的虚拟机;所述共享型虚拟机是指虚拟处理器共享所述物理处理器资源的虚拟机。The exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of the physical machine; the shared virtual machine refers to a virtual machine in which a virtual processor shares the physical processor resources.
本申请实施例还提供一种计算设备,包括:存储器和处理器;其中,所述存储器,用于存储计算机程序;An embodiment of the present application also provides a computing device, including: a memory and a processor; wherein the memory is used to store a computer program;
所述处理器耦合至所述存储器,用于执行所述计算机程序以用于执行上述各资源调度方法中的步骤。The processor is coupled to the memory and is configured to execute the computer program for performing the steps in each of the above resource scheduling methods.
本申请实施例还提供一种存储有计算机指令的计算机可读存储介质,当所述计算机指令被一个或多个处理器执行时,致使所述一个或多个处理器执行上述各资源调度方法中的步骤。Embodiments of the present application also provide a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute each of the above resource scheduling methods. A step of.
在本申请实施例中,通过对物理机预先规划可混合部署的独享型虚拟机和共享型虚拟机的规格和数量,实现了独享型虚拟机和共享型虚拟机的混合部署,有助于降低由于虚拟机规格受限导致的天然资源碎片量。另一方面,由于物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量,是预先以物理机的资源利用率最大化为目标,对物理机的总资源模拟调度出来的,因此,在物理机中部署模拟出的数量与规格的独享型虚拟机和共享型虚拟机,可降低物理机的实际资源调度时的资源碎片,有助于提高物理机的资源利用率。In the embodiment of this application, by pre-planning the specifications and quantity of exclusive virtual machines and shared virtual machines that can be mixedly deployed on the physical machine, the mixed deployment of exclusive virtual machines and shared virtual machines is realized, which is helpful to To reduce the amount of natural resource fragmentation caused by limited virtual machine specifications. On the other hand, because the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
附图说明Description of the drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the attached picture:
图1为本申请实施例提供的计算系统的结构示意图;Figure 1 is a schematic structural diagram of a computing system provided by an embodiment of the present application;
图2为本申请实施例提供的单独部署模式示意图;Figure 2 is a schematic diagram of a separate deployment mode provided by the embodiment of the present application;
图3为本申请实施例提供的计算系统的工作流程示意图;Figure 3 is a schematic diagram of the workflow of the computing system provided by the embodiment of the present application;
图4为本申请实施例提供的单独部署模式和混合部署模式的效果示意图;Figure 4 is a schematic diagram of the effects of the individual deployment mode and the mixed deployment mode provided by the embodiment of the present application;
图5为本申请实施例提供的混合部署模式进行资源调度的示意图;Figure 5 is a schematic diagram of resource scheduling in the hybrid deployment mode provided by the embodiment of the present application;
图6为本申请实施例提供的弱混部模式和强混部模式的示意图;Figure 6 is a schematic diagram of the weak mixing part mode and the strong mixing part mode provided by the embodiment of the present application;
图7为本申请实施例提供的计算系统进行虚拟机部署的流程示意图;Figure 7 is a schematic flow chart of virtual machine deployment by the computing system provided by the embodiment of the present application;
图8和图9为本申请实施例提供的虚拟机部署方式切换过程示意图;Figures 8 and 9 are schematic diagrams of the virtual machine deployment mode switching process provided by the embodiment of the present application;
图10和图11为本申请实施例提供的资源调度方法的流程示意图;Figures 10 and 11 are flowcharts of the resource scheduling method provided by the embodiment of the present application;
图12为本申请实施例提供的计算设备的结构示意图。 Figure 12 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
在本申请一些实施例中,可通过对物理机预先规划可混合部署的独享型虚拟机和共享型虚拟机的规格和数量,实现了独享型虚拟机和共享型虚拟机的混合部署,有助于降低由于虚拟机规格受限导致的天然资源碎片量。另一方面,由于物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量,是预先以物理机的资源利用率最大化为目标,对物理机的总资源模拟调度出来的,因此,在物理机中部署模拟出的数量与规格的独享型虚拟机和共享型虚拟机,可降低物理机的实际资源调度时的资源碎片,有助于提高物理机的资源利用率。In some embodiments of the present application, mixed deployment of exclusive virtual machines and shared virtual machines can be realized by pre-planning the specifications and quantities of exclusive virtual machines and shared virtual machines that can be mixed deployed on the physical machine. Helps reduce the amount of natural resource fragmentation caused by limited virtual machine specifications. On the other hand, because the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by each embodiment of the present application will be described in detail below with reference to the accompanying drawings.
应注意到:相同的标号在下面的附图以及实施例中表示同一物体,因此,一旦某一物体在一个附图或实施例中被定义,则在随后的附图和实施例中不需要对其进行进一步讨论。It should be noted that the same reference numerals refer to the same object in the following figures and embodiments. Therefore, once an object is defined in one figure or embodiment, it does not need to be defined in subsequent figures and embodiments. which is discussed further.
图1为本申请实施例提供的一种计算系统的结构示意图。如图1所示,计算系统包括:管控节点10和计算集群11。计算集群11包括:1台或多台物理机20。优选地,物理机20的数量为多台。在本实施例中,物理机20是指提供资源的计算设备。每台物理机20包含的资源量可能相同,也可能不同。其中,物理机20包含的资源量相同是指物理机每种资源类型的资源量都相同;物理机20包含的资源量不相同,是指不同的物理机存在某个维度或某些维度的资源量不同。其中,物理机的资源包括但不局限于:处理器资源(如CPU、GPU等)、存储资源(如内存等)及网络资源(带宽等)。Figure 1 is a schematic structural diagram of a computing system provided by an embodiment of the present application. As shown in Figure 1, the computing system includes: a management node 10 and a computing cluster 11. The computing cluster 11 includes: one or more physical machines 20. Preferably, the number of physical machines 20 is multiple. In this embodiment, the physical machine 20 refers to a computing device that provides resources. The amount of resources contained in each physical machine 20 may be the same or different. Among them, the same amount of resources contained in the physical machines 20 means that the amount of resources of each resource type of the physical machines is the same; the different amounts of resources contained in the physical machines 20 means that different physical machines have resources of a certain dimension or certain dimensions. The amount is different. Among them, the resources of the physical machine include but are not limited to: processor resources (such as CPU, GPU, etc.), storage resources (such as memory, etc.) and network resources (bandwidth, etc.).
管控节点10是指对物理机20进行资源管理和资源调度的计算设备。管控节点10可以为单一服务器设备,也可以云化的服务器阵列,或者为云化的服务器阵列中运行的虚拟机(Virtual Machine,VM)。另外,管控节点10也可以指具备相应服务能力的其他计算设备,例如电脑等终端设备(运行服务程序)等。The management and control node 10 refers to a computing device that performs resource management and resource scheduling on the physical machine 20 . The management and control node 10 can be a single server device, a cloud server array, or a virtual machine (Virtual Machine, VM) running in a cloud server array. In addition, the management and control node 10 may also refer to other computing devices with corresponding service capabilities, such as computers and other terminal devices (running service programs).
管控节点10和物理机20之间可以是无线或有线连接。可选地,管控节点10可以通过移动网络和物理机20通信连接,相应地,移动网络的网络制式可以为2G(GSM)、2.5G(GPRS)、3G(WCDMA、TD-SCDMA、CDMA2000、UTMS)、4G(LTE)、4G+(LTE+)、5G、WiMax等中的任意一种。可选地,管控节点10和物理机20也可以通过蓝牙、WiFi、红外线等方式通信连接。The connection between the management node 10 and the physical machine 20 may be wireless or wired. Optionally, the management and control node 10 can be connected to the physical machine 20 through a mobile network. Correspondingly, the network standard of the mobile network can be 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS). ), 4G(LTE), 4G+(LTE+), 5G, WiMax, etc. Optionally, the management node 10 and the physical machine 20 can also be communicated and connected through Bluetooth, WiFi, infrared, etc.
在实际应用中,云厂商可通过虚拟化技术在物理机20上部署独享型虚拟机201或共享型虚拟机202,实现物理机20的处理器资源的独享或共享。物理机20的处理器包括但不局限于:CPU、GPU等。物理机20的处理器资源可以处理器的物理核的数量表示。在本申请实施例中,将物理机具有的处理器的核称为物理核,将虚拟机使用的处理器的核称为逻辑核,为虚拟机分配处理器资源时需建立物理核和逻辑核之间的映射关系。In practical applications, cloud vendors can use virtualization technology to deploy an exclusive virtual machine 201 or a shared virtual machine 202 on the physical machine 20 to achieve exclusive or shared use of the processor resources of the physical machine 20 . The processor of the physical machine 20 includes but is not limited to: CPU, GPU, etc. The processor resources of the physical machine 20 may be represented by the number of physical cores of the processor. In the embodiment of this application, the core of the processor of the physical machine is called the physical core, and the core of the processor used by the virtual machine is called the logical core. When allocating processor resources to the virtual machine, it is necessary to establish the physical core and the logical core. mapping relationship between them.
在本申请实施例中,将虚拟机的处理器称为虚拟处理器;将物理机20的处理器称为 物理处理器。其中,独享型虚拟机是指虚拟处理器(如vCPU)独占物理机的物理处理器资源的虚拟机。即一个物理核只能映射到一个逻辑核或一个虚拟机。此时物理机的处理器资源的虚拟比较低,虚拟机的虚拟处理器之间不会争抢物理处理器资源。因此,独享型虚拟机的服务等级协议(Service Level Agreement,SLA)的性能指标较高。独享型虚拟机的具有较高的服务性能。In the embodiment of this application, the processor of the virtual machine is called a virtual processor; the processor of the physical machine 20 is called Physical processor. Among them, an exclusive virtual machine refers to a virtual machine in which a virtual processor (such as a vCPU) exclusively occupies the physical processor resources of a physical machine. That is, one physical core can only be mapped to one logical core or one virtual machine. At this time, the virtual processor resources of the physical machine are relatively low, and the virtual processors of the virtual machines will not compete for physical processor resources. Therefore, the performance index of the Service Level Agreement (SLA) of an exclusive virtual machine is relatively high. Exclusive virtual machines have higher service performance.
其中,处理器资源的虚拟比是指物理核虚拟化得到的逻辑核的数量与物理核数量的比值,用于反映一个物理核可虚拟化出的逻辑核的数量。例如,处理器资源的虚拟比为4(逻辑核数量):1(物理核数量),则表示一个物理核虚拟化为4个逻辑核。Among them, the virtual ratio of processor resources refers to the ratio of the number of logical cores obtained by virtualizing a physical core to the number of physical cores, and is used to reflect the number of logical cores that can be virtualized by one physical core. For example, if the virtual ratio of processor resources is 4 (number of logical cores): 1 (number of physical cores), it means that one physical core is virtualized into 4 logical cores.
共享型虚拟机是指虚拟处理器共享物理处理器资源的虚拟机,即一个物理核可以映射到多个逻辑核或多个虚拟机。此时一个物理核虚拟化为多个逻辑核,物理机的处理器资源的虚拟比较高,物理机的处理器资源的利用率较高。但是,由于共享型虚拟机中多个虚拟处理器共享同一物理处理器资源,导致共享型虚拟机会出现多台虚拟机争抢处理器资源的情况,因此,共享型虚拟机的SLA的性能指标较低。共享型虚拟机的服务性能较低。A shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources, that is, one physical core can be mapped to multiple logical cores or multiple virtual machines. At this time, one physical core is virtualized into multiple logical cores. The virtualization ratio of the physical machine's processor resources is high, and the utilization rate of the physical machine's processor resources is high. However, because multiple virtual processors in a shared virtual machine share the same physical processor resource, multiple virtual machines compete for processor resources in a shared virtual machine. Therefore, the performance index of the SLA of a shared virtual machine is relatively low. Low. Shared virtual machines have lower service performance.
如图1所示,在一些方案中,独享型虚拟机201和共享型虚拟机202不会部署于同一物理机20上。即独享型虚拟机201和共享型虚拟机202不共同存在于同一台物理机20上,在物理上隔离,资源完全不共享。用户可根据自己的需求,申请共享型虚拟机或独享型虚拟机。管控节点10可响应于用户的虚拟机部署请求,获取虚拟机需求信息;并根据虚拟机需求信息,在物理机20中进行资源调度,部署与虚拟机部署请求适配的虚拟机。如图2所示,若虚拟机部署请求申请部署共享型虚拟机,管控节点10可从用于部署共享型虚拟机的物理机中,调度适配的资源;并利用调度到的资源,在该物理机中部署共享型虚拟机。同理,若虚拟机部署请求申请部署独享型虚拟机,管控节点10可从用于独享型虚拟机的物理机中,调度适配的资源,并利用调度到的资源,在物理机中部署独享型虚拟机。As shown in Figure 1, in some solutions, the exclusive virtual machine 201 and the shared virtual machine 202 are not deployed on the same physical machine 20. That is, the exclusive virtual machine 201 and the shared virtual machine 202 do not coexist on the same physical machine 20, but are physically isolated, and their resources are not shared at all. Users can apply for shared virtual machines or dedicated virtual machines according to their own needs. The management and control node 10 can respond to the user's virtual machine deployment request, obtain the virtual machine demand information, and perform resource scheduling in the physical machine 20 based on the virtual machine demand information, and deploy a virtual machine adapted to the virtual machine deployment request. As shown in Figure 2, if a virtual machine deployment request applies to deploy a shared virtual machine, the management and control node 10 can schedule adapted resources from the physical machine used to deploy the shared virtual machine; and use the scheduled resources to Deploy shared virtual machines on physical machines. Similarly, if a virtual machine deployment request applies to deploy an exclusive virtual machine, the management and control node 10 can schedule adapted resources from the physical machine used for the exclusive virtual machine, and use the scheduled resources to in the physical machine Deploy dedicated virtual machines.
无论共享型虚拟机,还是独享型虚拟机,云厂商提供的虚拟机的规格是一定的。其中,虚拟机的资源规格包括:虚拟机的资源类型及每种资源类型的资源量。例如,虚拟机的资源规格可包括:虚拟处理器的数量、内存量、带宽、网卡数量及每秒发包数量(Packets Per Second,PPS)等,但不限于此。用户可根据资源的需求,选择适配的规格申请虚拟机资源。由于云厂商提供的虚拟机的规格是一定且有限的,虚拟机规格所需资源可能不能与物理机的资源完全相等,这就导致物理机产生资源碎片。例如,已知云厂商生产的独享型虚拟机的资源规格分别为:vCPU和内存比例分别为:1vCPU:2GB内存、1vCPU:4GB内存及1vCPU:8GB内存等三种规格;但物理机20的规格为:104vCPU:192GB内存、104vCPU:384GB内存及104vCPU:768GB内存等三种规格。无论哪种资源规格的物理机,其vCPU与内存的比例,都不是严格的1vCPU:2GB内存、1vCPU:4GB内存或1vCPU:8GB,这就导致无论如何部署或调度,都会导致物理机中出现资源碎片,导致这部分资源闲置,资源利用率较低。Regardless of whether it is a shared virtual machine or a dedicated virtual machine, the specifications of the virtual machines provided by cloud vendors are certain. Among them, the resource specifications of the virtual machine include: the resource type of the virtual machine and the amount of resources of each resource type. For example, the resource specifications of the virtual machine may include: the number of virtual processors, the amount of memory, bandwidth, the number of network cards, the number of packets per second (Packets Per Second, PPS), etc., but are not limited to this. Users can select appropriate specifications to apply for virtual machine resources based on resource requirements. Since the specifications of virtual machines provided by cloud vendors are certain and limited, the resources required by the virtual machine specifications may not be completely equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine. For example, it is known that the resource specifications of exclusive virtual machines produced by cloud vendors are: vCPU and memory ratios are: 1vCPU: 2GB memory, 1vCPU: 4GB memory and 1vCPU: 8GB memory; but the physical machine 20 The specifications are: 104vCPU: 192GB memory, 104vCPU: 384GB memory and 104vCPU: 768GB memory. Regardless of the physical machine's resource specifications, the ratio of vCPU to memory is not strictly 1vCPU: 2GB memory, 1vCPU: 4GB memory, or 1vCPU: 8GB. This results in resources appearing in the physical machine no matter how it is deployed or scheduled. Fragmentation causes this part of resources to be idle and the resource utilization rate is low.
在本申请实施例中,为了降低物理机资源碎片,提高资源利用率,提出虚拟机混部的方案。其中,虚拟机混部是指支持将独享型虚拟机和共享型虚拟机部署于同一物理机上。下面结合图3本申请实施例提供的虚拟机混部方式进行示例性说明。In the embodiment of this application, in order to reduce physical machine resource fragmentation and improve resource utilization, a virtual machine co-location solution is proposed. Among them, virtual machine hybrid deployment refers to supporting the deployment of dedicated virtual machines and shared virtual machines on the same physical machine. The following is an exemplary description of the virtual machine co-location method provided by the embodiment of the present application in conjunction with Figure 3.
如图3所示,管控节点10可管理和调度物理机20的资源。对于接入到计算系统中的物理机20,在接入到计算系统时,可将物理机20的标识及物理机20的资源注册到管控节 点10。相应地,管控节点10可获取物理机的总资源。在本申请实施例中,为了提高资源利用率,管控节点10可对物理机20的资源使用进行调度和规划,即预先确定物理机20部署的虚拟机类型和规格,使得物理机20的资源能够利用率最大化。在本申请实施例中,虚拟机类型用于表示虚拟机为共享型虚拟机,还是为独享型虚拟机。As shown in Figure 3, the management and control node 10 can manage and schedule the resources of the physical machine 20. For the physical machine 20 connected to the computing system, when connecting to the computing system, the identity of the physical machine 20 and the resources of the physical machine 20 can be registered in the management and control section. Point 10. Correspondingly, the management and control node 10 can obtain the total resources of the physical machine. In the embodiment of the present application, in order to improve resource utilization, the management and control node 10 can schedule and plan the resource usage of the physical machine 20, that is, predetermine the type and specification of the virtual machine deployed on the physical machine 20, so that the resources of the physical machine 20 can Maximize utilization. In this embodiment of the present application, the virtual machine type is used to indicate whether the virtual machine is a shared virtual machine or an exclusive virtual machine.
基于上述提高物理机资源利用率的目标,在本申请实施例中,管控节点10可获取物理机单独部署第一类型虚拟机需要占用的资源。其中,第一类型虚拟机为独享型虚拟机或共享型虚拟机。在本申请实施例中,不限定管控节点10获取物理机部署第一类型虚拟机需要占用的资源的具体实施方式。Based on the above goal of improving physical machine resource utilization, in this embodiment of the present application, the management and control node 10 can obtain the resources required by the physical machine to separately deploy the first type of virtual machine. Among them, the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. In the embodiment of the present application, the specific implementation manner in which the management and control node 10 obtains the resources required by the physical machine to deploy the first type of virtual machine is not limited.
在一些实施例中,管控节点10可基于预设的第一类型虚拟机的资源规格,对物理机20的总资源进行贪心装箱,以确定贪心装箱的第一类型虚拟机占用的资源,并确定贪心装箱的第一类型虚拟机占用的资源,为物理机部署第一类型虚拟机需要占用的资源。预设的第一类型虚拟机的资源规格可为1种规格或多种规格。多种是指2种或2种以上。不同资源规格中至少一个维度的资源量不同。In some embodiments, the management and control node 10 can greedily box the total resources of the physical machine 20 based on the preset resource specifications of the first type of virtual machine to determine the resources occupied by the greedy boxed first type of virtual machine. And determine the resources occupied by the greedy boxed first-type virtual machine, and deploy the resources occupied by the first-type virtual machine for the physical machine. The preset resource specification of the first type of virtual machine may be one specification or multiple specifications. Multiple means 2 or more types. The amount of resources in at least one dimension is different in different resource specifications.
可选地,管控节点10可基于预设的第一类型虚拟机的资源规格,按照资源规格从大到小的顺序,依次按照物理机当前能够部署的第一类型虚拟机的目标规格,模拟部署目标规格的第一类型虚拟机,至物理机的空闲资源不满足任一第一类型虚拟机的规格需求,得到已模拟部署至物理机的第一类型虚拟机占用的资源,即为贪心装箱的第一类型虚拟机占用的资源。其中,贪心装箱的第一类型虚拟机的资源规格可能全部相同,也可能部分相同,或者全部不同。Optionally, the management and control node 10 can simulate deployment based on the preset resource specifications of the first type of virtual machine, in descending order of resource specifications, and in accordance with the target specifications of the first type of virtual machine that the physical machine can currently deploy. For a first-type virtual machine with target specifications, the free resources of the physical machine do not meet the specification requirements of any first-type virtual machine. The resources occupied by the first-type virtual machine that has been simulated and deployed to the physical machine are obtained, which is greedy boxing. The resources occupied by the first type of virtual machine. Among them, the resource specifications of the first type of virtual machines in greedy boxing may be all the same, partially the same, or completely different.
例如,第一类型虚拟机为独享型虚拟机,则可基于预设的独享型虚拟机的资源规格,对物理机20的总资源进行贪心装箱,以确定贪心装箱的独享型虚拟机占用的资源。假设如图4所示,独享型虚拟机的资源规格为1vCPU:2GB内存;物理机的总资源配比为104vCPU:192GB内存,则对该资源规格的独享项虚拟机对物理机的总资源进行贪心装箱,得到物理机最多可部署96个资源规格为1vCPU:2GB内存的独享型虚拟机,即贪心装箱的独享型虚拟机占用的资源为96个vCPU和192GB内存。For example, if the first type of virtual machine is an exclusive virtual machine, the total resources of the physical machine 20 can be greedily boxed based on the preset resource specifications of the exclusive virtual machine to determine the greedy boxed exclusive type. The resources occupied by the virtual machine. Assume that as shown in Figure 4, the resource specification of the exclusive virtual machine is 1vCPU:2GB memory; the total resource ratio of the physical machine is 104vCPU:192GB memory, then the total resource ratio of the exclusive virtual machine to the physical machine with this resource specification After greedy boxing of resources, the physical machine can deploy up to 96 exclusive virtual machines with resource specifications of 1vCPU:2GB memory. That is, the resources occupied by the exclusive virtual machine with greedy boxing are 96 vCPUs and 192GB of memory.
由于云厂商提供的虚拟机的规格是一定且有限的,虚拟机规格所需资源可能不能与物理机的资源完全相等,这就导致物理机产生资源碎片。例如,对于上述图4中,相应地,贪心装箱后虚拟机会产生8个vCPU的资源碎片。基于此,在确定出物理机单独部署第一类型虚拟机占用的资源的情况下,还可判断物理机单独部署第一类型虚拟机是否会产生资源碎片。具体地,可比较物理机单独部署第一类型虚拟机占用的资源是否小于物理机的总资源;若物理机单独部署第一类型虚拟机占用的资源小于物理机的总资源,可确定物理机单独部署第一类型虚拟机会产生资源碎片。Since the specifications of virtual machines provided by cloud vendors are certain and limited, the resources required by the virtual machine specifications may not be completely equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine. For example, in Figure 4 above, correspondingly, after greedy boxing, the virtual machine will generate resource fragments of 8 vCPUs. Based on this, when it is determined that the resources occupied by the first type of virtual machine alone are deployed on the physical machine, it can also be determined whether resource fragmentation will occur if the physical machine alone deploys the first type of virtual machine. Specifically, it can be compared whether the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine; if the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine, it can be determined that the resources occupied by the physical machine alone are less than the total resources of the physical machine. Deploying the first type of virtual machine will create resource fragmentation.
在本实施例中,为了降低物理机的资源碎片,可在物理机单独部署第一类型虚拟机占用的资源小于物理机的总资源的情况下,管控节点10可将物理机的虚拟机部署模式设置为支持独享型虚拟机和共享型虚拟机混合部署模式。相应地,若物理机单独部署第一类型 虚拟机占用的资源等于物理机的总资源,可将虚拟机的虚拟机部署模式设置为支持第一类型虚拟机单独部署。In this embodiment, in order to reduce the resource fragmentation of the physical machine, when the resources occupied by the first type of virtual machine deployed separately on the physical machine are less than the total resources of the physical machine, the management and control node 10 can change the virtual machine deployment mode of the physical machine. Set to support mixed deployment mode of dedicated virtual machines and shared virtual machines. Correspondingly, if the physical machine is deployed separately with the first type The resources occupied by the virtual machine are equal to the total resources of the physical machine. The virtual machine deployment mode of the virtual machine can be set to support independent deployment of the first type of virtual machine.
进一步,管控节点10可以物理机的总资源利用率最大化为目标,根据第一类型虚拟机的资源规格及第二类型虚拟机的资源规格,对物理机的总资源进行模拟调度,以确定物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源类型和数量。上述第二类型虚拟机为独享型虚拟机和共享型虚拟机中与第一类型虚拟机不同的类型。例如,第一类型虚拟机为独享型虚拟机,则第二类型虚拟机为共享型虚拟机。相应地,若第一类型虚拟机为共享型虚拟机,则第二类型虚拟机为独享型虚拟机。Furthermore, the management and control node 10 can aim at maximizing the total resource utilization of the physical machine, and perform simulated scheduling on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine to determine the physical machine's total resource utilization. The target resource type and quantity of the first type of virtual machines and the second type of virtual machines supported by the machine. The above-mentioned second type of virtual machine is a type different from the first type of virtual machine among exclusive virtual machines and shared virtual machines. For example, the first type of virtual machine is a dedicated virtual machine, and the second type of virtual machine is a shared virtual machine. Correspondingly, if the first type of virtual machine is a shared virtual machine, the second type of virtual machine is an exclusive virtual machine.
可选地,管控节点10可根据物理机的总资源配比,对第一类型虚拟机的资源规格和第二类型虚拟机的资源规格进行组合,得到多个第一类型虚拟机和第二类型虚拟机的组合;每个组合中至少一种类型的虚拟机的资源规格不同,且每个组合所需资源量小于或等于物理机的总资源。进一步,可从多个第一类型虚拟机和第二类型虚拟机的组合中,获取资源所需资源量与物理机的总资源之间的差值最小的组合,作为目标组合。进一步,可确定目标组合中的第一类型虚拟机和第二类型虚拟机的资源规格和数量,作为模拟调度结果中的第一类型虚拟机和第二类型虚拟机的资源规格和数量。Optionally, the management and control node 10 can combine the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine according to the total resource allocation of the physical machine to obtain multiple first type virtual machines and second type virtual machines. A combination of virtual machines; at least one type of virtual machine in each combination has different resource specifications, and the amount of resources required by each combination is less than or equal to the total resources of the physical machine. Further, from the combinations of multiple first-type virtual machines and second-type virtual machines, the combination with the smallest difference between the amount of resources required and the total resources of the physical machine can be obtained as the target combination. Further, the resource specifications and quantity of the first type virtual machine and the second type virtual machine in the target combination may be determined as the resource specifications and quantity of the first type virtual machine and the second type virtual machine in the simulation scheduling result.
或者,在一些实施例中,管控节点10可基于预设的第一类型虚拟机的资源规格,对物理机的总资源进行贪心装箱,以确定贪心装箱的第一类型虚拟机占用的资源;并根据物理机的总资源和贪心装箱的第一类型虚拟机占用的资源,确定物理机的资源碎片。之后,管控节点10以资源碎片利用率最大化为目标,根据第二类型虚拟机的资源规格对资源碎片进行模拟调度,以确定在资源碎片中部署的第二类型虚拟机的资源规格和数量。当然,管控节点10还可确定贪心装箱的第一类型虚拟机的资源规格和数量。进一步,确定在资源碎片中部署的第二类型虚拟机的资源规格和数量,及,贪心装箱的第一类型虚拟机的资源规格和数量,为模拟调度结果中的第一类型虚拟机和第二类型虚拟机的资源规格和数量。Alternatively, in some embodiments, the management and control node 10 can greedily box the total resources of the physical machine based on the preset resource specifications of the first type of virtual machine to determine the resources occupied by the greedy boxed first type of virtual machine. ; And determine the resource fragments of the physical machine based on the total resources of the physical machine and the resources occupied by the greedy boxed first-type virtual machine. Afterwards, the management and control node 10 aims at maximizing the utilization of the resource fragments and performs simulation scheduling on the resource fragments according to the resource specifications of the second type virtual machine to determine the resource specifications and quantity of the second type virtual machines deployed in the resource fragments. Of course, the management and control node 10 can also determine the resource specifications and quantity of the first type of virtual machine for greedy boxing. Further, determine the resource specifications and quantity of the second type of virtual machines deployed in the resource fragments, and the resource specifications and quantity of the first type of virtual machines in greedy boxing, as the first type of virtual machines and the third type of virtual machines in the simulation scheduling results. Resource specifications and quantity of type 2 virtual machines.
优选地,物理机20支持的第一类型虚拟机和第二类型虚拟机所需的资源与物理机20的总资源相等。例如,图4中在独享型虚拟机和共享型虚拟机混合部署模式下,确定出独享型虚拟机的资源规格为1vCPU:2GB内存、数量为88;共享型虚拟机的资源规格为2vCPU:0.5GB内存、数量为32,且共享型虚拟机对应的虚拟比例为4:1,即一个物理核虚拟出4个逻辑核。这样,确定出的独享型虚拟机和共享型虚拟机占用的资源等于物理机的总资源。Preferably, the resources required by the first type virtual machine and the second type virtual machine supported by the physical machine 20 are equal to the total resources of the physical machine 20 . For example, in Figure 4, in the mixed deployment mode of dedicated virtual machines and shared virtual machines, it is determined that the resource specifications of the dedicated virtual machine are 1vCPU: 2GB memory, and the quantity is 88; the resource specifications of the shared virtual machine are 2vCPU :0.5GB memory, the quantity is 32, and the virtual ratio corresponding to the shared virtual machine is 4:1, that is, one physical core virtualizes 4 logical cores. In this way, the determined resources occupied by the dedicated virtual machine and the shared virtual machine are equal to the total resources of the physical machine.
在确定出物理机20支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量之后,可根据第一类型虚拟机和第二类型虚拟机的资源规格和数量,对物理机20进行独享型虚拟机和共享型虚拟机的混合部署。After determining the resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the physical machine 20, the physical machine 20 can be configured according to the resource specifications and quantity of the first type virtual machine and the second type virtual machine. Mixed deployment of dedicated virtual machines and shared virtual machines.
在本申请实施例中,通过对物理机预先规划可混合部署的独享型虚拟机和共享型虚拟机的规格和数量,实现了独享型虚拟机和共享型虚拟机的混合部署,有助于降低由于虚拟机规格受限导致的天然资源碎片量。另一方面,由于物理机支持的第一类型虚拟机和第二 类型虚拟机的资源规格和数量,是预先以物理机的资源利用率最大化为目标,对物理机的总资源模拟调度出来的,因此,在物理机中部署模拟出的数量与规格的独享型虚拟机和共享型虚拟机,可降低物理机的实际资源调度时的资源碎片,有助于提高物理机的资源利用率。In the embodiment of this application, by pre-planning the specifications and quantity of exclusive virtual machines and shared virtual machines that can be mixedly deployed on the physical machine, the mixed deployment of exclusive virtual machines and shared virtual machines is realized, which is helpful to To reduce the amount of natural resource fragmentation caused by limited virtual machine specifications. On the other hand, since the physical machine supports the first type of virtual machine and the second type The resource specifications and quantity of type virtual machines are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. Therefore, the simulated quantity and specifications are deployed in the physical machine. Virtual machines and shared virtual machines can reduce resource fragmentation during actual resource scheduling of physical machines and help improve resource utilization of physical machines.
在本申请实施例中,在确定出物理机可混合部署的独享型虚拟机和共享型虚拟机的规格和数量之后,还可对独享型虚拟机和共享型虚拟机占用的资源进行隔离。具体地,管控节点10可根据物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量,将总资源划分为第一资源池和第二资源池。其中,第一资源池用于支持第一类型虚拟机部署,第二资源池用于支持第二类型虚拟机部署。其中,支持共享型虚拟机部署的资源池可称为共享型资源池;支持独享型虚拟机部署的资源池可称为独享型资源池。进一步,管控节点10可对第一资源池和第二资源池进行隔离处理,以供后续在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机。这样,实现的是共享型虚拟机和独享型虚拟机的弱混部。即,如图5和图6所示,独享型虚拟机和共享型虚拟机分别具有分离且独立的资源池,每种类型的虚拟机只能调度支持该类型虚拟机部署的资源池进行虚拟机部署。In the embodiment of this application, after determining the specifications and quantity of dedicated virtual machines and shared virtual machines that can be mixedly deployed on physical machines, the resources occupied by the dedicated virtual machines and shared virtual machines can also be isolated. . Specifically, the management and control node 10 may divide the total resources into a first resource pool and a second resource pool according to the resource specifications and quantities of the first type virtual machines and the second type virtual machines supported by the physical machine. The first resource pool is used to support the deployment of a first type of virtual machine, and the second resource pool is used to support the deployment of a second type of virtual machine. Among them, the resource pool that supports the deployment of shared virtual machines can be called a shared resource pool; the resource pool that supports the deployment of exclusive virtual machines can be called an exclusive resource pool. Further, the management and control node 10 can isolate the first resource pool and the second resource pool for subsequent deployment of the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively. In this way, a weak mixture of shared virtual machines and exclusive virtual machines is achieved. That is, as shown in Figure 5 and Figure 6, dedicated virtual machines and shared virtual machines have separate and independent resource pools respectively. Each type of virtual machine can only schedule resource pools that support the deployment of that type of virtual machine for virtualization. machine deployment.
在另一些实施例中,还可实现共享型虚拟机和独享型虚拟机的强混部。如图6所示,在强混部的实施方式中,物理机20的资源是动态实时划分的而非物理隔离,可通过调度器来保证独享型虚拟机的SLA需求。In other embodiments, a forced mixing of shared virtual machines and exclusive virtual machines can also be implemented. As shown in Figure 6 , in the implementation of the strong mixing department, the resources of the physical machine 20 are dynamically divided in real time rather than physically isolated, and the scheduler can be used to ensure the SLA requirements of the exclusive virtual machine.
对于上述弱混部的实施例来说,针对上述第一资源池和第二资源池中支持共享型虚拟机部署的共享资源池,可对共享资源池中的物理核进行虚拟化处理,以得到多个逻辑核,以供后续共享资源池部署的共享型虚拟机共享共享资源池中的物理核。For the above embodiment of the weak hybrid part, for the shared resource pool in the first resource pool and the second resource pool that supports shared virtual machine deployment, the physical cores in the shared resource pool can be virtualized to obtain Multiple logical cores are used for shared virtual machines that are subsequently deployed in the shared resource pool to share the physical cores in the shared resource pool.
在本申请实施例中,不限定对共享资源池中的物理核进行虚拟化的具体实施方式。在一些实施例中,可根据设定的虚拟比例,确定需要虚拟出的逻辑核的数量M。M≥2,且为整数。可选地,可预先设定物理机的机型与虚拟比例之间的对应关系。基于该对应关系,在本实施例中,管控节点10可根据物理机20的机型,确定该机型对应的虚拟比例。进一步,可根据机型对应的虚拟比例,确定需要虚拟出的逻辑核的数量M。进一步,如图6所示,管控节点10可利用超线程技术将第二资源中的每个物理核虚拟化为M个逻辑核。这样,后续对于共享型虚拟机,可根据共享型虚拟机的资源规格,确定共享型虚拟机需要的逻辑核数量;并利用相应数量的逻辑核,在共享资源池中部署共享型虚拟机。In the embodiment of this application, the specific implementation manner of virtualizing the physical cores in the shared resource pool is not limited. In some embodiments, the number M of logical cores that need to be virtualized can be determined based on the set virtualization ratio. M≥2, and is an integer. Optionally, the corresponding relationship between the model of the physical machine and the virtual scale can be preset. Based on this corresponding relationship, in this embodiment, the management and control node 10 can determine the virtual proportion corresponding to the physical machine 20 according to the model of the machine. Furthermore, the number M of logical cores that need to be virtualized can be determined according to the virtual ratio corresponding to the machine model. Further, as shown in FIG. 6 , the management and control node 10 can use hyper-threading technology to virtualize each physical core in the second resource into M logical cores. In this way, for the shared virtual machine in the future, the number of logical cores required by the shared virtual machine can be determined based on the resource specifications of the shared virtual machine; and the corresponding number of logical cores can be used to deploy the shared virtual machine in the shared resource pool.
值得说明的是,对于具有虚拟机混合部署模式的物理机20来说,共享资源池的数量可为1个或多个。多个是指2个或2个以上。多个共享资源池对应的虚拟比例不同,即不同共享资源池中物理核虚拟化出的逻辑核的数量M不同。同一物理机中共享资源池的数量和每个共享资源池支持的虚拟比例,可根据实际需求进行灵活设定。例如,可根据用户实际申请部署共享型虚拟机的规格设定共享资源池的数量及每个共享资源池对应的虚拟比例等。It is worth noting that for the physical machine 20 with a virtual machine hybrid deployment mode, the number of shared resource pools may be one or more. Multiple means 2 or more. Multiple shared resource pools correspond to different virtual ratios, that is, the number M of logical cores virtualized from physical cores in different shared resource pools is different. The number of shared resource pools in the same physical machine and the virtual ratio supported by each shared resource pool can be flexibly set according to actual needs. For example, the number of shared resource pools and the virtual ratio corresponding to each shared resource pool can be set according to the specifications of the shared virtual machine that the user actually applies to deploy.
上述实施例预先确定了物理机的虚拟机部署方式,针对支持共享型虚拟机和独享 型虚拟机混合部署的物理机,还可预先确定物理机支持的共享型虚拟机的资源规格和数量,以及,独享型虚拟机的资源规格和数量。在确定出这些之后,后续管控节点10可根据虚拟机部署请求,对物理机20进行资源调度,以在物理机20中部署满足虚拟机部署请求的虚拟机。下面对本申请实施例提供的虚拟机部署过程中的资源调度方式进行示例性说明。The above embodiment predetermines the virtual machine deployment method of the physical machine, aiming at supporting shared virtual machines and exclusive virtual machines. For physical machines deployed with mixed virtual machines, the resource specifications and quantity of shared virtual machines supported by the physical machine can also be determined in advance, as well as the resource specifications and quantity of exclusive virtual machines. After determining these, the subsequent management and control node 10 can perform resource scheduling on the physical machine 20 according to the virtual machine deployment request, so as to deploy a virtual machine that satisfies the virtual machine deployment request in the physical machine 20 . The following is an exemplary description of the resource scheduling method in the virtual machine deployment process provided by the embodiments of this application.
如图7所示,用户端30可向管控节点10提供虚拟机部署请求。该虚拟机部署请求可包括待部署虚拟机的类型(独享型虚拟机或共享型虚拟机)、目标资源规格及数量等。对于管控节点10可获取虚拟机部署请求。进一步,管控节点10可从虚拟机部署请求中,获取待部署虚拟机的目标类型和目标资源规格;之后,可从物理机20中选择支持目标类型和目标资源规格的物理机。进一步,管控节点10可根据支持目标类型和目标资源规格的物理机中目标资源池的空闲资源,选择空闲资源满足目标资源规格需求的目标物理机;并在目标物理机的目标资源池中部署待部署虚拟机。其中,目标资源池为支持目标类型的虚拟机部署的资源池。例如,目标类型为独享型虚拟机,目标资源池为独享型资源池。若目标类型为共享型虚拟机,则目标资源池为共享型资源池。As shown in Figure 7, the client 30 can provide a virtual machine deployment request to the management and control node 10. The virtual machine deployment request may include the type of virtual machine to be deployed (exclusive virtual machine or shared virtual machine), target resource specifications and quantity, etc. The management and control node 10 can obtain a virtual machine deployment request. Further, the management and control node 10 can obtain the target type and target resource specifications of the virtual machine to be deployed from the virtual machine deployment request; and then select a physical machine from the physical machines 20 that supports the target type and target resource specifications. Further, the management and control node 10 can select a target physical machine whose idle resources meet the target resource specification requirements based on the idle resources in the target resource pool in the physical machine that supports the target type and target resource specification; and deploy the target physical machine in the target resource pool of the target physical machine. Deploy virtual machines. The target resource pool is a resource pool that supports the deployment of virtual machines of the target type. For example, the target type is an exclusive virtual machine and the target resource pool is an exclusive resource pool. If the target type is a shared virtual machine, the target resource pool is a shared resource pool.
在一些实施例中,目标类型为共享型虚拟机。相应地,目标资源池为共享型资源池。不同物理机支持的共享型虚拟机的资源规格可能相同,也可能不同。当然,不同物理机的共享型资源池对应的虚拟比例也可能相同,也可不同。在一些实施例中,可预先设置共享型虚拟机的资源规格与虚拟比例之间的对应关系。基于该对应关系,管控节点10可确定虚拟机部署请求包含的目标资源规格对应的目标虚拟比例,并从共享型资源池中,选择支持目标虚拟比例的共享资源池,作为目标资源池。In some embodiments, the target type is a shared virtual machine. Correspondingly, the target resource pool is a shared resource pool. The resource specifications of shared virtual machines supported by different physical machines may be the same or different. Of course, the virtual ratios corresponding to the shared resource pools of different physical machines may be the same or different. In some embodiments, the correspondence between the resource specifications and the virtual ratio of the shared virtual machine may be preset. Based on the corresponding relationship, the management and control node 10 can determine the target virtual ratio corresponding to the target resource specification included in the virtual machine deployment request, and select a shared resource pool that supports the target virtual ratio from the shared resource pool as the target resource pool.
进一步,可从作为目标资源池的共享资源池的逻辑核中,确定满足目标资源规格的处理器核数需求的目标逻辑核;并从共享资源池的其它资源中,获取满足目标资源规格的其它资源需求的其它类型资源;之后,可利用目标逻辑核和上述其它类型资源,在共享资源池中部署共享虚拟机。Further, the target logical core that meets the processor core number requirement of the target resource specification can be determined from the logical cores of the shared resource pool as the target resource pool; and other resources that meet the target resource specification can be obtained from other resources in the shared resource pool. Other types of resources according to resource requirements; then, shared virtual machines can be deployed in the shared resource pool using the target logical core and other types of resources mentioned above.
在另一项实施例中,目标类型为独享虚拟机。相应地,目标资源池为独享型资源池。相应地,管控节点10可从根据支持目标类型和目标资源规格的物理机中独享型资源池的空闲资源,选择空闲资源满足目标资源规格需求的目标物理机;并在目标物理机的独享型资源池中部署待部署虚拟机。In another embodiment, the target type is a dedicated virtual machine. Accordingly, the target resource pool is an exclusive resource pool. Correspondingly, the management and control node 10 can select a target physical machine whose idle resources meet the target resource specification requirements from the idle resources in the exclusive resource pool among the physical machines that support the target type and target resource specifications; and in the exclusive resource pool of the target physical machine Deploy the virtual machine to be deployed in a resource pool.
具体地,管控节点10可从所述独享资源池中,确定满足目标资源规格中处理器的核数需求的目标物理核;并从共享资源池的其它资源中,获取满足目标资源规格的其它资源需求的其它类型资源;之后,可利用目标逻辑核和上述其它类型资源,在独享型资源池中部署独享型虚拟机。Specifically, the management and control node 10 can determine the target physical core that meets the core number requirement of the processor in the target resource specification from the exclusive resource pool; and obtain other resources that meet the target resource specification from other resources in the shared resource pool. Other types of resources according to resource requirements; then, the target logical core and other types of resources mentioned above can be used to deploy exclusive virtual machines in the exclusive resource pool.
在本申请实施例中,管控节点10除了可预先设置物理机的虚拟机部署模式之外,还可根据物理机的在线实时负载情况,对物理机的虚拟机部署模式进行灵活切换。下面对管控节点10对物理机的虚拟机部署模式进行切换的具体实施方式进行示例性说明。In this embodiment of the present application, in addition to pre-setting the virtual machine deployment mode of the physical machine, the management and control node 10 can also flexibly switch the virtual machine deployment mode of the physical machine according to the online real-time load condition of the physical machine. The following is an exemplary description of the specific implementation manner in which the management and control node 10 switches the virtual machine deployment mode of the physical machine.
如图8所示,在一些实施例中,计算集群11中存在当前虚拟机部署模式为独享型虚拟机和共享型虚拟机混合部署模式的物理机。相应地,管控节点10可监测计算集 群11中独享型虚拟机和共享型虚拟机的库存水位。其中,独享型虚拟机的库存水位用于表征计算集群11中尚可部署独享型虚拟机的空闲资源,可以计算集群11中独享型资源池的空闲资源占独享型资源池的总资源的比例进行表示。当然,独享型虚拟机的库存水位也可以计算集群11中的独享型资源池尚可部署的独享型虚拟机的数量,与独享型资源池可部署的独享型虚拟机的总数量之间的比值进行表示等。同理,共享型虚拟机的库存水位用于表征计算集群11尚可部署共享型虚拟机的空闲资源,可以计算集群11中共享型资源池的空闲资源占共享型资源池的总资源的比例进行表示。当然,共享型虚拟机的库存水位也可以计算集群11的共享型资源池尚可部署的共享型虚拟机的数量,与该共享型资源池可部署的共享型虚拟机的总数量之间的比值进行表示等。As shown in Figure 8, in some embodiments, there are physical machines in the computing cluster 11 whose current virtual machine deployment mode is a mixed deployment mode of exclusive virtual machines and shared virtual machines. Accordingly, the management and control node 10 can monitor the calculation set Inventory levels of dedicated virtual machines and shared virtual machines in group 11. Among them, the inventory level of the exclusive virtual machine is used to represent the idle resources in the computing cluster 11 that can still deploy the exclusive virtual machine. It can be calculated that the idle resources of the exclusive resource pool in the cluster 11 account for the total number of exclusive resource pools. Expressed in proportion to resources. Of course, the inventory level of exclusive virtual machines can also be calculated by calculating the number of exclusive virtual machines that can be deployed in the exclusive resource pool in cluster 11, and the total number of exclusive virtual machines that can be deployed in the exclusive resource pool. Express the ratio between quantities, etc. In the same way, the inventory level of the shared virtual machine is used to indicate that the computing cluster 11 can still deploy the idle resources of the shared virtual machine. The ratio of the idle resources of the shared resource pool in the cluster 11 to the total resources of the shared resource pool can be calculated. express. Of course, the inventory level of shared virtual machines can also be calculated as the ratio between the number of shared virtual machines that can still be deployed in the shared resource pool of cluster 11 and the total number of shared virtual machines that can be deployed in the shared resource pool. Express etc.
若计算集群11的独享型虚拟机和共享型虚拟机中存在库存水位小于设定的第一水位阈值的目标类型虚拟机,且另一类型虚拟机的库存水位大于设定的第二水位阈值,管控节点10可从计算集群11中,选择当前虚拟机部署模式为虚拟机混合部署模式的目标物理机。其中,目标物理机的数量小于或等于计算集群11中当前虚拟机部署模式的部分或全部物理机。目标物理机的数量可为1台或多台。多台是指2台或2台以上。目标物理机的具体数量可根据目标类型虚拟机的实际需求和计算集群11中各虚拟机的空闲资源进行决定。If there are virtual machines of the target type whose inventory level is less than the set first water level threshold among the dedicated virtual machines and shared virtual machines of the computing cluster 11, and the inventory level of another type of virtual machine is greater than the set second water level threshold. , the management and control node 10 can select a target physical machine whose current virtual machine deployment mode is the virtual machine hybrid deployment mode from the computing cluster 11 . The number of target physical machines is less than or equal to some or all of the physical machines in the current virtual machine deployment mode in the computing cluster 11 . The number of target physical machines can be 1 or multiple. Multiple units refers to 2 or more units. The specific number of target physical machines can be determined based on the actual needs of the target type virtual machines and the idle resources of each virtual machine in the computing cluster 11 .
具体地,管控节点10可从计算集群中,获取当前虚拟机部署模式为虚拟机混合部署模式的物理机;并从当前虚拟机部署模式为虚拟机混合部署模式的物理机中,选择支持目标类型虚拟机的资源规格的物理机;之后,可从支持目标类型虚拟机的资源规格的物理机中,选择具有空闲资源的物理机,作为目标物理机等等。Specifically, the management and control node 10 can obtain the physical machines whose current virtual machine deployment mode is the virtual machine hybrid deployment mode from the computing cluster; and select the supported target type from the physical machines whose current virtual machine deployment mode is the virtual machine hybrid deployment mode. A physical machine with the resource specifications of the virtual machine; then, a physical machine with idle resources can be selected from the physical machines that support the resource specifications of the target type virtual machine as the target physical machine, and so on.
进一步,可将目标物理机的虚拟机部署模式切换为目标类型虚拟机单独部署模式。其中,第一水位阈值小于第二水位阈值。一般地,第一水位阈值小于50%;第二水位阈值大于50%。另一类型虚拟机是指独享型虚拟机和共享型虚拟机中,除目标类型虚拟机之外的另一类型虚拟机。例如,目标类型虚拟机为独享型虚拟机,则另一类型虚拟机为共享型虚拟机。若目标类型虚拟机为共享型虚拟机,则另一类型虚拟机为独享型虚拟机。Furthermore, the virtual machine deployment mode of the target physical machine can be switched to the separate deployment mode of the target type virtual machine. Wherein, the first water level threshold is smaller than the second water level threshold. Generally, the first water level threshold is less than 50%; the second water level threshold is greater than 50%. Another type of virtual machine refers to another type of virtual machine other than the target type virtual machine among exclusive virtual machines and shared virtual machines. For example, if the target type of virtual machine is an exclusive virtual machine, the other type of virtual machine is a shared virtual machine. If the target type of virtual machine is a shared virtual machine, the other type of virtual machine is an exclusive virtual machine.
在将目标物理机的虚拟机部署模式切换为目标类型虚拟机单独部署模式之后,可在目标物理机上单独部署目标类型的虚拟机。对于已部署于物理机的除目标类型虚拟机之外的另一类型的虚拟机,在一些实施例中,管控节点10可将另一类型的虚拟机迁移至支持该另一类型的虚拟机部署的物理机。在当前实施例中,为了便于表述和区分,将上述虚拟机部署模式从切换为目标类型虚拟机单独部署的目标物理机,定义为第一物理机;并将接收第一物理机的另一类型的虚拟机迁移的物理机,定义为第二物理机。上述或下述实施例中,另一类型均是指独享型虚拟机和共享型虚拟机中,除目标类型虚拟机之外的另一虚拟机类型。After switching the virtual machine deployment mode of the target physical machine to the target type virtual machine individual deployment mode, the target type virtual machine can be deployed separately on the target physical machine. For another type of virtual machine other than the target type virtual machine that has been deployed on the physical machine, in some embodiments, the management node 10 may migrate the other type of virtual machine to support the deployment of the other type of virtual machine. physical machine. In the current embodiment, in order to facilitate expression and distinction, the target physical machine in which the above-mentioned virtual machine deployment mode is switched to a separate deployment of the target type virtual machine is defined as the first physical machine; and another type of the first physical machine will be received. The physical machine to which the virtual machine is migrated is defined as the second physical machine. In the above or following embodiments, the other type refers to another virtual machine type between the exclusive virtual machine and the shared virtual machine except the target type virtual machine.
可选地,管控节点10可根据第一物理机上部署的另一类型的虚拟机的资源规格,从计算集群11的其它物理机中选择支持另一类型的虚拟机部署的物理机;并从支持另一类型的虚拟机部署的物理机中,选择支持另一类型的虚拟机的资源规格的物理机;之后,从支 持另一类型的虚拟机的资源规格的物理机中,选择空闲资源可满足上述支持另一类型的虚拟机的资源规格的资源需求的物理机,作为第二物理机。进一步,可将第一物理机上部署的另一类型的虚拟机的资源规格,从第一物理机迁移至第二物理机。Optionally, the management node 10 can select a physical machine that supports the deployment of another type of virtual machine from other physical machines in the computing cluster 11 according to the resource specifications of another type of virtual machine deployed on the first physical machine; and select a physical machine that supports the deployment of another type of virtual machine; Among the physical machines deployed for another type of virtual machine, select a physical machine that supports the resource specifications of the other type of virtual machine; after that, select the physical machine that supports the resource specifications of the other type of virtual machine. Among the physical machines supporting the resource specifications of another type of virtual machine, a physical machine whose idle resources can meet the resource requirements supporting the resource specifications of another type of virtual machine is selected as the second physical machine. Further, resource specifications of another type of virtual machine deployed on the first physical machine may be migrated from the first physical machine to the second physical machine.
在另一些实施例中,管控节点10可对第一物理机上部署的另一类型的虚拟机不进行处理。相应地,管控节点10可在第一物理机的虚拟机部署模式切换为目标类型虚拟机单独部署模式之后,可利用第一物理机的空闲资源部署目标类型的虚拟机,并对第一物理机上部署的另一类型的虚拟机不进行处理。In other embodiments, the management node 10 may not process another type of virtual machine deployed on the first physical machine. Correspondingly, after the virtual machine deployment mode of the first physical machine is switched to the separate deployment mode of the target type virtual machine, the management and control node 10 can use the idle resources of the first physical machine to deploy the virtual machine of the target type, and configure the target type virtual machine on the first physical machine. Deployed virtual machines of another type are not processed.
物理机20当前支持的虚拟机部署方式可能为上述共享型虚拟机和独享型虚拟机混合部署,也可能为任一类型的虚拟机单独部署。如图9所示,针对当前虚拟机部署模式为某一类型的虚拟机单独部署的物理机20,管控节点10可获取单独部署第一类型虚拟机的第三物理机的虚拟机库存水位。其中,第一类型虚拟机为独享型虚拟机或共享型虚拟机。其中,第三物理机可为:计算集群11中当前虚拟机部署模式为单独部署第一类型虚拟机的部分或全部物理机。第三物理机的虚拟机库存水位,可以第三物理机尚可部署的第一类型虚拟机的数量占第三物理机支持的第一类型虚拟机的总量的比例等。The virtual machine deployment method currently supported by the physical machine 20 may be a mixed deployment of the above-mentioned shared virtual machines and dedicated virtual machines, or may be separate deployment of any type of virtual machine. As shown in Figure 9, for the physical machine 20 in which the current virtual machine deployment mode is to separately deploy a certain type of virtual machine, the management and control node 10 can obtain the virtual machine inventory level of the third physical machine in which the first type of virtual machine is separately deployed. Among them, the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. The third physical machine may be: some or all physical machines in which the current virtual machine deployment mode in the computing cluster 11 is to separately deploy the first type of virtual machine. The virtual machine inventory level of the third physical machine can be the ratio of the number of first-type virtual machines that can still be deployed on the third physical machine to the total number of first-type virtual machines supported by the third physical machine, etc.
进一步,若第一类型虚拟机的虚拟机库存水位小于设定的第一水位阈值,可从单独部署第二类型虚拟机的物理机中,选择空闲资源满足第一类型虚拟机的资源需求的第四物理机。其中,第二类型虚拟机为独享型虚拟机和共享型虚拟机中,与第一类型虚拟机不同的类型。在本申请实施例中,不限低第一水位阈值的具体取值。一般地,第一水位阈值小于50%。Further, if the virtual machine inventory level of the first type virtual machine is less than the set first water level threshold, a third physical machine with idle resources that meets the resource requirements of the first type virtual machine can be selected from the physical machines that separately deploy the second type virtual machine. Four physical machines. Among them, the second type of virtual machine is an exclusive virtual machine or a shared virtual machine, which is different from the first type of virtual machine. In the embodiment of the present application, the specific value of the first lower water level threshold is not limited. Generally, the first water level threshold is less than 50%.
可选地,管控节点10可从单独部署第二类型虚拟机的物理机中,选择机型支持第一类型虚拟机的第五物理机;并从第五物理机中,选择空闲资源满足所述第一类型虚拟机的资源需求的第四物理机。Optionally, the management and control node 10 may select a fifth physical machine whose model supports the first type of virtual machine from the physical machines where the second type of virtual machine is separately deployed; and select idle resources from the fifth physical machine that satisfy the requirements. The resource requirements of the first type of virtual machine are the fourth physical machine.
进一步,管控节点10可将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式;之后,管控节点10可利用第四物理机的空闲资源,在第四物理机中部署第一类型虚拟机,实现第四物理机中独享型虚拟机和共享型虚拟机的混合部署。由于第三物理机中第一类型虚拟机的库存水位较低,而单独部署第二类型虚拟机的第四物理机中有空闲资源,因此,将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式,实现第四物理机中独享型虚拟机和共享型虚拟机的混合部署,有助于降低第四物理机中的空闲资源,提高第四物理机的资源利用率。Further, the management and control node 10 can switch the virtual machine deployment mode of the fourth physical machine to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines; after that, the management and control node 10 can use the idle resources of the fourth physical machine, in The first type of virtual machine is deployed in the fourth physical machine to realize mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine. Since the inventory level of the first type of virtual machine in the third physical machine is low, and there are idle resources in the fourth physical machine where the second type of virtual machine is deployed separately, the virtual machine deployment mode of the fourth physical machine is switched to support The mixed deployment mode of exclusive virtual machines and shared virtual machines realizes the mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine, which helps to reduce idle resources in the fourth physical machine and improve the efficiency of the fourth physical machine. Resource utilization of four physical machines.
在将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式之后,管控节点10可相应于针对第一类型虚拟机的部署请求,从第四物理机的空闲资源中调度满足部署请求所需资源的目标资源;进一步,可利用目标资源在第四物理机中部署第一类型虚拟机。After switching the virtual machine deployment mode of the fourth physical machine to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines, the management and control node 10 may respond to the deployment request for the first type of virtual machine from the fourth physical machine. The target resource that satisfies the resources required by the deployment request is scheduled from the idle resources of the computer; further, the target resource can be used to deploy the first type of virtual machine in the fourth physical machine.
对于虚拟机弱混部的实施例来说,管控节点10在将第四物理机的虚拟机部署方 式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式之后,还可利用第四物理机的空闲资源,构建第一资源池;并利用第四物理机中部署第二类型虚拟机占用的资源,构建第二资源池;之后,可对第一资源池和第二资源池进行隔离处理,以供在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机。其中,在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机的具体实施方式,可参见上述实施例的相关内容,在此不再赘述。For the embodiment of weak hybrid deployment of virtual machines, the management and control node 10 deploys the virtual machine of the fourth physical machine. After the mode is switched to a mixed deployment mode that supports dedicated virtual machines and shared virtual machines, the idle resources of the fourth physical machine can also be used to build the first resource pool; and the second type of virtual machines can be deployed in the fourth physical machine. The occupied resources are used to construct a second resource pool; after that, the first resource pool and the second resource pool can be isolated for deployment of the first type of virtual machine and the second type of virtual machine in the first resource pool and the second resource pool respectively. Type virtual machine. For specific implementation methods of respectively deploying the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool, please refer to the relevant content of the above embodiments, and will not be described again here.
在本申请一些实施例中,对于上述单独部署第一类型虚拟机的第三物理机,在第三物理机对应的第一类型虚拟机的库存水位小于或等于设定的第二水位阈值的持续时长大于或等于设定的时长阈值的情况下,还可将第三物理机的虚拟机部署模式切换为支持独享型虚拟机与共享型虚拟机的混合部署模式。进一步,可以第三物理机的资源利用率最大化为目标,确定第三物理机支持的第二类型虚拟机的资源规格和数量。之后,可响应于针对第二类型虚拟机的部署请求,在第三物理机中部署第二类型虚拟机,实现了第三物理机中独享型虚拟机和共享型虚拟机的混合部署,可降低第三物理机中空闲资源,有助于提高第三物理机的资源利用率。In some embodiments of the present application, for the third physical machine in which the first type virtual machine is separately deployed, the inventory level of the first type virtual machine corresponding to the third physical machine is less than or equal to the set second water level threshold continuously. If the duration is greater than or equal to the set duration threshold, the virtual machine deployment mode of the third physical machine can also be switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines. Further, the resource specification and quantity of the second type of virtual machines supported by the third physical machine can be determined with the goal of maximizing the resource utilization of the third physical machine. After that, the second type virtual machine can be deployed in the third physical machine in response to the deployment request for the second type virtual machine, thereby realizing the mixed deployment of the exclusive virtual machine and the shared virtual machine in the third physical machine. Reducing idle resources in the third physical machine helps improve resource utilization of the third physical machine.
除了上述系统实施例之外,本申请实施例还提供资源调度方法。下面对本申请实施例提供的资源调度方法进行示例性说明。In addition to the above system embodiments, embodiments of the present application also provide resource scheduling methods. The following is an exemplary description of the resource scheduling method provided by the embodiment of the present application.
图10为本申请实施例提供的一种资源调度方法的流程示意图。如图10所示,该方法包括:Figure 10 is a schematic flowchart of a resource scheduling method provided by an embodiment of the present application. As shown in Figure 10, the method includes:
S101、获取第一物理机单独部署第一类型虚拟机占用的第一资源;第一类型虚拟机为独享型虚拟机或共享型虚拟机。S101. Obtain the first resource occupied by the first physical machine for separately deploying the first type of virtual machine; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine.
S102、在第一资源小于物理机的总资源的情况下,设置第一物理机的虚拟机部署模式为支持独享型虚拟机和共享型虚拟机的混合部署模式。S102. When the first resource is less than the total resources of the physical machine, set the virtual machine deployment mode of the first physical machine to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines.
S103、以总资源利用率最大化为目标,根据第一类型虚拟机的资源规格及第二类型虚拟机的资源规格,对物理机的总资源进行模拟调度,以确定物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量;第二类型虚拟机为独享型虚拟机和共享型虚拟机中与第一类型虚拟机不同的类型。S103. With the goal of maximizing total resource utilization, simulate and schedule the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine to determine the first type supported by the physical machine. The target resource specifications and quantities of the virtual machine and the second type of virtual machine; the second type of virtual machine is a type of exclusive virtual machine or shared virtual machine that is different from the first type of virtual machine.
S104、根据第一物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量,对物理机进行独享型虚拟机和共享型虚拟机的混合部署。S104. According to the target resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the first physical machine, perform a mixed deployment of exclusive virtual machines and shared virtual machines on the physical machine.
在本实施例中,关于共享型虚拟机和独享型虚拟机的描述,可参见上述系统实施例的相关内容,在此不再赘述。In this embodiment, for descriptions of the shared virtual machine and the exclusive virtual machine, please refer to the relevant content of the above system embodiment, and will not be described again here.
在本申请实施例中,为了提高资源利用率,可对物理机的资源使用进行调度和规划,即预先确定物理机部署的虚拟机类型和规格,使得物理机的资源能够利用率最大化。在本申请实施例中,虚拟机类型用于表示虚拟机为共享型虚拟机,还是为独享型虚拟机。In this embodiment of the present application, in order to improve resource utilization, the resource usage of the physical machine can be scheduled and planned, that is, the type and specification of the virtual machine deployed on the physical machine can be determined in advance to maximize the resource utilization of the physical machine. In this embodiment of the present application, the virtual machine type is used to indicate whether the virtual machine is a shared virtual machine or an exclusive virtual machine.
基于上述提高物理机资源利用率的目标,在步骤S101中,可获取物理机单独部署第一类型虚拟机需要占用的资源。其中,第一类型虚拟机为独享型虚拟机或共享型虚拟机。 在本申请实施例中,不限定获取物理机部署第一类型虚拟机需要占用的资源的具体实施方式。Based on the above goal of improving physical machine resource utilization, in step S101, the resources required by the physical machine to separately deploy the first type of virtual machine can be obtained. Among them, the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. In the embodiment of this application, the specific implementation method of obtaining the resources required to deploy the first type of virtual machine on a physical machine is not limited.
在一些实施例中,可基于预设的第一类型虚拟机的资源规格,对物理机的总资源进行贪心装箱,以确定贪心装箱的第一类型虚拟机占用的资源,并确定贪心装箱的第一类型虚拟机占用的资源,为物理机部署第一类型虚拟机需要占用的资源。预设的第一类型虚拟机的资源规格可为1种规格或多种规格。多种是指2种或2种以上。不同资源规格中至少一个维度的资源量不同。In some embodiments, based on the preset resource specifications of the first type virtual machine, greedy boxing can be performed on the total resources of the physical machine to determine the resources occupied by the greedy boxed first type virtual machine, and determine the greedy boxing. The resources occupied by the first type of virtual machine in the box and the resources required to deploy the first type of virtual machine to the physical machine. The preset resource specification of the first type of virtual machine may be one specification or multiple specifications. Multiple means 2 or more types. The amount of resources in at least one dimension is different in different resource specifications.
由于云厂商提供的虚拟机的规格是一定且有限的,虚拟机规格所需资源可能不能与物理机的资源完全相等,这就导致物理机产生资源碎片。基于此,在确定出物理机单独部署第一类型虚拟机占用的资源的情况下,还可判断物理机单独部署第一类型虚拟机是否会产生资源碎片。具体地,可比较物理机单独部署第一类型虚拟机占用的资源是否小于物理机的总资源;若物理机单独部署第一类型虚拟机占用的资源小于物理机的总资源,可确定物理机单独部署第一类型虚拟机会产生资源碎片。Since the specifications of virtual machines provided by cloud vendors are certain and limited, the resources required by the virtual machine specifications may not be completely equal to the resources of the physical machine, which leads to resource fragmentation in the physical machine. Based on this, when it is determined that the resources occupied by the first type of virtual machine alone are deployed on the physical machine, it can also be determined whether resource fragmentation will occur if the physical machine alone deploys the first type of virtual machine. Specifically, it can be compared whether the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine; if the resources occupied by the first type of virtual machine deployed alone on the physical machine are less than the total resources of the physical machine, it can be determined that the resources occupied by the physical machine alone are less than the total resources of the physical machine. Deploying the first type of virtual machine will create resource fragmentation.
在本实施例中,为了降低物理机的资源碎片,在步骤S102中,可在物理机单独部署第一类型虚拟机占用的资源小于物理机的总资源的情况下,可将物理机的虚拟机部署模式设置为支持独享型虚拟机和共享型虚拟机混合部署模式。相应地,若物理机单独部署第一类型虚拟机占用的资源等于物理机的总资源,可将虚拟机的虚拟机部署模式设置为支持第一类型虚拟机单独部署。In this embodiment, in order to reduce the resource fragmentation of the physical machine, in step S102, when the resources occupied by the first type of virtual machine deployed separately on the physical machine are less than the total resources of the physical machine, the virtual machines of the physical machine can be The deployment mode is set to support a mixed deployment mode of dedicated virtual machines and shared virtual machines. Correspondingly, if the resources occupied by the first type of virtual machine when deployed separately on the physical machine are equal to the total resources of the physical machine, the virtual machine deployment mode of the virtual machine can be set to support the independent deployment of the first type of virtual machine.
进一步,在步骤S103中,可以物理机的总资源利用率最大化为目标,根据第一类型虚拟机的资源规格及第二类型虚拟机的资源规格,对物理机的总资源进行模拟调度,以确定物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源类型和数量。上述第二类型虚拟机为独享型虚拟机和共享型虚拟机中与第一类型虚拟机不同的类型。关于确定物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源类型和数量的具体实施方式,可参见上述系统实施例的相关内容,在此不再赘述。Further, in step S103, with the goal of maximizing the total resource utilization of the physical machine, simulation scheduling is performed on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine, so as to Determine the target resource type and quantity of the first type of virtual machine and the second type of virtual machine supported by the physical machine. The above-mentioned second type of virtual machine is a type different from the first type of virtual machine among exclusive virtual machines and shared virtual machines. Regarding the specific implementation method of determining the target resource type and quantity of the first type virtual machine and the second type virtual machine supported by the physical machine, please refer to the relevant content of the above system embodiment, and will not be described again here.
在确定出物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量之后,在步骤S104中,可根据第一类型虚拟机和第二类型虚拟机的资源规格和数量,对物理机进行独享型虚拟机和共享型虚拟机的混合部署。After determining the resource specifications and quantity of the first type virtual machine and the second type virtual machine supported by the physical machine, in step S104, the resource specification and quantity of the first type virtual machine and the second type virtual machine can be determined. Physical machines are deployed with a mixture of dedicated virtual machines and shared virtual machines.
在本申请实施例中,通过对物理机预先规划可混合部署的独享型虚拟机和共享型虚拟机的规格和数量,实现了独享型虚拟机和共享型虚拟机的混合部署,有助于降低由于虚拟机规格受限导致的天然资源碎片量。另一方面,由于物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量,是预先以物理机的资源利用率最大化为目标,对物理机的总资源模拟调度出来的,因此,在物理机中部署模拟出的数量与规格的独享型虚拟机和共享型虚拟机,可降低物理机的实际资源调度时的资源碎片,有助于提高物理机的资源利用率。In the embodiment of this application, by pre-planning the specifications and quantity of exclusive virtual machines and shared virtual machines that can be mixedly deployed on the physical machine, the mixed deployment of exclusive virtual machines and shared virtual machines is realized, which is helpful to To reduce the amount of natural resource fragmentation caused by limited virtual machine specifications. On the other hand, because the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
在本申请实施例中,在确定出物理机可混合部署的独享型虚拟机和共享型虚拟机的规 格和数量之后,还可对独享型虚拟机和共享型虚拟机占用的资源进行隔离。具体地,可根据物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量,将总资源划分为第一资源池和第二资源池。其中,第一资源池用于支持第一类型虚拟机部署,第二资源池用于支持第二类型虚拟机部署。进一步,可对第一资源池和第二资源池进行隔离处理,以供后续在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机。这样,实现的是共享型虚拟机和独享型虚拟机的弱混部。即,独享型虚拟机和共享型虚拟机分别具有分离且独立的资源池,每种类型的虚拟机只能调度支持该类型虚拟机部署的资源池进行虚拟机部署。In the embodiment of this application, after determining the rules of dedicated virtual machines and shared virtual machines that can be mixedly deployed on physical machines, After specifying the size and quantity, you can also isolate the resources occupied by dedicated virtual machines and shared virtual machines. Specifically, the total resources may be divided into a first resource pool and a second resource pool according to the resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the physical machine. The first resource pool is used to support the deployment of a first type of virtual machine, and the second resource pool is used to support the deployment of a second type of virtual machine. Further, the first resource pool and the second resource pool may be isolated for subsequent deployment of the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively. In this way, a weak mixture of shared virtual machines and exclusive virtual machines is achieved. That is, dedicated virtual machines and shared virtual machines each have separate and independent resource pools. Each type of virtual machine can only schedule virtual machine deployment in a resource pool that supports the deployment of that type of virtual machine.
在另一些实施例中,还可实现共享型虚拟机和独享型虚拟机的强混部。在强混部的实施方式中,物理机的资源是动态实时划分的而非物理隔离,可通过调度器来保证独享型虚拟机的SLA需求。In other embodiments, a forced mixing of shared virtual machines and exclusive virtual machines can also be implemented. In the implementation of strong hybrid deployment, the resources of physical machines are dynamically divided in real time rather than physically isolated, and the scheduler can be used to ensure the SLA requirements of exclusive virtual machines.
对于上述弱混部的实施例来说,针对上述第一资源池和第二资源池中支持共享型虚拟机部署的共享资源池,可对共享资源池中的物理核进行虚拟化处理,以得到多个逻辑核,以供后续共享资源池部署的共享型虚拟机共享共享资源池中的物理核。For the above embodiment of the weak hybrid part, for the shared resource pool in the first resource pool and the second resource pool that supports shared virtual machine deployment, the physical cores in the shared resource pool can be virtualized to obtain Multiple logical cores are used for shared virtual machines that are subsequently deployed in the shared resource pool to share the physical cores in the shared resource pool.
在本申请实施例中,不限定对共享资源池中的物理核进行虚拟化的具体实施方式。在一些实施例中,可根据设定的虚拟比例,确定需要虚拟出的逻辑核的数量M。M≥2,且为整数。可选地,可预先设定物理机的机型与虚拟比例之间的对应关系。基于该对应关系,在本实施例中,可根据物理机的机型,确定该机型对应的虚拟比例。进一步,可根据机型对应的虚拟比例,确定需要虚拟出的逻辑核的数量M。进一步,可利用超线程技术将第二资源中的每个物理核虚拟化为M个逻辑核。这样,后续对于共享型虚拟机,可根据共享型虚拟机的资源规格,确定共享型虚拟机需要的逻辑核数量;并利用相应数量的逻辑核,在共享资源池中部署共享型虚拟机。In the embodiment of this application, the specific implementation manner of virtualizing the physical cores in the shared resource pool is not limited. In some embodiments, the number M of logical cores that need to be virtualized can be determined based on the set virtualization ratio. M≥2, and is an integer. Optionally, the corresponding relationship between the model of the physical machine and the virtual scale can be preset. Based on this corresponding relationship, in this embodiment, the virtual proportion corresponding to the physical machine model can be determined according to the model of the physical machine. Furthermore, the number M of logical cores that need to be virtualized can be determined according to the virtual ratio corresponding to the machine model. Further, hyper-threading technology can be used to virtualize each physical core in the second resource into M logical cores. In this way, for the shared virtual machine in the future, the number of logical cores required by the shared virtual machine can be determined based on the resource specifications of the shared virtual machine; and the corresponding number of logical cores can be used to deploy the shared virtual machine in the shared resource pool.
值得说明的是,对于具有虚拟机混合部署模式的物理机来说,共享资源池的数量可为1个或多个。多个是指2个或2个以上。多个共享资源池对应的虚拟比例不同,即不同共享资源池中物理核虚拟化出的逻辑核的数量M不同。It is worth noting that for physical machines with virtual machine hybrid deployment mode, the number of shared resource pools can be one or more. Multiple means 2 or more. Multiple shared resource pools correspond to different virtual ratios, that is, the number M of logical cores virtualized from physical cores in different shared resource pools is different.
上述实施例预先确定了物理机的虚拟机部署方式,针对支持共享型虚拟机和独享型虚拟机混合部署的物理机,还可预先确定物理机支持的共享型虚拟机的资源规格和数量,以及,独享型虚拟机的资源规格和数量。在确定出这些之后,后续可根据虚拟机部署请求,对物理机进行资源调度,以在物理机中部署满足虚拟机部署请求的虚拟机。下面对本申请实施例提供的虚拟机部署过程中的资源调度方式进行示例性说明。The above embodiment predetermines the virtual machine deployment method of the physical machine. For the physical machine that supports the mixed deployment of shared virtual machines and exclusive virtual machines, the resource specifications and quantity of the shared virtual machines supported by the physical machine can also be predetermined. And, the resource specifications and quantity of exclusive virtual machines. After these are determined, resource scheduling can be performed on the physical machine according to the virtual machine deployment request, so that virtual machines that meet the virtual machine deployment request can be deployed in the physical machine. The following is an exemplary description of the resource scheduling method in the virtual machine deployment process provided by the embodiments of this application.
用户端可向管控节点提供虚拟机部署请求。该虚拟机部署请求可包括待部署虚拟机的类型(独享型虚拟机或共享型虚拟机)、目标资源规格及数量等。对于管控节点,可获取虚拟机部署请求。进一步,可从虚拟机部署请求中,获取待部署虚拟机的目标类型和目标资源规格;之后,可从计算系统的物理机中选择支持目标类型和目标资源规格的物理机。进一步,可根据支持目标类型和目标资源规格的物理机中目标资源池 的空闲资源,选择空闲资源满足目标资源规格需求的目标物理机;并在目标物理机的目标资源池中部署待部署虚拟机。其中,目标资源池为支持目标类型的虚拟机部署的资源池。例如,目标类型为独享型虚拟机,目标资源池为独享型资源池。若目标类型为共享型虚拟机,则目标资源池为共享型资源池。关于在目标资源池中部署独享型虚拟机和共享型虚拟机的具体实施方式,可参见上述系统实施例的相关内容,在此不再赘述。The client can provide a virtual machine deployment request to the management and control node. The virtual machine deployment request may include the type of virtual machine to be deployed (exclusive virtual machine or shared virtual machine), target resource specifications and quantity, etc. For management and control nodes, virtual machine deployment requests can be obtained. Further, the target type and target resource specifications of the virtual machine to be deployed can be obtained from the virtual machine deployment request; then, a physical machine that supports the target type and target resource specifications can be selected from the physical machines of the computing system. Furthermore, the target resource pool in the physical machine that supports the target type and target resource specifications can be of idle resources, select a target physical machine whose idle resources meet the target resource specification requirements; and deploy the virtual machine to be deployed in the target resource pool of the target physical machine. The target resource pool is a resource pool that supports the deployment of virtual machines of the target type. For example, the target type is an exclusive virtual machine and the target resource pool is an exclusive resource pool. If the target type is a shared virtual machine, the target resource pool is a shared resource pool. Regarding the specific implementation of deploying exclusive virtual machines and shared virtual machines in the target resource pool, please refer to the relevant content of the above system embodiments, and will not be described again here.
在本申请实施例中,管控节点除了可预先设置物理机的虚拟机部署模式之外,还可根据物理机的在线实时负载情况,对物理机的虚拟机部署模式进行灵活切换。下面对管控节点对物理机的虚拟机部署模式进行切换的具体实施方式进行示例性说明。In this embodiment of the present application, in addition to pre-setting the virtual machine deployment mode of the physical machine, the management and control node can also flexibly switch the virtual machine deployment mode of the physical machine according to the online real-time load condition of the physical machine. The following is an exemplary description of the specific implementation method of the management and control node switching the virtual machine deployment mode of the physical machine.
在一些实施例中,计算集群中存在当前虚拟机部署模式为独享型虚拟机和共享型虚拟机混合部署模式的物理机。相应地,可监测计算集群中独享型虚拟机和共享型虚拟机的库存水位。其中,关于库存水位的描述,可参见上述实施例的相关内容,在此不再赘述。In some embodiments, there are physical machines in the computing cluster whose current virtual machine deployment mode is a mixed deployment mode of dedicated virtual machines and shared virtual machines. Accordingly, the inventory levels of dedicated virtual machines and shared virtual machines in the computing cluster can be monitored. For the description of the inventory water level, please refer to the relevant content of the above embodiments, and will not be described again here.
若计算集群的独享型虚拟机和共享型虚拟机中存在库存水位小于设定的第一水位阈值的目标类型虚拟机,且另一类型虚拟机的库存水位大于设定的第二水位阈值,可从计算集群中,选择当前虚拟机部署模式为虚拟机混合部署模式的目标物理机;并将目标物理机的虚拟机部署模式切换为目标类型虚拟机单独部署模式。其中,第一水位阈值小于第二水位阈值。一般地,第一水位阈值小于50%;第二水位阈值大于50%。另一类型虚拟机是指独享型虚拟机和共享型虚拟机中,除目标类型虚拟机之外的另一类型虚拟机。例如,目标类型虚拟机为独享型虚拟机,则另一类型虚拟机为共享型虚拟机。若目标类型虚拟机为共享型虚拟机,则另一类型虚拟机为独享型虚拟机。If there are virtual machines of the target type in the dedicated virtual machines and shared virtual machines of the computing cluster whose inventory level is less than the set first water level threshold, and the inventory level of another type of virtual machine is greater than the set second water level threshold, From the computing cluster, you can select a target physical machine whose current virtual machine deployment mode is virtual machine mixed deployment mode; and switch the virtual machine deployment mode of the target physical machine to the target type virtual machine separate deployment mode. Wherein, the first water level threshold is smaller than the second water level threshold. Generally, the first water level threshold is less than 50%; the second water level threshold is greater than 50%. Another type of virtual machine refers to another type of virtual machine other than the target type virtual machine among exclusive virtual machines and shared virtual machines. For example, if the target type of virtual machine is an exclusive virtual machine, the other type of virtual machine is a shared virtual machine. If the target type of virtual machine is a shared virtual machine, the other type of virtual machine is an exclusive virtual machine.
在将目标物理机的虚拟机部署模式切换为目标类型虚拟机单独部署模式之后,可在目标物理机上单独部署目标类型的虚拟机。对于已部署于目标物理机(定义为第一物理机)的除目标类型虚拟机之外的另一类型的虚拟机,在一些实施例中,可将另一类型的虚拟机迁移至支持该另一类型的虚拟机部署的另一物理机(定义为第二物理机)。可选地,可根据第一物理机上部署的另一类型的虚拟机的资源规格,从计算集群的其它物理机中选择支持另一类型的虚拟机部署的物理机;并从支持另一类型的虚拟机部署的物理机中,选择支持另一类型的虚拟机的资源规格的物理机;之后,从支持另一类型的虚拟机的资源规格的物理机中,选择空闲资源可满足上述支持另一类型的虚拟机的资源规格的资源需求的物理机,作为第二物理机。进一步,可将第一物理机上部署的另一类型的虚拟机的资源规格,从第一物理机迁移至第二物理机。After switching the virtual machine deployment mode of the target physical machine to the target type virtual machine individual deployment mode, the target type virtual machine can be deployed separately on the target physical machine. For a virtual machine of another type other than the target type virtual machine that has been deployed on the target physical machine (defined as the first physical machine), in some embodiments, the virtual machine of the other type may be migrated to support the other type of virtual machine. A virtual machine of one type is deployed on another physical machine (defined as the second physical machine). Optionally, according to the resource specifications of another type of virtual machine deployed on the first physical machine, a physical machine that supports the deployment of another type of virtual machine can be selected from other physical machines in the computing cluster; and from other physical machines that support the deployment of another type of virtual machine; Among the physical machines for virtual machine deployment, select a physical machine that supports the resource specifications of another type of virtual machine; then, select idle resources from the physical machines that support the resource specifications of another type of virtual machine to meet the above requirements of supporting another type of virtual machine. The resource specifications of the type of virtual machine are the resource requirements of the physical machine, as the second physical machine. Further, resource specifications of another type of virtual machine deployed on the first physical machine may be migrated from the first physical machine to the second physical machine.
在另一些实施例中,可对第一物理机上部署的另一类型的虚拟机不进行处理。相应地,可在第一物理机的虚拟机部署模式切换为目标类型虚拟机单独部署模式之后,可利用第一物理机的空闲资源部署目标类型的虚拟机,并对第一物理机上部署的另一类型的虚拟机不进行处理。 In other embodiments, another type of virtual machine deployed on the first physical machine may not be processed. Correspondingly, after the virtual machine deployment mode of the first physical machine is switched to the separate deployment mode of the target type virtual machine, the idle resources of the first physical machine can be used to deploy the target type virtual machine, and another virtual machine deployed on the first physical machine can be deployed. One type of virtual machine is not processed.
物理机当前支持的虚拟机部署方式可能为上述共享型虚拟机和独享型虚拟机混合部署,也可能为任一类型的虚拟机单独部署。下面结合图11对当前虚拟机部署模式为某一类型的虚拟机单独部署的物理机的资源调度方式进行示例性说明。The virtual machine deployment methods currently supported by physical machines may be a mixed deployment of the above shared virtual machines and dedicated virtual machines, or they may be deployed separately for either type of virtual machine. The following is an exemplary description of the resource scheduling method of a physical machine in which a certain type of virtual machine is separately deployed in the current virtual machine deployment mode with reference to Figure 11.
图11为本申请实施例提供的另一资源调度方法的流程示意图。如图11所示,该方法包括:Figure 11 is a schematic flowchart of another resource scheduling method provided by an embodiment of the present application. As shown in Figure 11, the method includes:
S111、从计算集群中获取单独部署第一类型虚拟机的第三物理机的虚拟机库存水位;第一类型虚拟机为独享型虚拟机或共享型虚拟机。S111. Obtain the virtual machine inventory level of the third physical machine in which the first type of virtual machine is separately deployed from the computing cluster; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine.
S112、在虚拟机库存水位小于设定的第一水位阈值的情况下,从单独部署第二类型虚拟机的物理机中,选择空闲资源满足第一类型虚拟机的资源需求的第四物理机;第二类型虚拟机为独享型虚拟机和共享型虚拟机中与第一类型虚拟机不同的类型。S112. When the virtual machine inventory level is less than the set first water level threshold, select a fourth physical machine whose idle resources meet the resource requirements of the first type virtual machine from the physical machines where the second type virtual machine is deployed separately; The second type of virtual machine is a type of exclusive virtual machine or shared virtual machine that is different from the first type of virtual machine.
S113、将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式。S113. Switch the virtual machine deployment mode of the fourth physical machine to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines.
S114、利用第四物理机的空闲资源,在第四物理机中部署第一类型虚拟机。S114. Use the idle resources of the fourth physical machine to deploy the first type of virtual machine in the fourth physical machine.
在本实施例中,关于共享型虚拟机和独享型虚拟机的描述,可参见上述系统实施例的相关内容,在此不再赘述。In this embodiment, for descriptions of the shared virtual machine and the exclusive virtual machine, please refer to the relevant content of the above system embodiment, and will not be described again here.
在本实施例中,针对当前虚拟机部署模式为某一类型的虚拟机单独部署的物理机,可获取单独部署第一类型虚拟机的物理机(定义为第三物理机)的虚拟机库存水位。其中,第一类型虚拟机为独享型虚拟机或共享型虚拟机。第三物理机为计算集群中单独部署第一类型虚拟机的全部或部分物理机。In this embodiment, for a physical machine in which a certain type of virtual machine is deployed separately in the current virtual machine deployment mode, the virtual machine inventory level of the physical machine (defined as the third physical machine) on which the first type of virtual machine is deployed separately can be obtained. . Among them, the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. The third physical machine is all or part of the physical machine on which the first type of virtual machine is separately deployed in the computing cluster.
进一步,若第一类型虚拟机的虚拟机库存水位小于设定的第一水位阈值,在步骤S112中,可从单独部署第二类型虚拟机的物理机中,选择空闲资源满足第一类型虚拟机的资源需求的第四物理机。其中,第二类型虚拟机为独享型虚拟机和共享型虚拟机中,与第一类型虚拟机不同的类型。在本申请实施例中,不限低第一水位阈值的具体取值。一般地,第一水位阈值小于50%。Further, if the virtual machine inventory level of the first type virtual machine is less than the set first water level threshold, in step S112, idle resources can be selected from physical machines that separately deploy the second type virtual machine to satisfy the requirements of the first type virtual machine. The resource requirements of the fourth physical machine. Among them, the second type of virtual machine is an exclusive virtual machine or a shared virtual machine, which is different from the first type of virtual machine. In the embodiment of the present application, the specific value of the first lower water level threshold is not limited. Generally, the first water level threshold is less than 50%.
可选地,可从单独部署第二类型虚拟机的物理机中,选择机型支持第一类型虚拟机的第五物理机;并从第五物理机中,选择空闲资源满足所述第一类型虚拟机的资源需求的第四物理机。其中,第五物理机包括:第四物理机。Optionally, a fifth physical machine whose model supports the first type of virtual machine can be selected from the physical machines that separately deploy the second type of virtual machine; and from the fifth physical machine, select idle resources that meet the requirements of the first type of virtual machine. The resource requirements of a virtual machine are those of a fourth physical machine. Among them, the fifth physical machine includes: the fourth physical machine.
进一步,在步骤S113中,可将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式;之后,在步骤S114中,可利用第四物理机的空闲资源,在第四物理机中部署第一类型虚拟机,实现第四物理机中独享型虚拟机和共享型虚拟机的混合部署。由于第三物理机中第一类型虚拟机的库存水位较低,而单独部署第二类型虚拟机的第四物理机中有空闲资源,因此,将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式,实现第四物理机中独享型虚拟机和共享型虚拟机的混合部署,有助于降低第四物理机中的空闲资源,提高第四物理机的资源利用率。 Further, in step S113, the virtual machine deployment mode of the fourth physical machine can be switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines; and then, in step S114, the virtual machine deployment mode of the fourth physical machine can be used. Use idle resources to deploy the first type of virtual machine in the fourth physical machine to achieve mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine. Since the inventory level of the first type of virtual machine in the third physical machine is low, and there are idle resources in the fourth physical machine where the second type of virtual machine is deployed separately, the virtual machine deployment mode of the fourth physical machine is switched to support The mixed deployment mode of exclusive virtual machines and shared virtual machines realizes the mixed deployment of exclusive virtual machines and shared virtual machines in the fourth physical machine, which helps to reduce idle resources in the fourth physical machine and improve the efficiency of the fourth physical machine. Resource utilization of four physical machines.
在将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式之后,可响应于针对第一类型虚拟机的部署请求,从第四物理机的空闲资源中调度满足部署请求所需资源的目标资源;进一步,可利用目标资源在第四物理机中部署第一类型虚拟机。After the virtual machine deployment mode of the fourth physical machine is switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines, in response to a deployment request for the first type of virtual machine, the idle state of the fourth physical machine can be Target resources that meet the resources required by the deployment request are scheduled among the resources; further, the target resources can be used to deploy the first type of virtual machine in the fourth physical machine.
对于虚拟机弱混部的实施例来说,在将第四物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式之后,还可利用第四物理机的空闲资源,构建第一资源池;并利用第四物理机中部署第二类型虚拟机占用的资源,构建第二资源池;之后,可对第一资源池和第二资源池进行隔离处理,以供在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机。其中,在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机的具体实施方式,可参见上述实施例的相关内容,在此不再赘述。For the embodiment of weak hybrid deployment of virtual machines, after switching the virtual machine deployment mode of the fourth physical machine to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines, the fourth physical machine can also be used. Idle resources are used to construct a first resource pool; and the resources occupied by the second type of virtual machine deployed in the fourth physical machine are used to construct a second resource pool; after that, the first resource pool and the second resource pool can be isolated to The first type virtual machine and the second type virtual machine are respectively deployed in the first resource pool and the second resource pool. For specific implementation methods of respectively deploying the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool, please refer to the relevant content of the above embodiments, and will not be described again here.
在本申请一些实施例中,对于上述单独部署第一类型虚拟机的第三物理机,在第三物理机中第一类型虚拟机的库存水位小于或等于设定的第二水位阈值的持续时长大于或等于设定的时长阈值的情况下,还可将第三物理机的虚拟机部署模式切换为支持独享型虚拟机与共享型虚拟机的混合部署模式。进一步,可以第三物理机的资源利用率最大化为目标,确定第一物理机支持的第二类型虚拟机的资源规格和数量。之后,可响应于针对第二类型虚拟机的部署请求,在第三物理机中部署第二类型虚拟机,实现了第三物理机中独享型虚拟机和共享型虚拟机的混合部署,可降低第三物理机中空闲资源,有助于提高第三物理机的资源利用率。In some embodiments of the present application, for the above-mentioned third physical machine where the first type virtual machine is separately deployed, the inventory level of the first type virtual machine in the third physical machine is less than or equal to the duration of the set second water level threshold. If the duration is greater than or equal to the set duration threshold, the virtual machine deployment mode of the third physical machine can also be switched to a mixed deployment mode that supports exclusive virtual machines and shared virtual machines. Further, the resource specification and quantity of the second type of virtual machines supported by the first physical machine can be determined with the goal of maximizing the resource utilization of the third physical machine. After that, the second type virtual machine can be deployed in the third physical machine in response to the deployment request for the second type virtual machine, thereby realizing the mixed deployment of the exclusive virtual machine and the shared virtual machine in the third physical machine. Reducing idle resources in the third physical machine helps improve resource utilization of the third physical machine.
需要说明的是,上述实施例所提供方法的各步骤的执行主体均可以是同一设备,或者,该方法也由不同设备作为执行主体。比如,步骤S101和S102的执行主体可以为设备A;又比如,步骤S101的执行主体可以为设备A,步骤S102的执行主体可以为设备B;等等。It should be noted that the execution subject of each step of the method provided in the above embodiments may be the same device, or the method may also be executed by different devices. For example, the execution subject of steps S101 and S102 may be device A; for another example, the execution subject of step S101 may be device A, the execution subject of step S102 may be device B; and so on.
另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如S101、S102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。In addition, some of the processes described in the above embodiments and drawings include multiple operations that appear in a specific order, but it should be clearly understood that these operations may not be performed in the order in which they appear in this document or may be performed in parallel. , the sequence numbers of operations, such as S101, S102, etc., are only used to distinguish different operations. The sequence numbers themselves do not represent any execution order. Additionally, these processes may include more or fewer operations, and the operations may be performed sequentially or in parallel.
相应地,本申请实施例还提供一种存储有计算机指令的计算机可读存储介质,当计算机指令被一个或多个处理器执行时,致使一个或多个处理器执行上述各资源调度方法中的步骤。Correspondingly, embodiments of the present application also provide a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute each of the above resource scheduling methods. step.
图12为本申请实施例提供的计算设备的结构示意图。如图12所示,该计算设备包括:存储器12a和处理器12b;其中,存储器12a,用于存储计算机程序。Figure 12 is a schematic structural diagram of a computing device provided by an embodiment of the present application. As shown in Figure 12, the computing device includes: a memory 12a and a processor 12b; wherein the memory 12a is used to store computer programs.
处理器12b耦合至存储器12a,用于执行计算机程序以用于:获取第一物理机单独部署第一类型虚拟机占用的第一资源;第一类型虚拟机为独享型虚拟机或共享型虚拟机;在第一资源小于物理机的总资源的情况下,设置第一物理机的虚拟机部署模式 为支持独享型虚拟机和共享型虚拟机的混合部署模式;以总资源利用率最大化为目标,根据第一类型虚拟机的资源规格及第二类型虚拟机的资源规格,对物理机的总资源进行模拟调度,以确定物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量;第二类型虚拟机为独享型虚拟机和共享型虚拟机中与第一类型虚拟机不同的类型;根据第一物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量,对物理机进行独享型虚拟机和共享型虚拟机的混合部署;其中,独享型虚拟机是指虚拟处理器独占物理机的物理处理器资源的虚拟机;共享型虚拟机是指虚拟处理器共享物理处理器资源的虚拟机。The processor 12b is coupled to the memory 12a and is used to execute a computer program for: obtaining the first resource occupied by the first physical machine to separately deploy the first type of virtual machine; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. machine; when the first resource is less than the total resources of the physical machine, set the virtual machine deployment mode of the first physical machine In order to support the mixed deployment mode of dedicated virtual machines and shared virtual machines; with the goal of maximizing total resource utilization, the physical machine is configured based on the resource specifications of the first type of virtual machine and the resource specifications of the second type of virtual machine. The total resources are simulated and scheduled to determine the target resource specifications and quantities of the first type of virtual machine and the second type of virtual machine supported by the physical machine; the second type of virtual machine is an exclusive virtual machine and a shared virtual machine that are the same as the first type. Different types of virtual machines; according to the target resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the first physical machine, perform a mixed deployment of exclusive virtual machines and shared virtual machines on the physical machine; Among them, an exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of a physical machine; a shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
可选地,处理器12b在获取第一物理机部署第一类型虚拟机需要占用的第一资源时,具体用于:基于预设的第一类型虚拟机的资源规格,对第一物理机的总资源进行贪心装箱,以确定贪心装箱的第一类型虚拟机占用的资源;确定贪心装箱的第一类型虚拟机占用的资源作为第一资源。Optionally, when acquiring the first resources required by the first physical machine to deploy the first type virtual machine, the processor 12b is specifically configured to: based on the preset resource specifications of the first type virtual machine, configure the first physical machine based on the preset resource specifications of the first type virtual machine. The total resources are greedily boxed to determine the resources occupied by the first type of virtual machine in greedy boxing; the resources occupied by the first type of virtual machine in greedy boxing are determined as the first resources.
可选地,处理器12b还用于:根据第一物理机支持的第一类型虚拟机的目标资源规格和数量,将总资源划分为第一资源池和第二资源池;对第一资源池和第二资源池进行隔离处理,以供在第一资源池和第二资源池分别部署第一类型虚拟机和第二类型虚拟机。Optionally, the processor 12b is also configured to: divide the total resources into a first resource pool and a second resource pool according to the target resource specifications and quantity of the first type of virtual machine supported by the first physical machine; Perform isolation processing with the second resource pool to deploy the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively.
进一步,物理处理器资源为物理处理器的物理核。处理器12b还用于:针对第一资源池和第二资源池中部署共享型虚拟机的共享资源池,对共享资源池中的物理核进行虚拟化处理,以得到多个逻辑核,以供共享资源池部署的共享型虚拟机共享共享资源池中的物理核。Further, the physical processor resources are physical cores of the physical processor. The processor 12b is also configured to perform virtualization processing on the physical cores in the shared resource pool in which the shared virtual machine is deployed in the first resource pool and the second resource pool to obtain multiple logical cores for use. Shared virtual machines deployed in a shared resource pool share the physical cores in the shared resource pool.
可选地,处理器12b在对共享资源池中的物理核进行虚拟化处理时,具体用于:根据设定的虚拟比例,确定需要虚拟出的逻辑核的数量M;虚拟比例表示1个物理核与虚拟出的逻辑核的比值;利用超线程技术将第二资源中的每个物理核虚拟化为M个逻辑核;M≥2,且为整数。Optionally, when the processor 12b performs virtualization processing on the physical cores in the shared resource pool, it is specifically used to: determine the number M of logical cores that need to be virtualized according to the set virtual ratio; the virtual ratio represents 1 physical core. The ratio of cores to virtualized logical cores; hyper-threading technology is used to virtualize each physical core in the second resource into M logical cores; M≥2, and is an integer.
其中,共享资源池的数量为1个或多个。多个是指2个或2个以上。多个共享资源池对应的虚拟比例不同。Among them, the number of shared resource pools is 1 or more. Multiple means 2 or more. Multiple shared resource pools correspond to different virtual ratios.
在一些实施例中,处理器12b还用于:监测计算集群中独享型虚拟机和共享型虚拟机的库存水位;在独享型虚拟机和共享型虚拟机中第一目标类型的虚拟机库存水位小于设定的第一水位阈值,另一类型的虚拟机库存水位大于设定的第二水位阈值的情况下,从计算集群中,选择当前虚拟机部署模式为虚拟机混合部署模式的目标物理机;将目标物理机的虚拟机部署模式切换为第一目标类型的虚拟机单独部署模式。In some embodiments, the processor 12b is also configured to: monitor the inventory levels of exclusive virtual machines and shared virtual machines in the computing cluster; When the inventory water level is less than the set first water level threshold and the inventory level of another type of virtual machine is greater than the set second water level threshold, select the target of the current virtual machine deployment mode as the virtual machine hybrid deployment mode from the computing cluster Physical machine; switch the virtual machine deployment mode of the target physical machine to the virtual machine independent deployment mode of the first target type.
可选地,处理器12b还用于:在将目标物理机的虚拟机部署模式切换为第一目标类型的虚拟机单独部署模式的过程中,将目标物理机部署的另一类型的虚拟机迁移至支持另一类型的虚拟机部署的第二物理机;或者,在将目标物理机的虚拟机部署模式切换为任一类型的虚拟机单独部署模式之后,利用目标物理机的空闲资源部署第一目标类型的虚拟机。Optionally, the processor 12b is also configured to: in the process of switching the virtual machine deployment mode of the target physical machine to the virtual machine independent deployment mode of the first target type, migrate another type of virtual machine deployed on the target physical machine. to a second physical machine that supports the deployment of another type of virtual machine; or, after switching the virtual machine deployment mode of the target physical machine to a separate virtual machine deployment mode of any type, use the idle resources of the target physical machine to deploy the first Target type of virtual machine.
在另一些实施例中,处理器12b还用于:获取虚拟机部署请求;从虚拟机部署请求中,获取待部署虚拟机的第二目标类型和目标资源规格;从计算集群的物理机中, 确定存在支持第二目标类型的目标资源池,且支持目标资源规格的目标物理机;根据目标资源规格,在目标物理机的目标资源池中部署具有第二目标类型的待部署虚拟机。In other embodiments, the processor 12b is also used to: obtain a virtual machine deployment request; obtain the second target type and target resource specification of the virtual machine to be deployed from the virtual machine deployment request; obtain the second target type and target resource specifications of the virtual machine to be deployed; and obtain the target resource specification from the physical machine of the computing cluster. Determine that there is a target resource pool that supports the second target type and a target physical machine that supports the target resource specifications; and deploy the to-be-deployed virtual machine of the second target type in the target resource pool of the target physical machine according to the target resource specifications.
本实施例提供的计算设备,通过对物理机预先规划可混合部署的独享型虚拟机和共享型虚拟机的规格和数量,实现了独享型虚拟机和共享型虚拟机的混合部署,有助于降低由于虚拟机规格受限导致的天然资源碎片量。另一方面,由于物理机支持的第一类型虚拟机和第二类型虚拟机的资源规格和数量,是预先以物理机的资源利用率最大化为目标,对物理机的总资源模拟调度出来的,因此,在物理机中部署模拟出的数量与规格的独享型虚拟机和共享型虚拟机,可降低物理机的实际资源调度时的资源碎片,有助于提高物理机的资源利用率。The computing device provided in this embodiment realizes the mixed deployment of exclusive virtual machines and shared virtual machines by pre-planning the specifications and quantities of exclusive virtual machines and shared virtual machines that can be mixedly deployed on the physical machine. Helps reduce the amount of natural resource fragmentation caused by limited virtual machine specifications. On the other hand, because the resource specifications and quantities of the first type of virtual machines and the second type of virtual machines supported by the physical machine are pre-scheduled by simulating the total resources of the physical machine with the goal of maximizing the resource utilization of the physical machine. , Therefore, deploying the simulated number and specifications of dedicated virtual machines and shared virtual machines in the physical machine can reduce resource fragmentation during actual resource scheduling of the physical machine and help improve the resource utilization of the physical machine.
在本申请一下实施例中,处理器12b还用于:获取计算集群中单独部署第一类型虚拟机的第一物理机的虚拟机库存水位;第一类型虚拟机为独享型虚拟机或共享型虚拟机;在虚拟机库存水位小于设定的第一水位阈值的情况下,从单独部署第二类型虚拟机的物理机中,选择空闲资源满足第一类型虚拟机的资源需求的第二物理机;第二类型虚拟机为独享型虚拟机和共享型虚拟机中与第一类型虚拟机不同的类型;将第二物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式;利用第二物理机的空闲资源,在第二物理机中部署第一类型虚拟机;其中,独享型虚拟机是指虚拟处理器独占物理机的物理处理器资源的虚拟机;共享型虚拟机是指虚拟处理器共享物理处理器资源的虚拟机。In the following embodiment of the present application, the processor 12b is also used to: obtain the virtual machine inventory level of the first physical machine in the computing cluster where the first type of virtual machine is separately deployed; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine. type of virtual machine; when the virtual machine inventory level is less than the set first water level threshold, select a second physical machine with idle resources that meets the resource requirements of the first type of virtual machine from the physical machines that separately deploy the second type of virtual machine. machine; the second type of virtual machine is a type of exclusive virtual machine and shared virtual machine that is different from the first type of virtual machine; switch the virtual machine deployment mode of the second physical machine to support exclusive virtual machines and shared virtual machines Hybrid deployment mode of virtual machines; utilizing the idle resources of the second physical machine, deploying the first type of virtual machine in the second physical machine; wherein, the exclusive virtual machine refers to a virtual processor that exclusively occupies the physical processor resources of the physical machine. Virtual machine; a shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
可选地,处理器12b在选择空闲资源满足第一类型虚拟机的资源需求的第二物理机时,具体用于:从单独部署第二类型虚拟机的物理机中,选择机型支持第一类型虚拟机的第三物理机;从第三物理机中,选择空闲资源满足第一类型虚拟机的资源需求的第二物理机。Optionally, when selecting a second physical machine whose idle resources meet the resource requirements of the first type of virtual machine, the processor 12b is specifically configured to: select a model that supports the first type of physical machine from the physical machines that separately deploy the second type of virtual machine. a third physical machine of type virtual machine; and select a second physical machine whose idle resources meet the resource requirements of the first type virtual machine from the third physical machine.
在一些实施例中,处理器12b在第二物理机中部署第一类型虚拟机时,具体用于:响应于针对第一类型虚拟机的部署请求,从第二物理机的空闲资源中调度满足部署请求资源需求的目标资源;利用目标资源,在第二物理机中部署第一类型虚拟机。In some embodiments, when the processor 12b deploys the first type of virtual machine in the second physical machine, it is specifically configured to: in response to a deployment request for the first type of virtual machine, schedule from idle resources of the second physical machine that satisfies the requirements. Deploy the target resource required by the requested resource; use the target resource to deploy the first type of virtual machine in the second physical machine.
可选地,处理器12b还用于:利用第二物理机的空闲资源,构建第一资源池;Optionally, the processor 12b is also configured to: utilize the idle resources of the second physical machine to construct a first resource pool;
利用第二物理机中部署第二类型虚拟机占用的资源,构建第二资源池;对第一资源池和第二资源池进行隔离处理,以供在第一资源池和第二资源池中分别部署第一类型虚拟机和第二类型虚拟机。Using the resources occupied by the second type of virtual machine deployed in the second physical machine, a second resource pool is constructed; the first resource pool and the second resource pool are isolated for use in the first resource pool and the second resource pool respectively. Deploy the first type of virtual machine and the second type of virtual machine.
在本实施例提供的计算设备中,由于第一物理机中第一类型虚拟机的库存水位较低,而单独部署第二类型虚拟机的第二物理机中有空闲资源,因此,将第二物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式,实现第二物理机中独享型虚拟机和共享型虚拟机的混合部署,有助于降低第二物理机中的空闲资源,提高第二物理机的资源利用率。In the computing device provided by this embodiment, since the inventory level of the first type virtual machine in the first physical machine is low and there are idle resources in the second physical machine where the second type virtual machine is separately deployed, the second The virtual machine deployment mode of the physical machine is switched to a mixed deployment mode that supports dedicated virtual machines and shared virtual machines. This enables mixed deployment of dedicated virtual machines and shared virtual machines in the second physical machine, which helps reduce the cost of the second physical machine. The idle resources in the second physical machine improve the resource utilization of the second physical machine.
在一些可选实施方式中,如图12所示,该计算设备还可以包括:通信组件12c、电源组件12d等可选组件。图12中仅示意性给出部分组件,并不意味着计算设备必须包含图12所示全部组件,也不意味着计算设备只能包括图12所示组件。In some optional implementations, as shown in Figure 12, the computing device may also include: a communication component 12c, a power supply component 12d and other optional components. Only some components are schematically shown in FIG. 12 , which does not mean that the computing device must include all the components shown in FIG. 12 , nor does it mean that the computing device can only include the components shown in FIG. 12 .
在本申请实施例中,存储器用于存储计算机程序,并可被配置为存储其它各种数据以支持在其所在设备上的操作。其中,处理器可执行存储器中存储的计算机程序,以实现相 应控制逻辑。存储器可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。In the embodiment of the present application, the memory is used to store computer programs, and can be configured to store various other data to support operations on the device where it is located. Among them, the processor can execute the computer program stored in the memory to implement the corresponding The logic should be controlled. Memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable memory Read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
在本申请实施例中,处理器可以为任意可执行上述方法逻辑的硬件处理设备。可选地,处理器可以为中央处理器(Central Processing Unit,CPU)、图形处理器(Graphics Processing Unit,GPU)或微控制单元(Microcontroller Unit,MCU);也可以为现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程阵列逻辑器件(Programmable Array Logic,PAL)、通用阵列逻辑器件(General Array Logic,GAL)、复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD)等可编程器件;或者为先进精简指令集(RISC)处理器(Advanced RISC Machines,ARM)或系统芯片(System on Chip,SoC)等等,但不限于此。In this embodiment of the present application, the processor may be any hardware processing device that can execute the logic of the above method. Optionally, the processor can be a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) or a microcontroller unit (Microcontroller Unit, MCU); it can also be a field programmable gate array (Field -Programmable Gate Array (FPGA), Programmable Array Logic (PAL), General Array Logic (GAL), Complex Programmable Logic Device (CPLD) and other programmable devices ; Or advanced reduced instruction set (RISC) processors (Advanced RISC Machines, ARM) or system on chip (System on Chip, SoC), etc., but are not limited to this.
在本申请实施例中,通信组件被配置为便于其所在设备和其他设备之间有线或无线方式的通信。通信组件所在设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G,5G或它们的组合。在一个示例性实施例中,通信组件经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件还可基于近场通信(NFC)技术、射频识别(RFID)技术、红外数据协会(IrDA)技术、超宽带(UWB)技术、蓝牙(BT)技术或其他技术来实现。In the embodiment of the present application, the communication component is configured to facilitate wired or wireless communication between the device where it is located and other devices. The device where the communication component is located can access a wireless network based on communication standards, such as WiFi, 2G or 3G, 4G, 5G or their combination. In an exemplary embodiment, the communication component receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may also be based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology or other technologies to achieve this.
在本申请实施例中,电源组件被配置为其所在设备的各种组件提供电力。电源组件可以包括电源管理系统,一个或多个电源,及其他与为电源组件所在设备生成、管理和分配电力相关联的组件。In the embodiment of the present application, the power supply component is configured to provide power to various components of the device where it is located. A power component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power component resides.
需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order, nor do they limit "first" and "second" are different types.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will understand that embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。 These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机的存储介质为可读存储介质,也可称为可读介质。可读存储介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。The storage medium of a computer is a readable storage medium, which can also be called a readable medium. Readable storage media includes permanent and non-permanent, removable and non-removable media and can be implemented by any method or technology to store information. Information may be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory. (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, disk storage or other magnetic storage devices, or any other non-transmission medium, can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprises," "comprises," or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements not only includes those elements, but also includes Other elements are not expressly listed or are inherent to the process, method, article or equipment. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article, or device that includes the stated element.
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。 The above descriptions are only examples of the present application and are not intended to limit the present application. To those skilled in the art, various modifications and variations may be made to this application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application shall be included in the scope of the claims of this application.

Claims (14)

  1. 一种资源调度方法,其特征在于,包括:A resource scheduling method, characterized by including:
    获取第一物理机单独部署第一类型虚拟机占用的第一资源;所述第一类型虚拟机为独享型虚拟机或共享型虚拟机;Obtaining the first resources occupied by the first physical machine for separately deploying the first type of virtual machine; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine;
    在所述第一资源小于所述物理机的总资源的情况下,设置所述第一物理机的虚拟机部署模式为支持独享型虚拟机和共享型虚拟机的混合部署模式;When the first resource is less than the total resources of the physical machine, set the virtual machine deployment mode of the first physical machine to a hybrid deployment mode that supports exclusive virtual machines and shared virtual machines;
    以所述总资源利用率最大化为目标,根据所述第一类型虚拟机的资源规格及第二类型虚拟机的资源规格,对所述物理机的总资源进行模拟调度,以确定所述物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量;所述第二类型虚拟机为所述独享型虚拟机和所述共享型虚拟机中与所述第一类型虚拟机不同的类型;With the goal of maximizing the total resource utilization, simulation scheduling is performed on the total resources of the physical machine according to the resource specifications of the first type virtual machine and the resource specifications of the second type virtual machine to determine the physical machine's total resources. The target resource specifications and quantities of the first type of virtual machine and the second type of virtual machine supported by the machine; the second type of virtual machine is the same as the first type of the exclusive virtual machine and the shared virtual machine. Different types of virtual machines;
    根据所述第一物理机支持的第一类型虚拟机和第二类型虚拟机的目标资源规格和数量,对所述物理机进行独享型虚拟机和共享型虚拟机的混合部署;According to the target resource specifications and quantities of the first type virtual machine and the second type virtual machine supported by the first physical machine, perform a mixed deployment of exclusive virtual machines and shared virtual machines on the physical machine;
    其中,所述独享型虚拟机是指虚拟处理器独占所述物理机的物理处理器资源的虚拟机;所述共享型虚拟机是指虚拟处理器共享物理处理器资源的虚拟机。The exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of the physical machine; the shared virtual machine refers to a virtual machine in which a virtual processor shares physical processor resources.
  2. 根据权利要求1所述的方法,其特征在于,所述获取第一物理机部署第一类型虚拟机需要占用的第一资源,包括:The method of claim 1, wherein obtaining the first resources required by the first physical machine to deploy the first type of virtual machine includes:
    基于预设的第一类型虚拟机的资源规格,对所述第一物理机的总资源进行贪心装箱,以确定所述贪心装箱的第一类型虚拟机占用的资源;Based on the preset resource specifications of the first type virtual machine, perform greedy boxing on the total resources of the first physical machine to determine the resources occupied by the greedy boxed first type virtual machine;
    确定所述贪心装箱的第一类型虚拟机占用的资源作为所述第一资源。The resources occupied by the greedy boxed first type virtual machine are determined as the first resources.
  3. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    根据所述第一物理机支持的第一类型虚拟机的目标资源规格和数量,将所述总资源划分为第一资源池和第二资源池;Divide the total resources into a first resource pool and a second resource pool according to the target resource specifications and quantity of the first type of virtual machine supported by the first physical machine;
    对所述第一资源池和所述第二资源池进行隔离处理,以供在所述第一资源池和所述第二资源池分别部署所述第一类型虚拟机和所述第二类型虚拟机。Perform isolation processing on the first resource pool and the second resource pool to deploy the first type virtual machine and the second type virtual machine in the first resource pool and the second resource pool respectively. machine.
  4. 根据权利要求3所述的方法,其特征在于,所述物理处理器资源为物理处理器的物理核;针对所述第一资源池和所述第二资源池中部署共享型虚拟机的共享资源池,所述方法还包括:The method according to claim 3, characterized in that the physical processor resource is a physical core of a physical processor; for the shared resources of the shared virtual machine deployed in the first resource pool and the second resource pool pool, the method further includes:
    对所述共享资源池中的物理核进行虚拟化处理,以得到多个逻辑核,以供所述共享资源池部署的共享型虚拟机共享所述共享资源池中的物理核。The physical cores in the shared resource pool are virtualized to obtain multiple logical cores, so that the shared virtual machines deployed in the shared resource pool can share the physical cores in the shared resource pool.
  5. 根据权利要求4所述的方法,其特征在于,所述对所述共享资源池中的物理核进行虚拟化处理,以得到多个逻辑核,包括:The method according to claim 4, characterized in that said virtualizing the physical cores in the shared resource pool to obtain multiple logical cores includes:
    根据设定的虚拟比例,确定需要虚拟出的逻辑核的数量M;所述虚拟比例表示1个物理核与虚拟出的逻辑核的比值;According to the set virtual ratio, determine the number M of logical cores that need to be virtualized; the virtual ratio represents the ratio of one physical core to the virtualized logical core;
    利用超线程技术将所述第二资源中的每个物理核虚拟化为M个逻辑核;M≥2,且为整数。Hyper-threading technology is used to virtualize each physical core in the second resource into M logical cores; M≥2, and is an integer.
  6. 根据权利要求5所述的方法,其特征在于,所述共享资源池的数量为多个;多个共享资源池对应的虚拟比例不同。The method according to claim 5, characterized in that the number of the shared resource pools is multiple; the virtual ratios corresponding to the multiple shared resource pools are different.
  7. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    监测计算集群中独享型虚拟机和共享型虚拟机的库存水位; Monitor the inventory levels of dedicated virtual machines and shared virtual machines in the computing cluster;
    在所述独享型虚拟机和所述共享型虚拟机中第一目标类型的虚拟机库存水位小于设定的第一水位阈值,另一类型的虚拟机库存水位大于设定的第二水位阈值的情况下,从所述计算集群中,选择当前虚拟机部署模式为虚拟机混合部署模式的目标物理机;In the exclusive virtual machine and the shared virtual machine, the virtual machine inventory level of the first target type is less than the set first water level threshold, and the virtual machine inventory level of the other type is greater than the set second water level threshold. In the case of , select the target physical machine whose current virtual machine deployment mode is the virtual machine hybrid deployment mode from the computing cluster;
    将所述目标物理机的虚拟机部署模式切换为所述第一目标类型的虚拟机单独部署模式。Switch the virtual machine deployment mode of the target physical machine to the virtual machine independent deployment mode of the first target type.
  8. 根据权利要求7所述的方法,其特征在于,还包括:The method according to claim 7, further comprising:
    在将所述目标物理机的虚拟机部署模式切换为所述第一目标类型的虚拟机单独部署模式的过程中,将所述目标物理机部署的另一类型的虚拟机迁移至支持所述另一类型的虚拟机部署的第二物理机;In the process of switching the virtual machine deployment mode of the target physical machine to the virtual machine independent deployment mode of the first target type, migrating another type of virtual machine deployed on the target physical machine to support the other type. A second physical machine for deploying a type of virtual machine;
    或者,or,
    在将所述目标物理机的虚拟机部署模式切换为所述第一目标类型的虚拟机单独部署模式之后,利用所述目标物理机的空闲资源部署所述第一目标类型的虚拟机。After the virtual machine deployment mode of the target physical machine is switched to the virtual machine independent deployment mode of the first target type, the virtual machine of the first target type is deployed using idle resources of the target physical machine.
  9. 根据权利要求3所述的方法,其特征在于,还包括:The method according to claim 3, further comprising:
    获取虚拟机部署请求;Get the virtual machine deployment request;
    从所述虚拟机部署请求中,获取待部署虚拟机的第二目标类型和目标资源规格;Obtain the second target type and target resource specifications of the virtual machine to be deployed from the virtual machine deployment request;
    从计算集群的物理机中,确定存在支持所述第二目标类型的目标资源池,且支持目标资源规格的目标物理机;Determine from the physical machines of the computing cluster that there is a target resource pool that supports the second target type and a target physical machine that supports the target resource specifications;
    根据所述目标资源规格,在所述目标物理机的目标资源池中部署具有所述第二目标类型的待部署虚拟机。According to the target resource specification, the to-be-deployed virtual machine of the second target type is deployed in the target resource pool of the target physical machine.
  10. 一种资源调度方法,其特征在于,包括:A resource scheduling method, characterized by including:
    获取计算集群中单独部署第一类型虚拟机的第一物理机的虚拟机库存水位;所述第一类型虚拟机为独享型虚拟机或共享型虚拟机;Obtaining the virtual machine inventory level of the first physical machine in which the first type of virtual machine is separately deployed in the computing cluster; the first type of virtual machine is an exclusive virtual machine or a shared virtual machine;
    在所述虚拟机库存水位小于设定的第一水位阈值的情况下,从单独部署第二类型虚拟机的物理机中,选择空闲资源满足所述第一类型虚拟机的资源需求的第二物理机;所述第二类型虚拟机为所述独享型虚拟机和所述共享型虚拟机中与所述第一类型虚拟机不同的类型;When the virtual machine inventory level is less than the set first water level threshold, select a second physical machine with idle resources that meets the resource requirements of the first type virtual machine from the physical machines where the second type virtual machine is deployed separately. machine; the second type virtual machine is a type different from the first type virtual machine among the exclusive virtual machine and the shared virtual machine;
    将所述第二物理机的虚拟机部署方式切换为支持独享型虚拟机和共享型虚拟机的混合部署模式;Switch the virtual machine deployment mode of the second physical machine to a hybrid deployment mode that supports exclusive virtual machines and shared virtual machines;
    利用所述第二物理机的空闲资源,在所述第二物理机中部署所述第一类型虚拟机;Utilizing the idle resources of the second physical machine, deploy the first type virtual machine in the second physical machine;
    其中,所述独享型虚拟机是指虚拟处理器独占所述物理机的物理处理器资源的虚拟机;所述共享型虚拟机是指虚拟处理器共享所述物理处理器资源的虚拟机。The exclusive virtual machine refers to a virtual machine in which a virtual processor exclusively occupies the physical processor resources of the physical machine; the shared virtual machine refers to a virtual machine in which a virtual processor shares the physical processor resources.
  11. 根据权利要求10所述的方法,其特征在于,从单独部署第二类型虚拟机的物理机中,选择空闲资源满足所述第一类型虚拟机的资源需求的第二物理机,包括:The method according to claim 10, characterized in that selecting a second physical machine whose idle resources meet the resource requirements of the first type virtual machine from the physical machines in which the second type virtual machine is deployed separately includes:
    从所述单独部署第二类型虚拟机的物理机中,选择机型支持所述第一类型虚拟机的第三物理机;Select a third physical machine whose model supports the first type virtual machine from the physical machines on which the second type virtual machine is separately deployed;
    从所述第三物理机中,选择空闲资源满足所述第一类型虚拟机的资源需求的第二物理机。Select a second physical machine whose idle resources meet the resource requirements of the first type virtual machine from the third physical machine.
  12. 根据权利要求10所述的方法,其特征在于,还包括: The method according to claim 10, further comprising:
    利用所述第二物理机的空闲资源,构建第一资源池;Utilize the idle resources of the second physical machine to construct a first resource pool;
    利用所述第二物理机中部署所述第二类型虚拟机占用的资源,构建第二资源池;Utilize the resources occupied by the second type of virtual machine deployed in the second physical machine to construct a second resource pool;
    对所述第一资源池和所述第二资源池进行隔离处理,以供在所述第一资源池和所述第二资源池中分别部署所述第一类型虚拟机和所述第二类型虚拟机。Perform isolation processing on the first resource pool and the second resource pool for respectively deploying the first type virtual machine and the second type in the first resource pool and the second resource pool. virtual machine.
  13. 一种计算设备,其特征在于,包括:存储器和处理器;其中,所述存储器,用于存储计算机程序;A computing device, characterized by comprising: a memory and a processor; wherein the memory is used to store a computer program;
    所述处理器耦合至所述存储器,用于执行所述计算机程序以用于执行权利要求1-12任一项所述方法中的步骤。The processor is coupled to the memory for executing the computer program for performing the steps of the method of any one of claims 1-12.
  14. 一种存储有计算机指令的计算机可读存储介质,其特征在于,当所述计算机指令被一个或多个处理器执行时,致使所述一个或多个处理器执行权利要求1-12任一项所述方法中的步骤。 A computer-readable storage medium storing computer instructions, characterized in that, when the computer instructions are executed by one or more processors, they cause the one or more processors to execute any one of claims 1-12 steps in the method.
PCT/CN2023/093401 2022-05-16 2023-05-11 Resource scheduling method, device, and storage medium WO2023221844A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210530246.4A CN114880077A (en) 2022-05-16 2022-05-16 Resource scheduling method, device and storage medium
CN202210530246.4 2022-05-16

Publications (1)

Publication Number Publication Date
WO2023221844A1 true WO2023221844A1 (en) 2023-11-23

Family

ID=82676705

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/093401 WO2023221844A1 (en) 2022-05-16 2023-05-11 Resource scheduling method, device, and storage medium

Country Status (2)

Country Link
CN (1) CN114880077A (en)
WO (1) WO2023221844A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573373A (en) * 2024-01-15 2024-02-20 中诚华隆计算机技术有限公司 CPU virtualization scheduling method and system based on cloud computing

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880077A (en) * 2022-05-16 2022-08-09 阿里巴巴(中国)有限公司 Resource scheduling method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130275975A1 (en) * 2010-10-27 2013-10-17 Hitachi, Ltd. Resource management server, resource management method and storage medium in which resource management program is stored
CN109144706A (en) * 2017-06-15 2019-01-04 阿里巴巴集团控股有限公司 A kind of dynamic allocation method of cpu resource, device and physical machine
US20210089362A1 (en) * 2018-02-19 2021-03-25 Nippon Telegraph And Telephone Corporation Virtual resource management device, virtual resource allocation method, and virtual resource allocation program
CN113342534A (en) * 2021-06-29 2021-09-03 中国电信股份有限公司 Method, device and equipment for allocating graphics processing resources and storage medium
CN114880077A (en) * 2022-05-16 2022-08-09 阿里巴巴(中国)有限公司 Resource scheduling method, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130275975A1 (en) * 2010-10-27 2013-10-17 Hitachi, Ltd. Resource management server, resource management method and storage medium in which resource management program is stored
CN109144706A (en) * 2017-06-15 2019-01-04 阿里巴巴集团控股有限公司 A kind of dynamic allocation method of cpu resource, device and physical machine
US20210089362A1 (en) * 2018-02-19 2021-03-25 Nippon Telegraph And Telephone Corporation Virtual resource management device, virtual resource allocation method, and virtual resource allocation program
CN113342534A (en) * 2021-06-29 2021-09-03 中国电信股份有限公司 Method, device and equipment for allocating graphics processing resources and storage medium
CN114880077A (en) * 2022-05-16 2022-08-09 阿里巴巴(中国)有限公司 Resource scheduling method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573373A (en) * 2024-01-15 2024-02-20 中诚华隆计算机技术有限公司 CPU virtualization scheduling method and system based on cloud computing
CN117573373B (en) * 2024-01-15 2024-03-26 中诚华隆计算机技术有限公司 CPU virtualization scheduling method and system based on cloud computing

Also Published As

Publication number Publication date
CN114880077A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
WO2023221844A1 (en) Resource scheduling method, device, and storage medium
US10659318B2 (en) Methods and apparatus related to management of unit-based virtual resources within a data center environment
US9268394B2 (en) Virtualized application power budgeting
US9898794B2 (en) Host-based GPU resource scheduling
US9092269B2 (en) Offloading virtual machine flows to physical queues
US9875124B2 (en) Data assignment and data scheduling for physical machine in a virtual machine environment
JP6564838B2 (en) Multi-operating system operating method and apparatus based on Industrial Internet Operating System
EP3253027B1 (en) Resource allocation method and apparatus for virtual machines
US20150120928A1 (en) Container virtual machines for hadoop
US20170024251A1 (en) Scheduling method and apparatus for distributed computing system
CN111880750A (en) Method, device and equipment for distributing read-write resources of disk and storage medium
CN103747107B (en) A kind of compatible cloud operating platform and its implementation
CN112148489A (en) Game resource scheduling method, device, equipment and storage medium
CN111796908A (en) System and method for automatic elastic expansion and contraction of resources and cloud platform
WO2023093843A1 (en) Configuration device, scheduling device, configuration method, and scheduling method
WO2023050819A1 (en) System on chip, virtual machine task processing method and device, and storage medium
CN111176829B (en) Flexible resource allocation of physical and virtual functions in virtualized processing systems
WO2023000673A1 (en) Hardware accelerator device management method and apparatus, and electronic device and storage medium
CN113296926B (en) Resource allocation method, computing device and storage medium
CA2982132A1 (en) Network service infrastructure management system and method of operation
US11169844B2 (en) Virtual machine migration to multiple destination nodes
CN109697105A (en) A kind of container cloud environment physical machine selection method and its system, virtual resource configuration method and moving method
CN113064695A (en) Processing method and device of video memory resources
WO2018137363A1 (en) Method and apparatus for adjusting acceleration capability of virtual machine
CN113722051B (en) Hardware performance acquisition method, equipment, system and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23806796

Country of ref document: EP

Kind code of ref document: A1