WO2018006864A1 - 创建虚拟机的方法、装置及系统、控制设备和存储介质 - Google Patents

创建虚拟机的方法、装置及系统、控制设备和存储介质 Download PDF

Info

Publication number
WO2018006864A1
WO2018006864A1 PCT/CN2017/092197 CN2017092197W WO2018006864A1 WO 2018006864 A1 WO2018006864 A1 WO 2018006864A1 CN 2017092197 W CN2017092197 W CN 2017092197W WO 2018006864 A1 WO2018006864 A1 WO 2018006864A1
Authority
WO
WIPO (PCT)
Prior art keywords
host
virtual machine
candidate
priority
hosts
Prior art date
Application number
PCT/CN2017/092197
Other languages
English (en)
French (fr)
Inventor
李德铠
陈煜东
周维跃
王旻
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2018006864A1 publication Critical patent/WO2018006864A1/zh
Priority to US15/962,678 priority Critical patent/US10642641B2/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/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • 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
    • 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/45595Network integration; Enabling network access in virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Definitions

  • the present application relates to the field of cloud technologies, and in particular, to a method, an apparatus, and a system for creating a virtual machine.
  • a cloud computing system usually includes a control device and a large number of hosts.
  • the control device can simulate the creation of one or more virtual machines on a host computer through virtual machine software, and these virtual machines work like real computers.
  • the host selected only considering the resource requirements of the virtual machine and the hardware resources of the current host does not consider other virtual machines being created on the host, and other virtual machines occupying the hardware resources of the host may cause The virtual machine creation failed.
  • the embodiment of the present application provides a method for creating a virtual machine, which selects a host machine for a virtual machine to be created from multiple aspects, thereby improving the success rate of virtual machine creation.
  • the embodiments of the present application also provide corresponding devices and systems.
  • the first aspect of the present application provides a method for creating a virtual machine, where the method is applied to a system having multiple hosts, each host having attribute information, and the method includes:
  • a second aspect of the present application provides an apparatus for creating a virtual machine, the apparatus being applied to a system having a plurality of hosts, each host having attribute information, the apparatus comprising:
  • a receiving unit configured to receive a virtual machine creation request
  • a filtering unit configured to select at least one candidate host from the plurality of hosts according to the virtual machine creation request and the attribute information
  • a determining unit configured to determine a target host from the at least one candidate host according to a priority of each candidate host
  • a virtual machine creating unit configured to create the virtual machine on the target host.
  • a third aspect of the present application provides a control device, where the control device includes multiple devices for creating a virtual machine as described in the second aspect;
  • the plurality of devices that create the virtual machine execute a plurality of the virtual machine creation requests in parallel, and create a corresponding virtual machine for each virtual machine creation request.
  • a fourth aspect of the present application provides a cloud computing system, including the control device and the multiple hosts in the third aspect.
  • the fifth aspect of the present application provides an apparatus for creating a virtual machine, including:
  • One or more processors are One or more processors.
  • a memory storing program instructions that, when executed by the one or more processors, configure the apparatus to perform the method of creating a virtual machine of the present application.
  • a sixth aspect of the present application provides a computer readable storage medium comprising instructions for performing a method of creating a virtual machine of the present application when the instruction is run on a processor of a computing device.
  • the method for creating a virtual machine not only considers that the host function can be used for the virtual machine to be created, but also considers the hardware resources that can be provided by the host machine.
  • the hardware resources provided also consider the other aspects of the virtual machine to be created, and select the host for the virtual machine to be created from multiple aspects, thereby improving the success rate of the virtual machine creation.
  • FIG. 1 is a schematic structural view of a host machine in an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a cloud computing system in an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a control device in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a method for creating a virtual machine in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an example of a filtering process in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a process of determining a target host in the embodiment of the present application.
  • FIG. 7 is a schematic diagram of an apparatus for creating a virtual machine in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an apparatus for creating a virtual machine in another embodiment of the present application.
  • FIG. 9 is a schematic diagram of a control device in an embodiment of the present application.
  • the embodiment of the present application provides a method for creating a virtual machine, which selects a host machine for a virtual machine to be created from multiple aspects, thereby improving the success rate of virtual machine creation.
  • the embodiments of the present application also provide corresponding devices and systems. The details are described below separately.
  • FIG. 1 is a schematic structural diagram of a host machine in an embodiment of the present application.
  • the host shown in FIG. 1 includes a virtual machine (VM) and a hardware layer, and the hardware layer can provide hardware resources for each virtual machine.
  • VM virtual machine
  • hardware layer can provide hardware resources for each virtual machine.
  • Virtual machine software can simulate one or more virtual computers on a single host. These virtual machines work like real computers.
  • the virtual machine can be installed with operating systems and applications, and virtual machines can access network resources.
  • the virtual machine is like a real computer.
  • m virtual machines VM-1 up to VM-m are shown, and m may be any integer greater than one.
  • the hardware layer may include various hardwares, such as a processor (such as a CPU) and a memory, and may also include a high-speed or low-speed input/output (I/O) device such as a network card or a memory, and has a specific processing function.
  • a processor such as a CPU
  • I/O input/output
  • Other devices such as the Input/Output Memory Management Unit (IOMMU), where the IOMMU can be used to convert the virtual machine physical address and the host physical address.
  • IOMMU Input/Output Memory Management Unit
  • An example of a memory is a disk (eg, a hard disk).
  • Heterogeneous Network Environments are network environments consisting of computers and systems produced by different manufacturers. Since the cloud computing system often has the characteristics of long maintenance period and large cluster size, it is necessary to purchase a large number of hosts one by one, resulting in different hardware and software aspects of the host, such as whether to support the private network (Virtual Private Cloud), whether to support the cloud. Disk, whether it supports Solid State Drives (SSD), has different Central Processing Unit (CPU) types, has different virtualization methods (for example: KVM or Xen) and hypervisor (Hypervisor). At the same time, there are many kinds of applications running in the virtual machine.
  • SSD Solid State Drives
  • CPU Central Processing Unit
  • the virtual machine Due to the different functions and features of the application, the virtual machine has different requirements for the network, storage, CPU, and virtualization modes of the host. This causes a problem. Not all hosts can support the VM to be created. If only the hardware resource requirements of the VM to be created are considered, the success rate of VM creation will be low. Therefore, the method for creating a virtual machine provided by the embodiment of the present application not only considers the hardware resource requirements of the virtual machine to be created, but also considers other requirements of the virtual machine to be created, thereby improving the success rate of the virtual machine creation.
  • FIG. 2 is a schematic structural diagram of a cloud computing system according to an embodiment of the present application.
  • the cloud computing system includes a control device 10, a network 20, and a plurality of hosts 30.
  • the control device 10 and the plurality of hosts 30 are communicatively connected through the network 20, and each host can be stored on the control device 10.
  • the attribute information of the machine may also include a database 40 in the cloud computing system, and the attribute information of each host is stored by the database 40.
  • the control device 10 can store the attribute information of the host machine in itself or in the storage device. In database 40.
  • the attribute information of the host includes, for example but not limited to, the contents shown in Table 1.
  • the above table 1 shows only some of the main attribute information of the host machine, and other information not listed on the host machine can be regarded as the attribute information of the host machine.
  • FIG. 3 is a schematic diagram of a control device in an embodiment of the present application.
  • the control device includes an application interface (API), a message queue, a scheduler, and other components, and there may be multiple schedulers and other components.
  • the control device shown in FIG. 3 further includes a storage device, where the storage device is configured to store global resource data, and the global resource data may include attribute information of the host shown in Table 1 and a remaining amount of each resource on the host.
  • the API controls an access module of the device, and other devices (for example, a foreground device) interact with the control device through the API component.
  • the API component is responsible for parameter validation of the request packet for the virtual machine creation request, routing the request, and distributing it to other components in the system. For asynchronous tasks, the API component distributes the request package to the message queue component.
  • Message Queuing For asynchronous tasks, messages are streamed in the message queue, controlling each device The components have the identity of the producer or consumer, the producer sends a message to the message queue, and the consumer receives the message from the message queue.
  • Scheduler The scheduler is responsible for selecting the appropriate host for the virtual machine. From the specific process point of view, the scheduler mainly completes the following tasks:
  • the scheduler receives as a consumer a message from the message queue to read the virtual machine
  • the host can be selected for different virtual machines, which can improve the throughput and concurrency of the cloud computing system and prevent the scheduler from becoming the performance of the entire system. bottleneck.
  • the method of creating a virtual machine on the host is controlled by a control device.
  • the method for creating a virtual machine in the embodiment of the present application is described below with reference to FIG. 4 .
  • the method for creating a virtual machine includes:
  • the control device receives a virtual machine creation request.
  • the control device receives the virtual machine creation request sent by the foreground device, and the foreground device may be the terminal device used by the staff responsible for creating the virtual machine.
  • the control device can be referred to as a background device.
  • the virtual machine creation request includes first requirement information and/or second requirement information of the virtual machine to be created.
  • the first requirement information is resource requirement information.
  • the first requirement information may include information of a processor, information of a memory, and information of a disk required by the virtual machine to be created.
  • the first requirement information mainly refers to hardware resource information that the host itself can provide.
  • the second requirement information includes the virtual machine to be created by the virtual machine, the cloud disk, the private network, Demand information for at least one of a network card, a router, a network structure, a data center, a rack, a host model, a resource pool to which the host belongs, and a virtualization type.
  • the control device filters the multiple hosts according to the virtual machine creation request (for example, the first requirement information and/or the second requirement information) and attribute information of each host. At least one candidate host is selected from the plurality of hosts.
  • the attribute information of the host machine can be understood by referring to the description in Table 1.
  • a string filtering model can be constructed.
  • the string filtering model includes multiple filters connected in series, and each filter is responsible for one filter. Item filtering function, each filter will make a corresponding judgment according to the first demand information and the second demand information, and then perform corresponding filtering, for example, the first filter connected in series is responsible for filtering out the CPU required by the virtual machine.
  • the host whose memory and disk resources do not meet the requirements of the virtual machine to be created retains only the host that meets its resource requirements.
  • the second filter connected in series is responsible for filtering out the host that supports or does not support SSD.
  • each filter in the specific filtering model may be set according to the first requirement information and the second requirement information. If the second requirement information requires the host to support the SSD, the filter filters out the host that does not support the SSD according to the second requirement information, and retains the host supporting the SSD.
  • the functions of other filters can be understood by referring to this filter, except that other filters are responsible for other filtering functions.
  • the first requirement information is information about hardware resource requirements that can be provided by a host such as a CPU, a memory, and a disk resource required by the virtual machine.
  • the second requirement information includes: need to support SSD, need to support cloud disk, need to support private network, specify the type of network card, and specify router.
  • the eight hosts perform filtering according to the attribute information of the host and the first requirement information and the second requirement information of the virtual machine to be created.
  • Filter A is responsible for filtering out the requirements that are not met by the virtual machine.
  • Filter A removes 2 hosts.
  • the remaining 6 hosts then enter filter B.
  • Filter B is responsible for filtering out hosts that do not support SSD according to the second requirement information. After filtering through filter B, one host is filtered out, and five hosts remain.
  • the other filters can be responsible for filtering out the host that does not support the cloud disk, filtering out the host that does not support the private network, and finally reaching the filter X.
  • the filter X is responsible for filtering out the non-conformity.
  • a host of a virtualization type for example, if the virtualization type of the host is KVM, the host whose virtualization type is Xen is filtered out. After the filtering is completed, three candidate hosts are obtained.
  • the filtering process is filtered according to the attribute information of the host. If the virtual machine to be created does not explicitly indicate whether it needs to support SSD, then filter B does not perform any filtering and directly releases all hosts.
  • S1 A host that determines whether the host machine has the hardware resources required by the host, such as the CPU, memory, and disk resources required by the virtual machine, and retains the host that meets the resource requirements.
  • S2. Determine whether the virtual machine needs to support the SSD. If necessary, only the host supporting the SSD is reserved; otherwise, only the host that does not support the SSD is reserved.
  • S4. Determine whether the virtual machine needs a private network. If necessary, only the host that supports the private network is reserved; if not, only the host that does not support the private network is reserved; if not specified, no operation is performed.
  • S5. Determine whether the virtual machine specifies the network card. If specified, only the host with the specified network card type is reserved; otherwise, no operation is performed.
  • S6 Determine whether the virtual machine specifies a router. If the router is specified, only the host under the designated router is reserved; otherwise, no operation is performed.
  • S7 Determine whether the virtual machine needs to bond the network structure. If necessary, only the host that supports the bound network structure is reserved; otherwise, no operation is performed.
  • S8 Determine whether the virtual machine specifies a data center/computer room. If specified, only the specified data is retained. Host in the center/computer room; otherwise no operation.
  • S10 Determine whether the virtual machine is a large memory type. If it is a large memory type virtual machine, only the large memory type (M10) host is reserved; otherwise, only the non-large memory type host is reserved.
  • M10 large memory type
  • S12. Determine whether the virtual machine specifies a sales pool. If specified, only the host in the designated sales pool is retained; otherwise, only the host in the default sales pool is retained.
  • the control device determines a target host from the at least one candidate host.
  • control device determines the target host from the at least one candidate host according to the priority of each candidate host (where the control device can determine the priority of each candidate host from multiple dimensions) .
  • control device may be randomly selected when selecting the target host.
  • the multiple hosts may be filtered to After obtaining at least one candidate host, the priority values of each candidate host are determined.
  • the priority of each dimension may include: private network priority (vpcPrio), concurrent task priority (taskPrio), historical error priority (errorPrio), anti-affinity priority (affinityPrio), idle priority (freePrio), mirroring Cache priority (imgPrio), fragment rate priority (fragmentPrio). Wait.
  • the priority values of the above dimensions may be separately calculated.
  • the priority values of the respective dimensions may be calculated by the following scheme.
  • Private network priority value vpcPrio, the smaller the value, the higher the priority. Can traverse candidate hosts The list of machines determines the private network priority value for each host. The vpcPrio of the host that supports the private network is assigned a value of 0, and the vpcPrio of the other hosts is assigned a value of 1.
  • the IP address of the private network does not depend on the physical network topology and is easier to migrate in the future.
  • the role of the private network priority is to prioritize the placement of virtual machines on hosts that support private networks, making future migrations more convenient and flexible.
  • Concurrent task priority the smaller the value, the higher the priority. You can traverse the list of candidate hosts, determine the priority of concurrent tasks for each host, and determine the current number of tasks on the host. If it is less than the threshold, the value is 0. Otherwise, the value is the current number of tasks.
  • the concurrency threshold defaults to 3, which of course can be configured.
  • Concurrent tasks on the host will occur at the same time, and the concurrent is too high, which may cause the virtual machine to create slow or even fail.
  • the priority of the concurrent task is to place the virtual machine on the host with a lower number of concurrent tasks, ensuring the success rate and real-time performance of the virtual machine.
  • Historical error priority errorPrio, the smaller the value, the higher the priority. You can traverse the list of candidate hosts, calculate the historical error priority for each host, and determine the historical error number of the host for the most recent period (for example, the default of 24 hours). If it is less than the threshold, the value is 0. Otherwise, the value is the historical error number. .
  • the error threshold can be 5 by default, and the error threshold can be configured.
  • a host that has experienced multiple errors in a short period of time may have experienced some kind of failure. If the virtual machine is continuously placed on it before processing it, the virtual machine creation task may fail and the success rate may be reduced.
  • the role of historical error priority is to prioritize the placement of virtual machines on hosts that do not have too many errors, improving the success rate of virtual machine creation.
  • Anti-affinity priority affinityPrio, the smaller the value, the higher the priority. You can traverse the list of candidate hosts, calculate the anti-affinity priority for each host, and determine the number of virtual machines that the virtual machine user already has on the host. If it is less than the affinity threshold, the value is 0. Otherwise, the value is 0. The number of virtual machines already available.
  • the affinity threshold is 3, of course, the affinity threshold can be configured.
  • Idle priority freePrio, the smaller the value, the higher the priority. You can traverse the list of candidate hosts to determine if each host is completely idle. If it is completely idle, it is assigned a value of 0, otherwise it is assigned a value of 1.
  • the role of the idle priority is to protect the idle host, put the virtual machine on the non-idle host, and make full use of the resources on the non-idle host to improve resource utilization.
  • Image cache priority imgPrio, the smaller the value, the higher the priority. You can traverse the list of candidate hosts to determine whether each host has the image file required by the virtual machine. If it has one, it is assigned a value of 0, otherwise it is assigned a value of 1.
  • the priority of the image cache priority is to place the virtual machine on the host that has already stored the virtual machine image. This saves the production time and improves the real-time production process of the virtual machine when the virtual machine is actually produced. Sex.
  • Fragment rate priority fragmentPrio, the smaller the value, the higher the priority.
  • the candidate host list can be traversed, the fragment rate priority is calculated for each host, and the priority is calculated according to the resources of the CPU and memory. By default, the fragment rate priority is equal to the CPU fragmentation rate multiplied by the memory fragmentation rate. The formula is as follows:
  • FragmentPrio (cpuUsed/cpuTotal)*(memUsed/memTotal)
  • cpuUsed indicates the amount of used CPU resources (including the virtual machine to be placed)
  • cpuTotal indicates the total amount of CPU resources
  • memUsed indicates the amount of used memory resources (including the virtual machine to be placed)
  • memTotal indicates the total amount of memory resources.
  • cpuUsed is equal to cpuTotal
  • memUsed is equal to memTotal
  • the role of the fragment rate priority is to make full use of the host's resources and reduce the resource fragmentation rate. Improve resource utilization and reduce operating costs.
  • the specific determination process can be:
  • the control device sorts the hosts of the same dimension in descending order of priority values according to the priority of the dimensions from the highest to the lowest, and according to the host with the same priority value of the same dimension, The priority values of one dimension are sorted to obtain candidate hosts sorted according to priority from highest to lowest;
  • the control device decrements the resources required by the virtual machine to be created one by one according to the descending order of the sorted candidate hosts, when the candidate host is sorted first, when the deduction is successful on a candidate host , the successful candidate host is deducted as the target host.
  • the sort order of the dimensions can be preset.
  • the default dimension sorting criteria and the order of priority from high to low can be: private network priority (vpcPrio), concurrent task priority (taskPrio), historical error priority (errorPrio), anti-affinity priority (affinityPrio) ), idle priority (freePrio), image cache priority (imgPrio), and fragment rate priority (fragmentPrio).
  • Sorting criteria can also be selected within the default criteria, and the order can be adjusted.
  • vpcPrio private network priority
  • errorPrio historical error priority
  • the host may include:
  • the control device writes resource data remaining by the candidate host into a database for maintaining remaining resource data of each host machine
  • control device When the write is successful, the control device will write the successful candidate host as the target host.
  • the sorted candidate host is optimally ranked in the first place, but it is also possible that the optimal candidate host has other creation tasks, which may not be guaranteed to be successfully created, so the resource needs to be passed.
  • the way the data is deducted is to determine the final target host.
  • the process of determining the target host can be:
  • the attribute information of each host is maintained in the global resource database, and the remaining amount of each resource.
  • conditional write is based on the fact that there may be other virtual machine creation requests that are also deducting for the host, so once the value of the remaining resources changes during deduction, the deduction fails and the basis of no change is made. Perform deductions on it.
  • step 204 Whether the database is successfully written. If successful, step 205 is performed. If not, step 206 is performed.
  • the current host is the target host, and the process ends.
  • the write succeeds, the value of the remaining resources is successfully modified. For example, the original remaining resource is 120. If the virtual machine needs to be deducted by 20, the remaining resources after deduction are 100. If 100 is successfully written, the write is successful. Successful.
  • step 207 is performed, and if step 208 is exceeded.
  • the concurrent write times can be understood by referring to the description of the aforementioned concurrent task priority section.
  • step 207 may be performed. If it exceeds 3, step 208 is performed.
  • the failure to write to the database is usually caused by multiple scheduler processes attempting to write to the database concurrently. At this time, only one process can be successfully written, and the rest of the processes fail to write.
  • step 207 If not, re-read the resource data of the host, and jump to step 202.
  • step 208 If the number of concurrent times threshold has been exceeded, determine whether there is an unselected host in the candidate host list. If there is an unselected host, go to step 201. If there is no host that is not selected, Then, the process ends by step 209.
  • the selected host in the heterogeneous environment can meet the personalized requirements of the virtual machine; intelligently sort according to the concurrent task priority and historical error priority, and improve the success rate and real-time of the production virtual machine process.
  • Intelligent sorting based on anti-affinity priority, placing the same user's virtual machine on different hosts, performing distributed fault tolerance, improving the overall availability and stability of the user application system; according to idle priority, resources
  • the fragment rate priority is intelligently sorted, the host resources are fully utilized, the resource utilization of the data center is improved, and the operation cost is reduced.
  • the intelligent sorting is performed according to the mirror cache priority, the mirror downloading link is avoided as much as possible, the virtual machine creation time is shortened, and the process is improved.
  • Real-time adopting the concurrent scheduling mechanism, multiple scheduler processes select the appropriate host for the virtual machine at the same time, and improve the throughput of the packing algorithm and the scheduler.
  • an apparatus 30 for creating a virtual machine which is applicable to a system having multiple hosts, such as a cloud computing system, is provided by an embodiment of the present application.
  • the device 30 includes:
  • the receiving unit 301 is configured to receive a virtual machine creation request.
  • the filtering unit 302 is configured to select at least one candidate host from the plurality of hosts according to the virtual machine creation request received by the receiving unit 301 and the attribute information of each host;
  • a determining unit 303 configured to determine a target host from the at least one candidate host according to a priority of each candidate host
  • the virtual machine creating unit 304 is configured to create the virtual machine on the target host.
  • the virtual machine creation request may include first requirement information and second requirement information of the virtual machine to be created, where the first requirement information is resource requirement information.
  • the device for creating a virtual machine provided by the embodiment of the present application not only considers that the host function can be used for the virtual machine to be created, but also considers the hardware resources that can be provided by the host machine, and the information of other aspects of the host machine is no longer considered.
  • the determining unit 303 includes a determining subunit 305.
  • the determining subunit 305 is configured to determine a priority of each candidate host from multiple dimensions after the filtering unit 302 selects at least one candidate host.
  • the determining unit 303 is configured to determine the target host from the at least one candidate host according to the priority.
  • the determining unit 303 is configured to:
  • the candidate hosts are sorted in descending order of priority of the same dimension, and the candidate hosts of the same dimension have the same priority. Sort by the priority of the next dimension;
  • the resources required to create the virtual machine are deducted one by one, and when the deduction is successful on one candidate host, the successful candidate host is deducted as the target. Host machine.
  • the determining unit 303 is configured to:
  • the candidate host that successfully writes is used as the target host.
  • the database is used to maintain remaining resource data of each host.
  • the plurality of dimensions are included in the predetermined order:
  • At least two of the private network concurrent tasks, historical errors, anti-affinity, idle, mirror cache, and fragmentation rate.
  • the filtering unit 302 is configured to:
  • the first requirement information includes information of a processor required to create the virtual machine, information of a memory, and information of a disk;
  • the second requirement information includes creating the virtual machine to a solid state hard disk, a cloud disk, a private network, a network card, a router, a network structure, a data center, a rack, a host model, a resource pool of the host, and virtualization. Demand information for at least one of the types.
  • the multiple virtual machine creation devices execute a plurality of the virtual machine creation requests in parallel, and create a corresponding virtual machine for each virtual machine creation request.
  • the device for creating a virtual machine provided above can be understood by referring to the description in the parts of FIG. 1 to FIG. 6 , and details are not repeatedly described herein.
  • FIG. 9 is a schematic structural diagram of a computing device 60 according to an embodiment of the present application, and an example of the computing device is a control device.
  • the control device 60 includes a processor 610, a memory 650, and an input output device (e.g., transceiver) 630, which can include read only memory and random access memory, and provides operational instructions and data to the processor 610.
  • a portion of the memory 650 can also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 650 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the operation instruction can be stored in the operating system
  • the virtual machine creation request includes first requirement information and second requirement information of the virtual machine to be created, and the first requirement information is resource requirement information.
  • the control device not only considers the hardware that the host function can provide for the virtual machine to be created, but also considers the hardware resources that can be provided by the host machine and the information of other aspects of the host machine. Resources, also taking into account the other aspects of the virtual machine to be created, from multiple The aspect selects the host for the virtual machine to be created, thereby improving the success rate of virtual machine creation.
  • the processor 610 controls the operation of the control device 60, which may also be referred to as a CPU (Central Processing Unit).
  • Memory 650 can include read only memory and random access memory and provides instructions and data to processor 610. A portion of the memory 650 can also include non-volatile random access memory (NVRAM).
  • the specific components of the control device 60 are coupled together by a bus system 620 in a specific application.
  • the bus system 620 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 620 in the figure.
  • Processor 610 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 610 or an instruction in a form of software.
  • the processor 610 described above may be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or discrete hardware. Component.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 650, and the processor 610 reads the information in the memory 650 and performs the steps of the above method in combination with its hardware.
  • processor 610 is further configured to:
  • the processor 610 is configured to:
  • the candidate hosts are sorted in descending order of priority of the same dimension, and the candidate hosts of the same dimension have the same priority. Sort by the priority of the next dimension;
  • the resources required to create the virtual machine are deducted one by one, and when the deduction is successful on one candidate host, the successful candidate host is deducted as the target. Host machine.
  • the processor 610 is configured to:
  • the candidate host that successfully writes is used as the target host.
  • the processor 610 is configured to:
  • the first requirement information includes information of a processor required to create the virtual machine, information of a memory, and information of a disk;
  • the second requirement information includes creating the virtual machine to a solid state hard disk, a cloud disk, a private network, a network card, a router, a network structure, a data center, a rack, a host model, a resource pool of the host, and virtualization. Demand information for at least one of the types.
  • the processor 610 is configured to: when the virtual machine creation request has multiple, execute a plurality of the virtual machine creation requests in parallel, and create a corresponding virtual machine for each virtual machine creation request.
  • control device 60 can be understood by referring to the description in the parts of FIG. 1 to FIG. 6 , and no further description is made herein.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: ROM, RAM, disk or CD.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种创建虚拟机的方法,应用于具有多台宿主机的系统,每台宿主机具有属性信息,该方法包括:接收虚拟机创建请求(101);根据所述虚拟机创建请求和每台宿主机的属性信息,从所述多台宿主机中选择至少一台候选宿主机(102);按照每台候选宿主机的优先级,从至少一台候选宿主机中确定目标宿主机(103),并在目标宿主机上创建虚拟机(104)。所述创建虚拟机的方法,从多个方面为待创建的虚拟机选择宿主机,从而提高了虚拟机创建的成功率。

Description

创建虚拟机的方法、装置及系统、控制设备和存储介质
本申请要求于2016年7月7日提交中国专利局,申请号为201610539385.8,发明名称为“一种创建虚拟机的方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云技术领域,尤其涉及一种创建虚拟机的方法、装置及系统。
背景技术
云计算系统通常包括控制设备和大量的宿主机,控制设备可以通过虚拟机软件在一台宿主机上模拟创建出一台或者多台虚拟机,而这些虚拟机就像真正的计算机那样进行工作。
因为云计算系统中有大量的宿主机,在创建虚拟机时要选择在哪台宿主机上创建虚拟机,通常是根据待创建虚拟机的硬件资源需求,例如:需要几个中央处理器(Central Processing Unit,CPU)、需要多大内存等宿主机所能提供的资源的需求量。
这种只考虑虚拟机的资源需求和当前宿主机的硬件资源情况所选择出的宿主机,没有考虑其他正在该宿主机上创建的虚拟机,其他占用该宿主机硬件资源的虚拟机可能会导致该虚拟机创建失败。
发明内容
为了解决虚拟机创建成功率低的问题,本申请实施例提供一种创建虚拟机的方法,从多个方面为待创建的虚拟机选择宿主机,从而提高了虚拟机创建的成功率。本申请实施例还提供了相应的装置和系统。
本申请第一方面提供一种创建虚拟机的方法,所述方法应用于具有多台宿主机的系系统,每台宿主机具有属性信息,所述方法包括:
接收虚拟机创建请求;
根据所述虚拟机创建请求和所述属性信息,从所述多台宿主机中选择至少 一台候选宿主机;
按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机,并在所述目标宿主机上创建所述虚拟机。
本申请第二方面提供一种创建虚拟机的装置,所述装置应用于具有多台宿主机的系统,每台宿主机具有属性信息,所述装置包括:
接收单元,用于接收虚拟机创建请求;
过滤单元,用于根据所述虚拟机创建请求和所述属性信息,从所述多台宿主机中选择至少一台候选宿主机;
确定单元,用于按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机;
虚拟机创建单元,用于在所述目标宿主机上创建所述虚拟机。
本申请第三方面提供一种控制设备,所述控制设备包括多个如第二方面所述的创建虚拟机的装置;
当所述虚拟机创建请求有多个时,所述多个创建虚拟机的装置,并行执行多个所述虚拟机创建请求,为每个虚拟机创建请求创建对应的虚拟机。
本申请第四方面提供一种云计算系统,包括第三方面所述控制设备和多台宿主机。
本申请第五方面提供一种创建虚拟机的装置,包括:
一个或多个处理器;和
存储器,所述存储器存储程序指令,所述指令当由所述一个或多个处理器执行时,配置所述装置执行本申请的创建虚拟机的方法。
本申请第六方面提供一种计算机可读存储介质,包括指令,当该指令在计算装置的处理器上运行时,该装置执行本申请的创建虚拟机的方法。
与只考虑宿主机所能提供的硬件资源,不再考虑宿主机的其他方面的信息相比,本申请实施例提供的创建虚拟机的方法,不仅考虑了宿主机能为待创建的虚拟机所能提供的硬件资源,还考虑了待创建的虚拟机其他方面的需求信息,从多个方面为待创建的虚拟机选择宿主机,从而提高了虚拟机创建的成功率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例中宿主机的结构示意图;
图2是本申请实施例中云计算系统的结构示意图;
图3是本申请实施例中控制设备的结构示意图;
图4是本申请实施例中创建虚拟机的方法的示意图;
图5是本申请实施例中过滤过程的示例示意图;
图6是本申请实施例中确定目标宿主机的过程的示意图;
图7是本申请实施例中创建虚拟机的装置的示意图;
图8是本申请另一实施例中创建虚拟机的装置的示意图;
图9是本申请实施例中控制设备的示意图。
具体实施方式
本申请实施例提供一种创建虚拟机的方法,从多个方面为待创建的虚拟机选择宿主机,从而提高了虚拟机创建的成功率。本申请实施例还提供了相应的装置和系统。以下分别进行详细说明。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1为本申请实施例中宿主机的结构示意图。
如图1所示的宿主机包括虚拟机(Virtual Machine,VM)和硬件层,硬件层可以为每个虚拟机提供硬件资源。
虚拟机:
通过虚拟机软件可以在一台宿主机上模拟出一台或者多台虚拟的计算机, 而这些虚拟机就像真正的计算机那样进行工作,虚拟机上可以安装操作系统和应用程序,虚拟机还可访问网络资源。对于在虚拟机中运行的应用程序而言,虚拟机就像是真正的计算机进行工作。其中,在图1中,示出了m个虚拟机VM-1直到VM-m,m可以是大于1的任意整数。
硬件层:
用于支持虚拟化环境的硬件平台。其中,硬件层可包括多种硬件,例如处理器(如CPU)和内存,还可以包括网卡、存储器等高速或低速输入/输出(I/O,Input/Output)设备,及具有特定处理功能的其它设备,如输入输出内存管理单元(IOMMU,Input/Output Memory Management Unit),其中IOMMU可用于虚拟机物理地址和主机(Host)物理地址的转换。存储器的一个例子是磁盘(例如,硬盘)。
随着云计算的不断发展,宿主机和虚拟机都出现了明显的异构化趋势。异构网络环境(Heterogeneous Network Environments)是指由不同制造商生产的计算机和系统组成的网络环境。由于云计算系统往往具有维护周期长、集群规模大等特征,需要逐批采购大量宿主机,导致宿主机在软硬件方面存在诸多不同,例如:是否支持私有网络(Virtual Private Cloud)、是否支持云盘、是否支持固态硬盘(Solid State Drives,SSD)、具有不同的中央处理器(Central Processing Unit,CPU)类型、具有不同的虚拟化方式(例如:KVM或者Xen)及管理程序(Hypervisor)等。同时,虚拟机中运行着多种多样的应用程序,由于应用程序自身功能和特性不同,虚拟机对于宿主机的网络、存储、CPU、虚拟化方式的需求也有诸多不同。这样就出现了一个问题,不是所有的宿主机都可以支持待创建的虚拟机,如果只考虑待创建虚拟机的硬件资源需求,则会导致虚拟机创建的成功率很低。因此,本申请实施例提供的虚拟机创建的方法,不仅考虑了待创建虚拟机的硬件资源需求,还考虑了待创建虚拟机的其他方面的需求,从而可以提高虚拟机创建的成功率。
图2为本申请实施例中云计算系统的结构示意图。
如图2所示,云计算系统包括控制设备10、网络20和多台宿主机30,控制设备10和多台宿主机30通过网络20通信连接,控制设备10上可以存储每台宿主 机的属性信息,也可以是云计算系统中还包括数据库40,由数据库40存储每台宿主机的属性信息。
宿主机在安装到云计算系统时,需要经过宿主机导入流程,进行必要的初始化,宿主机会向控制设备10上报其属性信息,控制设备10可以将宿主机的属性信息存储在自身,也可以存储在数据库40中。
宿主机的属性信息例如包括但不限于表1所示的内容。
表1.宿主机主要属性表
字段 说明
uuid 宿主机标识号
deviceId 设备号
ip IP地址
type 机型
osName 操作系统名称
kernelVersion 内核版本
cpuModel CPU型号
Hypervisor 虚拟化方式(管理程序)
zoneId 逻辑区编号
idcId 互联网数据中心编号
rackId 机架编号
innerSwitch 交换机
flag 宿主机状态
cbsFlag 是否支持云盘
ssdFlag 是否支持ssd
netVersion 网络版本
soldPool 售卖池
cpuType CPU类型,例如NUMA01
cpuAvailable 可用CPU资源
nodeQuota CPU节点资源配额
memAvailable 可用内存资源
diskAvailable 可用磁盘资源
以上表1所示出的只是宿主机的一些主要的属性信息,其他未列出的归属于宿主机的信息,都可以认为是宿主机的属性信息。
图3是本申请实施例中控制设备的示意图。如图3所示,控制设备包括应用接口(API)、消息队列、调度器和其他组件,其中调度器和其他组件都可以有多个。图3所示的控制设备中还包括存储设备,该存储设备用于存储全局资源数据,全局资源数据可以包括表1所示的宿主机的属性信息以及宿主上各项资源的剩余量等。
其中,API:控制设备的接入模块,其它设备(例如,前台设备)通过API组件与控制设备交互。API组件负责对虚拟机创建请求的请求包进行参数校验,并对请求进行路由,分发给系统中其他组件。对于异步任务,API组件会将请求包分发给消息队列组件。
消息队列:对于异步任务,消息会在消息队列中进行流转,控制设备的各 个组件具有生产者或者消费者的身份,生产者向消息队列中发送消息,消费者从消息队列中接收消息。
调度器:调度器负责为虚拟机选择合适的宿主机。从具体流程来看,调度器主要完成以下几件工作:
调度器作为消费者从消息队列中接收读取虚拟机的消息;
根据虚拟机自身需求和宿主机的属性信息为虚拟机选择合适的宿主机;
选择宿主机后,尝试修改全局资源数据,修改失败则选择其他候选宿主机重新修改资源数据,直至修改成功或者全部失败;
将所选的宿主机信息发送到消息队列中。或者,将所选的宿主机信息汇总到已有消息中,并将消息发送到消息队列中。消息向后续步骤流转。
因调度器组件具有多个实例,即多个调度器并发进行调度,因此可以为不同的虚拟机选择宿主机,这样可以提升云计算系统的吞吐量和并发能力,避免调度器成为整个系统的性能瓶颈。
其他组件:分别负责虚拟机的网络管理、云盘存储管理、镜像管理和虚拟机生产等功能。
在宿主机上创建虚拟机是由控制设备来控制实现的,下面结合图4,介绍本申请实施例中创建虚拟机的方法。
如图4所示,本申请实施例提供的创建虚拟机的方法包括:
101、控制设备接收虚拟机创建请求。
在该步骤控制设备接收前台设备发送的虚拟机创建请求,前台设备可以是负责创建虚拟机的工作人员所使用的终端设备。相应的,控制设备可以称作后台设备。
所述虚拟机创建请求包括待创建的虚拟机的第一需求信息和/或第二需求信息。
所述第一需求信息为资源需求信息。所述第一需求信息可以包括待创建的所述虚拟机所需的处理器的信息、内存的信息和磁盘的信息,第一需求信息主要指的是宿主机自身所能提供的硬件资源信息。
所述第二需求信息包括待创建的所述虚拟机对固态硬盘、云盘、私有网络、 网卡、路由器、网络结构、数据中心、机架、宿主机的机型、宿主机所属资源池,以及虚拟化类型中的至少一个的需求信息。
102、控制设备根据所述虚拟机创建请求(例如,所述第一需求信息和/或所述第二需求信息),以及每台宿主机的属性信息,对所述多台宿主机进行过滤,以从所述多台宿主机中选择得到至少一台候选宿主机。
宿主机的属性信息可以参阅表1部分的描述进行理解,按照宿主机的属性信息可以构建出一个串式过滤模型,该串式过滤模型包括串接的多个过滤器,每个过滤器负责一项过滤功能,每个过滤器会根据第一需求信息和第二需求信息做出相应的判断,然后执行相应的过滤,例如:串接的第一个过滤器负责过滤掉虚拟机所需的CPU、内存和磁盘资源不满足该待创建的虚拟机需求的宿主机,仅保留满足其资源需求的宿主机,串接的第二个过滤器负责过滤掉支持或者不支持SSD的宿主机。具体过滤模型中各过滤器的功能可以依据第一需求信息和第二需求信息进行设置。如果第二需求信息中要求宿主机支持SSD,则过滤器根据该第二需求信息就过滤掉不支持SSD的宿主机,保留支持SSD的宿主机。其他过滤器的功能都可以参阅该过滤器的进行理解,只是其他过滤器负责其他过滤功能。
下面以图5为例,介绍本申请实施例中,对宿主机进行过滤,以得到至少一台候选宿主机的过程。
如图5所示,若云计算系统中有8台宿主机,当然,云计算系统中可以有更多或更少的宿主机,这里8台宿主机只是为了便于描述所举的例子,不应理解为是对宿主机数量的限定,但不管有多少台宿主机,过滤的过程都是类似的,都可以按照该示例进行理解。
第一需求信息是虚拟机所需的CPU、内存以及磁盘资源等宿主机所能提供的硬件资源需求信息。
第二需求信息包括:需要支持SSD、需要支持云盘、需要支持私有网络、指定网卡的类型以及指定路由器等。
如图5所示,8台宿主机按照宿主机的属性信息和待创建的虚拟机的第一需求信息和所述第二需求信息进行过滤。过滤器A负责过滤掉不满足虚拟机所需 的CPU、内存以及磁盘资源等宿主机所能提供的硬件资源需求的宿主机,保留符合资源需求的宿主机。经过过滤器A,过滤掉2台宿主机。剩余的6台宿主机再进入过滤器B。过滤器B根据第二需求信息负责过滤掉不支持SSD的宿主机。经过过滤器B过滤后,又过滤掉一台宿主机,还剩余5台宿主机。然后再依次经过其他过滤器,其他过滤器可以分别负责过滤掉不支持云盘的宿主机、负责过滤掉不支持私有网络的宿主机等,最后到达过滤器X,过滤器X负责过滤掉不符合虚拟化类型的宿主机,例如:如果需要宿主机的虚拟化类型是KVM,则会过滤掉虚拟化类型是Xen的宿主机。过滤结束后得到三个候选宿主机。
以上图5的示例中,过滤的过程是按照宿主机的属性信息进行过滤的。若待创建的虚拟机没有明确给出是否需要支持SSD,则过滤器B不做任何过滤,直接放行所有宿主机。
以上图5中没有具体示出每个过滤器,但过滤过程更详细的可以例如是:
S1、判断宿主机是否具备虚拟机所需的CPU、内存以及磁盘资源等宿主机所能提供的硬件资源需求的宿主机,保留符合资源需求的宿主机。
S2、判断虚拟机是否需要支持SSD,如果需要,则仅保留支持SSD的宿主机;否则仅保留不支持SSD的宿主机。
S3、判断虚拟机是否需要连接到云盘,如果需要,则仅保留支持云盘的宿主机;否则不做操作。
S4、判断虚拟机是否需要私有网络,如果需要,则仅保留支持私有网络的宿主机;如果不需要,则仅保留不支持私有网络的宿主机;如果未指定,则不做操作。
S5、判断虚拟机是否指定网卡,如果指定,则仅保留具有指定网卡类型的宿主机;否则不做操作。
S6、判断虚拟机是否指定路由器,如果指定路由器,则仅保留指定路由器下的宿主机;否则不做操作。
S7、判断虚拟机是否需要绑定(bonding)网络结构,如果需要,则仅保留支持绑定网络结构的宿主机;否则不做操作。
S8、判断虚拟机是否指定数据中心/机房,如果指定,则仅保留指定数据 中心/机房的宿主机;否则不做操作。
S9、判断虚拟机是否指定机架,如果指定机架,则仅保留指定机架上的宿主机;否则不做操作。
S10、判断虚拟机是否为大内存类型,如果是大内存类型虚拟机,则仅保留大内存型(M10)宿主机;否则仅保留非大内存型宿主机。
S11、判断虚拟机是否指定宿主机机型,如果指定,则仅保留具有指定机型的宿主机;否则不做操作。
S12、判断虚拟机是否指定售卖池,如果指定,则仅保留指定售卖池内的宿主机;否则仅保留默认售卖池内的宿主机。
S13、判断虚拟机是否指定虚拟化类型,如果指定,则仅保留指定虚拟化类型的宿主机;否则不做操作;经过上述步骤,得到的宿主机列表即为候选宿主机列表。
103、控制设备从所述至少一台候选宿主机中确定目标宿主机。
可选的,控制设备根据每台候选宿主机的优先级(其中,控制设备可以从多个维度确定每台候选宿主机的优先级),从所述至少一台候选宿主机中确定目标宿主机。
104、在所述目标宿主机上创建所述虚拟机。
根据本申请的实施例,控制设备在选择目标宿主机时,可以是随机选择的,当然,为了选择一台符合度最好的目标宿主机可以是在对所述多台宿主机进行过滤,以得到至少一个候选宿主机之后,确定每台候选宿主机各维度的优先级值。
各维度的优先级可以包括:私有网络优先级(vpcPrio)、并发任务优先级(taskPrio)、历史错误优先级(errorPrio)、反亲和性优先级(affinityPrio)、空闲优先级(freePrio)、镜像缓存优先级(imgPrio)、碎片率优先级(fragmentPrio)。等。
可以分别计算上述各维度的优先级值,例如,可以通过如下方案计算各维度的优先级值。
私有网络优先级值:vpcPrio,数值越小优先级越高。可以遍历候选宿主 机列表,为每台宿主机确定私有网络优先级值,可以是支持私有网络的宿主机的vpcPrio赋值为0,其余宿主机的vpcPrio赋值为1。
私有网络的IP地址不依赖物理网络拓扑,未来更易于迁移。私有网络优先级的作用在于,优先把虚拟机放置到支持私有网络的宿主机上,未来迁移更加便利灵活。
并发任务优先级:taskPrio,数值越小优先级越高。可以遍历候选宿主机列表,为每台宿主机确定并发任务优先级,判断宿主机上当前任务数量,如果小于阈值,则赋值为0,否则赋值为当前任务数量。例如:并发阈值默认为3,当然该阈值可以进行配置。
宿主机上的并发任务会同时进行,并发过高,可能导致虚拟机创建缓慢甚至失败。并发任务优先级的作用在于,优先把虚拟机放置到并发任务数量更低的宿主机上,确保虚拟机创建的成功率和实时性。
历史错误优先级:errorPrio,数值越小优先级越高。可以遍历候选宿主机列表,为每台宿主机计算历史错误优先级,判断宿主机最近一段时间(例如默认24小时)的历史错误数量,如果小于阈值,则赋值为0,否则赋值为历史错误数量。例如:错误阈值默认可以为5,错误阈值可以进行配置。
短时间内出现多次错误的宿主机可能已经出现了某种故障,在对其进行处理之前,如果持续将虚拟机放置其上,可能导致虚拟机创建任务失败,降低成功率。历史错误优先级的作用在于,优先把虚拟机放置到没有出现过多错误的宿主机上,提高虚拟机创建的成功率。
反亲和性优先级:affinityPrio,数值越小优先级越高。可以遍历候选宿主机列表,为每台宿主机计算反亲和性优先级,判断虚拟机用户在该宿主机上已经存在虚拟机数量,如果小于亲和性阈值,则赋值为0,否则赋值为已有虚拟机数量。例如:亲和性阈值为3,当然,亲和性阈值可以进行配置。
在大规模分布式系统中,完全规避错误是几乎不可能的。如果某位用户的虚拟机集中在一台或者几台宿主机上,当这些宿主机发生故障,其上虚拟机将全部受到影响,严重影响了该用户应用整体的可用性。反亲和性优先级的作用在于,使得同一用户的虚拟机广泛的分布在不同的宿主机上,进行分布式容灾, 即使单台宿主机故障对应用整体可用性的影响也比较有限,进而提高用户应用的稳定性和可用性。
空闲优先级:freePrio,数值越小优先级越高。可以遍历候选宿主机列表,判断每台宿主机是否完全空闲,如果完全空闲,则赋值为0,否则赋值为1。
空闲优先级的作用在于,保护空闲宿主机,优先把虚拟机放置到非空闲宿主机上,充分利用非空闲宿主机上的资源,提升资源利用率。
镜像缓存优先级:imgPrio,数值越小优先级越高。可以遍历候选宿主机列表,判断每台宿主机是否具有虚拟机所需的镜像文件,如果具有则赋值为0,否则赋值为1。
镜像缓存优先级的作用在于,优先将虚拟机放置到已经存储虚拟机镜像的宿主机上,这样在真正生产虚拟机的时候可以免去下载镜像环节,节省生产时间,提升虚拟机生产流程的实时性。
碎片率优先级:fragmentPrio,数值越小优先级越高。可以遍历候选宿主机列表,为每台宿主机计算碎片率优先级,根据CPU和内存两个维度的资源计算优先级。默认情况下,碎片率优先级等于CPU碎片率乘以内存碎片率,公式如下:
FragmentPrio=(cpuUsed/cpuTotal)*(memUsed/memTotal)
其中,cpuUsed表示已用CPU资源量(包含待放置的虚拟机),cpuTotal表示CPU资源总量,memUsed表示已用内存资源量(包含待放置的虚拟机),memTotal表示内存资源总量。
在默认情况之外,有两种情况特殊处理。如果cpuUsed与cpuTotal相等,且memUsed和memTotal相等,表示将虚拟机放置到该宿主机后,宿主机的CPU、内存资源同时得到完全利用,充分利用了宿主机的资源,这种情况是最为理想的情况,则赋值为最高优先级0。如果CPU、内存某一种资源已经完全被利用,而另一种资源还有较多剩余,则剩余资源无法再卖出,我们称之为“不可售卖资源”。不可售卖资源会直接造成资源浪费,是最不理想的情况,我们赋值为最低优先级(LOW_PRIO)。
碎片率优先级的作用在于,充分利用宿主机的资源,降低资源碎片率,进 而提升资源利用率,降低运营成本。
确定每台候选宿主机各维度的优先级值后,可以根据所述各维度的优先级值,从所述至少一台候选宿主机中确定一台符合度最高的候选宿主机作为所述目标宿主机。
具体的确定过程可以是:
控制设备按照所述各维度的优先级从高到低的顺序,对同一维度的宿主机按照优先级值从小到大的顺序进行排序,针对同一维度的优先级值相同的宿主机,再按照下一维度的优先级值进行排序,以得到按照优先级从高到低排序的候选宿主机;
控制设备按照排序后的候选宿主机的降序,从排序在第一位的候选宿主机开始,逐一扣减待创建的所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,则将扣减成功的候选宿主机作为所述目标宿主机。
维度的排序顺序可以是预先设定的。例如:默认维度排序标准及优先级从高到低的顺序可以是:私有网络优先级(vpcPrio)、并发任务优先级(taskPrio)、历史错误优先级(errorPrio)、反亲和性优先级(affinityPrio)、空闲优先级(freePrio)、镜像缓存优先级(imgPrio)和碎片率优先级(fragmentPrio)。排序标准也可以在默认标准范围内进行选择,顺序可以调整配置。
举例来说明多维排序标准。例如:宿主机A和宿主机B在排序时,首先比较私有网络优先级(vpcPrio),vpcPrio更小的宿主机排在前面。如果二者的vpcPrio相等,则比较并发任务优先级(taskPrio),如果仍然相等,则再比较历史错误优先级(errorPrio),并以此类推。
其中,所述从排序在第一位的候选宿主机开始,逐一扣减待创建的所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,则将扣减成功的候选宿主机作为所述目标宿主机,可以包括:
所述控制设备根据待创建的所述虚拟机所需的资源数据,确定扣减后所述候选宿主机所剩余的资源数据;
所述控制设备将所述候选宿主机所剩余的资源数据写入用于维护每台宿主机的剩余资源数据的数据库;
当写入成功时,则所述控制设备将写入成功的候选宿主机作为所述目标宿主机。
本申请实施例中,排序后的候选宿主机肯定排序在第一位的是最优的,但是也可能该最优的候选宿主机有其他创建任务,不一定能保定创建成功,所以需要通过资源数据扣减的方式来确定最后的目标宿主机。
扣减的过程可以参阅图6进行理解。
如图6所示,确定目标宿主机的过程可以是:
201、从候选宿主机列表中按照排序后的顺序选出一台宿主机。
202、根据虚拟机的资源需求,计算扣减后该宿主机的剩余资源。
203、将扣减后的剩余资源,附带条件写入全局资源数据库。
全局资源数据库中维护有每一台宿主机的属性信息,以及各项资源的剩余量。
附带条件写入是考虑到同时可能会有其他虚拟机创建请求也在针对该宿主机执行扣减,所以一旦在扣减时,剩余资源的数值发生变化,则扣减失败,不再变化的基础上执行扣减。
204、写入数据库是否成功,若成功,执行步骤205,若不成功,执行步骤206。
205、写入成功时,则当前宿主机即为目标宿主机,流程结束。
写入成功,则表示对剩余资源的值修改成功,例如:原来的剩余资源为120,创建虚拟机需要扣减20,则扣减后的剩余资源为100,如果成功写入100,则表示写入成功。
206、写入失败时,则判断是否超过并发写入次数阈值,若未超过,执行步骤207,若超过执行步骤208。
并发写入次可以参阅前述的并发任务优先级部分的描述进行理解。
若并发次数阈值为3,若未超过3次,则可以执行步骤207,若超过3,则执行步骤208。
写入数据库失败通常是由于多个调度器进程并发尝试写入数据库造成的,此时只有一个进程可以写入成功,其余进程本次写入失败。
207、如果没有超过,则重新读取宿主机的资源数据,并跳转到步骤202。
208、如果已经超过并发次数阈值,则判断候选宿主机列表中是否还有未选用的宿主机,若还有未选用的宿主机,则跳转到步骤201,若无未被选用的宿主机,则通过步骤209结束流程。
209,无未被选用的宿主机,则结束流程。
以上所描述的创建虚拟机的过程的有益效果可以包括:
通过多方面的属性过滤,保证在异构环境中所选宿主机可以满足虚拟机的个性化需求;根据并发任务优先级、历史错误优先级进行智能排序,提高生产虚拟机流程的成功率和实时性;根据反亲和性优先级进行智能排序,将同一用户的虚拟机放置于不同的宿主机之上,进行分布式容错,提高用户应用系统的整体可用性和稳定性;根据空闲优先级、资源碎片率优先级进行智能排序,充分使用宿主机资源,提升数据中心的资源利用率,降低运营成本;根据镜像缓存优先级进行智能排序,尽可能避免镜像下载环节,缩短虚拟机创建时间,提升流程实时性;采用并发调度机制,多个调度器进程同时为虚拟机选择合适宿主机,提升装箱算法和调度器的吞吐率。
参阅图7,本申请实施例提供的创建虚拟机的装置30,装置30可应用于具有多台宿主机的系统,例如云计算系统。所述装置30的包括:
接收单元301,用于接收虚拟机创建请求;
过滤单元302,用于根据所述接收单元301接收的虚拟机创建请求以及每台宿主机的属性信息,从所述多台宿主机中选择至少一台候选宿主机;
确定单元303,用于按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机;
虚拟机创建单元304,用于在所述目标宿主机上创建所述虚拟机。
其中,所述虚拟机创建请求可以包括待创建的虚拟机的第一需求信息和第二需求信息,所述第一需求信息为资源需求信息。
与只考虑宿主机所能提供的硬件资源,不再考虑宿主机的其他方面的信息相比,本申请实施例提供的创建虚拟机的装置,不仅考虑了宿主机能为待创建的虚拟机所能提供的硬件资源,还考虑了待创建的虚拟机其他方面的需求信 息,从多个方面为待创建的虚拟机选择宿主机,从而提高了虚拟机创建的成功率。
可选地,参阅图8,本申请实施例提供的创建虚拟机的装置30的另一实施例中,所述确定单元303包括确定子单元305,
所述确定子单元305,用于在所述过滤单元302选择至少一个候选宿主机之后,从多个维度确定每台候选宿主机的优先级。
所述确定单元303,用于根据所述优先级,从所述至少一台候选宿主机中确定所述目标宿主机。
可选地,所述确定单元303用于:
按照所述多个维度的预定顺序,从排序在第一的维度开始,对候选宿主机按照同一维度的优先级从高到低的顺序进行排序,针对同一维度的优先级相同的候选宿主机,按照下一维度的优先级进行排序;
从排序在第一位的候选宿主机开始,逐一扣减创建所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,则将扣减成功的候选宿主机作为所述目标宿主机。
可选地,所述确定单元303用于:
根据创建所述虚拟机所需的资源数据,确定扣减后所述候选宿主机所剩余的资源数据;
将所述候选宿主机所剩余的资源数据写入数据库;
将写入成功的候选宿主机作为所述目标宿主机。
可选地,所述数据库用于维护每台宿主机的剩余资源数据。
可选地,所述多个维度按照所述预定顺序包括:
私有网络、并发任务、历史错误、反亲和性、空闲、镜像缓存以及碎片率中的至少两个。
可选地,所述过滤单元302用于:
依据所述属性信息构建串式过滤器;
根据所述第一需求信息和所述第二需求信息,控制所述过滤器对所述多台宿主机进行过滤,以得到所述至少一台候选宿主机。
可选地,所述第一需求信息包括创建所述虚拟机所需的处理器的信息、内存的信息和磁盘的信息;
所述第二需求信息包括创建所述虚拟机对固态硬盘、云盘、私有网络、网卡、路由器、网络结构、数据中心、机架、宿主机的机型、宿主机所属资源池,以及虚拟化类型中的至少一个的需求信息。
另外,当所述虚拟机创建请求有多个时,所述多个创建虚拟机的装置,并行执行多个所述虚拟机创建请求,为每个虚拟机创建请求创建对应的虚拟机。
以上所提供的创建虚拟机的装置可以参阅图1至图6部分的描述进行理解,本处不再重复赘述。
图9是本申请实施例提供的一种计算装置60的结构示意图,所述计算装置的一个例子是控制设备。所述控制设备60包括处理器610、存储器650和输入输出装置(例如收发器)630,存储器650可以包括只读存储器和随机存取存储器,并向处理器610提供操作指令和数据。存储器650的一部分还可以包括非易失性随机存取存储器(NVRAM)。
在一些实施方式中,存储器650存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:
在本申请实施例中,通过调用存储器650存储的操作指令(该操作指令可存储在操作系统中),
接收虚拟机创建请求;
根据所述虚拟机创建请求以及每台宿主机的属性信息,从所述多台宿主机中选择至少一台候选宿主机;
按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机,并在所述目标宿主机上创建所述虚拟机。
其中,所述虚拟机创建请求包括待创建的虚拟机的第一需求信息和第二需求信息,所述第一需求信息为资源需求信息。
与只考虑宿主机所能提供的硬件资源,不再考虑宿主机的其他方面的信息相比,本申请实施例提供的控制设备,不仅考虑了宿主机能为待创建的虚拟机所能提供的硬件资源,还考虑了待创建的虚拟机其他方面的需求信息,从多个 方面为待创建的虚拟机选择宿主机,从而提高了虚拟机创建的成功率。
处理器610控制控制设备60的操作,处理器610还可以称为CPU(Central Processing Unit,中央处理单元)。存储器650可以包括只读存储器和随机存取存储器,并向处理器610提供指令和数据。存储器650的一部分还可以包括非易失性随机存取存储器(NVRAM)。具体的应用中控制设备60的各个组件通过总线系统620耦合在一起,其中总线系统620除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统620。
上述本申请实施例揭示的方法可以应用于处理器610中,或者由处理器610实现。处理器610可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器610中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器610可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器650,处理器610读取存储器650中的信息,结合其硬件完成上述方法的步骤。
可选地,处理器610还用于:
从多个维度确定每台候选宿主机的优先级;
根据所述优先级,从所述至少一台候选宿主机中确定所述目标宿主机。
可选地,处理器610用于:
按照所述多个维度的预定顺序,从排序在第一的维度开始,对候选宿主机按照同一维度的优先级从高到低的顺序进行排序,针对同一维度的优先级相同的候选宿主机,按照下一维度的优先级进行排序;
从排序在第一位的候选宿主机开始,逐一扣减创建所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,则将扣减成功的候选宿主机作为所述目标宿主机。
可选地,处理器610用于:
根据创建所述虚拟机所需的资源数据,确定扣减后所述候选宿主机所剩余的资源数据;
将所述候选宿主机所剩余的资源数据写入数据库;
将写入成功的候选宿主机作为所述目标宿主机。
可选地,处理器610用于:
依据所述属性信息构建串式过滤器;
根据所述第一需求信息和所述第二需求信息,控制所述过滤器对所述多台宿主机进行过滤,以得到所述至少一台候选宿主机。
可选地,所述第一需求信息包括创建所述虚拟机所需的处理器的信息、内存的信息和磁盘的信息;
所述第二需求信息包括创建所述虚拟机对固态硬盘、云盘、私有网络、网卡、路由器、网络结构、数据中心、机架、宿主机的机型、宿主机所属资源池,以及虚拟化类型中的至少一个的需求信息。
可选地,处理器610用于:当所述虚拟机创建请求有多个时,并行执行多个所述虚拟机创建请求,为每个虚拟机创建请求创建对应的虚拟机。
以上的控制设备60可以参阅图1至图6部分的描述进行理解,本处不做过多赘述。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:ROM、RAM、磁盘或光盘等。
以上对本申请实施例所提供的创建虚拟机的方法、装置以及系统进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领 域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种创建虚拟机的方法,所述方法应用于具有多台宿主机的系统,每台宿主机具有属性信息,所述方法包括:
    接收虚拟机创建请求;
    根据所述虚拟机创建请求和所述属性信息,从所述多台宿主机中选择至少一台候选宿主机;
    按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机;
    在所述目标宿主机上创建所述虚拟机。
  2. 根据权利要求1所述的方法,其中,按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机包括:
    从多个维度确定每台候选宿主机的优先级;
    根据所述优先级,从所述至少一台候选宿主机中确定所述目标宿主机。
  3. 根据权利要求2所述的方法,其中,根据所述优先级,从所述至少一台候选宿主机中确定所述目标宿主机,包括:
    按照所述多个维度的预定顺序,从排序在第一的维度开始,对候选宿主机按照同一维度的优先级从高到低的顺序进行排序,针对同一维度的优先级相同的候选宿主机,按照下一维度的优先级进行排序;
    从排序在第一位的候选宿主机开始,逐一扣减创建所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,将扣减成功的候选宿主机作为所述目标宿主机。
  4. 根据权利要求3所述的方法,其中,所述从排序在第一位的候选宿主机开始,逐一扣减创建所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,将扣减成功的候选宿主机作为所述目标宿主机,包括:
    根据创建所述虚拟机所需的资源数据,确定扣减后所述候选宿主机所剩余的资源数据;
    将所述候选宿主机所剩余的资源数据写入数据库;
    将写入成功的候选宿主机作为所述目标宿主机。
  5. 根据权利要求3所述的方法,其中,所述多个维度按照所述预定顺序包括:
    私有网络、并发任务、历史错误、反亲和性、空闲、镜像缓存以及碎片率中的至少两个。
  6. 根据权利要求1-5中任一项所述的方法,其中,所述系统是云计算系统,所述云计算系统还包括与所述多台宿主机连接的控制设备,所述方法由所述控制设备执行,
    其中,所述虚拟机创建请求包括创建所述虚拟机的第一需求信息和第二需求信息,所述第一需求信息为资源需求信息。
  7. 根据权利要求6所述的方法,其中,根据所述虚拟机创建请求和所述属性信息,从所述多台宿主机中选择至少一台候选宿主机,包括:
    依据所述属性信息构建串式过滤器;
    根据所述第一需求信息和所述第二需求信息,控制所述过滤器对所述多台宿主机进行过滤,以得到所述至少一台候选宿主机。
  8. 根据权利要求7所述的方法,其中,
    所述第一需求信息包括创建所述虚拟机所需的处理器的信息、内存的信息和磁盘的信息;
    所述第二需求信息包括创建所述虚拟机对固态硬盘、云盘、私有网络、网卡、路由器、网络结构、数据中心、机架、宿主机的机型、宿主机所属资源池以及虚拟化类型中的至少一个的需求信息。
  9. 根据权利要求1所述的方法,其中,接收虚拟机创建请求包括接收多个虚拟机创建请求,所述方法还包括:
    并行执行多个所述虚拟机创建请求,为每个虚拟机创建请求创建对应的虚拟机。
  10. 一种创建虚拟机的装置,所述装置应用于具有多台宿主机的系统,每台宿主机具有属性信息,所述装置包括:
    接收单元,用于接收虚拟机创建请求;
    过滤单元,用于根据所述虚拟机创建请求和所述属性信息,从所述多台宿 主机中选择至少一台候选宿主机;
    确定单元,用于按照每台候选宿主机的优先级,从所述至少一台候选宿主机中确定目标宿主机;
    虚拟机创建单元,用于在所述目标宿主机上创建所述虚拟机。
  11. 根据权利要求10所述的装置,其中,所述确定单元还用于:
    从多个维度确定每台候选宿主机的优先级;
    根据所述优先级,从所述至少一台候选宿主机中确定所述目标宿主机。
  12. 根据权利要求11所述的装置,其中,所述确定单元还用于:
    按照所述多个维度的预定顺序,从排序在第一的维度开始,对候选宿主机按照同一维度的优先级从高到低的顺序进行排序,针对同一维度的优先级相同的候选宿主机,按照下一维度的优先级进行排序;
    从排序在第一位的候选宿主机开始,逐一扣减创建所述虚拟机所需的资源,当在一个候选宿主机上扣减成功时,将扣减成功的候选宿主机作为所述目标宿主机。
  13. 根据权利要求12所述的装置,其中,所述确定单元还用于:
    根据创建所述虚拟机所需的资源数据,确定扣减后所述候选宿主机所剩余的资源数据;
    将所述候选宿主机所剩余的资源数据写入数据库;
    将写入成功的候选宿主机作为所述目标宿主机。
  14. 根据权利要求12所述的装置,其中,所述多个维度按照所述预定顺序包括:
    私有网络、并发任务、历史错误、反亲和性、空闲、镜像缓存以及碎片率中的至少两个。
  15. 根据权利要求10-14中任一项所述的装置,其中,所述系统是云计算系统,所述云计算系统还包括与所述多台宿主机连接的控制设备,所述装置位于所述控制设备中,
    其中,所述虚拟机创建请求包括创建所述虚拟机的第一需求信息和第二需求信息,所述第一需求信息为资源需求信息。
  16. 根据权利要求15所述的装置,其中,所述过滤单元还用于:
    依据所述属性信息构建串式过滤器;
    根据所述第一需求信息和所述第二需求信息,控制所述过滤器对所述多台宿主机进行过滤,以得到所述至少一台候选宿主机。
  17. 根据权利要求16所述的装置,其中,
    所述第一需求信息包括创建所述虚拟机所需的处理器的信息、内存的信息和磁盘的信息;
    所述第二需求信息包括创建所述虚拟机对固态硬盘、云盘、私有网络、网卡、路由器、网络结构、数据中心、机架、宿主机的机型、宿主机所属资源池,以及虚拟化类型中的至少一个的需求信息。
  18. 一种控制设备,包括多个如权利要求10-17中任一项所述的创建虚拟机的装置;
    当所述虚拟机创建请求有多个时,所述多个创建虚拟机的装置,并行执行多个所述虚拟机创建请求,为每个虚拟机创建请求创建对应的虚拟机。
  19. 一种云计算系统,包括控制设备和多台宿主机,
    所述控制设备包括根据权利要求10-17中任一项所述的装置。
  20. 一种计算机可读存储介质,包括指令,当该指令在计算装置的处理器上运行时,该装置执行权利要求1-9中任一项所述的方法。
PCT/CN2017/092197 2016-07-07 2017-07-07 创建虚拟机的方法、装置及系统、控制设备和存储介质 WO2018006864A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/962,678 US10642641B2 (en) 2016-07-07 2018-04-25 Method, apparatus, and system for creating virtual machine, control device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610539385.8 2016-07-07
CN201610539385.8A CN106020937A (zh) 2016-07-07 2016-07-07 一种创建虚拟机的方法、装置及系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/962,678 Continuation US10642641B2 (en) 2016-07-07 2018-04-25 Method, apparatus, and system for creating virtual machine, control device, and storage medium

Publications (1)

Publication Number Publication Date
WO2018006864A1 true WO2018006864A1 (zh) 2018-01-11

Family

ID=57109912

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/092197 WO2018006864A1 (zh) 2016-07-07 2017-07-07 创建虚拟机的方法、装置及系统、控制设备和存储介质

Country Status (3)

Country Link
US (1) US10642641B2 (zh)
CN (1) CN106020937A (zh)
WO (1) WO2018006864A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730205A (zh) * 2019-09-06 2020-01-24 深圳平安通信科技有限公司 集群系统部署的方法、装置、计算机设备和存储介质
CN111190691A (zh) * 2019-12-25 2020-05-22 中国建设银行股份有限公司 适用于虚拟机的自动迁移方法、系统、装置及存储介质
CN112882820A (zh) * 2019-11-29 2021-06-01 北京百度网讯科技有限公司 用于配置资源的方法及装置
EP3800549A4 (en) * 2018-06-15 2021-08-04 Huawei Technologies Co., Ltd. ADMINISTRATIVE PROCEDURE, DEVICE AND SYSTEM FOR VIRTUAL MACHINERY
RU2780973C2 (ru) * 2018-05-25 2022-10-04 МАЙКРОСОФТ ТЕКНОЛОДЖИ ЛАЙСЕНСИНГ, ЭлЭлСи Ответ с идентификатором функции процессора для виртуализации
CN115454576A (zh) * 2022-09-29 2022-12-09 安超云软件有限公司 一种虚拟机进程管理方法、系统及电子设备

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020937A (zh) * 2016-07-07 2016-10-12 腾讯科技(深圳)有限公司 一种创建虚拟机的方法、装置及系统
CN106648462B (zh) * 2016-11-21 2019-10-25 华为技术有限公司 数据存储方法及装置
CN107018175B (zh) * 2017-01-11 2021-01-19 杨立群 移动云计算平台的调度方法和装置
CN108399101B (zh) * 2017-02-06 2021-03-16 腾讯科技(深圳)有限公司 资源调度的方法、装置和系统
CN107203411B (zh) * 2017-04-18 2020-02-28 中国科学院计算技术研究所 一种基于远程ssd的虚拟机内存扩展方法及系统
CN107273468B (zh) * 2017-06-06 2018-08-03 腾讯科技(深圳)有限公司 一种数据库数据处理方法、装置及终端
CN107368355B (zh) * 2017-08-17 2020-05-15 北京云纵信息技术有限公司 虚拟机的动态调度方法和装置
CN107643939A (zh) * 2017-09-14 2018-01-30 郑州云海信息技术有限公司 一种分配虚拟机的方法及系统
CN109582433B (zh) * 2017-09-29 2022-02-01 腾讯科技(深圳)有限公司 一种资源调度方法、装置、云计算系统及存储介质
CN108170508A (zh) * 2017-12-12 2018-06-15 顺丰科技有限公司 批量创建虚拟机的方法、装置、设备及其存储介质
CN108337109B (zh) * 2017-12-28 2021-12-17 中兴通讯股份有限公司 一种资源分配方法及装置和资源分配系统
CN108614727B (zh) * 2018-03-23 2021-04-20 华为技术有限公司 一种虚拟机创建方法及装置
CN108833592A (zh) * 2018-07-13 2018-11-16 无锡华云数据技术服务有限公司 云主机调度器优化方法、装置、设备及存储介质
CN109375992A (zh) * 2018-08-17 2019-02-22 华为技术有限公司 一种资源调度方法及装置
CN109388478A (zh) * 2018-11-01 2019-02-26 郑州云海信息技术有限公司 用于OpenStack环境中迁移虚拟机的方法和装置
CN109460287A (zh) * 2018-11-14 2019-03-12 携程旅游信息技术(上海)有限公司 资源混合调度的控制方法及系统
CN109558214B (zh) * 2018-12-05 2021-06-15 腾讯科技(深圳)有限公司 异构环境下宿主机资源管理方法、装置和存储介质
CN111949384B (zh) * 2019-05-14 2023-05-02 龙芯中科技术股份有限公司 任务调度方法、装置、设备及计算机可读存储介质
CN110750330A (zh) * 2019-10-18 2020-02-04 北京浪潮数据技术有限公司 一种虚拟机创建方法、系统、电子设备及存储介质
CN110750331B (zh) * 2019-10-21 2023-06-09 北京华育兴业科技有限公司 一种针对教育桌面云应用的容器集群调度方法及平台
CN111324415A (zh) * 2019-10-28 2020-06-23 烽火通信科技股份有限公司 一种虚拟机镜像缓存创建方法、系统及计算机可读介质
CN111078354A (zh) * 2019-11-22 2020-04-28 紫光云技术有限公司 一种云计算领域快速调度方法
CN113076171B (zh) * 2020-01-03 2023-12-19 阿里巴巴集团控股有限公司 虚拟机装机方法及装置
CN111198749A (zh) * 2020-01-06 2020-05-26 紫光云技术有限公司 一种提高创建虚拟机物理节点调度效率的方法
US10970127B1 (en) * 2020-02-11 2021-04-06 Verizon Patent And Licensing Inc. Systems and methods for virtual machine resource optimization using machine learning techniques
US11948010B2 (en) * 2020-10-12 2024-04-02 International Business Machines Corporation Tag-driven scheduling of computing resources for function execution
CN112579258A (zh) * 2020-12-14 2021-03-30 科东(广州)软件科技有限公司 一种虚拟机的管理方法、装置、设备及存储介质
CN112732401A (zh) * 2020-12-29 2021-04-30 深圳前海微众银行股份有限公司 虚拟机资源分配方法、系统、设备及介质
CN113608833A (zh) * 2021-07-19 2021-11-05 曙光信息产业(北京)有限公司 虚拟机创建方法、装置、计算机设备和存储介质
CN113992511A (zh) * 2021-10-19 2022-01-28 京东科技信息技术有限公司 云主机创建方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929701A (zh) * 2012-10-17 2013-02-13 北京搜狐新媒体信息技术有限公司 一种批量虚拟机的调度方法及装置
CN102946413A (zh) * 2012-10-17 2013-02-27 北京搜狐新媒体信息技术有限公司 虚拟机调度和执行部署过程中的资源预处理方法及系统
CN103176847A (zh) * 2011-12-26 2013-06-26 英业达集团(天津)电子技术有限公司 虚拟机的分配方法
CN104008002A (zh) * 2014-06-17 2014-08-27 电子科技大学 云平台环境下虚拟机部署的目标主机选择方法
CN106020937A (zh) * 2016-07-07 2016-10-12 腾讯科技(深圳)有限公司 一种创建虚拟机的方法、装置及系统

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080089338A1 (en) * 2006-10-13 2008-04-17 Robert Campbell Methods for remotely creating and managing virtual machines
CN103164283B (zh) * 2012-05-10 2018-08-10 上海兆民云计算科技有限公司 一种虚拟桌面系统中虚拟化资源动态调度管理方法及系统
US8923320B2 (en) * 2012-12-10 2014-12-30 Dell Products L.P. Systems and methods for automating virtual network interface controller configuration during workload provisioning
CN103885831B (zh) * 2012-12-19 2017-06-16 中国电信股份有限公司 虚拟机宿主机的选择方法与装置
CN104793982A (zh) * 2014-01-20 2015-07-22 联想(北京)有限公司 一种创建虚拟机的方法和设备
US10613887B2 (en) * 2015-10-21 2020-04-07 International Business Machines Corporation Ordering optimization of host machines in a computing environment based on policies
US10146439B2 (en) * 2016-04-13 2018-12-04 Samsung Electronics Co., Ltd. System and method for high performance lockless scalable target

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176847A (zh) * 2011-12-26 2013-06-26 英业达集团(天津)电子技术有限公司 虚拟机的分配方法
CN102929701A (zh) * 2012-10-17 2013-02-13 北京搜狐新媒体信息技术有限公司 一种批量虚拟机的调度方法及装置
CN102946413A (zh) * 2012-10-17 2013-02-27 北京搜狐新媒体信息技术有限公司 虚拟机调度和执行部署过程中的资源预处理方法及系统
CN104008002A (zh) * 2014-06-17 2014-08-27 电子科技大学 云平台环境下虚拟机部署的目标主机选择方法
CN106020937A (zh) * 2016-07-07 2016-10-12 腾讯科技(深圳)有限公司 一种创建虚拟机的方法、装置及系统

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2780973C2 (ru) * 2018-05-25 2022-10-04 МАЙКРОСОФТ ТЕКНОЛОДЖИ ЛАЙСЕНСИНГ, ЭлЭлСи Ответ с идентификатором функции процессора для виртуализации
EP3800549A4 (en) * 2018-06-15 2021-08-04 Huawei Technologies Co., Ltd. ADMINISTRATIVE PROCEDURE, DEVICE AND SYSTEM FOR VIRTUAL MACHINERY
CN110730205A (zh) * 2019-09-06 2020-01-24 深圳平安通信科技有限公司 集群系统部署的方法、装置、计算机设备和存储介质
CN110730205B (zh) * 2019-09-06 2023-06-20 深圳平安通信科技有限公司 集群系统部署的方法、装置、计算机设备和存储介质
CN112882820A (zh) * 2019-11-29 2021-06-01 北京百度网讯科技有限公司 用于配置资源的方法及装置
CN111190691A (zh) * 2019-12-25 2020-05-22 中国建设银行股份有限公司 适用于虚拟机的自动迁移方法、系统、装置及存储介质
CN115454576A (zh) * 2022-09-29 2022-12-09 安超云软件有限公司 一种虚拟机进程管理方法、系统及电子设备
CN115454576B (zh) * 2022-09-29 2024-02-02 安超云软件有限公司 一种虚拟机进程管理方法、系统及电子设备

Also Published As

Publication number Publication date
US10642641B2 (en) 2020-05-05
US20180239633A1 (en) 2018-08-23
CN106020937A (zh) 2016-10-12

Similar Documents

Publication Publication Date Title
WO2018006864A1 (zh) 创建虚拟机的方法、装置及系统、控制设备和存储介质
US10969975B2 (en) Dynamically composable computing system, a data center, and method for dynamically composing a computing system
US10331492B2 (en) Techniques to dynamically allocate resources of configurable computing resources
EP2698711B1 (en) Method for dispatching central processing unit of hotspot domain virtual machine and virtual machine system
WO2018010654A1 (zh) 一种虚拟机热迁移的方法、装置及系统
US9019826B2 (en) Hierarchical allocation of network bandwidth for quality of service
US20180246751A1 (en) Techniques to select virtual machines for migration
WO2017019901A1 (en) Multiprocessing within a storage array system executing controller firmware designed for a uniprocessor environment
WO2016205978A1 (en) Techniques for virtual machine migration
JP2006018820A (ja) 仮想マシン環境においてオペレーティングシステムを実施するためのシステムおよび方法
WO2015101091A1 (zh) 一种分布式资源调度方法及装置
US10579416B2 (en) Thread interrupt offload re-prioritization
JP2017538184A (ja) 入出力(i/o)割込みの改良型優先ルーティングを実施する方法、システムおよびプログラム
JP6955163B2 (ja) 情報処理装置、情報処理方法及びプログラム
CN112513821A (zh) 用于scm应用的多实例2lm架构
US10949368B2 (en) Input/output command rebalancing in a virtualized computer system
CN115280285A (zh) 由独立操作的多个调度器在公共资源集上调度工作负载
CN113535087A (zh) 数据迁移过程中的数据处理方法、服务器及存储系统
US11080092B1 (en) Correlated volume placement in a distributed block storage service
JP6653786B2 (ja) I/o制御方法およびi/o制御システム
US20240111755A1 (en) Two-phase commit using reserved log sequence values
US11995016B2 (en) Input/output command rebalancing in a virtualized computer system
KR20140056743A (ko) 가상 클라우드 환경 내 맵리듀스 클러스터 및 이를 위한 설계방법
US11853807B1 (en) Cluster scaling based on task state information
US11048554B1 (en) Correlated volume placement in a distributed block storage service

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17823676

Country of ref document: EP

Kind code of ref document: A1