WO2022001353A1 - 一种虚拟机和容器混合调度系统、方法、调度器及装置 - Google Patents

一种虚拟机和容器混合调度系统、方法、调度器及装置 Download PDF

Info

Publication number
WO2022001353A1
WO2022001353A1 PCT/CN2021/091733 CN2021091733W WO2022001353A1 WO 2022001353 A1 WO2022001353 A1 WO 2022001353A1 CN 2021091733 W CN2021091733 W CN 2021091733W WO 2022001353 A1 WO2022001353 A1 WO 2022001353A1
Authority
WO
WIPO (PCT)
Prior art keywords
container
deployed
machine
physical
containers
Prior art date
Application number
PCT/CN2021/091733
Other languages
English (en)
French (fr)
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 WO2022001353A1 publication Critical patent/WO2022001353A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • 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]
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a hybrid scheduling system, method, scheduler and device for virtual machines and containers.
  • the virtual machine scheduling architecture and the container scheduling architecture are two independent architectures that manage different physical machines respectively; the virtual machine scheduling architecture can perform virtual machine scheduling on the managed physical machines, while the container scheduling architecture can implement virtual machine scheduling on the managed physical machines. Container scheduling is performed on physical machines.
  • the present application provides a hybrid scheduling system, method, scheduler and device for virtual machines and containers, so as to provide a scheduling method for co-deployment of virtual machines and containers.
  • an embodiment of the present application provides a hybrid scheduling system for virtual machines and containers, the scheduling system includes a scheduler and a resource pool, and the resource pool includes one or more physical machines; the scheduler can receive resource requests; After the resource request, if the scheduler confirms that the resource request requires virtual machine resources, the scheduler selects a physical machine to deploy the virtual machine from the resource pool to deploy the virtual machine. If the scheduler confirms that the resource request requires container resources, the scheduler selects from the resource pool The physical machine used to deploy the container deploys the container.
  • the scheduler uniformly schedules virtual machines and containers, and virtual machines and containers can be deployed in the same resource pool, which provides the possibility of co-deployment of virtual machines and containers, and improves the scheduling efficiency of virtual machines and containers.
  • the physical machine used to deploy the virtual machine and the physical machine used to deploy the container are the same physical machine. That is, physical machines allow for simultaneous deployment of virtual machines and containers.
  • the physical machine used to deploy the virtual machine and the physical machine used to deploy the container are different physical machines.
  • the scheduler may receive resource requests from a virtual machine controller or a container controller.
  • the scheduler can receive the resource request through the virtual machine controller or the container controller in time, so as to facilitate the subsequent determination of the physical machine for deploying the virtual machine or the container.
  • the system further includes a virtual machine controller, and the resource request includes the total number of virtual machines to be deployed and the specifications of the virtual machines; when the scheduler selects the physical machine for deploying the virtual machine from the resource pool to deploy the virtual machine,
  • the physical machines for deploying virtual machines, the number of virtual machines to be deployed on the physical machines, and the virtual machine specifications can be determined based on the idle resource distribution information of the resource pool, according to the total number of virtual machines to be deployed and the specifications of the virtual machines.
  • the information can indicate the distribution of idle resources in the resource pool, that is, the distribution of idle resources on multiple physical machines; after determining the physical machines for deploying virtual machines, the number of virtual machines to be deployed on the physical machines, and the specifications of the virtual machines , the scheduler can instruct the virtual machine controller to deploy the virtual machine on the physical machine, wherein the virtual machine deployed on the physical machine conforms to the determined number of virtual machines to be deployed on the physical machine and the virtual machine specifications; to deploy a virtual machine on a physical machine.
  • the scheduler determines the physical machine for deploying the virtual machine according to the number of virtual machines to be deployed and the specifications of the virtual machine, and instructs the virtual machine controller to deploy the virtual machine on the physical machine to realize the scheduling of the virtual machine.
  • the system further includes a container controller, and the resource request includes the total number of containers to be deployed and the specifications of the containers; when the scheduler selects the physical machine for deploying the container from the resource pool to deploy the container, it can be based on the resource pool.
  • the idle resource distribution information indicates the number of idle resources on multiple physical machines.
  • the scheduler can instruct the container controller to deploy the container on the physical machine, where the container deployed on the physical machine conforms to the physical machine.
  • the number of containers to be deployed and the specifications of the containers after that, the container controller can deploy the containers on the physical machine according to the instructions of the scheduler.
  • the scheduler determines the physical machine for deploying the container according to the number of containers to be deployed and the container specification, and instructs the container controller to deploy the container on the physical machine to realize the scheduling of the container.
  • the system further includes a container controller, and the resource request includes a candidate physical machine for the container to be deployed, the number of containers to be deployed on the candidate physical machine, and the specifications of the container, where the candidate physical machine is the resource Physical machines in the pool; when the scheduler selects the physical machine for deploying the container from the resource pool to deploy the container, it determines the idle resource distribution of the candidate physical machine based on the idle resource distribution information of the resource pool. The distribution of idle resources on each physical machine; then, based on the distribution of idle resources of the candidate physical machines, the physical machines for deploying containers and the number of containers to be deployed on the physical machines are determined according to the number of containers deployed on the candidate physical machines and the specifications of the containers.
  • the container controller instructs the container controller to deploy the container on the physical machine, where the container deployed on the physical machine conforms to the number of containers to be deployed on the physical machine and the specifications of the container; after that, the container controller deploys the container on the physical machine according to the instructions of the scheduler .
  • the scheduler determines the physical machine for deploying the container according to the candidate physical machine of the container for deployment, the number of containers to be deployed on the candidate physical machine, and the specification of the container, and instructs the container controller to deploy the container on the physical machine. , which provides another container scheduling method.
  • the system further includes a container controller, and when the scheduler selects a physical machine for deploying the container from the resource pool to deploy the container, it can send idle resource distribution information of the resource pool to the container controller, wherein the idle resource The distribution information indicates the distribution of idle resources on multiple physical machines; after receiving the idle resource distribution information of the resource pool from the scheduler, the container controller determines the total number of containers to be deployed and the specifications of the containers based on the idle resource distribution information of the resource pool.
  • the physical machine used to deploy the container the number of containers to be deployed on the physical machine, and the specifications of the container; when the container is deployed on the physical machine, the container deployed on the physical machine conforms to the number of containers to be deployed on the physical machine and the specifications of the container.
  • the scheduler can send the idle resource distribution information of the resource pool to the container controller, and then the container controller determines the physical machine used to deploy the container, and instructs the container controller to deploy the container on the physical machine, providing another A container scheduling method, which can effectively reduce the signaling interaction between the container controller and the scheduler, and can also improve the efficiency of container scheduling.
  • the physical machine used for deploying the virtual machine and the physical machine used for deploying the container are the same physical machine
  • the physical machine includes a virtual machine management module, a container management module, and an agent module.
  • a virtual machine and a container are deployed on the same physical machine, and resource conflicts are likely to exist between the virtual machine and the container. In order to resolve the resource conflict.
  • the virtual machine management module may send a virtual machine resource allocation request to the proxy module, for requesting to allocate resources for the virtual machine to be deployed in the physical machine.
  • the container management module can send a container resource allocation request to the proxy module for requesting to allocate resources for the container to be deployed on the physical machine; the proxy module allocates resources to the virtual machine and the container to be deployed based on the idle resources of the physical machine; and to the virtual machine
  • the management module feeds back the resources allocated for the virtual machine to be deployed; and feeds back the resources allocated for the container to be deployed to the container management module; after that, the virtual machine management module can use the resources allocated for the virtual machine to be deployed to create a virtual machine; container;
  • the management module is also used to create a container using the resources allocated for the container to be deployed.
  • the agent module can uniformly allocate resources to the container and the virtual machine, so as to solve the resource conflict generated when the virtual machine and the container are co-deployed.
  • an embodiment of the present invention provides a hybrid scheduling method for a virtual machine and a container.
  • the method is applied to the scheduler.
  • the scheduler may first receive resource request; after that, if the scheduler determines that the resource request requires virtual machine resources, the scheduler selects a physical machine for deploying virtual machines from the resource pool to deploy the virtual machine; if the scheduler determines that the resource request requires container resources, the scheduler selects from the resource pool The physical machine used to deploy the container deploys the container.
  • the physical machine used to deploy the virtual machine and the physical machine used to deploy the container are the same physical machine.
  • the physical machine used to deploy the virtual machine and the physical machine used to deploy the container are different physical machines.
  • the scheduler when the scheduler receives the resource request, it can receive the resource request from the virtual machine controller, and can also receive the resource request from the container controller.
  • the resource request includes the total number of virtual machines to be deployed and the specifications of the virtual machines; when the scheduler selects the physical machine for deploying the virtual machine from the resource pool to deploy the virtual machine, it can be based on the idle resources of the resource pool.
  • Distribution information according to the total number of virtual machines to be deployed and the specifications of the virtual machines to determine the physical machines for deploying virtual machines, the number of virtual machines to be deployed on the physical machines, and the specifications of the virtual machines, wherein the idle resource distribution information indicates that multiple physical machines are idle
  • the distribution of resources instructs the virtual machine controller to deploy virtual machines on physical machines.
  • the virtual machines deployed on the physical machine conform to the number of virtual machines to be deployed on the physical machine and the specifications of the virtual machines.
  • the resource request includes the total number of containers to be deployed and the specifications of the containers; when the scheduler selects the physical machine for deploying the container from the resource pool to deploy the container, it can be based on the idle resource distribution information of the resource pool, Determine the physical machine used to deploy the container, the number of containers to be deployed on the physical machine, and the specification of the container according to the total number of containers to be deployed and the specifications of the container, and the idle resource distribution information indicates the distribution of idle resources on multiple physical machines; The container controller deploys the container on the physical machine, wherein the container deployed on the physical machine conforms to the number of containers to be deployed on the physical machine and the specifications of the container.
  • the resource request includes a candidate physical machine for deploying the container, the number of containers to be deployed on the candidate physical machine, and the specifications of the container; the scheduler deploys the container after selecting the physical machine for deploying the container from the resource pool
  • the idle resource distribution information of the resource pool is used to determine the idle resource distribution of the candidate physical machines
  • the idle resource distribution information indicates the distribution of idle resources on multiple physical machines; then, based on the idle resource distribution of the candidate physical machines , according to the number of containers deployed on the candidate physical machine and the specifications of the container to determine the physical machine for deploying the container, the number of containers to be deployed on the physical machine, and the specification of the container; and then instruct the container controller to deploy the container on the physical machine.
  • Containers conform to the number of containers to be deployed on the physical machine and the container specifications.
  • the scheduler when the scheduler selects the physical machine for deploying the container from the resource pool to deploy the container, the scheduler may send idle resource distribution information of the resource pool to the container controller, wherein the idle resource distribution information indicates a plurality of physical machines The distribution of idle resources on the machine, so that the container controller can determine the physical machine for deploying the container based on the idle resource distribution information of the resource pool, and deploy the container.
  • an embodiment of the present application further provides a scheduler, which has a function of implementing the behavior in the method example of the second aspect.
  • the functions can be implemented by hardware, or can be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the apparatus includes a transmission unit and a processing unit, and these units can perform the corresponding functions in the method example of the second aspect. For details, refer to the detailed description in the method example, which will not be repeated here.
  • an embodiment of the present application further provides a device, the device has a function of implementing the behavior in the method example of the second aspect, and the beneficial effects can be referred to the description of the second aspect and will not be repeated here.
  • the structure of the communication device includes a processor and a memory, and the processor is configured to support the base station to perform the corresponding functions in the method of the second aspect.
  • the memory is coupled to the processor and holds program instructions and data necessary for the communication device.
  • the structure of the communication device further includes a communication interface for communicating with other devices.
  • the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer executes the methods described in the above aspects.
  • the present application further provides a computer program product comprising instructions, which, when executed on a computer, cause the computer to perform the method described in the second aspect above.
  • the present application further provides a computer chip, the chip is connected to a memory, and the chip is configured to read and execute a software program stored in the memory, and execute the method described in the second aspect above.
  • FIG. 1 is a schematic diagram of the architecture of a system provided by the application.
  • FIG. 2 is a schematic diagram of a hybrid scheduling method for virtual machines and containers provided by the present application.
  • FIG. 3 is a schematic structural diagram of a scheduler provided by the present application.
  • FIG. 4 is a schematic structural diagram of a device provided by the present application.
  • FIG. 1 it is a schematic diagram of the architecture of a system to which this embodiment of the present application is applied.
  • the system includes a scheduler 100 and a resource pool 200.
  • the resource pool 200 includes one or more physical machines 210, and the one or more The physical machine 210 allows simultaneous deployment of virtual machines and containers.
  • the system may further include a virtual machine controller 300 and a container controller 400 .
  • the scheduler 100 is configured to uniformly schedule instances deployed on one or more physical machines 210 in the resource pool 200, and the types of the instances include but are not limited to: containers and virtual machines.
  • the scheduler 100 may receive a resource request from the virtual machine controller 300 or the container controller 400.
  • the resource request from the virtual machine controller 300 is referred to as a virtual machine resource request
  • the resource request from the virtual machine controller 300 is referred to as a
  • the resource request of the container controller 400 is called a container resource request, wherein the virtual machine resource request is used for requesting virtual machine resources, and the container resource request is used for requesting container resources.
  • the scheduler 100 may select the physical machine 210 that can be used to deploy the virtual machine from the resource pool 200 to deploy the virtual machine.
  • the scheduler 100 may send a virtual machine resource response to the virtual machine controller 300, the virtual machine resource response indicating the physical machine used to deploy the virtual machine.
  • the virtual machine controller 300 So that the virtual machine controller 300 can deploy the physical machine 210 on the physical machine 210 according to the virtual machine resource response.
  • the scheduler 100 may select the physical machine 210 that can be used to deploy the container from the resource pool 200 to deploy the container.
  • the scheduler 100 may send a container resource response to the container controller 400, the container resource response indicating the physical machine 210 for deploying the container. So that the container controller 400 can deploy the physical machine 210 on the physical machine 210 according to the container resource response.
  • the virtual machine controller 300 is configured to schedule virtual machines deployed on one or more physical machines 210 in the resource pool 200 .
  • the virtual machine controller 300 may send a virtual machine resource request to the scheduler 100 for virtual machine resources, and may also receive a virtual machine resource response from the scheduler 100, and deploy the virtual machine on the physical machine 210 according to the virtual machine resource response.
  • the virtual machine controller 300 sends a virtual machine resource request.
  • the virtual machine resource request may be triggered by a user, and the user can select the virtual machine creation interface provided by the virtual machine controller 300 to be deployed.
  • the total number of virtual machines and the specifications of the virtual machines trigger the virtual machine controller 300 to send a virtual machine resource request to the scheduler 100 .
  • the virtual machine controller 300 may receive a virtual machine creation request from another device (such as a client) for requesting to create a virtual machine, and the virtual machine creation request may include the total number of virtual machines to be deployed and the virtual machine specifications, Afterwards, when the virtual machine controller 300 determines that a virtual machine needs to be created, it may send a virtual machine resource request to the scheduler 100 .
  • the container controller 400 is configured to schedule containers deployed on one or more physical machines 210 in the resource pool 200 .
  • the container controller 400 may send a container resource request to the scheduler 100, requesting container resources, and may also receive a container resource response from the scheduler 100, and deploy the container on the physical machine 210 according to the container resource response.
  • the embodiments of the present application do not limit the scenario in which the container controller 400 sends a container resource request.
  • the container resource request may be triggered by a user, and the user can select a container to be deployed on the container creation interface provided by the container controller 400
  • the total number and container specifications trigger the container controller 400 to send a container resource request to the scheduler 100 .
  • the container controller 400 may receive a container creation request from another device (such as a client) for requesting to create a container.
  • the container creation request may include the total number of containers to be deployed and the container specifications. After that, the container controller 400 When it is determined that a container needs to be created, a container resource request may be sent to the scheduler 100 .
  • a virtual machine management module 211 inside each physical machine 210 in the resource pool 200 , a virtual machine management module 211 , a container management module 213 and an agent module 212 may be deployed on each physical machine 210 .
  • the virtual machine management module 211 can manage the virtual machines deployed on the physical machine 210.
  • the management performed by the virtual machine management module 211 includes but is not limited to: creating virtual machines, deleting virtual machines, stopping the running state of virtual machines, and starting virtual machines. machine.
  • the virtual machine controller 300 When the virtual machine controller 300 needs to deploy a virtual machine on a physical machine 210, it can send a virtual machine creation instruction to the virtual machine management module 211 deployed on the physical machine 210, and the virtual machine creation instruction can indicate the virtual machine to be deployed
  • the specifications of the virtual machines to be deployed are used to indicate the resources occupied by the virtual machines to be created.
  • the resources include but are not limited to: virtual processors, memory, disks, network bandwidth, network throughput, or network bits rate etc.
  • the virtual processor is a virtualization technology of the central processing unit.
  • the virtual machine management module 211 may create a virtual machine on the physical machine 210 according to the virtual machine creation instruction.
  • the container management module 213 is used to manage the containers deployed on the physical machine 210.
  • the management performed by the container management module 213 includes but is not limited to: creating containers, deleting containers, stopping the running state of containers, and starting containers.
  • the container controller 400 When the container controller 400 needs to deploy a container on a physical machine 210, it can send a container creation instruction to the container management module 213 deployed on the physical machine 210, where the container creation instruction can indicate the number of containers to be deployed and the specifications of the containers , the specification of the container to be deployed is used to indicate the resource occupied by the container to be deployed, the resource includes but not limited to: virtual processor, memory, disk, network throughput, or network bit rate, etc.
  • the container management module 213 may create a container on the physical machine 210 according to the container creation instruction.
  • the proxy module 212 is used to allocate resources for the virtual machine or container to be deployed on the physical machine 210. When the virtual machine and the container are deployed on a physical machine 210, the proxy module 212 can be deployed on the physical machine 210 respectively.
  • the virtual machine and the container are allocated resources, the resources allocated for the virtual machine to be deployed are fed back to the virtual machine management module 211 , and the resources allocated for the container to be deployed are fed back to the container management module 213 .
  • the virtual machine management module 211 may create a virtual machine using the resources allocated for the virtual machine to be deployed.
  • the container management module 213 may use the resources allocated for the container to be deployed to create a container.
  • steps 201 to 203 are the scheduling method for virtual machines by the scheduler 100
  • steps 204 to 204 206 is a method for scheduling containers by the scheduler 100.
  • This embodiment of the present application does not limit the order in which the scheduler 100 can schedule virtual machines and containers.
  • the scheduler 100 can schedule virtual machines and containers in an order and practical applications
  • the order in which the scheduler 100 receives the virtual machine resource request is related to the sequence of the container resource request.
  • the scheduler 100 can schedule the virtual machine first (steps 201 to 203 ), and then schedule the container.
  • the scheduling (steps 204 to 206 ) is described as an example.
  • the method includes:
  • Step 201 The virtual machine controller 300 sends a virtual machine resource request to the scheduler 100, where the virtual machine resource request requires virtual machine resources.
  • Step 202 After receiving the virtual machine resource request, the scheduler 100 determines that the virtual machine resource request requires virtual machine resources.
  • Step 203 The scheduler 100 selects the physical machine 210 for deploying the virtual machine from the resource pool 200 to deploy the virtual machine.
  • Step 204 The container controller 400 sends a container resource request to the scheduler 100, where the container resource request requires container resources.
  • Step 205 After receiving the container resource request, the scheduler 100 determines that the container resource request requires container resources.
  • Step 206 The scheduler 100 selects the physical machine 210 for deploying the container from the resource pool 200 to deploy the container.
  • the method for scheduling virtual machines by the scheduler 100 is described below:
  • the virtual machine scheduling request may include the total number of virtual machines to be deployed and the specifications of the virtual machines. If the total number of virtual machines to be deployed is multiple and the virtual machines have different specifications, the virtual machine scheduling request may include the specifications of each virtual machine.
  • the scheduler 100 may acquire the idle resource distribution information of the resource pool 200 saved by the scheduler 100 , and the idle resource distribution information of the resource pool 200 may indicate one or more of the resource pools 200
  • the distribution of idle resources on the physical machines 210 may also indicate the occupied resources on the one or more physical machines 210 .
  • the idle resource distribution information of the resource pool 200 may also indicate the number of virtual machines and containers deployed on the one or more physical machines 210, the specifications of each virtual machine, and the specifications of each container.
  • the scheduler 100 selects a physical machine 210 for deploying virtual machines from one or more physical machines 210 according to the total number of virtual machines to be deployed and the specifications of the virtual machines.
  • the scheduler 100 also The number of virtual machines to be deployed on the selected physical machine 210 and the specifications of the virtual machines can be determined. If the number of selected physical machines 210 is multiple, the scheduler 100 may determine the number of virtual machines to be deployed on each physical machine 210 and the specifications of the virtual machines.
  • the virtual machine can be deployed on the physical machine 210 .
  • the scheduler 100 determines the physical machine 210 for deploying virtual machines, if the number of virtual machines that can be deployed on the physical machine 210 that currently has idle resources is lower than the total number of virtual machines to be deployed, or the current The virtual machine specifications that can be deployed by the physical machine 210 with idle resources are inconsistent with the virtual machine specifications to be deployed.
  • the scheduler 100 may use the physical machine 210 information for deploying part of the virtual machines (such as the virtual machines that can be deployed) number and virtual machine specifications) are fed back to the virtual machine controller 300.
  • the virtual machine controller 300 After the virtual machine controller 300 receives the physical machine 210 information for deploying some virtual machines, it can Part of the virtual machine can be deployed on the physical machine 210 if the virtual machine is determined to be deployed; if it is determined not to deploy part of the virtual machine, the user can be notified that the virtual machine has failed to be scheduled.
  • This embodiment of the present application does not limit the manner in which the scheduler 100 deploys the virtual machine on the physical machine 210.
  • the scheduler 100 may instruct the virtual machine controller 300 to deploy on the physical machine 210 virtual machine, the virtual machine controller 300 deploys the virtual machine on the physical machine 210 under the instruction of the scheduler 100, and the deployed virtual machine conforms to the determined number of virtual machines to be deployed on the physical machine 210 and the virtual machine specifications, that is, The number of deployed virtual machines is consistent with the determined number of virtual machines to be deployed on the physical machine 210 , and the specifications of the deployed virtual machines are consistent with the determined specifications of the virtual machines to be deployed on the physical machine 210 .
  • the scheduler 100 may carry the physical machine 210 information for deploying the virtual machine in the virtual machine scheduling response, and feed it back to the virtual machine controller 300 .
  • the physical machine 210 information for deploying virtual machines includes the number of virtual machines to be deployed on the physical machine 210 and the specifications of the virtual machines.
  • the physical machine 210 information may further include the identifier of the physical machine 210, and the identifier of the physical machine 210 may be the address of the physical machine 210, such as an internet protocol (internet protocol, IP) address,
  • IP internet protocol
  • the media access control address (MAC) can also be the serial number of the physical machine 210 , and any information that can identify the physical machine 210 can be used as the identification of the physical machine 210 .
  • the virtual machine controller 300 After receiving the virtual machine scheduling response, the virtual machine controller 300 determines, according to the physical machine 210 information for deploying the virtual machine carried in the virtual machine scheduling response, the physical machine 210 for deploying the virtual machine, and the physical machine 210 to be deployed on the physical machine 210. number of virtual machines and virtual machine specifications.
  • the virtual machine controller 300 may deploy a virtual machine on the physical machine 210, and the virtual machine deployed on the physical machine 210 conforms to the number of virtual machines to be deployed on the physical machine 210 and the virtual machine specifications indicated in the virtual machine scheduling response.
  • the virtual machine controller 300 may send a virtual machine creation instruction to the virtual machine management module 211 on the physical machine 210, where the virtual machine creation instruction includes the number of virtual machines to be deployed and virtual machine specifications.
  • This embodiment of the present application does not limit the number of virtual machines to be deployed on the physical machine 210, which may be one or multiple, and the specifications of the virtual machines deployed on the physical machine 210 may be the same or different.
  • the virtual machine management module 211 can create a virtual machine on the physical machine 210 according to the virtual machine creation instruction, and the virtual machine created on the physical machine 210 conforms to the virtual machine to be deployed on the physical machine 210.
  • number of machines and virtual machine specifications That is, the number of virtual machines created by the virtual machine management module 211 is consistent with the number of virtual machines to be deployed included in the virtual machine creation instruction, and the virtual machine specifications created by the virtual machine management module 211 are the same as those included in the virtual machine creation instruction.
  • the virtual machine specifications are the same.
  • the virtual machine management module 211 may send a virtual machine resource allocation request to the proxy module 212 of the physical machine 210, and the virtual machine resource allocates resources.
  • the request includes the number of virtual machines to be deployed on the physical machine 210 and the specifications of the virtual machines, and the virtual machine resource allocation request is used to request resource allocation for the virtual machines to be deployed on the physical machine 210 .
  • the proxy module 212 can allocate resources to the virtual machine to be deployed according to the number of virtual machines to be deployed and the specifications of the virtual machines based on the idle resources on the physical machine 210 . After that, the virtual machine resource allocation response carrying the resources allocated for the virtual machine to be deployed is fed back to the virtual machine management module 211 .
  • the virtual machine management module 211 creates a virtual machine using the resources allocated for the virtual machine to be deployed.
  • the proxy module 212 may first determine whether a container is deployed on the physical machine 210, or whether there is a container to be deployed on the physical machine 210 (for example, a container resource allocation request is received), if Currently, no container is deployed on the physical machine 210, and there is no container to be deployed. That is, the instance type deployed on the physical machine 210 is only a virtual machine, and there is no conflict in resource occupation between the virtual machine and the container.
  • the proxy module 212 can An instruction message is directly sent to the virtual machine management module 211, where the instruction message is used to instruct the virtual machine management module 211 to allocate resources to the virtual machine by itself. After receiving the instruction message, the virtual machine management module 211 can directly use the idle resources on the physical machine 210 to create a virtual machine.
  • a container is currently deployed on the physical machine 210, or there is a container to be deployed, that is to say, there are two types of instances deployed on the physical machine 210, namely virtual machines and containers.
  • the virtual machine management module 211 After the virtual machine management module 211 creates a virtual machine on the physical machine 210, it can send a virtual machine creation success response to the virtual machine controller 300.
  • the virtual machine creation success response can also include the number of virtual machines created by the virtual machine management module 211 and the virtual machine. resources occupied by the machine.
  • the virtual machine controller 300 After receiving the virtual machine creation success response, the virtual machine controller 300 determines that the virtual machine creation is successful, and can also feed back the virtual machine creation success response to the scheduler 100, and the scheduler 100 receives the virtual machine creation success response after receiving the virtual machine creation success response.
  • the idle resource distribution information of the resource pool 200 can be updated, the resources occupied by the virtual machines on the physical machine 210 can be marked as occupied, and the number of virtual machines deployed on the physical machine 210 and the specifications of each virtual machine can be marked.
  • the method for scheduling containers by the scheduler 100 is described below:
  • the scheduler 100 can schedule containers in three ways.
  • the three ways are described below:
  • the scheduler 100 determines the physical machine 210 for deploying the containers according to the total number of containers to be deployed and the specifications of the containers.
  • the container scheduling request can include the total number of containers to be deployed and the specifications of the containers. If the total number of containers to be deployed is multiple and the container specifications are different, the container scheduling request may include the specifications of each container.
  • the scheduler 100 After the scheduler 100 receives the container scheduling request, it can obtain the idle resource distribution information of the resource pool 200 saved by the scheduler 100.
  • the idle resource distribution information of the resource pool 200 please refer to the foregoing description, which will not be repeated here. .
  • the scheduler 100 selects a physical machine 210 for deploying containers from one or more physical machines 210 according to the total number of containers to be deployed and the specifications of the containers, and the scheduler 100 may also determine The number of containers to be deployed on the selected physical machine 210 and the specifications of the containers. If the number of selected physical machines 210 is multiple, the scheduler 100 may determine the number of containers to be deployed on each physical machine 210 and the specifications of the containers.
  • the scheduler 100 determines the physical machine 210 for deploying containers, if the number of containers that can be deployed on the physical machine 210 that currently has idle resources is lower than the total number of containers to be deployed, or if there are currently idle resources The container specifications that can be deployed by the physical machine 210 are inconsistent with the container specifications to be deployed.
  • the scheduler 100 can directly feed back a scheduling failure response to the container controller 400, and the scheduler 100 can also determine the physical machine 210 for deploying some containers.
  • the container is deployed on the physical machine 210 of the selected part of the containers.
  • the scheduler 100 can feed back the physical machine 210 information (such as the number of containers that can be deployed and the container specifications) for deploying part of the container to the container controller 400 , after receiving the physical machine 210 information for deploying some containers, the container controller 400 can determine whether to deploy some containers according to a preset policy. If it is determined to deploy containers, it can deploy some containers on the physical machine 210. Some containers, you can notify the user that the container scheduling failed.
  • the container controller 400 can determine whether to deploy some containers according to a preset policy. If it is determined to deploy containers, it can deploy some containers on the physical machine 210. Some containers, you can notify the user that the container scheduling failed.
  • the scheduler 100 After the scheduler 100 selects the physical machine 210 for deploying the container, it can deploy the container on the physical machine 210 .
  • the embodiments of the present application do not limit the manner in which the scheduler 100 deploys containers on the physical machine 210.
  • the following describes a manner in which the scheduler 100 deploys containers on the physical machine 210 provided by the embodiments of the present application:
  • the scheduler 100 selects the physical machine 210 for deploying containers, and after determining the number of containers to be deployed on the physical machine 210 and the container specifications, the scheduler 100 can instruct the container controller 400 to deploy the container on the physical machine 210, and the container controls
  • the server 400 deploys the container on the physical machine 210 under the instruction of the scheduler 100 , and the deployed container conforms to the determined number of containers to be deployed on the physical machine 210 and the container specification. That is, the number of deployed containers is consistent with the determined number of containers to be deployed on the physical machine 210 , and the specifications of the deployed containers are consistent with the determined container specifications to be deployed on the physical machine 210 .
  • the scheduler 100 may carry the information of the physical machine 210 used to deploy the container in the container scheduling response, and feed it back to the container controller 400 .
  • the physical machine 210 information for deploying containers includes the number of containers to be deployed on the physical machine 210 and the specifications of the containers.
  • the physical machine 210 information may further include the identifier of the physical machine 210, and the identifier of the physical machine 210 may be the address of the physical machine 210, such as an IP address, a MAC address, or the physical machine 210 , any information that can identify the physical machine 210 can be used as the identification of the physical machine 210 .
  • the container controller 400 After receiving the container scheduling response, the container controller 400 determines the physical machine 210 for deploying the container, the number of containers to be deployed on the physical machine 210, and the physical machine 210 for deploying the container carried in the container scheduling response. Specifications of the container.
  • the container controller 400 may send a container creation instruction to the container management module 213 on the physical machine 210, where the container creation instruction includes the number of containers to be deployed and the specifications of the containers.
  • This embodiment of the present application does not limit the number of containers to be deployed on the physical machine 210, which may be one or multiple, and the specifications of the containers deployed on the physical machine 210 may be the same or different.
  • the container management module 213 can create a container on the physical machine 210 according to the container creation instruction.
  • the number of containers created by the container management module 213 is the same as the number of containers to be deployed included in the container creation instruction. If the number is the same, the specification of the container created by the container management module 213 is the same as the specification of the container included in the container creation instruction.
  • the container management module 213 may send a container resource allocation request to the proxy module 212 of the physical machine 210, where the container resource allocation resource request includes the physical machine 210.
  • the container resource allocation request is used to request resource allocation for the container to be deployed.
  • the proxy module 212 can allocate resources to the container to be deployed according to the number of containers to be deployed and the specifications of the container based on the free resources on the physical machine 210 . After that, a container resource allocation response carrying resources allocated for the container to be deployed is fed back to the container management module 213 .
  • the container management module 213 creates containers using the resources allocated for the containers to be deployed.
  • the proxy module 212 may first determine whether a virtual machine is deployed on the physical machine 210, or whether there is a virtual machine to be deployed on the physical machine 210 (for example, a container resource allocation request is received), If no virtual machine is currently deployed on the physical machine 210, and there is no virtual machine to be deployed, that is, the instance type deployed on the physical machine 210 is only a container, and there is no conflict in resource occupation between the virtual machine and the container, and the proxy module 212 may directly send an indication message to the container management module 213, where the indication message is used to instruct the container management module 213 to allocate resources for the container by itself. After receiving the indication message, the container management module 213 can directly use the idle resources on the physical machine 210 to create a container.
  • the container may occupy the resources occupied by the virtual machine, and the agent module 212 may allocate resources to the container to be deployed according to the number of containers to be deployed and the specifications of the container based on the free resources on the physical machine 210 .
  • the container management module 213 may send a container creation success response to the container controller 400, and the container creation success response may also include the number of containers created by the container management module 213 and the resources occupied by the container.
  • the container controller 400 After receiving the container creation success response, the container controller 400 determines that the container creation is successful, and can feed back the container creation success response to the scheduler 100, and the scheduler 100 can update the resource pool 200 after receiving the container creation success response.
  • the idle resource distribution information of the physical machine 210 is marked as occupied by the container on the physical machine 210, and the number of containers deployed on the physical machine 210 and the specifications of each container can also be updated.
  • Manner 2 The scheduler 100 determines the physical machine 210 for deploying the container according to the candidate physical machine for deploying the container.
  • the container controller 400 may store resource distribution information, which is similar to the idle resource distribution information of the resource pool 200, and may indicate idle resources on multiple physical machines 210, and may also indicate occupied resources on multiple physical machines 210. Resources. The difference is that the idle resource distribution information of the resource pool 200 is stored by the scheduler 100 , and the resource distribution information is stored by the container controller 400 . In practical applications, the idle resource distribution information of the resource pool 200 may be consistent with the resource distribution information, or may be inconsistent (for example, the container controller 400 does not update the resource distribution information in time).
  • the container controller 400 may determine a candidate physical machine for deploying the container according to the stored resource distribution information, the total number of containers to be deployed, and the specifications of the container.
  • the container controller 400 may determine one or more candidate physical machines. For example, for any candidate physical machine, the container controller 400 may determine the number of containers to be deployed on the candidate physical machine and container specifications.
  • the container controller 400 may carry the candidate physical machine, the number of containers to be deployed on the candidate physical machine, and the specification of the container in the container scheduling request, and send the container scheduling request to the scheduler 100 .
  • the candidate physical machines determined by the container controller 400 may include one or more candidate physical machines on which the container can be deployed.
  • the container scheduling request includes a candidate physical machine, which means that it includes information that can indicate a candidate physical machine for deploying a container, such as the identifier of the candidate physical machine.
  • a candidate physical machine which means that it includes information that can indicate a candidate physical machine for deploying a container, such as the identifier of the candidate physical machine.
  • the identifier of the candidate physical machine please refer to the foregoing content
  • the description of the identifier of the physical machine 210 is not repeated here.
  • the scheduler 100 After the scheduler 100 receives the container scheduling request, it can obtain the idle resource distribution information of the resource pool 200 saved by the scheduler 100, and the scheduler 100 determines the idle resource distribution of the candidate physical machines from the idle resource distribution information of the resource pool 200. .
  • the scheduler 100 After the scheduler 100 determines the distribution of idle resources of the candidate physical machine, it can determine the physical machine 210 for deploying the container according to the number of containers to be deployed on the candidate physical machine and the specification of the container based on the distribution of idle resources of the candidate physical machine. , the number of containers to be deployed on the physical machine 210 and the container specifications.
  • the scheduler 100 may determine, according to the number of containers to be deployed on the candidate physical machine and the specifications of the containers, whether the candidate physical machine can deploy containers that meet the number of containers to be deployed on the candidate physical machine and the container specifications.
  • the scheduler 100 determines candidate physical machines that can deploy containers that meet the number of containers to be deployed on the candidate physical machine and the container specifications, and then further screen these candidate physical machines. From the perspective of containers, for any container to be deployed , the scheduler 100 may select the physical machine 210 as the physical machine 210 for deploying the container from one or more candidate physical machines included in the candidate physical machines that can deploy the container.
  • the scheduler 100 determines the physical machine 210 for deploying containers, if the number of containers that can be deployed on some candidate physical machines is lower than the number of containers to be deployed on the candidate physical machine, or the number of containers that can be deployed on some candidate physical machines is The container specifications that can be deployed are inconsistent with the container specifications to be deployed on the candidate physical machine.
  • the scheduler 100 can directly feed back a scheduling failure response to the container controller 400.
  • the scheduler 100 can also determine the physical machine 210 for deploying some containers. The container is deployed on the physical machine 210 of some of the containers.
  • the scheduler 100 can feed back the physical machine 210 information (such as the number of containers that can be deployed and the container specifications) for deploying some of the containers to the container controller 400, After receiving the physical machine 210 information for deploying some of the containers, the container controller 400 can determine whether to deploy some of the containers according to a preset policy. If it is determined to deploy the container, it can deploy some of the containers on the physical machine 210. container, you can notify the user that the container scheduling failed.
  • the container controller 400 can determine whether to deploy some of the containers according to a preset policy. If it is determined to deploy the container, it can deploy some of the containers on the physical machine 210. container, you can notify the user that the container scheduling failed.
  • the scheduler 100 can instruct the container controller 400 to deploy the container on the physical machine 210, and the container controls
  • the server 400 deploys the container on the physical machine 210 under the instruction of the scheduler 100, and the deployed container conforms to the determined number of containers to be deployed on the physical machine 210 and the container specifications, that is, the number of deployed containers is the same as the determined physical machine 210.
  • the number of containers to be deployed is the same, and the specifications of the containers to be deployed are the same as the specifications of the containers to be deployed on the determined physical machine 210 .
  • the scheduler 100 may carry the information of the physical machine 210 used to deploy the container in the container scheduling response, and send it to the container controller 400.
  • the physical machine 210 information for deploying containers includes the number of containers to be deployed on the physical machine 210 and container specifications.
  • the physical machine 210 information may further include an identifier of the physical machine 210, and the description of the identifier of the physical machine 210 can refer to the foregoing content, which will not be repeated here.
  • the container controller 400 After receiving the container scheduling response, the container controller 400 determines the physical machine 210 of the container to be deployed, the number of containers to be deployed on the physical machine 210, and the container specification according to the physical machine 210 information for deploying the container carried in the container scheduling response .
  • the container controller 400 may send a container creation instruction to the container management module 213 on the physical machine 210 , where the container creation instruction includes the number of containers to be deployed on the physical machine 210 and container specifications.
  • This embodiment of the present application does not limit the number of containers to be deployed on the physical machine 210, which may be one or multiple, and the specifications of the containers deployed on the physical machine 210 may be the same or different.
  • the container management module 213 may refer to the relevant description in the first way for the method of creating the container on the physical machine 210, and for details, please refer to the foregoing description, which will not be repeated here.
  • the container management module 213 After the container management module 213 creates a container on the physical machine 210, it can send a container creation success response to the container controller 400, and the container creation success response can also include the resources occupied by the container created by the container management module 213.
  • the container controller 400 After receiving the container creation success response, the container controller 400 determines that the container creation is successful, and can update the container information deployed on the physical machine 210, for example, update the number of containers deployed on the physical machine 210 and the specifications of each container .
  • the distribution of idle resources on the physical machine 210 can be updated, if the occupied resources are marked as non-idle.
  • the container management module 213 may send a container creation success response to the container controller 400, and the container creation success response may also include the number of containers created by the container management module 213 and the resources occupied by the container.
  • the container controller 400 After receiving the container creation success response, the container controller 400 determines that the container is successfully created, and can update the resource distribution information, mark the resources occupied by the container on the physical machine 210 as occupied, and can also update the deployment on the physical machine 210. the number of containers and the specifications of each container. The container controller 400 may also feed back the container creation success response to the scheduler 100. After receiving the container creation success response, the scheduler 100 may update the idle resource distribution information of the resource pool 200, and the container on the physical machine 210 has already been created. The occupied resources are marked as occupied, and the number of containers deployed on the physical machine 210 and the specifications of each container can also be updated.
  • the scheduler 100 can share the idle resource distribution information of the resource pool 200 with the container controller 400 , and the container controller 400 can automatically based on the idle resource distribution information of the resource pool 200 , according to the total number of containers to be deployed and the number of containers.
  • the specification selects a physical machine 210 for deploying the container on which to deploy the container.
  • the container controller 400 determines that the container needs to be deployed, it can obtain the idle resource distribution information of the resource pool 200 from the scheduler 100.
  • the idle resource distribution information of the resource pool 200 please refer to the foregoing content, here No longer.
  • the container controller 400 selects a physical machine 210 for deploying the container from one or more physical machines 210 based on the idle resource distribution information of the resource pool 200 and according to the total number of containers to be deployed and the container specifications.
  • the container controller 400 may also Determine the number of containers to be deployed on the selected physical machine 210 and the container specifications. If the number of selected physical machines 210 is multiple, the container controller 400 may determine the number of containers to be deployed on each physical machine 210 and the container specifications.
  • the container controller 400 selects the physical machine 210 for deploying the container, the container can be deployed on the physical machine 210 .
  • the embodiments of the present application do not limit the manner in which the container controller 400 deploys containers on the physical machine 210.
  • the following describes a manner in which the container controller 400 deploys containers on the physical machine 210 provided by the embodiments of the present application:
  • the container controller 400 determines the physical machine 210 for deploying containers, the number of containers to be deployed on the physical machine 210, and the specifications of the containers, for any physical machine 210 for deploying containers, the container controller 400 A container creation instruction may be sent to the container management module 213 on the physical machine 210, where the container creation instruction includes the number of containers to be deployed and the specifications of the containers.
  • This embodiment of the present application does not limit the number of containers to be deployed on the physical machine 210, which may be one or multiple, and the specifications of the containers deployed on the physical machine 210 may be the same or different.
  • the container management module 213 After the container management module 213 receives the container creation instruction, reference may be made to the relevant description of the first mode for the method of creating the container, which will not be repeated here.
  • the container management module 213 After the container management module 213 creates a container on the physical machine 210, it can send a container creation success response to the container controller 400, and the container creation success response can also include the resources occupied by the container created by the container management module 213.
  • the container controller 400 determines that the container creation is successful, and can also feed back the container creation success response to the scheduler 100.
  • the scheduler 100 can update the resource pool.
  • the idle resource distribution information of 200 is used to mark resources occupied by containers on the physical machine 210 as occupied, and the number of containers deployed on the physical machine 210 and the specifications of each container can also be updated.
  • an embodiment of the present application further provides a scheduler, which is used to execute the method performed by the scheduler in the method embodiment shown in FIG. 2.
  • a scheduler which is used to execute the method performed by the scheduler in the method embodiment shown in FIG. 2.
  • the scheduler 300 includes a transmission unit 301 and a processing unit 302;
  • a transmission unit 301 configured to receive a resource request
  • the processing unit 302 is configured to select a physical machine for deploying a virtual machine from a resource pool to deploy a virtual machine in the case of confirming that the resource request requires virtual machine resources, and select a virtual machine from the resource pool in the case of confirming that the resource request requires container resources. Deploy the container on the physical machine where the container is deployed.
  • the physical machine used for deploying the virtual machine and the physical machine used for deploying the container are the same physical machine.
  • the physical machine used for deploying the virtual machine and the physical machine used for deploying the container are different physical machines.
  • the transmission unit 301 may receive the resource request from the virtual machine controller, and may also receive the resource request from the container controller.
  • the resource request includes the total number of virtual machines to be deployed and the specifications of the virtual machines; when the processing unit 302 selects a physical machine for deploying the virtual machine from the resource pool to deploy the virtual machine, the Idle resource distribution information, according to the total number of virtual machines to be deployed and the specifications of the virtual machines to determine the physical machines for deploying virtual machines, the number of virtual machines to be deployed on the physical machines, and the specifications of the virtual machines, wherein the idle resource distribution information indicates a plurality of physical machines.
  • the distribution of idle resources on the machine after that, instruct the virtual machine controller to deploy the virtual machine on the physical machine.
  • the virtual machines deployed on the physical machine conform to the number of virtual machines to be deployed on the physical machine and the virtual machine specifications.
  • the resource request includes the total number of containers to be deployed and the specifications of the containers; when the processing unit 302 selects the physical machine for deploying the container from the resource pool to deploy the container, it may distribute the free resources based on the resource pool information, according to the total number of containers to be deployed and the specifications of the containers to determine the physical machines for deploying containers, the number of containers to be deployed on the physical machines, and the specifications of the containers, and the idle resource distribution information indicates the distribution of idle resources on multiple physical machines; , instructs the container controller to deploy the container on the physical machine, where the container deployed on the physical machine conforms to the number of containers to be deployed on the physical machine and the specifications of the container.
  • the resource request includes a candidate physical machine for deploying the container, the number of containers to be deployed on the candidate physical machine, and the container specification; the processing unit 302 selects a physical machine for deploying the container from the resource pool.
  • the idle resource distribution of the candidate physical machines can be determined based on the idle resource distribution information of the resource pool, wherein the idle resource distribution information indicates the distribution of idle resources on multiple physical machines; then, based on the idle resource distribution of the candidate physical machines Determine the physical machine for deploying the container, the number of containers to be deployed on the physical machine, and the specification of the container according to the number of containers deployed on the candidate physical machine and the specifications of the container; instruct the container controller to deploy the container on the physical machine.
  • Containers conform to the number of containers to be deployed on the physical machine and the container specifications.
  • the processing unit 302 when the processing unit 302 selects the physical machine for deploying the container from the resource pool to deploy the container, it may send the idle resource distribution information of the resource pool to the container controller, wherein the idle resource distribution information indicates the number of The distribution of idle resources on a physical machine.
  • each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media.
  • the semiconductor medium may be a solid state drive (SSD).
  • scheduler in the embodiment shown in FIG. 2 may take the form shown in FIG. 4 .
  • the apparatus 400 shown in FIG. 4 includes at least one processor 401 , a memory 402 , and optionally, a communication interface 403 .
  • the memory 402 can be volatile memory, such as random access memory; the memory can also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD) or solid-state drive (solid-state drive, SSD), or memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, without limitation. Memory 402 may be a combination of the above-described memories.
  • the memory 402 may be volatile memory, such as random access memory; the memory may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD) or solid-state drive (SSD) , or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • Memory 402 may be a combination of the above-described memories.
  • connection medium between the above-mentioned processor 401 and the memory 402 is not limited in this embodiment of the present application.
  • the processor 401 may be a CPU, and the processor 401 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (field programmable gate arrays). programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, artificial intelligence chips, chips on a chip, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGA field programmable gate array
  • a general purpose processor may be a microprocessor or any conventional processor or the like. It has the function of data sending and receiving, and can communicate with other devices.
  • an independent data sending and receiving module can also be set, such as the communication interface 403, which is used to send and receive data; when the processor 401 communicates with other devices, it can Data transmission is performed through the communication interface 403, such as receiving a resource request from the slave.
  • the processor 401 in FIG. 4 can execute instructions by calling the computer stored in the memory 402 , so that the detection apparatus can execute any of the above method embodiments. The method executed by the scheduler.
  • the functions/implementation processes of the transmission unit 301 and the processing unit 302 in FIG. 3 can be implemented by the processor 401 in FIG. 4 calling the computer execution instructions stored in the memory 402 .
  • the function/implementation process of the processing unit 302 in FIG. 3 can be implemented by the processor 401 in FIG. 4 calling the computer-executed instructions stored in the memory 402, and the function/implementation process of the transmission unit 301 in FIG.
  • the communication interface 403 in the implementation.
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining 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 capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

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)
  • General Factory Administration (AREA)

Abstract

一种虚拟机和容器混合调度系统、方法、调度器及装置,用以提供一种虚拟机和容器共部署的调度方式。本申请中,该调度系统包括调度器和资源池,资源池包括一个或多个物理机;调度器可以接收资源请求;在接收到该资源请求后,若调度器确认资源请求要求虚拟机资源,调度器从资源池选择用于部署虚拟机的物理机部署虚拟机,若调度器确认资源请求要求容器资源,调度器从资源池选择用于部署容器的物理机部署容器。由此,调度器统一对虚拟机和容器进行调度,虚拟机和容器可以部署在同一资源池内,为虚拟机和容器共部署提供了可能性,提高了虚拟机和容器调度效率。

Description

一种虚拟机和容器混合调度系统、方法、调度器及装置 技术领域
本申请涉及通信技术领域,尤其涉及一种虚拟机和容器混合调度系统、方法、调度器及装置。
背景技术
目前,虚拟机调度架构以及容器调度架构是两个独立的架构,分别管理不同的物理机;虚拟机调度架构能够在所管理的物理机进行虚拟机调度,而容器调度架构能够实现在所管理的物理机上进行容器调度。
基于现有的虚拟机调度架构以及容器调度架构,虚拟机和容器只能部署在不同的物理机上,这无疑增加了物理机的部署成本,虚拟机调度架构以及容器调度架构相互独立的调度方式效率较低。
综上,亟需一种能够实现虚拟机和容器共部署的调度方式。
发明内容
本申请提供一种虚拟机和容器混合调度系统、方法、调度器及装置,用以提供一种虚拟机和容器共部署的调度方式。
第一方面,本申请实施例提供了一种虚拟机和容器混合调度系统,该调度系统包括调度器和资源池,资源池包括一个或多个物理机;调度器可以接收资源请求;在接收到该资源请求后,若调度器确认资源请求要求虚拟机资源,调度器从资源池选择用于部署虚拟机的物理机部署虚拟机,若调度器确认资源请求要求容器资源,调度器从资源池选择用于部署容器的物理机部署容器。
通过上述调度系统,调度器统一对虚拟机和容器进行调度,虚拟机和容器可以部署在同一资源池内,为虚拟机和容器共部署提供了可能性,提高了虚拟机和容器调度效率。
在一种可能的设计中,用于部署虚拟机的物理机与用于部署容器的物理机为同一物理机。也就是说,物理机允许同时部署虚拟机和容器。
通过上述调度系统,能够保证物理机上的资源可以被充分利用,提高物理机的资源利用率。
在一种可能的设计中,用于部署虚拟机的物理机与用于部署容器的物理机为不同物理机。
通过上述调度系统,资源池中允许存在只部署虚拟机的物理机或只部署容器的物 理机,适用于不同场景。
在一种可能的设计中,调度器可以从虚拟机控制器或容器控制器接收资源请求。
通过上述调度系统,调度器可以通过虚拟机控制器或容器控制器及时接收到资源请求,便于后续确定用于部署虚拟机或容器的物理机。
在一种可能的设计中,系统还包括虚拟机控制器,资源请求包括待部署的虚拟机总数量以及虚拟机规格;调度器从资源池选择用于部署虚拟机的物理机部署虚拟机时,可以基于资源池的空闲资源分布信息,根据待部署的虚拟机总数量以及虚拟机规格确定用于部署虚拟机的物理机、物理机上待部署的虚拟机数量以及虚拟机规格,其中,空闲资源分布信息可以指示该资源池中空闲资源的分布情况,也即多个物理机上空闲资源的分布情况;在确定了用于部署虚拟机的物理机、物理机上待部署的虚拟机数量以及虚拟机规格之后,调度器可以指示虚拟机控制器在物理机上部署虚拟机,其中,物理机上部署的虚拟机符合确定的物理机上待部署的虚拟机数量以及虚拟机规格;之后,虚拟机控制器可以根据调度器的指示在物理机上部署虚拟机。
通过上述调度系统,调度器根据待部署的虚拟机数量以及虚拟机规格,确定用于部署虚拟机的物理机,并指示虚拟机控制器在物理机上部署虚拟机,实现虚拟机的调度。
在一种可能的设计中,系统还包括容器控制器,资源请求包括待部署的容器总数量以及容器的规格;调度器从资源池选择用于部署容器的物理机部署容器时,可以基于资源池的空闲资源分布信息,根据待部署的容器总数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格,空闲资源分布信息指示多个物理机上空闲资源的分布情况;在确定了用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格之后,调度器可以指示容器控制器在物理机上部署容器,其中,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格;之后,容器控制器可以根据调度器的指示在物理机上部署容器。
通过上述调度系统,调度器根据待部署的容器数量以及容器规格,确定用于部署容器的物理机,并指示容器控制器在物理机上部署容器,实现容器的调度。
在一种可能的设计中,系统还包括容器控制器,资源请求包括用于部署的容器的候选物理机、候选物理机上待部署的容器数量以及容器的规格,其中,该候选物理机为该资源池中的物理机;调度器从资源池选择用于部署容器的物理机部署容器时,基于资源池的空闲资源分布信息,确定候选物理机的空闲资源分布情况,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况;之后,再基于候选物理机的空闲资源分布情况,根据候选物理机部署的容器数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格;指示容器控制器在物理机上部署容器,其中,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格;之后,容器控制器根据调度器的指示在物理机上部署容器。
通过上述调度系统,调度器根据用于部署的容器的候选物理机、候选物理机上待部署的容器数量以及容器的规格,确定用于部署容器的物理机,并指示容器控制器在物理机上部署容器,提供了另一种容器调度方式。
在一种可能的设计中,系统还包括容器控制器,调度器从资源池选择用于部署容 器的物理机部署容器时,可以向容器控制器发送资源池的空闲资源分布信息,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况;容器控制器从调度器接收资源池的空闲资源分布信息后,基于资源池的空闲资源分布信息,根据待部署的容器总数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格;在物理机上部署容器,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格。
通过上述调度系统,调度器可以将资源池的空闲资源分布信息发送给容器控制器,之后容器控制器确定用于部署容器的物理机,并指示容器控制器在物理机上部署容器,提供了另一种容器调度方式,这种方式中可以有效减少容器控制器与调度器之间的信令交互,也可以提高容器调度的效率。
在一种可能的设计中,用于部署虚拟机的物理机与用于部署容器的物理机为同一物理机的情况下,该物理机包括虚拟机管理模块、容器管理模块以及代理模块。虚拟机和容器部署在同一物理机上,虚拟机和容器上容易存在资源冲突,为了解决资源冲突。
虚拟机管理模块可以向代理模块发送虚拟机资源分配请求,用于请求为物理机中待部署的虚拟机分配资源。容器管理模块可以向代理模块发送容器资源分配请求,用于请求为物理机待部署的容器分配资源;代理模块基于物理机的空闲资源,为待部署的虚拟机和容器分配资源;以及向虚拟机管理模块反馈为待部署的虚拟机分配的资源;以及向容器管理模块反馈为待部署的容器分配的资源;之后,虚拟机管理模块可以利用为待部署的虚拟机分配的资源创建虚拟机;容器管理模块,还用于利用为待部署的容器分配的资源创建容器。
通过上述调度系统,在物理机上,代理模块可以为容器和虚拟机统一分配资源,解决虚拟机和容器共部署时产生的资源冲突。
第二方面,本发明实施例提供了一种虚拟机和容器混合调度方法,有益效果可以参见第一方面的描述此处不再赘述,方法应用于调度器,该方法中,调度器可以先接收资源请求;之后,若调度器确定资源请求要求虚拟机资源,调度器从资源池选择用于部署虚拟机的物理机部署虚拟机;若调度器确定资源请求要求容器资源,调度器从资源池选择用于部署容器的物理机部署容器。
在一种可能的设计中,用于部署虚拟机的物理机与用于部署容器的物理机为同一物理机。
在一种可能的设计中,用于部署虚拟机的物理机与用于部署容器的物理机为不同物理机。
在一种可能的设计中,调度器在接收资源请求时,可以从虚拟机控制器接收资源请求,也可以从容器控制器接收资源请求。
在一种可能的设计中,资源请求包括待部署的虚拟机总数量以及虚拟机规格;调度器在从资源池选择用于部署虚拟机的物理机部署虚拟机时,可以基于资源池的空闲资源分布信息,根据待部署的虚拟机总数量以及虚拟机规格确定用于部署虚拟机的物理机、物理机上待部署的虚拟机数量以及虚拟机规格,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况;指示虚拟机控制器在物理机上部署虚拟机。其中, 物理机上部署的虚拟机符合物理机上待部署的虚拟机数量以及虚拟机规格。
在一种可能的设计中,资源请求包括待部署的容器总数量以及容器的规格;调度器在从资源池选择用于部署容器的物理机部署容器时,可以基于资源池的空闲资源分布信息,根据待部署的容器总数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格,空闲资源分布信息指示多个物理机上空闲资源的分布情况;之后,指示容器控制器在物理机上部署容器,其中,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格。
在一种可能的设计中,资源请求包括用于部署的容器的候选物理机、候选物理机上待部署的容器数量以及容器的规格;调度器在从资源池选择用于部署容器的物理机部署容器时,可以基于资源池的空闲资源分布信息,确定候选物理机的空闲资源分布情况,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况;之后,基于候选物理机的空闲资源分布情况,根据候选物理机部署的容器数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格;再指示容器控制器在物理机上部署容器,其中,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格。
在一种可能的设计中,调度器在从资源池选择用于部署容器的物理机部署容器时,可以向容器控制器发送资源池的空闲资源分布信息,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况,以便容器控制器可以基于资源池的空闲资源分布信息确定用于部署容器的物理机,部署容器。
第三方面,本申请实施例还提供了一种调度器,该装置具有实现上述第二方面的方法实例中行为的功能,有益效果可以参见第二方面的描述此处不再赘述。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。在一个可能的设计中,所述装置的结构中包括传输单元以及处理单元,这些单元可以执行上述第二方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。
第四方面,本申请实施例还提供了一种装置,该装置具有实现上述第二方面的方法实例中行为的功能,有益效果可以参见第二方面的描述此处不再赘述。所述通信装置的结构中包括处理器和存储器,所述处理器被配置为支持所述基站执行上述第二方面方法中相应的功能。所述存储器与所述处理器耦合,其保存所述通信装置必要的程序指令和数据。所述通信装置的结构中还包括通信接口,用于与其他设备进行通信。
第五方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
第六方面,本申请还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面所述的方法。
第七方面,本申请还提供一种计算机芯片,所述芯片与存储器相连,所述芯片用于读取并执行所述存储器中存储的软件程序,执行上述第二方面所述的方法。
附图说明
图1为本申请提供的一种系统的架构示意图;
图2为本申请提供的一种虚拟机和容器混合调度方法示意图;
图3为本申请提供的一种调度器的结构示意图;
图4为本申请提供的一种装置的结构示意图。
具体实施方式
如图1所示,为本申请实施例适用的一种系统的架构示意图,该系统中包括调度器100以及资源池200,该资源池200包括一个或多个物理机210,该一个或多个物理机210上允许同时部署虚拟机和容器。可选的,该系统中还可以包括虚拟机控制器300、容器控制器400。
调度器100用于对资源池200中的一个或多个物理机210上部署的实例进行统一调度,实例的类型包括但不限于:容器、虚拟机。
调度器100可以接收来自虚拟机控制器300或者容器控制器400的资源请求,在本申请实施例中,为方便说明,将来自虚拟机控制器300的资源请求称为虚拟机资源请求,将来自容器控制器400的资源请求称为容器资源请求,其中,虚拟机资源请求用于要求虚拟机资源,容器资源请求用于要求容器资源。
调度器100在接收到虚拟机控制器300发送的虚拟机资源请求后,调度器100可以从资源池200中选择能够用于部署虚拟机的物理机210部署虚拟机。调度器100在选择的用于部署虚拟机的物理机210上部署虚拟机时,调度器100可以向虚拟机控制器300发送虚拟机资源响应,该虚拟机资源响应指示用于部署虚拟机的物理机210。以便虚拟机控制器300可以根据该虚拟机资源响应在物理机210上部署物理机210。
调度器100在接收到容器控制器400发送的容器资源请求后,调度器100可以从资源池200中选择能够用于部署容器的物理机210部署容器。调度器100在选择的用于部署容器的物理机210上部署容器时,调度器100可以向容器控制器400发送容器资源响应,该容器资源响应指示用于部署容器的物理机210。以便容器控制器400可以根据该容器资源响应在物理机210上部署物理机210。
在本申请实施例中,虚拟机控制器300,用于对资源池200中的一个或多个物理机210上部署的虚拟机进行调度。例如,虚拟机控制器300可以向调度器100发送虚拟机资源请求,要求虚拟机资源,还可以从调度器100接收到虚拟机资源响应,根据虚拟机资源响应在物理机210上部署虚拟机。
本申请实施例并不限定虚拟机控制器300发送虚拟机资源请求的场景,例如,该虚拟机资源请求可以是用户触发的,用户可以在虚拟机控制器300提供的虚拟机创建界面选择待部署的虚拟机总数量以及虚拟机规格,触发虚拟机控制器300向调度器100发送虚拟机资源请求。又例如,虚拟机控制器300可以接收来自其他设备(如客户端)的虚拟机创建请求,用于请求创建虚拟机,虚拟机创建请求中可以包括待部署的虚拟机总数量以及虚拟机规格,之后,虚拟机控制器300在确定需要创建虚拟机时,可以向调度器100发送虚拟机资源请求。
容器控制器400,用于对资源池200中的一个或多个物理机210上部署的容器进行调度。例如,容器控制器400可以向调度器100发送容器资源请求,要求容器资源,还可以从调度器100接收到容器资源响应,根据容器资源响应在物理机210上部署容 器。
同样的,本申请实施例并不限定容器控制器400发送容器资源请求的场景,例如,该容器资源请求可以是用户触发的,用户可以在容器控制器400提供的容器创建界面选择待部署的容器总数量以及容器规格,触发容器控制器400向调度器100发送容器资源请求。又例如,容器控制器400可以接收来自其他设备(如客户端)的容器创建请求,用于请求创建容器,容器创建请求中可以包括待部署的容器总数量以及容器规格,之后,容器控制器400在确定需要创建容器时,可以向调度器100发送容器资源请求。
具体到资源池200中的每个物理机210内部,每个物理机210上可以部署有虚拟机管理模块211、容器管理模块213以及代理模块212。
虚拟机管理模块211可以对所在物理机210上部署的虚拟机进行管理,虚拟机管理模块211所执行的管理包括但不限于:创建虚拟机、删除虚拟机、停止虚拟机的运行状态、启动虚拟机。
当虚拟机控制器300需要在一个物理机210上部署虚拟机时,可以向该物理机210上部署的虚拟机管理模块211发送虚拟机创建指令,该虚拟机创建指令可以指示待部署的虚拟机数量以及虚拟机规格,待部署的虚拟机规格用于指示待创建虚拟机的所占用的资源,该资源包括但不限于:虚拟处理器、内存、磁盘、网络带宽、网络吞吐量、或网络比特率等。其中,虚拟处理器是中央处理器的一种虚拟机化技术。
虚拟机管理模块211在接收到该虚拟机创建指令后,可以根据该虚拟机创建指令在所在物理机210创建虚拟机。
容器管理模块213用于对所在物理机210上部署的容器进行管理,容器管理模块213所执行的管理包括但不限于:创建容器、删除容器、停止容器的运行状态、启动容器。
当容器控制器400需要在一个物理机210上部署容器时,可以向该物理机210上部署的容器管理模块213发送容器创建指令,该容器创建指令可以指示待部署的容器的数量以及容器的规格,待部署的容器的规格用于指示待部署的容器的所占用的资源,该资源包括但不限于:虚拟处理器、内存、磁盘、网络吞吐量、或网络比特率等。
容器管理模块213在接收到该容器创建指令后,可以根据该容器创建指令在所在物理机210创建容器。
代理模块212,用于可以为所在物理机210上待部署的虚拟机或容器分配资源,当虚拟机和容器部署在一个物理机210上,该代理模块212可以分别为该物理机210上待部署的虚拟机和容器分配资源,向虚拟机管理模块211反馈为待部署的虚拟机分配的资源,向容器管理模块213反馈为待部署的容器分配的资源。
虚拟机管理模块211在接收到代理模块212反馈的为待部署的虚拟机分配的资源后,可以利用为待部署的虚拟机分配的资源创建虚拟机。
容器管理模块213在接收到代理模块212反馈的为待部署的容器分配的资源后,可以利用为待部署的容器分配的资源创建容器。
下面结合附图2,对本申请实施例提供的一种实例调度方法进行说明,在如图2 所示的方法中,步骤201~步骤203为调度器100对虚拟机的调度方法,步骤204~步骤206为调度器100对容器的调度方法,本申请实施例,并不限定调度器100可以对虚拟机和容器进行调度的先后顺序,调度器100可以对虚拟机和容器调度的先后顺序与实际应用调度器100接收虚拟机资源请求和容器资源请求的先后顺序有关,在本申请实施例中,仅是以调度器100可以先对虚拟机进行调度(步骤201~步骤203),之后再对容器进行调度(步骤204~步骤206)为例进行说明。该方法包括:
步骤201:虚拟机控制器300向调度器100发送虚拟机资源请求,该虚拟机资源请求要求虚拟机资源。
步骤202:调度器100接收到虚拟机资源请求后,确定虚拟机资源请求要求虚拟机资源。
步骤203:调度器100从所述资源池200选择用于部署虚拟机的物理机210部署虚拟机。
步骤204:容器控制器400向调度器100发送容器资源请求,该容器资源请求要求容器资源。
步骤205:调度器100接收到容器资源请求后,确定容器资源请求要求容器资源。
步骤206:调度器100从所述资源池200选择用于部署容器的物理机210部署容器。
下面先对调度器100调度虚拟机的方法进行说明:
虚拟机调度请求中可以包括待部署的虚拟机总数量以及虚拟机规格。若待部署的虚拟机的总数量为多个,且虚拟机规格不同,虚拟机调度请求中可以包括各个虚拟机规格。
调度器100在接收到该虚拟机调度请求后,可以获取该调度器100保存的资源池200的空闲资源分布信息,该资源池200的空闲资源分布信息可以指示资源池200中的一个或多个物理机210上的空闲资源的分布情况,还可以指示该一个或多个物理机210上已占用的资源。可选的,资源池200的空闲资源分布信息还可以指示该一个或多个物理机210上部署的虚拟机和容器数量、每个虚拟机规格以及每个容器的规格。
调度器100基于该资源池200的空闲资源分布信息,根据待部署的虚拟机总数量以及虚拟机规格从一个或多个物理机210中选择用于部署虚拟机的物理机210,调度器100还可以确定选择的物理机210上待部署的虚拟机数量以及虚拟机规格。如果选择的物理机210的数量为多个,调度器100可以确定每个物理机210上待部署的虚拟机数量以及虚拟机规格。
调度器100在选择了用于部署虚拟机的物理机210后,可以在该物理机210上部署虚拟机。
需要说明的是,若调度器100在确定用于部署虚拟机的物理机210时,若当前存在空闲资源的物理机210所能部署的虚拟机数量低于待部署的虚拟机总数量,或当前存在空闲资源的物理机210所能部署的虚拟机规格与待部署的虚拟机规格不一致,调度器100可以直接向虚拟机控制器300反馈调度失败响应,调度器100也可以确定用于部署部分虚拟机的物理机210,在选择的部分虚拟机的物理机210上部署虚拟机,在这种情况下,调度器100可以将用于部署部分虚拟机的物理机210信息(如能够部 署的虚拟机数量以及虚拟机规格)反馈给虚拟机控制器300,虚拟机控制器300接收到用于部署部分虚拟机的物理机210信息后,可以根据预设的策略(如虚拟机全部部署的策略或虚拟机允许部分部署的策略等)确定是否部署部分虚拟机,若确定部署虚拟机则可以在物理机210上部署部分虚拟机,若确定不部署部分虚拟机,则可以通知用户虚拟机调度失败。
本申请实施例并不限定调度器100在该物理机210上部署虚拟机的方式,下面对本申请实施例提供的一种调度器100在物理机210上部署虚拟机的方式进行说明:
调度器100选择了用于部署虚拟机的物理机210,确定了物理机210上待部署的虚拟机数量以及虚拟机规格后,调度器100可以指示虚拟机控制器300在该物理机210上部署虚拟机,虚拟机控制器300在调度器100的指示下在该物理机210上部署虚拟机,部署的虚拟机符合确定的物理机210上待部署的虚拟机数量以及虚拟机规格,也即,部署的虚拟机数量与确定的物理机210上待部署的虚拟机数量一致,部署的虚拟机规格与确定的物理机210上待部署的虚拟机规格一致。
示例性的,调度器100可以将用于部署虚拟机的物理机210信息携带在虚拟机调度响应中,反馈给虚拟机控制器300。该用于部署虚拟机的物理机210信息包括该物理机210上待部署的虚拟机数量以及虚拟机规格。为了指示该物理机210,物理机210信息中还可以包括该物理机210的标识,该物理机210的标识可以为该物理机210的地址,如网际互连协议(internet protocol,IP)地址、媒体存取控制位址(media access control address,MAC),也可以为物理机210的编号,凡是能够标识该物理机210的信息均可以作为物理机210的标识。
虚拟机控制器300在接收到虚拟机调度响应后,根据该虚拟机调度响应中携带的用于部署虚拟机的物理机210信息确定用于部署虚拟机物理机210、该物理机210上待部署的虚拟机数量以及虚拟机规格。虚拟机控制器300可以在该物理机210上部署虚拟机,该物理机210上部署的虚拟机符合虚拟机调度响应中指示的该物理机210上待部署的虚拟机数量以及虚拟机规格。
针对任一用于部署虚拟机的物理机210,虚拟机控制器300可以向该物理机210上的虚拟机管理模块211发送虚拟机创建指令,该虚拟机创建指令中包括待部署的虚拟机数量以及虚拟机规格。本申请实施例并不限定该物理机210上待部署的虚拟机数量,可以为一个,也可以为多个,该物理机210上部署的虚拟机规格可以相同,也可以不同。
虚拟机管理模块211在接收到虚拟机创建指令后,可以根据该虚拟机创建指令在该物理机210上创建虚拟机,该物理机210上创建的虚拟机符合该物理机210上待部署的虚拟机数量和虚拟机规格。也即,虚拟机管理模块211所创建的虚拟机数量与该虚拟机创建指令中包括的待部署的虚拟机数量一致,虚拟机管理模块211所创建的虚拟机规格与该虚拟机创建指令中包括的虚拟机规格一致。
可选的,虚拟机管理模块211在根据该虚拟机创建指令在该物理机210上创建虚拟机之前,可以向该物理机210的代理模块212发送虚拟机资源分配请求,该虚拟机 资源分配资源请求中包括该物理机210上待部署的虚拟机数量以及虚拟机规格,虚拟机资源分配请求用于请求为该物理机210上待部署的虚拟机分配资源。
代理模块212在接收到该虚拟机资源分配请求后,可以基于该物理机210上空闲资源,根据待部署的虚拟机数量以及虚拟机规格,为待部署的虚拟机分配资源。之后,向虚拟机管理模块211反馈携带有为待部署的虚拟机分配的资源的虚拟机资源分配响应。虚拟机管理模块211利用为待部署的虚拟机分配的资源创建虚拟机。
代理模块212在接收到该虚拟机资源分配请求后,也可以先确定该物理机210上是否部署容器,或该物理机210上是否存在待部署的容器(如接收到容器资源分配请求),若当前物理机210上未部署容器,且不存在待部署的容器,也就是说,该物理机210部署的实例类型仅为虚拟机,虚拟机和容器在资源占用上不存在冲突,代理模块212可以直接向虚拟机管理模块211发送指示消息,该指示消息用于指示虚拟机管理模块211可自行为虚拟机分配资源。虚拟机管理模块211在接收到该指示消息后,可以直接利用该物理机210上的空闲资源创建虚拟机。
若当前物理机210上部署容器,或存在待部署的容器,也就是说,该物理机210部署的实例的类型有虚拟机和容器两种,虚拟机和容器在资源占用上可能存在冲突,也即虚拟机在创建过程中,可能会占用到容器需要占用的资源,代理模块212可以在基于该物理机210上的空闲资源,根据待部署的虚拟机数量以及虚拟机规格,为待部署的虚拟机分配资源。
虚拟机管理模块211在该物理机210上创建虚拟机后,可以向虚拟机控制器300发送虚拟机创建成功响应,虚拟机创建成功响应还可以包括虚拟机管理模块211创建的虚拟机数量以及虚拟机所占用的资源。
虚拟机控制器300在接收到该虚拟机创建成功响应后,确定虚拟机创建成功,还可以将该虚拟机创建成功响应反馈至调度器100,该调度器100在接收到虚拟机创建成功响应后,可以更新资源池200的空闲资源分布信息,将该物理机210上虚拟机已占用的资源标记为已占用,还可以标记该物理机210上部署的虚拟机数量以及每个虚拟机规格。
下面先对调度器100调度容器的方法进行说明:
在本申请实施例中调度器100在接收到容器资源请求后,可以采用三种方式调度容器,下面分别对这三种方式进行说明:
方式一、调度器100根据待部署的容器的总数量以及容器的规格确定用于部署容器的物理机210。
容器调度请求中可以包括待部署的容器总数量以及容器的规格。若待部署的容器的总数量为多个,且容器的规格不同,容器调度请求中可以包括各个容器的规格。
调度器100在接收到该容器调度请求后,可以获取该调度器100保存的资源池200的空闲资源分布信息,该资源池200的空闲资源分布信息的说明可以参见前述说明,此处不再赘述。
调度器100基于该资源池200的空闲资源分布信息,根据待部署的容器总数量以及容器的规格从一个或多个物理机210中选择用于部署容器的物理机210,调度器100还可以确定选择的物理机210上待部署的容器的数量以及容器的规格。如果选择的物理机210的数量为多个,调度器100可以确定每个物理机210上待部署的容器的数量以及容器的规格。
需要说明的是,若调度器100在确定用于部署容器的物理机210时,若当前存在空闲资源的物理机210所能部署的容器数量低于待部署的容器总数量,或当前存在空闲资源的物理机210所能部署的容器规格与待部署的容器规格不一致,调度器100可以直接向容器控制器400反馈调度失败响应,调度器100也可以确定用于部署部分容器的物理机210,在选择的部分容器的物理机210上部署容器,在这种情况下,调度器100可以将用于部署部分容器的物理机210信息(如能够部署的容器数量以及容器规格)反馈给容器控制器400,容器控制器400接收到用于部署部分容器的物理机210信息后,可以根据预设的策略确定是否部署部分容器,若确定部署容器则可以在物理机210上部署部分容器,若确定不部署部分容器,则可以通知用户容器调度失败。
调度器100在选择了用于部署容器的物理机210后,可以在该物理机210上部署容器。
本申请实施例并不限定调度器100在该物理机210上部署容器的方式,下面对本申请实施例提供的一种调度器100在物理机210上部署容器的方式进行说明:
调度器100选择了用于部署容器的物理机210,确定了物理机210上待部署的容器数量以及容器规格后,调度器100可以指示容器控制器400在该物理机210上部署容器,容器控制器400在调度器100的指示下在该物理机210上部署容器,部署的容器符合确定的物理机210上待部署的容器数量以及容器规格。也即,部署的容器数量与确定的物理机210上待部署的容器数量一致,部署的容器规格与确定的物理机210上待部署的容器规格一致。
示例性的,调度器100可以将用于部署容器的物理机210信息携带在容器调度响应中,反馈给容器控制器400。该用于部署容器的物理机210信息包括该物理机210上待部署的容器的数量以及容器的规格。为了指示该物理机210,物理机210信息中还可以包括该物理机210的标识,该物理机210的标识可以为该物理机210的地址,如IP地址、MAC地址,也可以为物理机210的编号,凡是能够标识该物理机210的信息均可以作为物理机210的标识。
容器控制器400在接收到容器调度响应后,根据该容器调度响应中携带的用于部署容器的物理机210信息确定用于部署容器物理机210、该物理机210上待部署的容器的数量以及容器的规格。
针对任一用于部署容器的物理机210,容器控制器400可以向该物理机210上的容器管理模块213发送容器创建指令,该容器创建指令中包括待部署的容器的数量以及容器的规格。本申请实施例并不限定该物理机210上待部署的容器的数量,可以为一个,也可以为多个,该物理机210上部署的容器的规格可以相同,也可以不同。
容器管理模块213在接收到容器创建指令后,可以根据该容器创建指令在该物理机210上创建容器,容器管理模块213所创建的容器的数量与该容器创建指令中包括 的待部署的容器的数量一致,容器管理模块213所创建的容器的规格与该容器创建指令中包括的容器的规格一致。
可选的,容器管理模块213在根据该容器创建指令在该物理机210上创建容器之前,可以向该物理机210的代理模块212发送容器资源分配请求,该容器资源分配资源请求中包括该物理机210上待部署的容器的数量以及容器的规格。容器资源分配请求用于请求为待部署的容器分配资源。
代理模块212在接收到该容器资源分配请求后,可以基于该物理机210上的空闲资源,根据待部署的容器的数量以及容器的规格,为待部署的容器分配资源。之后,向容器管理模块213反馈携带有为待部署的容器分配的资源的容器资源分配响应。容器管理模块213利用为待部署的容器分配的资源创建容器。
代理模块212在接收到该容器资源分配请求后,也可以先确定该物理机210上是否部署虚拟机,或该物理机210上是否存在待部署的虚拟机(如接收到容器资源分配请求),若当前物理机210上未部署虚拟机,且不存在待部署的虚拟机,也就是说,该物理机210部署的实例类型仅为容器,虚拟机和容器在资源占用上不存在冲突,代理模块212可以直接向容器管理模块213发送指示消息,该指示消息用于指示容器管理模块213可自行为容器分配资源。容器管理模块213在接收到该指示消息后,可以直接利用该物理机210上空闲的资源创建容器。
若当前物理机210上部署虚拟机,或存在待部署的虚拟机,也就是说,该物理机210部署的实例的类型有虚拟机和容器两种,虚拟机和容器在资源占用上可能存在冲突,容器可能会占用虚拟机占用的资源,代理模块212可以在基于该物理机210上的空闲资源,根据待部署的容器的数量以及容器的规格,为待部署的容器分配资源。
容器管理模块213在该物理机210上创建容器后,可以向容器控制器400发送容器创建成功响应,容器创建成功响应还可以包括容器管理模块213创建的容器数量以及容器所占用的资源。
容器控制器400在接收到该容器创建成功响应后,确定容器创建成功,可以将该容器创建成功响应反馈至调度器100,该调度器100在接收到容器创建成功响应后,可以更新资源池200的空闲资源分布信息,将该物理机210上容器已占用的资源标记为已占用,还可以更新该物理机210上部署的容器的数量以及每个容器的规格。
方式二、调度器100根据用于部署容器的候选物理机确定用于部署容器的物理机210。
容器控制器400可以存储有资源分布信息,该资源分布情况与该资源池200的空闲资源分布信息类似,可以指示多个物理机210上的空闲资源,还可以指示多个物理机210上已占用的资源。区别在于,资源池200的空闲资源分布信息是调度器100存储的,资源分布信息是容器控制器400存储的。在实际应用中,资源池200的空闲资源分布信息与资源分布信息可能一致,也可能不一致(例如,容器控制器400未及时更新资源分布信息)。
容器控制器400可以根据存储的资源分布信息以及待部署容器的总数量和容器的规格,确定用于部署容器的候选物理机。
容器控制器400可以确定一个或多个候选物理机,例如针对任一候选物理机,容器控制器400可以确定该候选物理机上待部署的容器数量和容器规格。
容器控制器400可以将候选物理机、候选物理机上待部署的容器数量以及容器的规格携带在容器调度请求中,向调度器100发送该容器调度请求。
从容器角度而言,对于任一待部署的容器,容器控制器400确定的候选物理机中可以包括一个或多个可以部署该容器的候选物理机。
这里需要说明的是,容器调度请求中包括候选物理机,是指包括可以指示用于部署容器的候选物理机的信息,例如该候选物理机的标识,候选物理机的标识的说明可以参见前述内容中物理机210的标识的说明,此处不再赘述。
调度器100在接收到该容器调度请求后,可以获取该调度器100保存的资源池200的空闲资源分布信息,调度器100从资源池200的空闲资源分布信息确定候选物理机的空闲资源分布情况。
调度器100在确定了候选物理机的空闲资源分布情况后,可以基于候选物理机的空闲资源分布情况,根据该候选物理机上待部署容器的数量以及容器的规格确定用于部署容器的物理机210,该物理机210上待部署的容器数量以及容器规格。
例如,调度器100可以根据该候选物理机上待部署容器的数量以及容器的规格确定候选物理机是否能够部署符合该候选物理机上待部署的容器数量以及容器规格的容器。调度器100确定出能够部署符合该候选物理机上待部署容器数量以及容器的规格的容器的候选物理机,之后对这些候选物理机进行进一步筛选,从容器角度而言,对于任一待部署的容器,调度器100可以从这些候选物理机中包括的一个或多个可以部署该容器的候选物理机选择物理机210作为用于部署该容器的物理机210。
需要说明的是,若调度器100在确定用于部署容器的物理机210时,若部分候选物理机所能部署的容器数量低于该候选物理机上待部署的容器数量,或部分候选物理机所能部署的容器规格与该候选物理机上待部署的容器规格不一致,调度器100可以直接向容器控制器400反馈调度失败响应,调度器100也可以确定用于部署部分容器的物理机210,在选择的部分容器的物理机210上部署容器,在这种情况下,调度器100可以将用于部署部分容器的物理机210信息(如能够部署的容器数量以及容器规格)反馈给容器控制器400,容器控制器400接收到用于部署部分容器的物理机210信息后,可以根据预设的策略确定是否部署部分容器,若确定部署容器则可以在物理机210上部署部分容器,若确定不部署部分容器,则可以通知用户容器调度失败。
调度器100确定了用于部署容器的物理机210,确定了物理机210上待部署的容器数量以及容器规格后,调度器100可以指示容器控制器400在该物理机210上部署容器,容器控制器400在调度器100的指示下在该物理机210上部署容器,部署的容器符合确定的物理机210上待部署的容器数量以及容器规格,也即,部署的容器数量与确定的物理机210上待部署的容器数量一致,部署的容器规格与确定的物理机210上待部署的容器规格一致。
示例性的,调度器100可以将用于部署容器的物理机210信息携带在容器调度响 应中,发送给容器控制器400。该用于部署容器的物理机210信息包括该物理机210上待部署的容器数量以及容器规格。为了指示该物理机210,物理机210信息中还可以包括该物理机210的标识,该物理机210的标识的说明可以参见前述内容,此处不再赘述。
容器控制器400在接收到容器调度响应后,根据该容器调度响应中携带的用于部署容器的物理机210信息确定待部署容器的物理机210、物理机210上待部署的容器数量以及容器规格。
针对任一用于部署容器的物理机210,容器控制器400可以向该物理机210上的容器管理模块213发送容器创建指令,该容器创建指令中包括该物理机210上待部署的容器的数量以及容器的规格。本申请实施例并不限定该物理机210上待部署的容器的数量,可以为一个,也可以为多个,该物理机210上部署的容器的规格可以相同,也可以不同。
容器管理模块213在接收到容器创建指令后,在该物理机210上创建容器的方式可以参见方式一中的相关说明,具体可以参见前述说明,此处不再赘述。
容器管理模块213在该物理机210上创建容器后,可以向容器控制器400发送容器创建成功响应,容器创建成功响应还可以包括容器管理模块213所创建的容器所占用的资源。
容器控制器400在接收到该容器创建成功响应后,确定容器创建成功,可以更新该物理机210上部署的容器信息,例如,更新该物理机210上部署的容器的数量以及每个容器的规格。可以更新物理机210上空闲资源的分布情况,若将已占用的资源标记为非空闲。
容器管理模块213在该物理机210上创建容器后,可以向容器控制器400发送容器创建成功响应,容器创建成功响应还可以包括容器管理模块213所创建的容器数量以及容器所占用的资源。
容器控制器400在接收到该容器创建成功响应后,确定容器创建成功,可以更新资源分布信息,将该物理机210上容器已占用的资源标记为已占用,还可以更新该物理机210上部署的容器的数量以及每个容器的规格。容器控制器400还可以将该容器创建成功响应反馈至调度器100,该调度器100在接收到容器创建成功响应后,可以更新资源池200的空闲资源分布信息,将该物理机210上容器已占用的资源标记为已占用,还可以更新该物理机210上部署的容器的数量以及每个容器的规格。
方式三、调度器100可以将资源池200的空闲资源分布信息共享给容器控制器400,容器控制器400可以自行基于资源池200的空闲资源分布信息,根据待部署的容器的总数量和容器的规格选择用于部署容器的物理机210,在该物理机210上部署容器。
在这种方式下,容器控制器400在确定需要部署容器时,可以从调度器100获取资源池200的空闲资源分布信息,该资源池200的空闲资源分布信息的说明可以参见前述内容,此处不再赘述。
容器控制器400基于该资源池200的空闲资源分布信息,根据待部署的容器总数 量以及容器规格从一个或多个物理机210中选择用于部署容器的物理机210,容器控制器400还可以确定选择的物理机210上待部署的容器数量以及容器规格。如果选择的物理机210的数量为多个,容器控制器400可以确定每个物理机210上待部署的容器数量以及容器规格。
容器控制器400在选择了用于部署容器的物理机210后,可以在该物理机210上部署容器。
本申请实施例并不限定容器控制器400在该物理机210上部署容器的方式,下面对本申请实施例提供的一种容器控制器400在物理机210上部署容器的方式进行说明:
容器控制器400在确定了用于部署容器的物理机210、以及该物理机210上待部署的容器的数量以及容器的规格后,针对任一用于部署容器的物理机210,容器控制器400可以向该物理机210上的容器管理模块213发送容器创建指令,该容器创建指令中包括待部署的容器的数量以及容器的规格。本申请实施例并不限定该物理机210上待部署的容器的数量,可以为一个,也可以为多个,该物理机210上部署的容器的规格可以相同,也可以不同。
容器管理模块213在接收到容器创建指令后,创建容器的方式可以参见方式一的相关说明,此处不再赘述。
容器管理模块213在该物理机210上创建容器后,可以向容器控制器400发送容器创建成功响应,容器创建成功响应还可以包括容器管理模块213所创建的容器所占用的资源。
容器控制器400在接收到该容器创建成功响应后,确定容器创建成功,还可以将该容器创建成功响应反馈至调度器100,该调度器100在接收到容器创建成功响应后,可以更新资源池200的空闲资源分布信息,将该物理机210上容器已占用的资源标记为已占用,还可以更新该物理机210上部署的容器的数量以及每个容器的规格。
基于与方法实施例同一发明构思,本申请实施例还提供了一种调度器,用于执行上述如图2所示的方法实施例中所述调度器执行的方法,相关特征可参见上述方法实施例,此处不再赘述,如图3所示,该调度器300包括传输单元301和处理单元302;
传输单元301,用于接收资源请求;
处理单元302,用于在确认资源请求要求虚拟机资源的情况下,从资源池选择用于部署虚拟机的物理机部署虚拟机,在确认资源请求要求容器资源的情况下,从资源池选择用于部署容器的物理机部署容器。
在一种可能的实施方式中,用于部署虚拟机的物理机与用于部署容器的物理机为同一物理机。
在一种可能的实施方式中,用于部署虚拟机的物理机与用于部署容器的物理机为不同物理机。
在一种可能的实施方式中,传输单元301在接收资源请求时可以从虚拟机控制器接收资源请求,也可以从容器控制器接收资源请求。
在一种可能的实施方式中,资源请求包括待部署的虚拟机总数量以及虚拟机规格;处理单元302在从资源池选择用于部署虚拟机的物理机部署虚拟机时,可以基于资源池的空闲资源分布信息,根据待部署的虚拟机总数量以及虚拟机规格确定用于部署虚 拟机的物理机、物理机上待部署的虚拟机数量以及虚拟机规格,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况;之后,指示虚拟机控制器在物理机上部署虚拟机。其中,物理机上部署的虚拟机符合物理机上待部署的虚拟机数量以及虚拟机规格。
在一种可能的实施方式中,资源请求包括待部署的容器总数量以及容器的规格;处理单元302在从资源池选择用于部署容器的物理机部署容器时,可以基于资源池的空闲资源分布信息,根据待部署的容器总数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格,空闲资源分布信息指示多个物理机上空闲资源的分布情况;之后,指示容器控制器在物理机上部署容器,其中,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格。
在一种可能的实施方式中,资源请求包括用于部署的容器的候选物理机、候选物理机上待部署的容器数量以及容器的规格;处理单元302在从资源池选择用于部署容器的物理机部署容器,可以基于资源池的空闲资源分布信息,确定候选物理机的空闲资源分布情况,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况;之后,基于候选物理机的空闲资源分布情况,根据候选物理机部署的容器数量以及容器的规格确定用于部署容器的物理机、物理机上待部署的容器数量以及容器的规格;指示容器控制器在物理机上部署容器,其中,物理机上部署的容器符合物理机上待部署的容器数量以及容器的规格。
在一种可能的实施方式中,处理单元302在从资源池选择用于部署容器的物理机部署容器时,可以向容器控制器发送资源池的空闲资源分布信息,其中,空闲资源分布信息指示多个物理机上空闲资源的分布情况。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。
在一个简单的实施例中,本领域的技术人员可以想到如图2所示的实施例中调度器可采用图4所示的形式。
如图4所示的装置400,包括至少一个处理器401、存储器402,可选的,还可以包括通信接口403。
存储器402可以是易失性存储器,例如随机存取存储器;存储器也可以是非易失性存储器,例如只读存储器,快闪存储器,硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)、或者存储器402是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器402可以是上述存储器的组合。
存储器402可以是易失性存储器,例如随机存取存储器;存储器也可以是非易失性存储器,例如只读存储器,闪存,硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)、或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器402可以是上述存储器的组合。
本申请实施例中不限定上述处理器401以及存储器402之间的具体连接介质。
处理器401可以为CPU,该处理器401还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件、人工智能芯片、片上芯片等。通用处理器可以是微处理器或者是任何常规的处理器等。具有数据收发功能,能够与其他设备进行通信,在如图1装置中,也可以设置独立的数据收发模块,例如通信接口403,用于收发数据;处理器401在与其他设备进行通信时,可以通过通信接口403进行数据传输,如从接收资源请求。
当所述调度器采用图4所示的形式时,图4中的处理器401可以通过调用存储器402中存储的计算机执行指令,使得所述检测装置可以执行上述任一方法实施例中的所述调度器执行的方法。
具体的,图3的传输单元301、处理单元302的功能/实现过程均可以通过图4中的处理器401调用存储器402中存储的计算机执行指令来实现。或者,图3中的处理单元302的功能/实现过程可以通过图4中的处理器401调用存储器402中存储的计算机执行指令来实现,图3的传输单元301的功能/实现过程可以通过图4中的通信接口403来实现。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些 计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (27)

  1. 一种虚拟机和容器混合调度系统,其特征在于,包括调度器和资源池,所述资源池包括多个物理机;
    所述调度器,用于接收资源请求;
    所述调度器,还用于在确认所述资源请求要求虚拟机资源的情况下,从所述资源池选择用于部署虚拟机的物理机部署虚拟机,在确认所述资源请求要求容器资源的情况下,从所述资源池选择用于部署容器的物理机部署容器。
  2. 根据权利要求1所述的系统,其特征在于,所述用于部署虚拟机的物理机与所述用于部署容器的物理机为同一物理机。
  3. 根据权利要求1所述的系统,其特征在于,所述用于部署虚拟机的物理机与所述用于部署容器的物理机为不同物理机。
  4. 根据权利要求1至3任一项所述的系统,其特征在于,所述调度器从虚拟机控制器或容器控制器接收所述资源请求。
  5. 根据权利要求1至4任一项所述的系统,其特征在于,所述系统还包括虚拟机控制器,所述资源请求包括待部署的虚拟机总数量以及虚拟机规格;所述调度器从所述资源池选择用于部署虚拟机的物理机部署虚拟机时,具体用于:
    基于所述资源池的空闲资源分布信息,根据所述待部署的虚拟机总数量以及虚拟机规格确定用于部署虚拟机的物理机、所述物理机上待部署的虚拟机数量以及虚拟机规格,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    指示所述虚拟机控制器在所述物理机上部署虚拟机,其中,所述物理机上部署的虚拟机符合所述物理机上待部署的虚拟机数量以及虚拟机规格;
    所述虚拟机控制器,用于根据所述调度器的指示在所述物理机上部署虚拟机。
  6. 根据权利要求1至4任一项所述的系统,其特征在于,所述系统还包括容器控制器,所述资源请求包括待部署的容器总数量以及容器的规格;所述调度器从所述资源池选择用于部署容器的物理机部署容器时,具体用于:
    基于所述资源池的空闲资源分布信息,根据所述待部署的容器总数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容器的规格,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    指示所述容器控制器在所述物理机上部署容器,其中,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格;
    所述容器控制器,用于根据所述调度器的指示在所述物理机上部署容器。
  7. 根据权利要求1至4任一项所述的系统,其特征在于,所述系统还包括容器控制器,所述资源请求包括用于部署的容器的候选物理机、所述候选物理机上待部署的容器数量以及容器的规格;所述调度器从所述资源池选择用于部署容器的物理机部署容器时,具体用于:
    基于所述资源池的空闲资源分布信息,确定所述候选物理机的空闲资源分布情况,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    基于所述候选物理机的空闲资源分布情况,根据所述候选物理机部署的容器数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容 器的规格;
    指示所述容器控制器在所述物理机上部署容器,其中,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格;
    所述容器控制器,用于根据所述调度器的指示在所述物理机上部署容器。
  8. 根据权利要求1至4任一项所述的系统,其特征在于,所述系统还包括容器控制器,所述调度器从所述资源池选择用于部署容器的物理机部署容器时,具体用于:
    向所述容器控制器发送所述资源池的空闲资源分布信息,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    所述容器控制器,用于从所述调度器接收所述资源池的空闲资源分布信息;
    基于所述资源池的空闲资源分布信息,根据所述待部署的容器总数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容器的规格;
    在所述物理机上部署容器,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格。
  9. 根据权利要求1至4任一项所述的系统,其特征在于,若所述用于部署虚拟机的物理机与所述用于部署容器的物理机为同一物理机,所述物理机包括虚拟机管理模块、容器管理模块以及代理模块:
    所述虚拟机管理模块,还用于向所述代理模块发送虚拟机资源分配请求,用于请求为所述物理机中待部署的虚拟机分配资源;
    所述容器管理模块,还用于向所述代理模块发送容器资源分配请求,用于请求为所述物理机中待部署的容器分配资源;
    所述代理模块,还用于基于所述物理机的空闲资源,为所述待部署的虚拟机和所述待部署的容器分配资源;以及向所述虚拟机管理模块反馈为所述待部署的虚拟机分配的资源;以及向所述容器管理模块反馈为所述待部署的容器分配的资源;
    所述虚拟机管理模块,还用于利用为所述待部署的虚拟机分配的资源创建虚拟机;
    所述容器管理模块,还用于利用为所述待部署的容器分配的资源创建容器。
  10. 一种虚拟机和容器混合调度方法,其特征在于,所述方法应用于调度器,包括:
    接收资源请求;
    在确认所述资源请求要求虚拟机资源的情况下,从所述资源池选择用于部署虚拟机的物理机部署虚拟机,在确认所述资源请求要求容器资源的情况下,从所述资源池选择用于部署容器的物理机部署容器。
  11. 根据权利要求10所述的方法,其特征在于,所述用于部署虚拟机的物理机与所述用于部署容器的物理机为同一物理机。
  12. 根据权利要求10所述的方法,其特征在于,所述用于部署虚拟机的物理机与所述用于部署容器的物理机为不同物理机。
  13. 根据权利要求10至12任一项所述的方法,其特征在于,所述接收资源请求包括:
    从虚拟机控制器或容器控制器接收所述资源请求。
  14. 根据权利要求10至13任一项所述的方法,其特征在于,所述资源请求包括待部署的虚拟机总数量以及虚拟机规格;所述从所述资源池选择用于部署虚拟机的物理机部署虚拟机,具体包括:
    基于所述资源池的空闲资源分布信息,根据所述待部署的虚拟机总数量以及虚拟机规格确定用于部署虚拟机的物理机、所述物理机上待部署的虚拟机数量以及虚拟机规格,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    指示所述虚拟机控制器在所述物理机上部署虚拟机,其中,所述物理机上部署的虚拟机符合所述物理机上待部署的虚拟机数量以及虚拟机规格。
  15. 根据权利要求10至13任一项所述的方法,其特征在于,所述资源请求包括待部署的容器总数量以及容器的规格;所述从所述资源池选择用于部署容器的物理机部署容器,具体包括:
    基于所述资源池的空闲资源分布信息,根据所述待部署的容器总数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容器的规格,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    指示所述容器控制器在所述物理机上部署容器,其中,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格。
  16. 根据权利要求10至13任一项所述的方法,其特征在于,所述资源请求包括用于部署的容器的候选物理机、所述候选物理机上待部署的容器数量以及容器的规格;所述从所述资源池选择用于部署容器的物理机部署容器,具体包括:
    基于所述资源池的空闲资源分布信息,确定所述候选物理机的空闲资源分布情况,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    基于所述候选物理机的空闲资源分布情况,根据所述候选物理机部署的容器数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容器的规格;
    指示所述容器控制器在所述物理机上部署容器,其中,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格。
  17. 根据权利要求10至13任一项所述的方法,其特征在于,所述从所述资源池选择用于部署容器的物理机部署容器,具体包括:
    向所述容器控制器发送所述资源池的空闲资源分布信息,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况。
  18. 一种调度器,其特征在于,所述调度器包括:
    传输单元,用于接收资源请求;
    处理单元,用于在确认所述资源请求要求虚拟机资源的情况下,从所述资源池选择用于部署虚拟机的物理机部署虚拟机,在确认所述资源请求要求容器资源的情况下,从所述资源池选择用于部署容器的物理机部署容器。
  19. 根据权利要求18所述的调度器,其特征在于,所述用于部署虚拟机的物理机与所述用于部署容器的物理机为同一物理机。
  20. 根据权利要求18所述的调度器,其特征在于,所述用于部署虚拟机的物理机与所述用于部署容器的物理机为不同物理机。
  21. 根据权利要求18至20任一项所述的调度器,其特征在于,所述传输单元在接收资源请求时,具体用于:
    从虚拟机控制器或容器控制器接收所述资源请求。
  22. 根据权利要求18至21任一项所述的调度器,其特征在于,所述资源请求包括待部署的虚拟机总数量以及虚拟机规格;所述处理单元在从所述资源池选择用于部署虚拟机的物理机部署虚拟机时,具体用于:
    基于所述资源池的空闲资源分布信息,根据所述待部署的虚拟机总数量以及虚拟机规格确定用于部署虚拟机的物理机、所述物理机上待部署的虚拟机数量以及虚拟机规格,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    指示所述虚拟机控制器在所述物理机上部署虚拟机,其中,所述物理机上部署的虚拟机符合所述物理机上待部署的虚拟机数量以及虚拟机规格。
  23. 根据权利要求18至21任一项所述的调度器,其特征在于,所述资源请求包括待部署的容器总数量以及容器的规格;所述处理单元在从所述资源池选择用于部署容器的物理机部署容器时,具体用于:
    基于所述资源池的空闲资源分布信息,根据所述待部署的容器总数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容器的规格,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    指示所述容器控制器在所述物理机上部署容器,其中,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格。
  24. 根据权利要求18至21任一项所述的调度器,其特征在于,所述资源请求包括用于部署的容器的候选物理机、所述候选物理机上待部署的容器数量以及容器的规格;所述处理单元在从所述资源池选择用于部署容器的物理机部署容器时,具体用于:
    基于所述资源池的空闲资源分布信息,确定所述候选物理机的空闲资源分布情况,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况;
    基于所述候选物理机的空闲资源分布情况,根据所述候选物理机部署的容器数量以及容器的规格确定用于部署容器的物理机、所述物理机上待部署的容器数量以及容器的规格;
    指示所述容器控制器在所述物理机上部署容器,其中,所述物理机上部署的容器符合所述物理机上待部署的容器数量以及容器的规格。
  25. 根据权利要求18至21任一项所述的调度器,其特征在于,所述处理单元在从所述资源池选择用于部署容器的物理机部署容器时,具体用于:
    向所述容器控制器发送所述资源池的空闲资源分布信息,其中,所述空闲资源分布信息指示所述多个物理机上空闲资源的分布情况。
  26. 一种装置,其特征在于,包括存储器和处理器;所述存储器存储有程序指令,所述处理器运行所述程序指令以执行权利要求10~17任一所述的方法。
  27. 一种计算机可读存储介质,其特征在于,计算机可读存储介质中存储有指令, 当其在计算机上运行时,使得计算机执行如权利要求10~17任一所述的方法。
PCT/CN2021/091733 2020-06-28 2021-04-30 一种虚拟机和容器混合调度系统、方法、调度器及装置 WO2022001353A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010598237.X 2020-06-28
CN202010598237.XA CN113849259A (zh) 2020-06-28 2020-06-28 一种虚拟机和容器混合调度系统、方法、调度器及装置

Publications (1)

Publication Number Publication Date
WO2022001353A1 true WO2022001353A1 (zh) 2022-01-06

Family

ID=78972123

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/091733 WO2022001353A1 (zh) 2020-06-28 2021-04-30 一种虚拟机和容器混合调度系统、方法、调度器及装置

Country Status (2)

Country Link
CN (1) CN113849259A (zh)
WO (1) WO2022001353A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832143A (zh) * 2017-10-17 2018-03-23 北京京东尚科信息技术有限公司 一种物理机资源的处理方法和装置
CN108287748A (zh) * 2017-10-25 2018-07-17 国云科技股份有限公司 一种虚拟机与容器并行调度方法
CN109885377A (zh) * 2018-11-23 2019-06-14 中国银联股份有限公司 统一资源调度协调器及其创建虚拟机和/或容器的方法、统一资源调度系统
US20200019426A1 (en) * 2018-07-12 2020-01-16 Vmware, Inc. Techniques for container scheduling in a virtual environment
CN110825494A (zh) * 2019-11-01 2020-02-21 北京京东尚科信息技术有限公司 物理机调度方法及装置、计算机可存储介质
CN111708632A (zh) * 2020-05-19 2020-09-25 中国人民财产保险股份有限公司 一种云资源管理方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832143A (zh) * 2017-10-17 2018-03-23 北京京东尚科信息技术有限公司 一种物理机资源的处理方法和装置
CN108287748A (zh) * 2017-10-25 2018-07-17 国云科技股份有限公司 一种虚拟机与容器并行调度方法
US20200019426A1 (en) * 2018-07-12 2020-01-16 Vmware, Inc. Techniques for container scheduling in a virtual environment
CN109885377A (zh) * 2018-11-23 2019-06-14 中国银联股份有限公司 统一资源调度协调器及其创建虚拟机和/或容器的方法、统一资源调度系统
CN110825494A (zh) * 2019-11-01 2020-02-21 北京京东尚科信息技术有限公司 物理机调度方法及装置、计算机可存储介质
CN111708632A (zh) * 2020-05-19 2020-09-25 中国人民财产保险股份有限公司 一种云资源管理方法及装置

Also Published As

Publication number Publication date
CN113849259A (zh) 2021-12-28

Similar Documents

Publication Publication Date Title
WO2020001320A1 (zh) 一种资源分配方法、装置及设备
US10701139B2 (en) Life cycle management method and apparatus
WO2020186909A1 (zh) 虚拟网络业务处理方法、装置和系统,控制器,存储介质
CN113918270A (zh) 基于Kubernetes的云资源调度方法及系统
CN105335229B (zh) 一种业务资源的调度方法和装置
CN110049504B (zh) 一种会话管理方法及装置
WO2020177564A1 (zh) Vnf的生命周期管理方法及装置
JP2021526768A (ja) 警報方法および警報装置
CN104144073A (zh) 主从装置环境的部署方法与主从装置环境的部署系统
CN110716787A (zh) 容器地址设置方法、设备和计算机可读存储介质
WO2021103646A1 (zh) 一种部署pod的方法及装置
CN113849260A (zh) 一种实例的处理核分配方法及装置
CN113296926B (zh) 一种资源分配方法、计算设备及存储介质
CN109213567B (zh) 一种管理vnf实例化的方法和设备
CN108933844B (zh) 提供dhcp服务的方法及设备
CN111163140A (zh) 资源获取和分配的方法、装置和计算机可读存储介质
KR20230069088A (ko) 컨테이너 클러스터 관리 방법 및 그 시스템
WO2017075796A1 (zh) 网络功能虚拟化nfv网络中分配虚拟资源的方法和装置
CN111399968A (zh) 一种基于容器的虚拟资源管理方法、装置及系统
WO2022001353A1 (zh) 一种虚拟机和容器混合调度系统、方法、调度器及装置
CN113760549A (zh) 一种pod部署方法及装置
WO2021013185A1 (zh) 虚机迁移处理及策略生成方法、装置、设备及存储介质
CN115314468B (zh) 一种容器云平台的ip地址分配方法和系统
WO2014079050A1 (zh) 一种逻辑对象部署方法、相关装置及系统
US10372470B2 (en) Copy of memory information from a guest transmit descriptor from a free pool and assigned an intermediate state to a tracking data structure

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: 21832129

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21832129

Country of ref document: EP

Kind code of ref document: A1