WO2019196692A1 - 虚拟机的调度方法和装置 - Google Patents

虚拟机的调度方法和装置 Download PDF

Info

Publication number
WO2019196692A1
WO2019196692A1 PCT/CN2019/080803 CN2019080803W WO2019196692A1 WO 2019196692 A1 WO2019196692 A1 WO 2019196692A1 CN 2019080803 W CN2019080803 W CN 2019080803W WO 2019196692 A1 WO2019196692 A1 WO 2019196692A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
host
resource data
candidate
processor
Prior art date
Application number
PCT/CN2019/080803
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 阿里巴巴集团控股有限公司
Priority to SG11202009363RA priority Critical patent/SG11202009363RA/en
Priority to EP19784797.3A priority patent/EP3779687A4/en
Priority to JP2020555183A priority patent/JP7304887B2/ja
Publication of WO2019196692A1 publication Critical patent/WO2019196692A1/zh
Priority to US17/066,328 priority patent/US20210034407A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • 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/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
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • 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/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5019Workload prediction
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to the field of cloud computing, and in particular to a method and apparatus for scheduling a virtual machine.
  • a virtual machine is a complete computer system that runs through a software and has full hardware system functionality running in a fully isolated environment.
  • the system needs to be scheduled to classify the host for the virtual machine.
  • the host running the virtual machine can also be replaced.
  • the process of allocating the host and the process of replacing the host are the scheduling of the virtual machine. process.
  • cloud computing scheduling in the industry often uses different methods for mixed scheduling of sensitive services and batch jobs to reduce interactions.
  • the user belongs to the category that the application belongs to: computationally intensive, memory intensive, and storage intensive, thus developing different scheduling strategies for different types of virtual machines.
  • the existing hybrid scheduling scheme is based on the premise that the batch application can lower the priority, and degrades in time when the problem is encountered, but the virtual machine scheduling does not have priority, and the virtual machine is created with the same priority, and Any migration has a certain impact on the user, so the host needs to reserve resources for the peak of each virtual machine, which will inevitably cause a great waste of resources.
  • the embodiment of the invention provides a method and a device for scheduling a virtual machine, so as to at least solve the technical problem that the host needs to reserve resources for the peak of each virtual machine in the prior art, resulting in a large waste of resources.
  • a method for scheduling a virtual machine includes: predicting resource data required by a virtual machine in a next time period, and obtaining a prediction result, where the resource data includes at least one of the following: processing Resource, processor misses, cache misses, and power consumption; acquire the used resource data and available resource data of the candidate host; superimpose the prediction result with the used resource data of each candidate host to obtain The superposition result of each candidate host; respectively, the superposition result of each candidate host is compared with the available resource data of each host, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • a method for scheduling a virtual machine includes: predicting a processor resource required by a virtual machine in a next time period, obtaining a prediction result; and acquiring used processing of the candidate host Resource and available processor resources; superimposing the prediction result with the used processor resources of each candidate host to obtain the superposition result of each candidate host; respectively, superimposing results of each candidate host with each candidate sink
  • the available processor resources of the host are compared, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • a scheduling apparatus for a virtual machine including: a prediction module, configured to predict resource data required by a virtual machine in a next time period, to obtain a prediction result, where the resource data
  • the method includes at least one of: a processor resource, a number of processor contending times, a cache miss count, and a power consumption utilization rate; an obtaining module, configured to acquire used resource data and available resource data of the candidate host; and an overlay module, configured to:
  • the prediction result is superimposed with the used resource data of each candidate host to obtain the superposition result of each candidate host; the comparison module is used to respectively superimpose the result of each candidate host with the available resources of each host.
  • the data is compared, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • a scheduling apparatus for a virtual machine including: a prediction module, configured to predict a processor resource required by a virtual machine in a next time period, to obtain a prediction result; and an acquiring module, a used processor resource and an available processor resource for acquiring a candidate host; an overlay module, configured to superimpose the prediction result with the utilized processor resources of each candidate host to obtain a superposition result of each candidate host;
  • the comparison module is configured to compare the superposition result of each candidate host with the available processor resources of each candidate host, and select a target host corresponding to the virtual machine from the candidate host.
  • a storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is controlled performs the following steps to predict a virtual machine to be required in a next time period.
  • the resource data is obtained by the at least one of the following: the processor resource, the number of processor contending times, the number of cache misses, and the power consumption utilization rate; acquiring the used resource data and the available resource data of the candidate host Superimposing the prediction result with the used resource data of each candidate host to obtain the superposition result of each candidate host; respectively comparing the superposition result of each candidate host with the available resource data of each host, The target host corresponding to the virtual machine is selected from the candidate hosts.
  • a processor is further provided, where the processor is configured to run a program, where the program is executed to perform the following steps: predicting resource data required by the virtual machine in a next time period, and obtaining a prediction result,
  • the resource data includes at least one of the following: a processor resource, a number of processor contending times, a number of cache misses, and a power consumption utilization rate; acquiring used resource data and available resource data of the candidate host; and predicting the result with each
  • the used host data of the candidate host is superimposed to obtain the superposition result of each candidate host; the superposition result of each candidate host is compared with the available resource data of each host, and the virtual host is selected from the candidate host.
  • the target host machine corresponding to the machine.
  • a system comprising: a processor; and a memory coupled to the processor for providing an instruction to the processor to process the following: predicting the virtual machine in a next time period The resource data required to obtain the predicted result, wherein the resource data includes at least one of the following: processor resources, number of processor contending, number of cache misses, and power consumption utilization; and acquired resource data of the candidate host And available resource data; superimposing the prediction result with the used resource data of each candidate host to obtain the superposition result of each candidate host; respectively, superimposing the result of each candidate host with the available resource data of each host For comparison, the target host corresponding to the virtual machine is selected from the candidate hosts.
  • the host machine determines the target host, so that the host can be selected more accurately for the virtual machine without each host reserve resources for the peak of each virtual machine, which reduces the waste of resources and uses the virtual machine as much as possible.
  • Uniform scheduling is distributed on different hosts to achieve smooth load balancing of the physical machine.
  • the foregoing embodiment of the present application solves the technical problem that the host needs to reserve resources for the peak of each virtual machine in the prior art, resulting in a large waste of resources.
  • FIG. 1 is a block diagram showing the hardware structure of a computer terminal (or mobile device) for implementing a scheduling method of a virtual machine
  • FIG. 2 is a flowchart of a scheduling method of a virtual machine according to Embodiment 1 of the present application;
  • FIG. 3 is a schematic diagram of a virtual machine migration according to Embodiment 1 of the present application.
  • FIG. 4 is a schematic diagram of changes in used resources of a host machine before and after migration of an optional virtual machine according to Embodiment 1 of the present application;
  • FIG. 5 is a flowchart of a scheduling method of a virtual machine according to Embodiment 2 of the present application.
  • FIG. 6 is a schematic diagram of a scheduling apparatus of a virtual machine according to Embodiment 3 of the present application.
  • FIG. 7 is a schematic diagram of a scheduling apparatus of a virtual machine according to Embodiment 4 of the present application.
  • Figure 8 is a block diagram showing the structure of a computer terminal according to Embodiment 6 of the present invention.
  • Virtual machine A complete computer system that runs through a software and has a complete hardware system function and runs in a completely isolated environment.
  • Virtual machine (VM) scheduling When creating a virtual machine, the scheduling system needs to classify the host for the virtual machine. After the virtual machine is created, the host running the virtual machine can also be replaced. The process of allocating the host and replacing the host The process is the scheduling process of the virtual machine.
  • an embodiment of a scheduling method of a virtual machine there is also provided an embodiment of a scheduling method of a virtual machine, and it should be noted that the steps shown in the flowchart of the accompanying drawings may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 1 shows a hardware block diagram of a computer terminal (or mobile device) for implementing a scheduling method of a virtual machine.
  • computer terminal 10 may include one or more (shown in the figures 102a, 102b, ..., 102n) processor 102 (processor 102 may include, but is not limited to, micro A processing device such as a processor MCU or a programmable logic device FPGA, a memory 104 for storing data, and a transmission module 106 for communication functions.
  • processor 102 may include, but is not limited to, micro A processing device such as a processor MCU or a programmable logic device FPGA, a memory 104 for storing data, and a transmission module 106 for communication functions.
  • FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
  • computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • processors 102 and/or other data processing circuits may be referred to herein generally as "data processing circuits.”
  • the data processing circuit may be embodied in whole or in part as software, hardware, firmware or any other combination.
  • the data processing circuitry can be a single, separate processing module, or incorporated in whole or in part into any of the other components in computer terminal 10 (or mobile device).
  • the data processing circuit is controlled as a processor (e.g., selection of a variable resistance terminal path connected to the interface).
  • the memory 104 can be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the scheduling method of the virtual machine in the embodiment of the present invention, and the processor 102 runs the software programs and modules stored in the memory 104. Thereby, various functional applications and data processing are performed, that is, the scheduling method of the above virtual machine is implemented.
  • Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 may further include memory remotely located relative to processor 102, which may be coupled to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • the display can be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of computer terminal 10 (or mobile device).
  • LCD liquid crystal display
  • the computer device (or mobile device) shown in FIG. 1 above may include hardware components (including circuits), software components (including computers stored on a computer readable medium). Code), or a combination of both hardware and software components.
  • Figure 1 is only one example of a particular embodiment and is intended to illustrate the types of components that may be present in the aforementioned computer device (or mobile device).
  • the present application provides a flowchart of a scheduling method of a virtual machine as shown in FIG. 2.
  • 2 is a flowchart of a scheduling method of a virtual machine according to Embodiment 1 of the present invention.
  • Step S21 predicting resource data required by the virtual machine in the next time period to obtain a prediction result, where the resource data includes at least one of the following: processor resources, processor contention times, cache miss times, and power consumption utilization rate. .
  • the virtual machine may be a newly created virtual machine, and may also be a virtual machine that needs to be migrated. For example, if the host running the virtual machine fails, or the host running the virtual machine is overloaded, it needs to be The virtual machine is migrated to ensure stable operation of the virtual machine.
  • the above processor can be a cpu, the cpu resource can be determined according to the cpu utilization rate, and the cpu utilization rate is used for the degree that the cpu is utilized, and can be expressed by a percentage.
  • the processor resource is a virtual processor (vcpu) resource, and for the host machine, the processor resource is an entity cpu resource.
  • the number of times of processor scrambling refers to the number of times the thread of the virtual machine waits in the host's kernel for more than the predetermined duration; the number of cache misses is cpu cache miss, which is used to refer to the miss when the virtual machine reads the host's cache. frequency.
  • the time period may be seven days, and the resource data required by the virtual machine in the next time period may be predicted by acquiring historical resource data of the virtual machine.
  • the enterprise assigns a virtual machine account to each employee.
  • the employee logs in to his virtual machine through the account.
  • each employee uses the virtual machine time, the cpu resources used, etc.
  • the data has a certain regularity. Therefore, the resource data law of the virtual machine can be determined through the historical resource data of the virtual machine, and the resource data required by the virtual machine in the next time period is predicted according to the obtained rule.
  • Step S23 Obtain the used resource data and available resource data of the candidate host.
  • the candidate host is a host that allows the virtual machine to run, and may be multiple. Still taking the enterprise application scenario as an example, the enterprise host machine allows each virtual machine of the enterprise to run, so when the enterprise virtual machine is scheduled, the enterprise host is a candidate host.
  • the used resource data of the candidate host may be the cpu resource used by the candidate host, the number of CPU contending, the number of cache misses, and/or the power consumption utilization, wherein the number of cpu contends and caches used by the candidate host The number of misses and/or power consumption can be determined by detection.
  • the cpu resources that the candidate host has utilized can be determined by the vcpu resources used by all the virtual machines running on the host.
  • the available resource data of the candidate host refers to the resource data that the candidate host allows the virtual machine to use.
  • the candidate host has certain resource data, which may include: a cpu resource, a predetermined cpu contention number, a predetermined number of cache misses, and a predetermined power consumption utilization rate.
  • Each resource data may have a corresponding usage threshold, that is, a proportion of the allowed portion of the total resource data, for example, a predetermined threshold of 80%, the virtual machine may use 80% of all resource data of the host.
  • Step S25 superimposing the prediction result with the used resource data of each candidate host to obtain a superposition result of each candidate host.
  • the prediction result is superimposed on the used resources of the candidate host, and is used to predict the resource data required by the candidate host after the virtual machine is migrated to the candidate host.
  • the prediction result of the virtual machine and the resource data of the corresponding candidate host are respectively added to obtain a superposition result.
  • the resource data of the virtual machine includes: cpu resource A1 required by the virtual machine, cc competition number B1, cache miss number C1, and power consumption utilization D1
  • the used resource data of the candidate host includes: used The cpu resource A2, the cpu contention B2, the cache miss number C2, and the power consumption utilization D2, the superimposed results are: A1+A2, B1+B2, C1+C2, and D1+D2.
  • step S27 the superposition result of each candidate host is compared with the available resource data of each host, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • step S27 in a case where the superposition result of one candidate host exceeds the available resource data of the candidate host, it may be determined that if the virtual machine is migrated to the candidate host, the candidate host is not enough.
  • the resource supports virtual machine operation, which may cause the candidate host to be overloaded; if the superposition result of a candidate host does not exceed the available resource data of the candidate host, it may be determined that if the virtual machine is migrated to the candidate sink On the host, the candidate host has sufficient resources to support the virtual machine running. Therefore, the target host capable of supporting the operation of the virtual machine can be selected from the candidate host by comparing the superposition result of each candidate host with the available resource data of each host.
  • the available resource data of the candidate host is: available cpu resource A3, cpu contention B3, cache miss number C3 and power consumption utilization D3, if it can satisfy A1+A2 ⁇ A3, B1+B2 ⁇ B3, C1+C2 ⁇ C3, and D1+D2 ⁇ D3, it is determined that the host is the target host, if any of the above conditions If it is not met, it is confirmed that the host is not the target host.
  • the solution determines the resource data used by the scheduling virtual machine in a future cycle, and obtains the current used resource data and available resource data of the candidate host. Which candidate host is migrated to the virtual machine, that is, the target host is determined, so that the host can be selected more accurately for the virtual machine without requiring each host to reserve resources for the peak of each virtual machine, thereby reducing resource waste.
  • the virtual machine is evenly distributed and distributed on different hosts to achieve a stable load balance of the physical machine.
  • the foregoing embodiment of the present application solves the technical problem that the host needs to reserve resources for the peak of each virtual machine in the prior art, resulting in a large waste of resources.
  • NC1 and NC2 are respectively two hosts, and the VM is a virtual machine waiting to be migrated, and the virtual machine VM needs to be determined to be migrated. To which host machine.
  • the prediction results of the virtual machine VM in a future time period are superimposed on the used resource data of NC1 and NC2, respectively, and are respectively available with NC1 and NC2.
  • Resource data comparisons determine which host to migrate the virtual machine VM to.
  • the time period can be divided into a plurality of preset time periods, still shown in FIG. 3, the time arrow indicates the time trend in the time period, and the rectangles after NC1 and NC2 indicate that NC1 and NC2 are in each
  • the used resource data of the time period, the circle after the virtual machine VM represents the prediction result of the virtual machine VM in each time period, and the prediction result corresponding to each time period is compared with the NC1 and NC2 in each time period.
  • the time period is divided into a plurality of preset time segments to describe the resource data required by the virtual machine in a future time period.
  • the time period includes a plurality of preset time periods, and predicting resource data required by the virtual machine in the next time interval to obtain a prediction result, including: acquiring a prediction model, wherein the prediction model is used for characterization Correspondence between the prediction result of the virtual machine with different attribute parameters and the preset time period, the attribute parameters include: the identifier, specification and application type of the virtual machine; input the attribute parameter of the virtual machine to the prediction model; receive the virtual output of the prediction model The predicted result of the machine.
  • the identifier of the virtual machine may be the user ID, that is, the user_id, and the user logs in to the virtual machine by using the user_id and the corresponding password; the specification of the virtual machine is used to indicate that the virtual machine includes multiple vcpus and how much memory is available; the application type of the virtual machine may be According to the use of the virtual machine, the application type can be an online service class (for example, used as a website server) or an offline operation class (for example, performing big data operations).
  • the above prediction model may be a neural network model obtained by training existing data (for example, historical resource data of a virtual machine).
  • the above attribute parameters are parameters that have a great influence on the resource data used by the virtual machine. For example, for the user identifier, different users have different usage habits for the virtual machine, and the resource data used has strong Personal characteristics; for the specification, the resource data occupied by different specifications of the virtual machine runs at a large difference; for the application type, the resource data used by the virtual machines of different application types at runtime also has a large difference. .
  • the above scheme inputs these attribute parameters as characteristics of the virtual machine into the prediction model, and the prediction model performs prediction based on the input data, and returns the prediction result of the virtual machine.
  • the method before inputting the attribute parameter of the virtual machine to the prediction model, the method further includes: obtaining a confidence of the prediction model and a preset confidence threshold; if the confidence of the prediction model is greater than or equal to The confidence threshold enters the step of inputting the virtual machine's attribute parameters to the predictive model; if the predictive model's confidence is less than the confidence threshold, the virtual machine is predicted based on the virtual machine's virtual processor resources and virtual processor utilization. Resource data required during the time period.
  • the prediction model For a virtual machine with certain regularity, the prediction model has higher confidence. Therefore, for a virtual machine with higher confidence, the accuracy of the resource data predicted by its prediction model is higher; and for a virtual machine whose law is not obvious The confidence of the prediction model is low, so for virtual machines with lower confidence, the accuracy of the resource data predicted by the prediction model is lower.
  • a confidence threshold is preset, and according to the confidence threshold, whether the prediction model is further used to predict the resource data of the virtual machine is determined.
  • the virtual machine has a prediction model with a confidence level of 90% and a confidence threshold of 85%, which allows the virtual machine's prediction model to be used to predict the virtual machine's resource data in the next time period. .
  • the virtual machine has a prediction model with a confidence of 80% and a confidence threshold of 85%, determining that the prediction model of the virtual machine has a lower accuracy and discarding the prediction model.
  • the resource data required by the virtual machine in the next time period is calculated according to a predetermined formula.
  • acquiring the prediction model includes: acquiring sample data, where the sample data includes attribute information of the plurality of sample virtual machines and historical resource data of the sample virtual machine in a preset time period; and performing according to the sample data Model training to obtain a predictive model.
  • the preset time period may be 6 hours, and each time period is consecutive but not coincident, for example, 0:00 to 6:00, 6:00 to 12:00, and 12:00 to 18: 00 and 18:00 to 24:00 are the four time periods of the day.
  • the sample virtual machine may be a virtual machine in the same operating environment as the virtual machine.
  • the number of sample virtual machines may be more and distributed on different attribute information.
  • the time period is 7 days, for example, if the preset time period is 6 Hours, then a time period consists of 28 time periods.
  • the sample virtual machine is selected, and a plurality of virtual machines with different identifiers, different specifications, and different application types are selected as the sample virtual machine, and then the resource data of the sample virtual machine in 28 periods of one cycle is obtained, and the historical resource data is obtained.
  • the verification model (including the historical resource data of the virtual machine and the virtual machine with different attribute information of different attribute periods) is used to verify the trained model, and the prediction model is obtained after the verification is passed.
  • acquiring the prediction model and acquiring the historical resource data of the sample virtual machine in the preset time period includes: collecting average resource data of the plurality of virtual processors of the virtual machine according to the preset sampling time, where The preset time period includes a plurality of sampling times; determining that the maximum average resource data in a preset time period is historical resource data of the preset time period.
  • the foregoing collection time may be 5 minutes, and a CPU of a virtual machine may have multiple vcpus, so an average value of multiple vcpus is obtained.
  • the resource data of all cores is collected once every 5 minutes, and the average value of 16 cores is obtained, and the virtual is obtained.
  • acquiring the used resource data of the candidate host includes: acquiring, using the virtual machine running on the candidate host, the preset time period. Resources; determine the sum of the resources used by each virtual machine in the preset time period as the utilized processor resources of the host for a preset period of time.
  • obtaining available resource data of the candidate host includes: acquiring a total processor resource of the host and a preset utilization threshold, wherein the total processor resource of the host is a physical core of the host.
  • the product of the quantity and the preset constant; the product of the total processor resource of the host and the preset utilization threshold is determined to be the available resource data of the candidate host.
  • the value of the cpu resource can be obtained by using a resource provided by a physical core of the host cpu as a constant x if a host has For y physical cores, the resource of the cpu is x multiplied by y.
  • the CPU of a host includes 56 physical cores, and the physical resource provided by one physical core is 100, and the CPU utilization resource of the host is 5600.
  • the cpu resource is quantized by multiplying the number of physical cores by a preset constant, so that the resources of the host machine can be calculated by numerical calculation.
  • the preset constant may be 100, that is, the resource provided by each physical core is calculated as 100 copies.
  • the processor resources used by each virtual machine running on the host machine for a plurality of preset time periods are obtained, including: acquiring the virtual processor number of the virtual machine, and creating the candidate host.
  • the processor resources of the segment including: acquiring the virtual processor number of the virtual machine, and creating the candidate host.
  • the average utilization rate of the above vcpu may be obtained from historical data, and may be: a maximum average of the average values corresponding to multiple sampling times in each time period (including multiple sampling times in each time period) The value, where the average value corresponding to each sampling time is the average utilization of all the cores of the virtual machine at the sampling time.
  • the number of vcpus of the virtual machine is a
  • the total vcpu of the host is b
  • the average utilization of the vcpu is c
  • the number of physical cores of the host is d
  • Table 1 shows a way for a computing host to utilize cou resources and available cpu resources, as shown in Table 1, in this example, a time period is 7 days, and the time period includes 4 time periods, each The time period is 6 hours, and the 4 time periods are connected but not coincident. Table 1 only shows the calculation method of the first two time periods on the first day. The other time periods are calculated in the same way. The following is a detailed description in conjunction with Table 1. .
  • NC1 will be described in the first time period (0 to 6) in the first day.
  • NC1 has 56 physical cores and 20 vcpus, which are applied to VM1 (4 cores), VM2 (8 cores), and VM3 (8 cores).
  • the preset constant is 100
  • the preset utilization threshold is 80%
  • NC1 has utilized cpu resources and available cpu resources in other time periods, and the used cpu resources and available cpu resources of NC2 in each time period can be calculated by the above scheme.
  • the average utilization of the vcpu of the virtual machine in each time period can be obtained by acquiring historical resource data, which is: collecting the average vcpu of all the cores of the virtual machine according to the preset sampling time.
  • NC2 also has 56 physical cores, the cpu resource is 5600, and the average CPU utilization of NC2 is 10%.
  • the time period includes a plurality of preset time periods
  • the superposition result of each candidate host is compared with the available resource data of each host, and the virtual machine is selected from the candidate hosts.
  • Corresponding host machine comprising: selecting a candidate host that satisfies the condition from the candidate host, wherein the condition includes: the superposition result of each preset time period does not exceed the available resource data of the host; determining the candidate that satisfies the condition The host is the target host corresponding to the virtual machine.
  • the above solution can be executed by the filter of the scheduling system, and through the above scheme, the host machine capable of supporting the running of the virtual machine is filtered out.
  • the superposition result of a candidate host exceeds the available resource data of the candidate host, it may be determined that if the virtual machine is migrated to the candidate host, the candidate host does not have sufficient resources to support the virtual machine running, The candidate host may be overloaded; if the superposition result of a candidate host does not exceed the available resource data of the candidate host, it may be determined that if the virtual machine is migrated to the candidate host, the candidate host Have enough resources to support virtual machine operation. Therefore, the target host capable of supporting the operation of the virtual machine can be selected from the candidate host by comparing the superposition result of each candidate host with the available resource data of each host.
  • determining that the candidate host that meets the condition is a host corresponding to the virtual machine includes: obtaining a weight value corresponding to each resource data; The weight value weights the superposition result to obtain a weighted result corresponding to the candidate host that satisfies the condition; and the candidate host whose minimum weighting result is determined is the target host corresponding to the virtual machine.
  • the above scheme can be performed by the weight of the scheduling system. After a plurality of candidate hosts are still filtered by the scheduling filter, that is, when multiple candidate hosts can support the virtual machine running, the weighting result can be represented by integrating the plurality of data in the resource data by the weights. The resource usage of the candidate host after migrating the virtual machine to the candidate host.
  • the weight values of the respective resource data may be arranged in the following order: processor resources, power consumption utilization, processor contention times, and cache miss times. 50%, 30%, 10% and 10%.
  • the superimposed result of the candidate host is: A1+A2, B1+B2, C1+C2, and D1+D2, and the weighting result corresponding to the host is (A1+A2).
  • the above embodiment shows the calculation method of the weighting result of a host, according to which the weighting result of each candidate host that satisfies the condition is calculated, and the candidate host with the smallest weighting result is selected as the target host.
  • the weighted result of the candidate host that satisfies the condition can explain the resource utilization of the host after the virtual machine is migrated to the host. If the weighting result is large, the virtual machine is migrated to The candidate host, the candidate host will use more resources, and the load is heavier; if the weighting result is smaller, it indicates that if the virtual machine is migrated to the candidate host, the used resources of the candidate host are used. Still less, in order to maintain the load balance of the host, the virtual machine is migrated to the candidate host with the smallest weighting result, that is, the candidate host with the smallest weighting result is determined as the target host.
  • the above solution predicts the target host by migrating the virtual machine to each candidate host that satisfies the condition, and predicts the resource utilization of each host if the virtual machine is migrated to each candidate host.
  • the method further This includes: migrating the virtual machine to the target host corresponding to the virtual machine.
  • the virtual machine is migrated to the corresponding target host, and the target host can provide the resource data required by the virtual machine to run, and can also achieve the purpose of balancing the load on the host.
  • predicting resource data required by the virtual machine in the next time period, and obtaining a prediction result including: obtaining an identifier of the newly created virtual machine. And/or specification; find the target virtual machine with the same identity and specifications as the newly created virtual machine; determine the predicted result of the target virtual machine as the predicted result of the newly created virtual machine.
  • For the newly created virtual machine select the predicted result of the virtual machine with the same identity and specifications as the newly created virtual machine as the predicted result of the newly created virtual machine.
  • the target virtual machine if there is no target virtual machine that has the same identity and specifications as the newly created virtual machine, and there is a target virtual machine with the same identifier and different specifications as the newly created virtual machine, and specifications. If the target virtual machine is the same and identifies a different target virtual machine, the predicted result of the target virtual machine that is the same as the newly created virtual machine is the predicted result of the newly created virtual machine.
  • FIG. 5 is a flowchart of a method for scheduling a virtual machine according to Embodiment 2 of the present application. :
  • step S51 the processor resources required by the virtual machine in the next time period are predicted, and the prediction result is obtained.
  • the virtual machine may be a newly created virtual machine, and may also be a virtual machine that needs to be migrated. For example, if the host running the virtual machine fails, or the host running the virtual machine is overloaded, it needs to be The virtual machine is migrated to ensure stable operation of the virtual machine.
  • the upper time period may be seven days, and the resource data required by the virtual machine in the next time period may be predicted by acquiring historical resource data of the virtual machine.
  • Step S53 acquiring the utilized processor resources and available processor resources of the candidate host.
  • the available processor resources of the candidate host are the processor resources that the candidate host allows the virtual machine to use.
  • the candidate host has a certain total processor resource and a corresponding usage threshold, that is, the proportion of the allowed portion to all the resource data. For example, if the predetermined threshold is 80%, the virtual machine can use the total processor resources of the host. 80%.
  • Step S55 superimposing the prediction result with the utilized processor resources of each candidate host to obtain a superposition result of each candidate host.
  • the prediction result is superimposed on the used processor resources of the candidate host, and is used to predict the processor resources required by the candidate host after migrating the virtual machine to the candidate host.
  • step S57 the superposition result of each candidate host is compared with the available processor resources of each candidate host, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • step S57 in a case where the superposition result of one candidate host exceeds the available processor resources of the candidate host, it may be determined that if the virtual machine is migrated to the candidate host, the candidate host does not have Sufficient processor resources to support virtual machine operation may cause the candidate host to be overloaded; if the superposition result of a candidate host does not exceed the available processor resources of the candidate host, then it can be determined that if the virtual machine is migrated Up to the candidate host, the candidate host has sufficient processor resources to support the virtual machine operation. Therefore, the target host capable of supporting the running of the virtual machine can be selected from the candidate host by comparing the superposition result of each candidate host with the available processor resources of each host.
  • the solution predicts the resource data used by the scheduling virtual machine in a future cycle, and obtains the current used processor resources and available processor resources of the candidate host. Determine which candidate host should be migrated to the virtual machine, that is, determine the target host, so that the host can be selected more accurately for the virtual machine without requiring each host to reserve resources for each virtual machine's peak, reducing resources. Waste, as much as possible, the virtual machine is evenly distributed on different hosts to achieve a smooth balance of the load of the physical machine.
  • the foregoing embodiment of the present application solves the technical problem that the host needs to reserve resources for the peak of each virtual machine in the prior art, resulting in a large waste of resources.
  • acquiring available processor resources of the candidate host includes: obtaining a preset constant, a number of physical cores of the host, and a preset threshold, wherein the preset threshold is less than 1; determining a preset constant, The product of the number of physical cores of the host and the preset threshold is the available processor resources of the host.
  • the value of the cpu resource can be obtained by using a resource provided by a physical core of the host cpu as a constant x if a host has For y physical cores, the resource of the cpu is x multiplied by y.
  • the CPU of a host includes 56 physical cores, and the physical resource provided by one physical core is 100, and the CPU utilization resource of the host is 5600.
  • the time period includes a plurality of preset time periods
  • acquiring the utilized processor resources of the candidate host includes: acquiring each virtual machine running on the candidate host in a preset time period. Processor resources; determining the sum of the processor resources of each virtual machine as the utilized processor resources of the candidate host for a preset period of time.
  • acquiring processor resources of each virtual machine running on the candidate host in a preset time period includes: acquiring a virtual processor number of the virtual machine, and total virtual processing created by the candidate host Number of devices, average utilization of virtual processors per preset time period, and number of physical cores of candidate hosts; ratio of the number of virtual processors that acquire virtual machines to the total number of virtual processors created by candidate hosts; The minimum value between the number of physical cores of the host and the total number of virtual processors created by the candidate host; the product of the ratio, the average utilization of the virtual processor, and the minimum value; the process of determining the product as the virtual machine for the preset time period Resource.
  • the number of vcpus of the virtual machine is a
  • the total vcpu of the host is b
  • the average utilization of the vcpu is c
  • the number of physical cores of the host is d
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods of various embodiments of the present invention.
  • the apparatus 600 includes:
  • the prediction module 602 is configured to predict resource data required by the virtual machine in the next time period to obtain a prediction result, where the resource data includes at least one of the following: processor resources, processor contention times, cache miss times, and work. Consumption rate.
  • the obtaining module 604 is configured to obtain the utilized resource data and the available resource data of the candidate host.
  • the superimposing module 606 is configured to superimpose the prediction result with the used resource data of each candidate host to obtain a superposition result of each candidate host.
  • the comparison module 608 is configured to compare the superposition result of each candidate host with the available resource data of each host, and select a target host corresponding to the virtual machine from the candidate host.
  • the foregoing prediction module 602, the obtaining module 604, the superimposing module 606, and the matching module 608 correspond to the steps S21 to S27 in Embodiment 1, and the examples and applications implemented by the four modules and corresponding steps.
  • the scene is the same, but is not limited to the content disclosed in the first embodiment. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the time period includes a plurality of preset time segments
  • the prediction module includes: a first acquisition submodule, configured to acquire a prediction model, where the prediction model is used to represent a virtual machine having different attribute parameters Corresponding relationship between the prediction result and the preset time period, the attribute parameters include: the identifier, specification and application type of the virtual machine; the input sub-module for inputting the attribute parameter of the virtual machine to the prediction model; and the receiving sub-module for receiving the prediction The predicted result of the virtual machine output by the model.
  • the foregoing processor may further execute the following program code: a second obtaining submodule, configured to obtain a confidence of the prediction model and a preset confidence threshold before inputting the attribute parameter of the virtual machine to the prediction model. Entering a sub-module for entering a step of inputting an attribute parameter of the virtual machine to the prediction model if the confidence level of the prediction model is greater than or equal to the confidence threshold; and predicting the sub-module for if the confidence of the prediction model is less than the confidence level
  • the threshold is used to predict the resource data required by the virtual machine in the next time period according to the virtual machine resource and virtual processor utilization of the virtual machine.
  • the first obtaining submodule includes: a first acquiring unit, configured to acquire sample data, where the sample data includes attribute information of the plurality of sample virtual machines and the sample virtual machine in a preset time period Historical resource data; a training unit for performing model training based on sample data to obtain a predictive model.
  • the first acquiring unit includes: a collecting subunit, configured to collect average resource data of multiple virtual processors of the virtual machine according to a preset sampling time, where the preset time period includes multiple The sampling time is determined by determining the sub-unit, and determining the maximum average resource data in a preset time period as historical resource data of the preset time period.
  • the time period includes a plurality of preset time segments.
  • the acquiring module includes: a third acquiring submodule, configured to acquire, run on the candidate host The resource used by each virtual machine in the preset time period; the first determining sub-module is configured to determine that the sum of the resources used by each virtual machine in the preset time period is the utilized processing of the host in the preset time period. Resource.
  • the obtaining module includes: a fourth acquiring submodule, configured to acquire a total processor resource and a preset utilization threshold of the host, where the total processor resource of the host is the physical of the host The product of the number of cores and the preset constant; the second determining sub-module is configured to determine that the product of the total processor resources of the host and the preset utilization threshold is the available resource data of the candidate host.
  • the third obtaining submodule includes: a second acquiring unit, configured to acquire a virtual processor number of the virtual machine, a total number of virtual processors created by the candidate host, and each preset time period. The average utilization of the virtual processor and the number of physical cores of the candidate host; the third obtaining unit is configured to obtain a ratio of the number of virtual processors of the virtual machine to the total number of virtual processors created by the candidate host; and the fourth acquiring unit, The minimum value between the number of physical cores of the candidate host and the total number of virtual processors created by the candidate host; the ratio obtaining unit is used to calculate the product of the ratio, the average utilization of the virtual processor, and the minimum value; A determining unit is configured to determine a processor resource whose product is a virtual machine for a preset period of time.
  • the time period includes a plurality of preset time segments
  • the comparison module includes: a screening sub-module, configured to filter out candidate hosts that satisfy the condition from the candidate host, wherein the conditions include: The superimposed result of the preset time period does not exceed the available resource data of the host; the third determining sub-module is configured to determine that the candidate host that satisfies the condition is the target host corresponding to the virtual machine.
  • the third determining submodule includes: a fifth obtaining unit, configured to acquire a weight value corresponding to each resource data; and a weighting unit, The weighting result corresponding to the candidate host that satisfies the condition is obtained by weighting the superimposed result according to the weight value; and the second determining unit is configured to determine that the candidate host with the smallest weighting result is the target host corresponding to the virtual machine.
  • the foregoing apparatus further includes: a migration module, configured to compare the superimposed result of each candidate host with the available resource data of each host respectively, and select a virtual one from the candidate host After the host corresponding to the machine, the virtual machine is migrated to the target host corresponding to the virtual machine.
  • a migration module configured to compare the superimposed result of each candidate host with the available resource data of each host respectively, and select a virtual one from the candidate host After the host corresponding to the machine, the virtual machine is migrated to the target host corresponding to the virtual machine.
  • the prediction module includes: a fifth obtaining submodule, configured to acquire an identifier and a specification of the newly created virtual machine; and searching for a submodule, The target virtual machine is searched for the same identifier and/or specification as the newly created virtual machine; and the fourth determining sub-module is configured to determine the predicted result of the target virtual machine as the predicted result of the newly created virtual machine.
  • the apparatus 700 includes:
  • the prediction module 702 is configured to predict processor resources required by the virtual machine in the next time period to obtain a prediction result.
  • the obtaining module 704 is configured to acquire the utilized processor resources and available processor resources of the candidate host.
  • the superimposing module 706 is configured to superimpose the prediction result with the utilized processor resources of each candidate host to obtain an overlay result of each candidate host.
  • the comparison module 708 is configured to compare the superposition result of each candidate host with the available processor resources of each candidate host, and select a target host corresponding to the virtual machine from the candidate hosts.
  • the foregoing prediction module 602, the obtaining module 604, the superimposing module 606, and the matching module 608 correspond to the steps S21 to S27 in Embodiment 1, and the examples and applications implemented by the four modules and corresponding steps.
  • the scene is the same, but is not limited to the content disclosed in the first embodiment. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the prediction module includes: a first obtaining submodule, configured to acquire a preset constant, a physical core number of the host machine, and a preset threshold, wherein the preset threshold is less than 1; the first determining submodule The product used to determine the preset constant, the number of physical cores of the host, and the preset threshold is the available processor resources of the host.
  • the time period includes a plurality of preset time periods
  • the obtaining module includes: a second acquiring sub-module, configured to acquire, for each preset time period, each virtual machine running on the candidate host machine
  • the second determining submodule is configured to determine that the sum of the processor resources of each virtual machine is the utilized processor resource of the candidate host in the preset time period.
  • the second obtaining submodule includes: a first acquiring unit, configured to acquire a virtual processor quantity of the virtual machine, a total number of virtual processors created by the candidate host, and each preset time period. The average utilization of the virtual processor and the number of physical cores of the candidate host; the second obtaining unit is configured to obtain a ratio of the number of virtual processors of the virtual machine to the total number of virtual processors created by the candidate host; and the third obtaining unit, The minimum value between the number of physical cores of the candidate host and the total number of virtual processors created by the candidate host; the ratio obtaining unit is used to calculate the product of the ratio, the average utilization of the virtual processor, and the minimum value; A unit for determining a processor resource whose product is a virtual machine for a preset period of time.
  • a system comprising: a processor; and a memory coupled to the processor for providing the processor with instructions to process the following processing steps:
  • the resource data includes at least one of the following: processor resources, processor contention times, cache miss times, and power consumption utilization; The resource data of the host machine and the available resource data; superimposing the prediction result with the used resource data of each candidate host to obtain a superposition result of each candidate host; respectively The superimposed result of the host is compared with the available resource data of each host, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • Embodiments of the present invention may provide a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
  • the computer terminal may execute the program code of the following steps in the scheduling method of the virtual machine: predicting resource data required by the virtual machine in the next time period, and obtaining a prediction result, where the resource data includes at least one of the following: : processor resources, number of processor contending, number of cache misses, and power consumption utilization; acquiring used resource data and available resource data of the candidate host; superimposing the prediction result with the used resource data of each candidate host Obtaining the superposition result of each candidate host; respectively comparing the superposition result of each candidate host with the available resource data of each host, and selecting the target host corresponding to the virtual machine from the candidate host.
  • FIG. 8 is a structural block diagram of a computer terminal according to Embodiment 6 of the present invention.
  • the computer terminal A can include one or more (only one shown) processor 802, memory 804, and peripheral interface 806.
  • the memory can be used to store software programs and modules, such as the scheduling method of the virtual machine and the program instructions/modules corresponding to the device in the embodiment of the present invention.
  • the processor executes various programs by running software programs and modules stored in the memory. Functional application and data processing, that is, the scheduling method of the above virtual machine is implemented.
  • the memory may include a high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • the memory can further include memory remotely located relative to the processor, which can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the processor may call the memory stored information and the application by the transmitting device to perform the following steps: predicting resource data required by the virtual machine in the next time period to obtain a prediction result, where the resource data includes at least one of the following: processing Resource, processor misses, cache misses, and power consumption; acquire the used resource data and available resource data of the candidate host; superimpose the prediction result with the used resource data of each candidate host to obtain The superposition result of each candidate host; respectively, the superposition result of each candidate host is compared with the available resource data of each host, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • the foregoing processor may further execute the following program code: acquiring a prediction model, where the prediction model is used to represent a correspondence between a prediction result of the virtual machine having different attribute parameters and a preset time period, where the attribute parameters include: The identifier, specification, and application type of the virtual machine; input the attribute parameters of the virtual machine to the prediction model; and receive the prediction result of the virtual machine output by the prediction model.
  • the foregoing processor may further execute the following program code: before inputting the attribute parameter of the virtual machine to the prediction model, the method further includes: obtaining a confidence of the prediction model and a preset confidence threshold; if the prediction If the confidence of the model is greater than or equal to the confidence threshold, the step of inputting the attribute parameter of the virtual machine to the prediction model is entered; if the confidence of the prediction model is less than the confidence threshold, the virtual processor resource and the virtual processor according to the virtual machine Utilization predicts the resource data that the virtual machine needs during the next time period.
  • the foregoing processor may further execute the following program code: acquiring sample data, where the sample data includes attribute information of the plurality of sample virtual machines and historical resource data of the sample virtual machine in a preset time period; Model training is performed to obtain a predictive model.
  • the foregoing processor may further execute the following program code: collecting average resource data of multiple virtual processors of the virtual machine according to a preset sampling time, where the preset time period includes multiple sampling times; determining one The maximum average resource data in the preset time period is historical resource data of the preset time period.
  • the foregoing processor may further execute the following program code: acquire resources used by each virtual machine running on the candidate host in a preset time period; and determine that each virtual machine is used in a preset time period. The sum of the resources is the utilized processor resources of the host for a preset period of time.
  • the foregoing processor may further execute the following program code: obtain a total processor resource of the host and a preset utilization threshold, where the total processor resource of the host is the number of physical cores of the host and the preset The product of the constant; the product of the total processor resource of the host and the preset utilization threshold is determined to be the available resource data of the candidate host.
  • the foregoing processor may further execute the following program code: obtain the virtual processor number of the virtual machine, the total number of virtual processors created by the candidate host, and the average virtual processor utilization rate of each preset time period; The number of physical cores of the candidate host; the ratio of the number of virtual processors of the virtual machine to the total number of virtual processors created by the candidate host; the number of physical cores of the candidate host and the total number of virtual processors created by the candidate host The minimum value; the product of the ratio, the average utilization of the virtual processor, and the minimum value; the processor resource that determines the product to be the virtual machine for a preset period of time.
  • the foregoing processor may further execute the following program code: the time period includes a plurality of preset time segments, and the candidate host that meets the condition is selected from the candidate host, wherein the condition includes: each preset time The superimposed result of the segment does not exceed the available resource data of the host; the candidate host that satisfies the condition is determined to be the target host corresponding to the virtual machine.
  • the foregoing processor may further execute the following program code: if there are multiple candidate hosts satisfying the condition, obtain a weight value corresponding to each resource data; and weight the superimposed result according to the weight value to obtain a satisfaction The weighted result corresponding to the candidate candidate host; the candidate host with the smallest weighted result is the target host corresponding to the virtual machine.
  • the foregoing processor may further execute the following program code: migrating the virtual machine to a target host corresponding to the virtual machine.
  • the foregoing processor may further execute the following program code: when the virtual machine is a newly created virtual machine, obtain the identifier and specification of the newly created virtual machine; and find the identifier of the newly created virtual machine and / or target virtual machine of the same specification; determine the predicted result of the target virtual machine as the predicted result of the newly created virtual machine.
  • the present invention by predicting the resource data used by the scheduling virtual machine in a future period, and determining the candidate resource of the virtual machine to be migrated by using the current used resource data and available resource data of the candidate host.
  • the host that is, the target host is determined, so that the host can be selected more accurately for the virtual machine without requiring each host to reserve resources for the peak of each virtual machine, thereby reducing resource waste and making the virtual machine as uniform as possible.
  • the ground scheduling is distributed on different hosts to achieve a stable load balance of the physical machine.
  • the foregoing embodiment of the present application solves the technical problem that the host needs to reserve resources for the peak of each virtual machine in the prior art, resulting in a large waste of resources.
  • FIG. 8 is only an illustration, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (Mobile Internet Devices, MID). ), PAD and other terminal devices.
  • FIG. 8 does not limit the structure of the above electronic device.
  • the computer terminal may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 8, or have a different configuration than that shown in FIG.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be used to save the program code executed by the scheduling method of the virtual machine provided in Embodiment 1 above.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: predicting resource data required by the virtual machine in a next time period, and obtaining a prediction result, wherein the resource data includes at least the following One: processor resources, number of processor contending, number of cache misses, and power consumption utilization; acquiring used resource data and available resource data of the candidate host; and using the predicted result with the used resources of each candidate host The data is superimposed to obtain the superposition result of each candidate host; the superposition result of each candidate host is compared with the available resource data of each host, and the target host corresponding to the virtual machine is selected from the candidate hosts.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种虚拟机的调度方法和装置。其中,该方法包括:预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果(S21);获取候选宿主机的已利用资源数据和可用资源数据(S23);将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果(S25);分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机(S27)。该方法解决了现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的技术问题。

Description

虚拟机的调度方法和装置
本申请要求2018年04月09日递交的申请号为201810312074.7、发明名称为“虚拟机的调度方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及云计算领域,具体而言,涉及一种虚拟机的调度方法和装置。
背景技术
虚拟机是指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。在创建虚拟机时,需要调度系统为虚拟机分类宿主机,在虚拟机创建之后,还可以更换虚拟机运行的宿主机,这些分配宿主机的过程和更换宿主机的过程都为虚拟机的调度过程。
目前,业内的云计算调度通常使用不同的方法来进行敏感服务和批处理作业的混部调度,以降低互相影响。通过用户画像来归类出应用所属于的类别:计算密集型、内存密集型、存储密集型,从而为不同类型的虚拟机制定不同的调度策略。
但现有的混部调度方案基于批处理应用可以降低优先级的前提,在遇到问题时及时降级,但是虚拟机调度是不具有优先级的,虚拟机创建时都是同等优先级的,并且任何一个迁移对用户都是有一定的影响,因此宿主机需要为每个虚拟机的波峰预留资源,这样势必造成很大的资源浪费。
针对现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种虚拟机的调度方法和装置,以至少解决现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的技术问题。
根据本发明实施例的一个方面,提供了一种虚拟机的调度方法,包括:预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可 用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
根据本发明实施例的另一方面,还提供了一种虚拟机的调度方法,包括:预测虚拟机在下一个时间周期内所需的处理器资源,得到预测结果;获取候选宿主机的已利用处理器资源和可用处理器资源;将预测结果与每个候选宿主机的已利用处理器资源叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个候选宿主机的可用处理器资源进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
根据本发明实施例的另一方面,还提供了一种虚拟机的调度装置,包括:预测模块,用于预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取模块,用于获取候选宿主机的已利用资源数据和可用资源数据;叠加模块,用于将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;比对模块,用于分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
根据本发明实施例的另一方面,还提供了一种虚拟机的调度装置,包括:预测模块,用于预测虚拟机在下一个时间周期内所需的处理器资源,得到预测结果;获取模块,用于获取候选宿主机的已利用处理器资源和可用处理器资源;叠加模块,用于将预测结果与每个候选宿主机的已利用处理器资源叠加,得到每个候选宿主机的叠加结果;比对模块,用于分别将每个候选宿主机的叠加结果与每个候选宿主机的可用处理器资源进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
根据本发明实施例的另一方面,还提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行如下步骤预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
根据本发明实施例的另一方面,还提供了一种处理器,处理器用于运行程序,其中,程序运行时执行如下步骤预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每 个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
根据本发明实施例的另一方面,还提供了一种系统,包括:处理器;以及存储器,与处理器连接,用于为处理器提供处理以下处理步骤的指令:预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
在本发明实施例中,通过预测调度虚拟机在未来一个周期内使用的资源数据,并通过获取的候选宿主机当前的已用资源数据和可用资源数据,来判断应该将虚拟机迁移至哪个候选宿主机,即确定目标宿主机,从而能够较准确的为虚拟机选择宿主机,而无需每个宿主机为每个虚拟机的波峰预留资源,减少了资源的浪费,尽可能地将虚拟机均匀地调度分布在不同宿主机上,以达到实体机的负载平稳均衡。
由此,本申请上述实施例解决了现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的技术问题。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1示出了一种用于实现虚拟机的调度方法的计算机终端(或移动设备)的硬件结构框图;
图2是根据本申请实施例1的一种虚拟机的调度方法的流程图;
图3是根据本申请实施例1的一种虚拟机迁移的示意图;
图4是根据本申请实施例1的一种可选的虚拟机迁移前后宿主机的已利用资源的变化示意图;
图5是根据本申请实施例2的一种虚拟机的调度方法的流程图;
图6是根据本申请实施例3的一种虚拟机的调度装置的示意图;
图7是根据本申请实施例4的一种虚拟机的调度装置的示意图;以及
图8是根据本发明实施例6的一种计算机终端的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本申请实施例进行描述的过程中出现的部分名词或术语适用于如下解释:
虚拟机:是指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。
虚拟机(VM)调度:在创建虚拟机时,需要调度系统为虚拟机分类宿主机,在虚拟机创建之后,还可以更换虚拟机运行的宿主机,这些分配宿主机的过程和更换宿主机的过程都为虚拟机的调度过程。
实施例1
根据本发明实施例,还提供了一种虚拟机的调度方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。图1示出了一种用于实现虚拟机的调度方法的计算机终端(或移动设备)的硬件结构框图。如图1所示,计算机终端10(或移动设备10)可以包括一个或多个(图中采用102a、102b,……,102n来示出)处理器102(处理器102可以包括但不限于微 处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为I/O接口的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
应当注意到的是上述一个或多个处理器102和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到计算机终端10(或移动设备)中的其他元件中的任意一个内。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的虚拟机的调度方法对应的程序指令/数据存储装置,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的虚拟机的调度方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与计算机终端10(或移动设备)的用户界面进行交互。
此处需要说明的是,在一些可选实施例中,上述图1所示的计算机设备(或移动设备)可以包括硬件元件(包括电路)、软件元件(包括存储在计算机可读介质上的计算机代码)、或硬件元件和软件元件两者的结合。应当指出的是,图1仅为特定具体实例 的一个实例,并且旨在示出可存在于上述计算机设备(或移动设备)中的部件的类型。
在上述运行环境下,本申请提供了如图2所示的虚拟机的调度方法的流程图。图2是根据本发明实施例1的虚拟机的调度方法的流程图。
步骤S21,预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率。
具体的,上述虚拟机可以是新创建的虚拟机,也是可需要被迁移的虚拟机,例如,在运行虚拟机的宿主机出现故障,或运行虚拟机的宿主机超负荷的情况下,需要对虚拟机进行迁移,以保证虚拟机的稳定运行。
以上的处理器可以为cpu,cpu资源可以根据cpu利用率来确定,cpu利用率用于cpu被利用的程度,可以使用百分比来表示。对于虚拟机来说,处理器资源为虚拟处理器(vcpu)资源,对于宿主机来说,处理器资源为实体cpu资源。处理器争抢次数是指虚拟机的线程在宿主机的内核等待的时间超过预定时长的次数;缓存未命中次数即为cpu cache miss,用于指虚拟机读取宿主机的缓存时未命中的次数。
在一种可选的实施例中,上是时间周期可以是七天,可以通过获取虚拟机的历史资源数据,来预测虚拟机在下一个时间周期内所需的资源数据。
以企业的应用场景为例,企业为每个员工分配一个虚拟机账户,员工通过账户登录自己的虚拟机办公,在这种情况下,每个员工使用虚拟机的时间、所使用的cpu资源等数据具有一定的规律,因此可以通过虚拟机的历史资源数据确定该虚拟机的资源数据规律,根据得到的规律预测虚拟机在下一个时间周期内所需的资源数据。
步骤S23,获取候选宿主机的已利用资源数据和可用资源数据。
具体的,候选宿主机是允许运行虚拟机的宿主机,可以为多个。仍以企业的应用场景为例,企业的宿主机允许运行企业的每个虚拟机,因此在进行企业虚拟机的调度时,企业的宿主机均为候选宿主机。
候选宿主机的已利用资源数据可以是候选宿主机已利用的cpu资源、cpu争抢次数、缓存未命中次数和/或功耗利用率,其中,候选宿主机已利用的cpu争抢次数、缓存未命中次数和/或功耗利用率可以通过检测得到,候选宿主机已利用的cpu资源可以通过运行在宿主机上的所有虚拟机所使用的vcpu资源来确定。
候选宿主机的可用资源数据是指候选宿主机允许虚拟机使用的资源数据。候选宿主机具有一定的资源数据,可以包括:cpu资源、预定的cpu争抢次数、预定的缓存未命中 次数和预定的功耗利用率。每个资源数据可以具有对应的使用阈值,即允许使用的部分占所有资源数据的比例,例如,预定阈值为80%,则虚拟机可以使用该宿主机所有资源数据的80%。
步骤S25,将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果。
在上述方案中,将预测结果叠加在候选宿主机的已利用资源上,用于预测将虚拟机迁移至候选宿主机后,候选宿主机所需的资源数据。
在一种可选的实施例中,在获取到候选宿主机的已利用资源数据后,分别将虚拟机的预测结果与对应的候选宿主机的资源数据相加,得到叠加结果。更具体的,虚拟机的资源数据包括:虚拟机所需的cpu资源A1、cpu争抢次数B1、缓存未命中次数C1和功耗利用率D1,候选宿主机的已利用资源数据包括:已利用cpu资源A2、cpu争抢次数B2、缓存未命中次数C2和功耗利用率D2,得到的叠加结果为:A1+A2、B1+B2、C1+C2以及D1+D2。
步骤S27,分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
在上述步骤S27中,在一个候选宿主机的叠加结果超过该候选宿主机的可用资源数据的情况下,则可以确定,如果将虚拟机迁移至该候选宿主机上,该候选宿主机并没有足够的资源支持虚拟机运行,可能会导致候选宿主机超负荷;在一个候选宿主机的叠加结果未超过该候选宿主机的可用资源数据的情况下,则可以确定如果将虚拟机迁移至该候选宿主机上,该候选宿主机具有足够的资源支持该虚拟机运行。因此,可以通过将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对的方式,从候选宿主机中筛选出能够支持该虚拟机运行的目标宿主机。
在一种可选的实施例中,结合上一实施例,以一个候选宿主机为例进行示例,候选宿主机的可用资源数据为:可用cpu资源A3、cpu争抢次数B3、缓存未命中次数C3和功耗利用率D3,如果能够满足A1+A2<A3、B1+B2<B3、C1+C2<C3以及D1+D2<D3,则确定该宿主机为目标宿主机,如果上述任意一个条件没有满足,则确认该宿主机不为目标宿主机。
在上述实施例中,首先需要注意的是,该方案通过预测调度虚拟机在未来一个周期内使用的资源数据,并通过获取的候选宿主机当前的已用资源数据和可用资源数据,来判断应该将虚拟机迁移至哪个候选宿主机,即确定目标宿主机,从而能够较准确的为虚 拟机选择宿主机,而无需每个宿主机为每个虚拟机的波峰预留资源,减少了资源的浪费,尽可能地将虚拟机均匀地调度分布在不同宿主机上,以达到实体机的负载平稳均衡。
由此,本申请上述实施例解决了现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的技术问题。
图3是根据本申请实施例1的一种虚拟机迁移的示意图,结合图3所示,NC1和NC2分别为两个宿主机,VM为等待被迁移的虚拟机,需要确定将虚拟机VM迁移至哪个宿主机。
根据上述实施例提供的方案,再结合图3所示可知,将虚拟机VM在未来一个时间周期的预测结果分别叠加在NC1和NC2的已利用资源数据上,再分别与NC1和NC2的可利用资源数据比对,即可确定将虚拟机VM迁移至哪个宿主机。
但为了使预测的更加准确,可以将时间周期分为多个预设时间段,仍结合图3所示,时间箭头表示时间周期内的时间走向,NC1和NC2后的矩形表示NC1和NC2在每个时间段的已利用资源数据,虚拟机VM后的圆形表示虚拟机VM在每个时间段的预测结果,将每个时间段对应的预测结果与NC1和NC2在每个时间段内的已利用资源数据进行叠加,再分别与NC1和NC2的可利用资源数据比对,即可更精确的确定将虚拟机VM迁移至哪个宿主机。
下面就以将时间周期分为多个预设时间段的方式,对虚拟机在未来的一个时间周期内所需的资源数据进行预测进行说明。
作为一种可选的实施例,时间周期包括多个预设时间段,预测虚拟机在下一个时间区间内所需的资源数据,得到预测结果,包括:获取预测模型,其中,预测模型用于表征具有不同属性参数的虚拟机的预测结果与预设时间段的对应关系,属性参数包括:虚拟机的标识、规格和应用类型;将虚拟机的属性参数输入至预测模型;接收预测模型输出的虚拟机的预测结果。
具体的,虚拟机的标识可以为用户Id,即user_id,用户通过user_id以及对应的密码登录虚拟机;虚拟机的规格用于表示虚拟机包括多个vcpu以及具有多少内存;虚拟机的应用类型可以根据虚拟机的用途来确定,应用类型可以为在线服务类(例如:作为网站服务器使用)或离线运算类(例如:进行大数据运算)等。
上述预测模型可以是通过对已有的数据(例如:虚拟机的历史资源数据)进行训练得到的神经网络模型。
上述几个属性参数均为对虚拟机所使用的资源数据具有较大影响的参数,例如:对 于用户标识来说,不同用户对虚拟机具有不同的使用习惯,所使用的资源数据具有较强的个人特点;对于规格来说,不同规格的虚拟机运行时所占用的资源数据相差较大;对于应用类型来说,不同应用类型的虚拟机在运行时所使用的资源数据也具有较大的差异。
因此,上述方案将这几个属性参数作为虚拟机的特征,输入至预测模型,预测模型根据输入数据进行预测,并返回虚拟机的预测结果。
作为一种可选的实施例,在将虚拟机的属性参数输入至预测模型之前,上述方法还包括:获取预测模型的置信度和预设的置信度阈值;如果预测模型的置信度大于或等于置信度阈值,则进入将虚拟机的属性参数输入至预测模型的步骤;如果预测模型的置信度小于置信度阈值,则根据虚拟机的虚拟处理器资源和虚拟处理器利用率预测虚拟机在下一个时间周期内所需的资源数据。
对于具有一定规律的虚拟机,其预测模型具有较高的置信度,因此对于置信度较高的虚拟机,通过其预测模型预测的资源数据的准确度较高;而对于规律不明显的虚拟机,其预测模型的置信度较低,因此对于置信度较低的虚拟机,通过预测模型预测的资源数据的准确度较低。
在上述方案中,预设一个置信度阈值,根据该置信度阈值来确定是否还用预测模型来预测虚拟机的资源数据。
在一种可选的实施例中,虚拟机的预测模型置信度为90%,置信度阈值为85%,则允许使用该虚拟机的预测模型来预测该虚拟机在下一个时间周期内的资源数据。
在另一种可选的实施例中,虚拟机的预测模型置信度为80%,置信度阈值为85%,则确定该虚拟机的预测模型预测的准确度较低,抛弃该预测模型,而使用虚拟机的虚拟处理器资源和虚拟处理器利用率,根据预定的公式,计算虚拟机在下一个时间周期内所需的资源数据。
作为一种可选的实施例,获取预测模型,包括:获取样本数据,其中,样本数据包括多个样本虚拟机的属性信息和样本虚拟机在预设时间段的历史资源数据;根据样本数据进行模型训练,得到预测模型。
具体的,上述预设时间段可以是6个小时,每个时间段连贯但不重合,例如,一天中的0:00~6:00,6:00~12:00,12:00~18:00和18:00~24:00即为这一天中的四个时间段。
样本虚拟机可以是与虚拟机处于相同运行环境的虚拟机,为了保证训练的预测模型的准确性,样本虚拟机的数量可以较多,并在不同属性信息上均有分布。
在一种可选的实施例中,由于用户行为通常跟周有关系,比如工作日利用率高,周末利用率低,因此以一个时间周期为7天为例,如果预设时间段为6个小时,则一个时间周期包括28个时间段。首先挑选样本虚拟机,选择多个不同标识、不同规格以及不同应用类型的虚拟机作为样本虚拟机,然后获取样本虚拟机在一个周期的28个时间段的资源数据,则得到历史资源数据。
然后获取空模型,使用样本数据对空模型进行学习训练,得到训练后的模型。再使用验证数据(包括已知属性信息的虚拟机和虚拟机在不同时间段的历史资源数据)对训练后的模型进行验证,验证通过后得到预测模型。
作为一种可选的实施例,获取预测模型,获取样本虚拟机在预设时间段的历史资源数据,包括:按照预设的采样时间采集虚拟机的多个虚拟处理器的平均资源数据,其中,预设时间段包括多个采样时间;确定一个预设时间段内的最大平均资源数据为预设时间段的历史资源数据。
具体的,上述采集时间可以为5分钟,一个虚拟机的cpu可以具有多个vcpu,因此获取多个vcpu的平均值。
在一种可选的实施例中,对于一个具有4个vcpu,每个vcpu为4核的虚拟机,5分钟采集一次所有核的资源数据,求取16个核的平均值,则得到该虚拟机在该采集点的平均资源数据。如果预设时间段为6小时,即360分钟,则预设时间段包括72个平均资源数据,确定这72个平均资源数据中的最大值为该时间段的历史资源数据。
作为一种可选的实施例,在资源数据为cpu资源的情况下,获取候选宿主机的已利用资源数据,包括:获取运行于候选宿主机上的每个虚拟机在预设时间段所使用的资源;确定每个虚拟机在预设时间段所使用的资源之和为宿主机在预设时间段的已利用处理器资源。
作为一种可选的实施例,获取候选宿主机的可用资源数据,包括:获取宿主机的总处理器资源和预设利用率阈值,其中,宿主机的总处理器资源为宿主机的物理核数量与预设常数的乘积;确定宿主机的总处理器资源和预设利用率阈值的乘积为候选宿主机的可用资源数据。
上述方案提出了一种将处理器资源数值化的方式,具体的,将cpu的资源数值化可以采用如下方式,将宿主机cpu的一个物理核提供的资源作为一个常数x,如果一个宿主机具有y个物理核,则该cpu的资源为x乘以y。在一种可选的实施例中,一个宿主机的cpu包括56个物理核,认为一个物理核提供的资源为100,则该宿主机的cpu利用 资源为5600。
在上述方案中,将cpu资源通过物理核数量与预设常数相乘的方式进行数值化,从而能够通过数值计算的方式对宿主机的资源进行计算。在这种方式中,预设常数可以为100,也即将每个物理核提供的资源作为100份来进行计算。
作为一种可选的实施例,获取运行于宿主机上的每个虚拟机在多个预设时间段所使用的处理器资源,包括:获取虚拟机的虚拟处理器数量、候选宿主机创建的总虚拟处理器数量、每个预设时间段的虚拟处理器平均利用率以及候选宿主机的物理核数量;获取虚拟机的虚拟处理器数量与候选宿主机创建的总虚拟处理器数量的比值;获取候选宿主机的物理核数量与候选宿主机创建的总虚拟处理器数量之间的最小值;求取比值、虚拟处理器平均利用率以及最小值的乘积;确定乘积为虚拟机在预设时间段的处理器资源。
具体的,上述vcpu平均利用率可以从历史数据中获取到,具体可以为:在每个时间段(每个时间段包括多个采样时间)中,多个采样时间对应的平均值中的最大平均值,其中,每个采样时间对应的平均值是虚拟机的所有核在采样时间的利用率平均值。
在一种可选的实施例中,虚拟机的vcpu数量为a,宿主机的总vcpu为b,vcpu的平均利用率为c,宿主机的物理核数量为d,则虚拟机的资源e=(a/b)*c*min(d,b)。更具体的,假设宿主机NC1具有56个物理核,创建出80个vcpu,其中虚拟机VM1具有8个vcpu,VM1的平均cpu利用率为50%,则VM1占用物理核的资源为(8/80)*50*56=280。
表一示出了一种计算宿主机已利用cou资源和可利用cpu资源的方式,结合表一所示,在该示例中,一个时间周期为7天,时间周期包括4个时间段,每个时间段为6小时,4个时间段相连但并不重合,表一仅示出了第一天的前两个时间段的计算方式,其他时间段的计算方式相同,下面结合表一进行具体说明。
先以第一天中的第一个时间段(0~6)对NC1进行说明。NC1具有56个物理核,创建有20个vcpu,分别应用于VM1(4核)、VM2(8核)和VM3(8核)。
VM1在第一个时间段内的vcpu平均利用率为5,则套用上述实施例的公式“e=(a/b)*c*min(d,b)”,可以得到VM1在第一时间段的使用的cpu资源为e1=(4/20)*5*min(56,20)=20。
VM2在第一个时间段内的vcpu平均利用率为20,同样套用公式得到VM2在第一时间段使用的资源为e2=160;VM3在第一个时间段内的vcpu平均利用率为30,同样套用公式得到VM3在第一时间段使用的资源为e3=240。因此NC1在第一时间段的已利用cpu资源为e1+e2+e3=420。在该示例中,预设常数为100,预设利用率阈值为80%,NC1 的总cpu资源为56*100=5600,因此NC1的可利用资源为5600*80%=4060。
NC1在其他时间段的已利用cpu资源和可利用cpu资源,以及NC2在每个时间段的已利用cpu资源和可利用cpu资源均可通过上述方案计算。
表一
Figure PCTCN2019080803-appb-000001
需要说明的是,在上述实施例中,虚拟机在每个时间段的vcpu平均利用率可以通过获取历史资源数据的方式得到,具体为:按照预设的采样时间采集虚拟机所有核的vcpu平均利用率,其中,时间周期中的每个预设时间段包括多个采样时间;确定一个预设时间段内采集到的最大平均利用率为预设时间段的vcpu平均利用率。
图4是根据本申请实施例1的一种可选的虚拟机迁移前后宿主机的已利用资源的变化示意图,结合图4所示,NC1具有56个物理核,cpu资源为5600,已利用资源为3000。NC1创建出80个vcpu(虚拟处理器),VM1包括8个vcup,平均利用率为50%,因此VM1占用宿主机的资源,即VM1所使用的cou资源为8/80*50*56=280。
NC2也具有56个物理核,cpu资源为5600,NC2的cpu平均利用率是10%,则NC2的已利用cpu资源为5600*10%=560。
因此将VM1由NC1迁移至NC2之后,NC1的已利用cpu资源为3000-280=2720, NC2的已利用cpu资源为560+280=840。
作为一种可选的实施例,时间周期包括多个预设时间段,分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的宿主机,包括:从候选宿主机中筛选出满足条件的候选宿主机,其中,该条件包括:每个预设时间段的叠加结果不超过宿主机的可用资源数据;确定满足条件的候选宿主机为虚拟机对应的目标宿主机。
上述方案可以由调度系统的过滤器来执行,通过上述方案,筛选出能够支持虚拟机运行的宿主机。在一个候选宿主机的叠加结果超过该候选宿主机的可用资源数据的情况下,则可以确定如果将虚拟机迁移至该候选宿主机上,该候选宿主机并没有足够的资源支持虚拟机运行,可能会导致候选宿主机超负荷;在一个候选宿主机的叠加结果未超过该候选宿主机的可用资源数据的情况下,则可以确定如果将虚拟机迁移至该候选宿主机上,该候选宿主机具有足够的资源支持虚拟机运行。因此,可以通过将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对的方式,从候选宿主机中筛选出能够支持该虚拟机运行的目标宿主机。
作为一种可选的实施例,在满足条件的候选宿主机为多个的情况下,确定满足条件的候选宿主机为虚拟机对应的宿主机,包括:获取每个资源数据对应权重值;根据权重值对叠加结果进行加权,得到满足条件的候选宿主机对应的加权结果;确定加权结果最小的候选宿主机为虚拟机对应的目标宿主机。
上述方案可以由调度系统的权重器来执行。在通过调度过滤器过滤后仍存在多个候选宿主机,即多个候选宿主机能够支持虚拟机运行的情况下,通过权重器对资源数据中的多种数据进行整合,得到的加权结果能够代表如果将虚拟机迁移至候选宿主机后,候选宿主机的资源使用情况。
在一种可选的实施例中,各个资源数据的权重值由大至小可以按照如下顺序排列:处理器资源、功耗利用率、处理器争抢次数和缓存未命中次数,分为别为50%、30%、10%和10%。结合步骤S25下的实施例继续进行说明,该候选宿主机的叠加结果为:A1+A2、B1+B2、C1+C2以及D1+D2,则该宿主机对应的加权结果为(A1+A2)50%+(B1+B2)10%+(C1+C2)10%+(D1+D2)30%。
上述实施例示出了一个宿主机的加权结果的计算方式,按照这种计算每个满足条件的候选宿主机的加权结果,并选择加权结果最小的候选宿主机作为目标宿主机。
在上述方案中,满足条件的候选宿主机的加权结果,能够说明当将虚拟机迁移至该 宿主机后,该宿主机的资源利用情况,如果加权结果较大,则说明如果将虚拟机迁移至该候选宿主机,该候选宿主机的会被使用较多的资源,负荷较重;如果加权结果较小,则说明如果将虚拟机迁移至该候选宿主机,该候选宿主机的被使用的资源仍然较少,为了保持宿主机的负载均衡,因此将虚拟机迁移至加权结果最小的候选宿主机,即确定加权结果最小的候选宿主机为目标宿主机。
上述方案通过假设将虚拟机迁移至各个满足条件的候选宿主机,来预测如果将虚拟机迁移至各个候选宿主机,各个宿主机的资源利用情况,从而确定目标宿主机。
作为一种可选的实施例,在分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的宿主机之后,上述方法还包括:将虚拟机迁移至虚拟机对应的目标宿主机。
将虚拟机迁移至对应的目标宿主机,目标宿主机能够提供虚拟机运行时所需的资源数据,还能够达到对宿主机均衡负载的目的。
作为一种可选的实施例,在虚拟机为新创建的虚拟机的情况下,预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,包括:获取新创建的虚拟机的标识和/或规格;查找与新创建的虚拟机的标识和规格相同的目标虚拟机;确定目标虚拟机的预测结果为新创建的虚拟机的预测结果。
对于新创建的虚拟机,选择与新创建的虚拟机的标识和规格都相同的虚拟机的预测结果作为新创建的虚拟机的预测结果。
在一种可选实施例中,如果不存在与新创建的虚拟机的标识和规格都相同的目标虚拟机,而存在与新创建的虚拟机的标识相同且规格不同的目标虚拟机,以及规格相同且标识不同的目标虚拟机,则选择与新创建的虚拟机的标识相同的目标虚拟机的预测结果为新创建的虚拟机的预测结果。
实施例2
根据本发明实施例,还提供了一种虚拟机的调度方法的实施例,图5是根据本申请实施例2的一种虚拟机的调度方法的流程图,结合图5所示,该方法包括:
步骤S51,预测虚拟机在下一个时间周期内所需的处理器资源,得到预测结果。
具体的,上述虚拟机可以是新创建的虚拟机,也是可需要被迁移的虚拟机,例如,在运行虚拟机的宿主机出现故障,或运行虚拟机的宿主机超负荷的情况下,需要对虚拟机进行迁移,以保证虚拟机的稳定运行。
在一种可选的实施例中,上是时间周期可以是七天,可以通过获取虚拟机的历史资 源数据,来预测虚拟机在下一个时间周期内所需的资源数据。
步骤S53,获取候选宿主机的已利用处理器资源和可用处理器资源。
具体的,上述候选宿主机的可用处理器资源是指候选宿主机允许虚拟机使用的处理器资源。候选宿主机具有一定的总处理器资源,以及对应的使用阈值,即允许使用的部分占所有资源数据的比例,例如,预定阈值为80%,则虚拟机可以使用该宿主机的总处理器资源的80%。
步骤S55,将预测结果与每个候选宿主机的已利用处理器资源叠加,得到每个候选宿主机的叠加结果。
在上述方案中,将预测结果叠加在候选宿主机的已利用处理器资源上,用于预测将虚拟机迁移至候选宿主机后,候选宿主机所需的处理器资源。
步骤S57,分别将每个候选宿主机的叠加结果与每个候选宿主机的可用处理器资源进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
在上述步骤S57中,在一个候选宿主机的叠加结果超过该候选宿主机的可用处理器资源的情况下,则可以确定,如果将虚拟机迁移至该候选宿主机上,该候选宿主机并没有足够的处理器资源支持虚拟机运行,可能会导致候选宿主机超负荷;在一个候选宿主机的叠加结果未超过该候选宿主机的可用处理器资源的情况下,则可以确定如果将虚拟机迁移至该候选宿主机上,该候选宿主机具有足够的处理器资源支持该虚拟机运行。因此,可以通过将每个候选宿主机的叠加结果与每个宿主机的可用处理器资源进行比对的方式,从候选宿主机中筛选出能够支持该虚拟机运行的目标宿主机。
在上述实施例中,首先需要注意的是,该方案通过预测调度虚拟机在未来一个周期内使用的资源数据,并通过获取的候选宿主机当前的已用处理器资源和可用处理器资源,来判断应该将虚拟机迁移至哪个候选宿主机,即确定目标宿主机,从而能够较准确的为虚拟机选择宿主机,而无需每个宿主机为每个虚拟机的波峰预留资源,减少了资源的浪费,尽可能地将虚拟机均匀地调度分布在不同宿主机上,以达到实体机的负载平稳均衡。
由此,本申请上述实施例解决了现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的技术问题。
作为一种可选的实施例,获取候选宿主机的可用处理器资源,包括:获取预设常数、宿主机的物理核数量以及预设阈值,其中,预设阈值小于1;确定预设常数、宿主机的物理核数量以及预设阈值的乘积为宿主机的可用处理器资源。
上述方案提出了一种将处理器资源数值化的方式,具体的,将cpu的资源数值化可 以采用如下方式,将宿主机cpu的一个物理核提供的资源作为一个常数x,如果一个宿主机具有y个物理核,则该cpu的资源为x乘以y。在一种可选的实施例中,一个宿主机的cpu包括56个物理核,认为一个物理核提供的资源为100,则该宿主机的cpu利用资源为5600。
作为一种可选的实施例,时间周期包括多个预设时间段,获取候选宿主机的已利用处理器资源,包括:获取运行于候选宿主机上的每个虚拟机在预设时间段的处理器资源;确定每个虚拟机的处理器资源之和为候选宿主机在预设时间段的已利用处理器资源。
作为一种可选的实施例,获取运行于候选宿主机上的每个虚拟机在预设时间段的处理器资源,包括:获取虚拟机的虚拟处理器数量、候选宿主机创建的总虚拟处理器数量、每个预设时间段的虚拟处理器平均利用率以及候选宿主机的物理核数量;获取虚拟机的虚拟处理器数量与候选宿主机创建的总虚拟处理器数量的比值;获取候选宿主机的物理核数量与候选宿主机创建的总虚拟处理器数量之间的最小值;求取比值、虚拟处理器平均利用率以及最小值的乘积;确定乘积为虚拟机在预设时间段的处理器资源。
在一种可选的实施例中,虚拟机的vcpu数量为a,宿主机的总vcpu为b,vcpu的平均利用率为c,宿主机的物理核数量为d,则虚拟机的资源e=(a/b)*c*min(d,b)。更具体的,假设宿主机NC1具有56个物理核,创建出80个vcpu,其中虚拟机VM1具有8个vcpu,VM1的平均cpu利用率为50%,则VM1占用物理核的资源为(8/80)*50*56=280。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。
实施例3
根据本发明实施例,还提供了一种用于实施上述拟机的调度方法的虚拟机的调度装 置,如图6所示,该装置600包括:
预测模块602,用于预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率。
获取模块604,用于获取候选宿主机的已利用资源数据和可用资源数据。
叠加模块606,用于将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果。
比对模块608,用于分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
此处需要说明的是,上述预测模块602、获取模块604、叠加模块606和比对模块608对应于实施例1中的步骤S21至步骤S27,四个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
作为一种可选的实施例,时间周期包括多个预设时间段,预测模块包括:第一获取子模块,用于获取预测模型,其中,预测模型用于表征具有不同属性参数的虚拟机的预测结果与预设时间段的对应关系,属性参数包括:虚拟机的标识、规格和应用类型;输入子模块,用于将虚拟机的属性参数输入至预测模型;接收子模块,用于接收预测模型输出的虚拟机的预测结果。
可选的,上述处理器还可以执行如下步骤的程序代码:第二获取子模块,用于在将虚拟机的属性参数输入至预测模型之前,获取预测模型的置信度和预设的置信度阈值;进入子模块,用于如果预测模型的置信度大于或等于置信度阈值,则进入将虚拟机的属性参数输入至预测模型的步骤;预测子模块,用于如果预测模型的置信度小于置信度阈值,则根据虚拟机的虚拟处理器资源和虚拟处理器利用率预测虚拟机在下一个时间周期内所需的资源数据。
作为一种可选的实施例,第一获取子模块包括:第一获取单元,用于获取样本数据,其中,样本数据包括多个样本虚拟机的属性信息和样本虚拟机在预设时间段的历史资源数据;训练单元,用于根据样本数据进行模型训练,得到预测模型。
作为一种可选的实施例,第一获取单元包括:采集子单元,用于按照预设的采样时间采集虚拟机的多个虚拟处理器的平均资源数据,其中,预设时间段包括多个采样时间;确定子单元,用于确定一个预设时间段内的最大平均资源数据为预设时间段的历史资源 数据。
作为一种可选的实施例,时间周期包括多个预设时间段,在资源数据为处理器资源的情况下,获取模块包括:第三获取子模块,用于获取运行于候选宿主机上的每个虚拟机在预设时间段所使用的资源;第一确定子模块,用于确定每个虚拟机在预设时间段所使用的资源之和为宿主机在预设时间段的已利用处理器资源。
作为一种可选的实施例,获取模块包括:第四获取子模块,用于获取宿主机的总处理器资源和预设利用率阈值,其中,宿主机的总处理器资源为宿主机的物理核数量与预设常数的乘积;第二确定子模块,用于确定宿主机的总处理器资源和预设利用率阈值的乘积为候选宿主机的可用资源数据。
作为一种可选的实施例,第三获取子模块包括:第二获取单元,用于获取虚拟机的虚拟处理器数量、候选宿主机创建的总虚拟处理器数量、每个预设时间段的虚拟处理器平均利用率以及候选宿主机的物理核数量;第三获取单元,用于获取虚拟机的虚拟处理器数量与候选宿主机创建的总虚拟处理器数量的比值;第四获取单元,用于获取候选宿主机的物理核数量与候选宿主机创建的总虚拟处理器数量之间的最小值;比值求取单元,用于求取比值、虚拟处理器平均利用率以及最小值的乘积;第一确定单元,用于确定乘积为虚拟机在预设时间段的处理器资源。
作为一种可选的实施例,时间周期包括多个预设时间段,比对模块包括:筛选子模块,用于从候选宿主机中筛选出满足条件的候选宿主机,其中,条件包括:每个预设时间段的叠加结果不超过宿主机的可用资源数据;第三确定子模块,用于确定满足条件的候选宿主机为虚拟机对应的目标宿主机。
作为一种可选的实施例,在满足条件的候选宿主机为多个的情况下,第三确定子模块包括:第五获取单元,用于获取每个资源数据对应权重值;加权单元,用于根据权重值对叠加结果进行加权,得到满足条件的候选宿主机对应的加权结果;第二确定单元,用于确定加权结果最小的候选宿主机为虚拟机对应的目标宿主机。
作为一种可选的实施例,上述装置还包括:迁移模块,用于在分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的宿主机之后,将虚拟机迁移至虚拟机对应的目标宿主机。
作为一种可选的实施例,在虚拟机为新创建的虚拟机的情况下,预测模块包括:第五获取子模块,用于获取新创建的虚拟机的标识和规格;查找子模块,用于查找与新创建的虚拟机的标识和/或规格相同的目标虚拟机;第四确定子模块,用于确定目标虚拟机 的预测结果为新创建的虚拟机的预测结果。
实施例4
根据本发明实施例,还提供了一种用于实施上述拟机的调度方法的虚拟机的调度装置,如图7所示,该装置700包括:
预测模块702,用于预测虚拟机在下一个时间周期内所需的处理器资源,得到预测结果。
获取模块704,用于获取候选宿主机的已利用处理器资源和可用处理器资源。
叠加模块706,用于将预测结果与每个候选宿主机的已利用处理器资源叠加,得到每个候选宿主机的叠加结果。
比对模块708,用于分别将每个候选宿主机的叠加结果与每个候选宿主机的可用处理器资源进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
此处需要说明的是,上述预测模块602、获取模块604、叠加模块606和比对模块608对应于实施例1中的步骤S21至步骤S27,四个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
作为一种可选的实施例,预测模块包括:第一获取子模块,用于获取预设常数、宿主机的物理核数量以及预设阈值,其中,预设阈值小于1;第一确定子模块,用于确定预设常数、宿主机的物理核数量以及预设阈值的乘积为宿主机的可用处理器资源。
作为一种可选的实施例,时间周期包括多个预设时间段,获取模块包括:第二获取子模块,用于获取运行于候选宿主机上的每个虚拟机在预设时间段的处理器资源;第二确定子模块,用于确定每个虚拟机的处理器资源之和为候选宿主机在预设时间段的已利用处理器资源。
作为一种可选的实施例,第二获取子模块包括:第一获取单元,用于获取虚拟机的虚拟处理器数量、候选宿主机创建的总虚拟处理器数量、每个预设时间段的虚拟处理器平均利用率以及候选宿主机的物理核数量;第二获取单元,用于获取虚拟机的虚拟处理器数量与候选宿主机创建的总虚拟处理器数量的比值;第三获取单元,用于获取候选宿主机的物理核数量与候选宿主机创建的总虚拟处理器数量之间的最小值;比值求取单元,用于求取比值、虚拟处理器平均利用率以及最小值的乘积;确定单元,用于确定乘积为虚拟机在预设时间段的处理器资源。
实施例5
根据本发明实施例,还提供了一种系统,包括:处理器;以及存储器,与所述处理器连接,用于为所述处理器提供处理以下处理步骤的指令:
预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将所述预测结果与每个候选宿主机的所述已利用资源数据叠加,得到所述每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
实施例6
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行虚拟机的调度方法中以下步骤的程序代码:预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
可选地,图8是根据本发明实施例6的一种计算机终端的结构框图。如图8所示,该计算机终端A可以包括:一个或多个(图中仅示出一个)处理器802、存储器804、以及外设接口806。
其中,存储器可用于存储软件程序以及模块,如本发明实施例中的虚拟机的调度方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的虚拟机的调度方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端A。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
可选的,上述处理器还可以执行如下步骤的程序代码:获取预测模型,其中,预测模型用于表征具有不同属性参数的虚拟机的预测结果与预设时间段的对应关系,属性参数包括:虚拟机的标识、规格和应用类型;将虚拟机的属性参数输入至预测模型;接收预测模型输出的虚拟机的预测结果。
可选的,上述处理器还可以执行如下步骤的程序代码:在将虚拟机的属性参数输入至预测模型之前,上述方法还包括:获取预测模型的置信度和预设的置信度阈值;如果预测模型的置信度大于或等于置信度阈值,则进入将虚拟机的属性参数输入至预测模型的步骤;如果预测模型的置信度小于置信度阈值,则根据虚拟机的虚拟处理器资源和虚拟处理器利用率预测虚拟机在下一个时间周期内所需的资源数据。
可选的,上述处理器还可以执行如下步骤的程序代码:获取样本数据,其中,样本数据包括多个样本虚拟机的属性信息和样本虚拟机在预设时间段的历史资源数据;根据样本数据进行模型训练,得到预测模型。
可选的,上述处理器还可以执行如下步骤的程序代码:按照预设的采样时间采集虚拟机的多个虚拟处理器的平均资源数据,其中,预设时间段包括多个采样时间;确定一个预设时间段内的最大平均资源数据为预设时间段的历史资源数据。
可选的,上述处理器还可以执行如下步骤的程序代码:获取运行于候选宿主机上的每个虚拟机在预设时间段所使用的资源;确定每个虚拟机在预设时间段所使用的资源之和为宿主机在预设时间段的已利用处理器资源。
可选的,上述处理器还可以执行如下步骤的程序代码:获取宿主机的总处理器资源和预设利用率阈值,其中,宿主机的总处理器资源为宿主机的物理核数量与预设常数的乘积;确定宿主机的总处理器资源和预设利用率阈值的乘积为候选宿主机的可用资源数据。
可选的,上述处理器还可以执行如下步骤的程序代码:获取虚拟机的虚拟处理器数量、候选宿主机创建的总虚拟处理器数量、每个预设时间段的虚拟处理器平均利用率以 及候选宿主机的物理核数量;获取虚拟机的虚拟处理器数量与候选宿主机创建的总虚拟处理器数量的比值;获取候选宿主机的物理核数量与候选宿主机创建的总虚拟处理器数量之间的最小值;求取比值、虚拟处理器平均利用率以及最小值的乘积;确定乘积为虚拟机在预设时间段的处理器资源。
可选的,上述处理器还可以执行如下步骤的程序代码:时间周期包括多个预设时间段,从候选宿主机中筛选出满足条件的候选宿主机,其中,条件包括:每个预设时间段的叠加结果不超过宿主机的可用资源数据;确定满足条件的候选宿主机为虚拟机对应的目标宿主机。
可选的,上述处理器还可以执行如下步骤的程序代码:在满足条件的候选宿主机为多个的情况下,获取每个资源数据对应权重值;根据权重值对叠加结果进行加权,得到满足条件的候选宿主机对应的加权结果;确定加权结果最小的候选宿主机为虚拟机对应的目标宿主机。
可选的,上述处理器还可以执行如下步骤的程序代码:将虚拟机迁移至虚拟机对应的目标宿主机。
可选的,上述处理器还可以执行如下步骤的程序代码:在虚拟机为新创建的虚拟机的情况下,获取新创建的虚拟机的标识和规格;查找与新创建的虚拟机的标识和/或规格相同的目标虚拟机;确定目标虚拟机的预测结果为新创建的虚拟机的预测结果。
采用本发明实施例,通过预测调度虚拟机在未来一个周期内使用的资源数据,并通过获取的候选宿主机当前的已用资源数据和可用资源数据,来判断应该将虚拟机迁移至哪个候选宿主机,即确定目标宿主机,从而能够较准确的为虚拟机选择宿主机,而无需每个宿主机为每个虚拟机的波峰预留资源,减少了资源的浪费,尽可能地将虚拟机均匀地调度分布在不同宿主机上,以达到实体机的负载平稳均衡。
由此,本申请上述实施例解决了现有技术中宿主机需要为每个虚拟机的波峰预留资源,导致存在较大的资源浪费的技术问题。
本领域普通技术人员可以理解,图8所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图8其并不对上述电子装置的结构造成限定。例如,计算机终端还可包括比图8中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图8所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通 过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
实施例7
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的虚拟机的调度方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将预测结果与每个候选宿主机的已利用资源数据叠加,得到每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从候选宿主机中选择虚拟机对应的目标宿主机。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (21)

  1. 一种虚拟机的调度方法,其特征在于,包括:
    预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;
    获取候选宿主机的已利用资源数据和可用资源数据;
    将所述预测结果与每个候选宿主机的所述已利用资源数据叠加,得到所述每个候选宿主机的叠加结果;
    分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
  2. 根据权利要求1所述的方法,其特征在于,所述时间周期包括多个预设时间段,预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,包括:
    获取预测模型,其中,所述预测模型用于表征具有不同属性参数的虚拟机的预测结果与所述预设时间段的对应关系,所述属性参数包括:所述虚拟机的标识、规格和应用类型;
    将所述虚拟机的属性参数输入至所述预测模型;
    接收所述预测模型输出的所述虚拟机的预测结果。
  3. 根据权利要求2所述的方法,其特征在于,在将所述虚拟机的属性参数输入至所述预测模型之前,所述方法还包括:
    获取所述预测模型的置信度和预设的置信度阈值;
    如果所述预测模型的置信度大于或等于所述置信度阈值,则进入将所述虚拟机的属性参数输入至所述预测模型的步骤;
    如果所述预测模型的置信度小于所述置信度阈值,则根据所述虚拟机的虚拟处理器资源和虚拟处理器利用率预测所述虚拟机在下一个时间周期内所需的资源数据。
  4. 根据权利要求2所述的方法,其特征在于,获取预测模型,包括:
    获取样本数据,其中,所述样本数据包括多个样本虚拟机的属性信息和所述样本虚拟机在所述预设时间段的历史资源数据;
    根据所述样本数据进行模型训练,得到所述预测模型。
  5. 根据权利要求4所述的方法,其特征在于,获取所述样本虚拟机在预设时间段的历史资源数据,包括:
    按照预设的采样时间采集所述虚拟机的多个虚拟处理器的平均资源数据,其中,所 述预设时间段包括多个采样时间;
    确定一个预设时间段内的最大平均资源数据为所述预设时间段的历史资源数据。
  6. 根据权利要求1所述的方法,其特征在于,所述时间周期包括多个预设时间段,在所述资源数据为所述处理器资源的情况下,获取候选宿主机的已利用资源数据,包括:
    获取运行于所述候选宿主机上的每个虚拟机在所述预设时间段所使用的资源;
    确定所述每个虚拟机在所述预设时间段所使用的资源之和为所述宿主机在所述预设时间段的已利用处理器资源。
  7. 根据权利要求6所述的方法,其特征在于,获取候选宿主机的可用资源数据,包括:
    获取所述宿主机的总处理器资源和预设利用率阈值,其中,所述宿主机的总处理器资源为所述宿主机的物理核数量与预设常数的乘积;
    确定所述宿主机的总处理器资源和所述预设利用率阈值的乘积为所述候选宿主机的可用资源数据。
  8. 根据权利要求6所述的方法,其特征在于,获取运行于所述宿主机上的每个虚拟机在所述预设时间段所使用的处理器资源,包括:
    获取虚拟机的虚拟处理器数量、所述候选宿主机创建的总虚拟处理器数量、每个所述预设时间段的虚拟处理器平均利用率以及所述候选宿主机的物理核数量;
    获取虚拟机的虚拟处理器数量与所述候选宿主机创建的总虚拟处理器数量的比值;
    获取所述候选宿主机的物理核数量与所述候选宿主机创建的总虚拟处理器数量之间的最小值;
    求取所述比值、所述虚拟处理器平均利用率以及所述最小值的乘积;
    确定所述乘积为所述虚拟机在所述预设时间段的处理器资源。
  9. 根据权利要求1所述的方法,其特征在于,所述时间周期包括多个预设时间段,分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的宿主机,包括:
    从所述候选宿主机中筛选出满足条件的候选宿主机,其中,所述条件包括:每个所述预设时间段的所述叠加结果不超过所述宿主机的可用资源数据;
    确定满足所述条件的候选宿主机为所述虚拟机对应的目标宿主机。
  10. 根据权利要求9所述的方法,其特征在于,在满足条件的候选宿主机为多个的情况下,确定满足所述条件的候选宿主机为所述虚拟机对应的宿主机,包括:
    获取每个资源数据对应权重值;
    根据所述权重值对所述叠加结果进行加权,得到所述满足条件的候选宿主机对应的加权结果;
    确定加权结果最小的候选宿主机为所述虚拟机对应的目标宿主机。
  11. 根据权利要求1所述的方法,其特征在于,在分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的宿主机之后,所述方法还包括:将所述虚拟机迁移至所述虚拟机对应的所述目标宿主机。
  12. 根据权利要求2所述的方法,其特征在于,在所述虚拟机为新创建的虚拟机的情况下,预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,包括:
    获取所述新创建的虚拟机的标识和规格;
    查找与所述新创建的虚拟机的标识和/或规格相同的目标虚拟机;
    确定所述目标虚拟机的预测结果为所述新创建的虚拟机的预测结果。
  13. 一种虚拟机的调度方法,其特征在于,包括:
    预测虚拟机在下一个时间周期内所需的处理器资源,得到预测结果;
    获取候选宿主机的已利用处理器资源和可用处理器资源;
    将所述预测结果与每个候选宿主机的已利用处理器资源叠加,得到所述每个候选宿主机的叠加结果;
    分别将所述每个候选宿主机的叠加结果与所述每个候选宿主机的可用处理器资源进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
  14. 根据权利要求13所述的方法,其特征在于,获取候选宿主机的可用处理器资源,包括:
    获取预设常数、所述宿主机的物理核数量以及预设阈值,其中,所述预设阈值小于1;
    确定所述预设常数、所述宿主机的物理核数量以及所述预设阈值的乘积为所述宿主机的可用处理器资源。
  15. 根据权利要求14所述的方法,其特征在于,所述时间周期包括多个预设时间段,获取候选宿主机的已利用处理器资源,包括:
    获取运行于所述候选宿主机上的每个虚拟机在所述预设时间段的处理器资源;
    确定所述每个虚拟机的处理器资源之和为所述候选宿主机在所述预设时间段的已利用处理器资源。
  16. 根据权利要求15所述的方法,其特征在于,获取运行于所述候选宿主机上的每个虚拟机在所述预设时间段的处理器资源,包括:
    获取虚拟机的虚拟处理器数量、所述候选宿主机创建的总虚拟处理器数量、每个所述预设时间段的虚拟处理器平均利用率以及所述候选宿主机的物理核数量;
    获取虚拟机的虚拟处理器数量与所述候选宿主机创建的总虚拟处理器数量的比值;
    获取所述候选宿主机的物理核数量与所述候选宿主机创建的总虚拟处理器数量之间的最小值;
    求取所述比值、所述虚拟处理器平均利用率以及所述最小值的乘积;
    确定所述乘积为所述虚拟机在所述预设时间段的处理器资源。
  17. 一种虚拟机的调度装置,其特征在于,包括:
    预测模块,用于预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;
    获取模块,用于获取候选宿主机的已利用资源数据和可用资源数据;
    叠加模块,用于将所述预测结果与每个候选宿主机的所述已利用资源数据叠加,得到所述每个候选宿主机的叠加结果;
    比对模块,用于分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
  18. 一种虚拟机的调度装置,其特征在于,包括:
    预测模块,用于预测虚拟机在下一个时间周期内所需的处理器资源,得到预测结果;
    获取模块,用于获取候选宿主机的已利用处理器资源和可用处理器资源;
    叠加模块,用于将所述预测结果与每个候选宿主机的已利用处理器资源叠加,得到所述每个候选宿主机的叠加结果;
    比对模块,用于分别将所述每个候选宿主机的叠加结果与所述每个候选宿主机的可用处理器资源进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
  19. 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行如下步骤预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将所述预测结果与每个候选宿主机的所述已利用资源数据叠加,得到所述每个 候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
  20. 一种处理器,其特征在于,所述处理器用于运行程序,其中,所述程序运行时执行如下步骤预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;获取候选宿主机的已利用资源数据和可用资源数据;将所述预测结果与每个候选宿主机的所述已利用资源数据叠加,得到所述每个候选宿主机的叠加结果;分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
  21. 一种系统,其特征在于,包括:
    处理器;以及
    存储器,与所述处理器连接,用于为所述处理器提供处理以下处理步骤的指令:
    预测虚拟机在下一个时间周期内所需的资源数据,得到预测结果,其中,资源数据包括如下至少一项:处理器资源、处理器争抢次数、缓存未命中次数和功耗利用率;
    获取候选宿主机的已利用资源数据和可用资源数据;
    将所述预测结果与每个候选宿主机的所述已利用资源数据叠加,得到所述每个候选宿主机的叠加结果;
    分别将每个候选宿主机的叠加结果与每个宿主机的可用资源数据进行比对,从所述候选宿主机中选择所述虚拟机对应的目标宿主机。
PCT/CN2019/080803 2018-04-09 2019-04-01 虚拟机的调度方法和装置 WO2019196692A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
SG11202009363RA SG11202009363RA (en) 2018-04-09 2019-04-01 Virtual machine scheduling method and apparatus
EP19784797.3A EP3779687A4 (en) 2018-04-09 2019-04-01 VIRTUAL MACHINE PLANNING PROCESS AND DEVICE
JP2020555183A JP7304887B2 (ja) 2018-04-09 2019-04-01 仮想マシンスケジューリング方法および装置
US17/066,328 US20210034407A1 (en) 2018-04-09 2020-10-08 Virtual Machine Scheduling Method and Apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810312074.7A CN110362377B (zh) 2018-04-09 2018-04-09 虚拟机的调度方法和装置
CN201810312074.7 2018-04-09

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/066,328 Continuation US20210034407A1 (en) 2018-04-09 2020-10-08 Virtual Machine Scheduling Method and Apparatus

Publications (1)

Publication Number Publication Date
WO2019196692A1 true WO2019196692A1 (zh) 2019-10-17

Family

ID=68162743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/080803 WO2019196692A1 (zh) 2018-04-09 2019-04-01 虚拟机的调度方法和装置

Country Status (6)

Country Link
US (1) US20210034407A1 (zh)
EP (1) EP3779687A4 (zh)
JP (1) JP7304887B2 (zh)
CN (1) CN110362377B (zh)
SG (1) SG11202009363RA (zh)
WO (1) WO2019196692A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032098A (zh) * 2021-03-25 2021-06-25 深信服科技股份有限公司 一种虚拟机调度方法、装置、设备及可读存储介质
CN113296870A (zh) * 2020-04-07 2021-08-24 阿里巴巴集团控股有限公司 预测Kubernetes集群配置的方法以及装置
CN115016949A (zh) * 2022-08-09 2022-09-06 中智关爱通(南京)信息科技有限公司 为客户机选择宿主机的方法、计算设备和计算机介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11449776B2 (en) * 2019-03-06 2022-09-20 Micro Focus Lcc Topology-based migration assessment
CN111143245B (zh) * 2019-11-15 2021-07-13 海光信息技术股份有限公司 一种缓存数据处理方法、电路、处理器及芯片
CN111240795A (zh) * 2019-12-29 2020-06-05 的卢技术有限公司 一种虚拟化办公平台的构建方法及系统
CN111158861A (zh) * 2019-12-31 2020-05-15 联想(北京)有限公司 一种选择虚拟机运行环境的方法、设备及存储介质
US11829792B1 (en) * 2020-09-21 2023-11-28 Amazon Technologies, Inc. In-place live migration of compute instances for efficient host domain patching
CN113672392B (zh) * 2021-08-25 2023-07-25 国家电网有限公司信息通信分公司 能耗优化的方法及装置、电子设备及计算机可读存储介质
CN113722100B (zh) * 2021-09-02 2023-12-15 上海仪电(集团)有限公司中央研究院 基于趋势预测的云平台内存资源动态超分配方法及设备
US20230245075A1 (en) * 2022-02-03 2023-08-03 Salesforce.Com, Inc. Precomputing user time resource utilization for querying for appointment distribution
CN114579305B (zh) * 2022-02-28 2023-09-15 北京百度网讯科技有限公司 用于函数计算的资源控制方法、装置、设备和介质
CN117234742B (zh) * 2023-11-14 2024-02-09 苏州元脑智能科技有限公司 一种处理器核心分配方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885831A (zh) * 2012-12-19 2014-06-25 中国电信股份有限公司 虚拟机宿主机的选择方法与装置
CN104424013A (zh) * 2013-08-26 2015-03-18 国际商业机器公司 在计算环境中部署虚拟机的方法和设备
CN105893113A (zh) * 2016-03-29 2016-08-24 上海携程商务有限公司 虚拟机的管理系统及管理方法
CN106933649A (zh) * 2016-12-21 2017-07-07 华南师范大学 基于移动平均和神经网络的虚拟机负载预测方法及系统
CN107038064A (zh) * 2017-04-18 2017-08-11 腾讯科技(深圳)有限公司 虚拟机管理方法及装置、存储介质

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8826292B2 (en) * 2010-08-06 2014-09-02 Red Hat Israel, Ltd. Migrating virtual machines based on level of resource sharing and expected load per resource on candidate target host machines
CN102236582B (zh) * 2011-07-15 2013-06-05 浙江大学 虚拟化集群负载在多台物理机中均衡分配的方法
US9152443B2 (en) * 2012-07-13 2015-10-06 Ca, Inc. System and method for automated assignment of virtual machines and physical machines to hosts with right-sizing
US9762506B2 (en) * 2013-02-06 2017-09-12 Hitachi, Ltd. Virtual guest management system and virtual guest management method
JP2015011569A (ja) * 2013-06-28 2015-01-19 株式会社東芝 仮想マシン管理装置、仮想マシン管理方法、及び仮想マシン管理プログラム
CN105378667B (zh) * 2013-12-10 2018-09-28 华为技术有限公司 一种虚拟机资源的调度方法和装置
US9817690B2 (en) * 2015-09-11 2017-11-14 International Business Machines Corporation Predictively provisioning cloud computing resources for virtual machines
US10216599B2 (en) * 2016-05-26 2019-02-26 International Business Machines Corporation Comprehensive testing of computer hardware configurations
US20200034167A1 (en) * 2016-08-10 2020-01-30 Nutanix, Inc. Automatic application migration across virtualization environments
US10909503B1 (en) * 2016-11-08 2021-02-02 EMC IP Holding Company LLC Snapshots to train prediction models and improve workflow execution
US11748610B1 (en) * 2017-11-22 2023-09-05 Amazon Technologies, Inc. Building sequence to sequence (S2S) models using previously generated S2S models with similar use cases
US10831591B2 (en) * 2018-01-11 2020-11-10 Commvault Systems, Inc. Remedial action based on maintaining process awareness in data storage management
GB201805302D0 (en) * 2018-03-29 2018-05-16 Benevolentai Tech Limited Ensemble Model Creation And Selection
US10819584B2 (en) * 2018-05-03 2020-10-27 Servicenow, Inc. System and method for performing actions based on future predicted metric values generated from time-series data
US10929165B2 (en) * 2018-07-31 2021-02-23 Nutanix, Inc. System and method for memory resizing in a virtual computing environment
US11861405B2 (en) * 2020-04-29 2024-01-02 Kyndryl, Inc. Multi-cluster container orchestration
US20220091874A1 (en) * 2020-09-24 2022-03-24 INDIAN INSTITUTE OF TECHNOLOGY MADRAS (IIT Madras) Method for optimizing the load balance in the cluster and framework thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885831A (zh) * 2012-12-19 2014-06-25 中国电信股份有限公司 虚拟机宿主机的选择方法与装置
CN104424013A (zh) * 2013-08-26 2015-03-18 国际商业机器公司 在计算环境中部署虚拟机的方法和设备
CN105893113A (zh) * 2016-03-29 2016-08-24 上海携程商务有限公司 虚拟机的管理系统及管理方法
CN106933649A (zh) * 2016-12-21 2017-07-07 华南师范大学 基于移动平均和神经网络的虚拟机负载预测方法及系统
CN107038064A (zh) * 2017-04-18 2017-08-11 腾讯科技(深圳)有限公司 虚拟机管理方法及装置、存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3779687A4

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296870A (zh) * 2020-04-07 2021-08-24 阿里巴巴集团控股有限公司 预测Kubernetes集群配置的方法以及装置
CN113296870B (zh) * 2020-04-07 2024-03-08 阿里巴巴集团控股有限公司 预测Kubernetes集群配置的方法以及装置
CN113032098A (zh) * 2021-03-25 2021-06-25 深信服科技股份有限公司 一种虚拟机调度方法、装置、设备及可读存储介质
CN113032098B (zh) * 2021-03-25 2024-04-09 深信服科技股份有限公司 一种虚拟机调度方法、装置、设备及可读存储介质
CN115016949A (zh) * 2022-08-09 2022-09-06 中智关爱通(南京)信息科技有限公司 为客户机选择宿主机的方法、计算设备和计算机介质

Also Published As

Publication number Publication date
JP2021521518A (ja) 2021-08-26
SG11202009363RA (en) 2020-10-29
JP7304887B2 (ja) 2023-07-07
CN110362377B (zh) 2023-05-30
EP3779687A1 (en) 2021-02-17
EP3779687A4 (en) 2021-12-15
CN110362377A (zh) 2019-10-22
US20210034407A1 (en) 2021-02-04

Similar Documents

Publication Publication Date Title
WO2019196692A1 (zh) 虚拟机的调度方法和装置
Pham et al. A cost-and performance-effective approach for task scheduling based on collaboration between cloud and fog computing
CN109783237B (zh) 一种资源配置方法及装置
US10019167B2 (en) Non-Uniform Memory Access (NUMA) resource assignment and re-evaluation
CN104102543B (zh) 一种云计算环境中负载调整的方法和装置
US7979864B2 (en) Apparatus for setting used license of executing job into unused license state and allocating the set unused license to a to be executed job based on priority
US10620959B2 (en) Optimized multi-processor instruction scheduler
CN110795203A (zh) 资源调度方法、装置、系统和计算设备
WO2017011282A1 (en) Method and device for computing resource scheduling
US11782769B2 (en) Virtual machine scheduling method and system
US10305974B2 (en) Ranking system
WO2022179486A1 (zh) 多核处理器任务调度方法、装置及设备、存储介质
CN109144658A (zh) 有限资源的负载均衡方法、装置及电子设备
CN112395075A (zh) 资源的处理方法、装置以及资源调度系统
CN111475251A (zh) 一种集群容器调度方法、系统、终端及存储介质
CN108874534B (zh) 一种pcpu资源的调度方法和装置
CN115952054A (zh) 一种仿真任务资源管理方法、装置、设备及介质
CN110691362B (zh) 站址确定方法及装置
CN116795524A (zh) 任务处理方法、装置、计算机设备、存储介质及程序产品
Liu et al. An optimized speculative execution strategy based on local data prediction in a heterogeneous hadoop environment
CN114385342A (zh) 容器云过载保护方法和装置、计算机装置和存储介质
CN107291500B (zh) 启动进程的数据分配方法及装置
CN114598705B (zh) 消息负载均衡方法、装置、设备和介质
CN116627629A (zh) 虚拟机集群资源负载均衡管理方法、系统、终端及介质
CN114968493B (zh) 虚拟机调度方法、装置、计算机可读介质及电子设备

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020555183

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019784797

Country of ref document: EP

Effective date: 20201109