WO2015149514A1 - 一种虚拟机的部署方法及装置 - Google Patents

一种虚拟机的部署方法及装置 Download PDF

Info

Publication number
WO2015149514A1
WO2015149514A1 PCT/CN2014/090451 CN2014090451W WO2015149514A1 WO 2015149514 A1 WO2015149514 A1 WO 2015149514A1 CN 2014090451 W CN2014090451 W CN 2014090451W WO 2015149514 A1 WO2015149514 A1 WO 2015149514A1
Authority
WO
WIPO (PCT)
Prior art keywords
deployed
group
machines
virtual
groups
Prior art date
Application number
PCT/CN2014/090451
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 WO2015149514A1 publication Critical patent/WO2015149514A1/zh

Links

Images

Classifications

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

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for deploying a virtual machine.
  • Cloud computing brings new resource integration and usage models to IT.
  • Virtualized resources-based resource allocation and scheduling can improve cloud platform resources.
  • the utilization rate improves the service quality of the cloud platform and reduces the overall usage cost of cloud users.
  • the cloud platform forms a large-scale computing resource pool by aggregating physical machine hardware and network resources, and the virtual machine can be deployed on the physical machine.
  • the cloud platform allocates physical machine resources to the virtual machine through the resource scheduling system, and runs the application through the virtual machine.
  • the embodiment of the invention provides a method and a device for deploying a virtual machine, which are used to solve the crossover in the prior art.
  • the first aspect provides a method for deploying a virtual machine, including:
  • N is a positive integer that is greater than or equal to 2 and less than or equal to M;
  • the N groups are respectively deployed on the K physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where K is a positive integer equal to or greater than 1, and less than or equal to N.
  • the N groups are respectively deployed on the K physical machines, and specifically:
  • the N groups are deployed on K physical machines in descending order according to the unit resource return value of the group;
  • the unit resource return value of the group is:
  • the N groups are respectively deployed on the K physical machines, including:
  • the method further includes:
  • the virtual machine to be deployed in the i-th group Divided into S a group, where S is a positive integer that is greater than or equal to 2 and less than M-1;
  • the S groups are respectively deployed on the T physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where T is a positive integer equal to or greater than 1, and less than or equal to S.
  • the method further includes:
  • the N-th group is selected except the i-th group.
  • the sum of the network deployment traffic between the K physical machines and the K physical machines before the replacement The difference between the sum of the network deployment traffic is less than a set threshold, and the sum of the revenue parameter values of the virtual machines deployed on the K physical machines after the replacement is greater than the revenue parameter values of the virtual machines deployed on the K physical machines before the replacement. And, replacing the selected deployed virtual machine with the virtual machine in the i-th group.
  • a virtual machine deployment apparatus including:
  • the obtaining module is configured to obtain network deployment traffic between each of the two virtual machines to be deployed, where M is a positive integer greater than or equal to 2;
  • a dividing module configured to divide the M virtual machines to be deployed into N groups according to network deployment traffic between each of the M virtual machines to be deployed obtained by the acquiring module, The network deployment traffic between the N groups is minimized, where N is a positive integer that is greater than or equal to 2 and less than or equal to M;
  • a deployment module configured to deploy the N groups of the partitioning modules on the K physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where K is greater than or equal to 1, A positive integer less than or equal to N.
  • the deployment module is specifically configured to: use the unit resource division value of the N groups divided by the partitioning module according to a group resource return value from large to small The order is deployed on K physical machines;
  • the unit resource return value of the group is the ratio of the sum of the revenue parameter values of all the virtual machines to be deployed in the group to the sum of the resource parameter values corresponding to the resources required by all the virtual machines to be deployed in the group.
  • the deployment module is specifically configured to: divide the N The group is deployed on the K physical machines that meet the specified conditions, where the specified condition is that the resource parameter value corresponding to the remaining resources of the physical machine for deploying the i-th group is not less than that required for all the virtual machines to be deployed in the i-th group.
  • the sum of the resource parameter values corresponding to the resource, i is any positive integer between 1 and N.
  • the dividing module when M is greater than 2, is further configured to: for the first one of the N groups In the i group, when there is no physical machine that meets the specified conditions, and the i-th group has more than one virtual machine to be deployed, the virtual machine to be deployed in the i-th group is divided into S groups, where S is a positive integer greater than or equal to 2 and less than M-1;
  • the deployment module is further configured to deploy the S groups that are divided by the partitioning module on the T physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where T is greater than A positive integer equal to 1, less than or equal to S.
  • the deployment module is further configured to: in the N groups that are divided by the dividing module In the i group, when there is no physical machine that meets the specified condition, and the i-th group has only one virtual machine to be deployed, one of the N groups except the i-th group is deployed.
  • the selected deployed virtual machine is replaced with the virtual machine in the i-th group, the sum of the network deployment traffic between the K physical machines and the K physicals before the replacement
  • the difference between the sum of the network deployment traffic between the machines is less than a set threshold, and the sum of the revenue parameter values of the virtual machines deployed on the K physical machines after the replacement is greater than the virtual machine deployed on the K physical machines before the replacement
  • the selected deployed virtual machine is replaced with the virtual machine in the i-th group.
  • An embodiment of the present invention provides a method and an apparatus for deploying a virtual machine, and divides M virtual machines to be deployed into N groups according to network deployment traffic between each of the two virtual machines to be deployed.
  • the network deployment traffic between the N groups is minimized, and the virtual machines in the same group are deployed on the same physical machine.
  • FIG. 1 is a schematic diagram of a virtual machine deployment method according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a virtual machine deployment apparatus according to an embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of hardware of a virtual machine deployment apparatus according to an embodiment of the present invention.
  • Embodiments of the present invention provide a method for deploying a virtual machine, which aims to minimize network traffic between physical machines, so as to save traffic across physical network networks.
  • the method divides the M virtual machines to be deployed into N groups, and the network deployment traffic between the N groups is the smallest, and then the virtual groups in the same group are virtualized.
  • the machines are deployed on the same physical machine.
  • the network deployment traffic between the two virtual machines refers to the maximum deployable network traffic between the two virtual machines.
  • the maximum network traffic that can be deployed can be applied by the user applying for the deployment of the virtual machine, or can be specified by the network provider. .
  • FIG. 1 is a schematic diagram of a method for deploying a virtual machine according to an embodiment of the present disclosure, which specifically includes the following steps:
  • M is a positive integer greater than or equal to 2.
  • the deployment device may be preset in the cloud platform, and the deployment device may obtain network deployment traffic between each two virtual machines in the virtual machine to be deployed. Specifically, if a user applies for M virtual machines to the cloud platform, the network deployment traffic between the virtual machines to which the application is applied may be set. The virtual machines that the user applies for are the virtual machines to be deployed, and the deployment device may be based on the user. Application virtual submitted to the cloud platform The application request of the machine obtains network deployment traffic between every two virtual machines in the M virtual machines to be deployed that the user applies for.
  • the user needs to apply for five virtual machines, namely virtual machines A to E, that is, virtual machines A to E are five virtual machines to be deployed, and the user sets the network deployment traffic between virtual machine A and virtual machine B.
  • the network deployment traffic between the virtual machine A and the virtual machine C is 100M
  • the network deployment traffic between the virtual machine A and the virtual machine C is 100M
  • the network deployment traffic between the virtual machine D and the virtual machine E is 100M.
  • the user sends the number of the virtual machines and the network deployment traffic between the virtual machines to the cloud platform in the application request, and the deployment device in the cloud platform acquires each of the five virtual machines to be deployed preset by the user. Network deployment traffic between virtual machines.
  • S102 According to network deployment traffic between each of the two virtual machines to be deployed, the M virtual machines to be deployed are divided into N groups, so that network deployment traffic between the N groups is minimized.
  • N is a positive integer greater than or equal to 2 and less than or equal to M.
  • the network deployment traffic between any two of the N groups is: all the VMs to be deployed in the first group and all the tolls in the second group. The sum of network deployment traffic between deployed virtual machines.
  • the deployment device determines the network deployment traffic between each of the two virtual machines A to E
  • the virtual machine A to C and the virtual machine D can be determined for the virtual machine D and the virtual machine E.
  • Network traffic is not required between the virtual machine and the virtual machine E. That is, the network deployment traffic between the virtual machines A to C and the virtual machines D and E is the smallest. Therefore, the deployment device can divide the virtual machines A to C into one group. Virtual machine D and virtual machine E are divided into another group. Thus, for any one of the two groups, the sum of the required network traffic between all the virtual machines in the group and all the virtual machines in the other group is the smallest, that is, zero.
  • S103 The N groups are deployed on the K physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine.
  • K is a positive integer greater than or equal to 1, less than or equal to N.
  • the network deployment traffic between the virtual machines in each group and the virtual machines in other groups is the smallest in step S102, the virtual machines in the same group are deployed in the same object. After the machine is on, the required network traffic between the physical machines is also the smallest, which can reduce the network traffic that is wasted due to the interaction between the virtual machines.
  • the large interaction between the virtual machines in a group is only in the physical machine where the virtual machine is located. It can be done internally.
  • the deployment device divides the virtual machines A to C into one group. After the virtual machines D and E are divided into one group, the virtual machines A to C can be deployed on one physical machine, and the virtual machines D and E can be deployed. On another physical machine, thus, between the virtual machines A to C and the virtual machines D and E, there is no need to interact between the virtual machines A to C and the physical machines deploying the virtual machines D and E. There is no need to interact.
  • the interaction between virtual machines A and C can be performed inside the physical machine where virtual machines A to C are deployed.
  • the interaction between virtual machines D and E can be inside the physical machines where virtual machines D and E are deployed. This will save the network resources between the two physical machines.
  • the deployment device can also deploy the virtual machines A to E on the same physical machine, as long as the virtual machines in the same group are deployed on the same physical machine.
  • the method for deploying the N groups on the K physical machines in the step S103 may be: deploying the N groups on the K physical machines that meet the specified conditions, where the specified condition is used for deploying the i th
  • the value of the resource parameter corresponding to the remaining resources of the physical machine of the group is not less than the sum of the resource parameter values corresponding to the resources required by all the virtual machines to be deployed in the i-th group, and i is any positive integer between 1 and N.
  • the deployment device deploys a virtual machine in a group
  • the physical value of the remaining resources is not less than the sum of the resources (ie, the second sum) required by all the virtual machines in the group.
  • the physical machine that is found is the physical machine that meets the specified conditions, and then all the virtual machines in the group are deployed on the discovered physical machine.
  • the M virtual machines to be deployed are After being divided into N groups, the virtual machines in the larger revenue group can be preferentially deployed. Specifically, after the deployment device divides the M virtual machines to be deployed into N groups, the N groups may be deployed on the K physical machines in descending order according to the unit resource return value of the group.
  • the unit resource return value of a group is the ratio of the sum of the revenue parameter values of all the virtual machines to be deployed in the group, and the sum of the resource parameter values corresponding to the resources required by all the virtual machines to be deployed in the group. In this way, the virtual machines in the group with large unit resource revenue value can be preferentially deployed, thereby increasing the probability that the virtual machines in the group that can bring a large profit are successfully deployed.
  • the i-th group of the N groups may include multiple virtual machines; the deployment device divides the M virtual machines to be deployed into N groups, and for the N groups.
  • the i-th group when there is no physical machine that meets the specified conditions, and the i-th group has more than one virtual machine to be deployed, that is, when all the remaining resources of the physical machine are smaller than all the virtual ones in the i-th group
  • the deployment device may further divide the virtual machine to be deployed in the i-th group into S groups, so that the S The network deployment traffic between the groups is the smallest, where S is greater than or equal to 2 and less than the positive integer of M-1, and then the S groups are respectively deployed on T physical machines, so that the virtual machines to be deployed in the same group are deployed. Deployed on the same physical machine, where T is a positive integer greater than or equal to 1, less than or equal to S.
  • the network deployment traffic between each of the two virtual machines to be deployed in the i-th group is also performed according to the network deployment between the S groups.
  • the mode of dividing the traffic is the smallest, and the VMs to be deployed in the i-th group are re-divided into S groups.
  • the network deployment traffic between virtual machine A and virtual machine B is 100M
  • the network deployment traffic between virtual machine B and virtual machine C is 200M.
  • the remaining resources of any one of the physical machines are not less than the sum of the resources required by all the virtual machines in the i-th group (that is, the sum of the resources required by the virtual machines A to C)
  • the deployment device subdivides the virtual machines in the i-th group into S groups. Assuming S is 2, then:
  • the deployment device re-divides virtual machine A into a group, it is recorded as the first group, and virtual machine B is And C is re-divided into another group, which is recorded as the second group.
  • the virtual machine A in the first group only has 100M network deployment traffic between the virtual machine B in the second group, so the two groups are re-divided.
  • the network deployment traffic is 200M. It can be seen that the minimum division of network traffic required between the re-divided groups is the first division manner.
  • the first division manner enables the network deployment traffic between the re-grouped groups to be the minimum 100M. Therefore, The first type of division is used to re-group the virtual machines A to C in the i-th group, and after re-grouping, the virtual machines in the same group are deployed on the same physical machine, and then regrouped. Virtual machines are deployed on T physical machines.
  • the deployment device divides the M virtual machines to be deployed into N groups, for the i-th group in the N groups, when there is no physical machine that meets the specified condition (that is, all the remaining resources of the physical machine are smaller than If the sum of the resources required by all the virtual machines in the i-th group is only one, and the i-th group has only one virtual machine to be deployed, one of the N groups other than the i-th group may be selected.
  • the deployed virtual machine if the selected deployed virtual machine is replaced with the virtual machine in the i-th group, the sum of the network deployment traffic between the K physical machines and the K physicals before the replacement The difference between the sum of the network deployment traffic between the machines is less than a set threshold, and the sum of the revenue parameter values of the virtual machines deployed on the K physical machines after the replacement is greater than the virtual machine deployed on the K physical machines before the replacement
  • the selected virtual machine is replaced with the virtual machine in the i-th group.
  • the user wants to apply for five virtual machines, which are virtual machines A to E, that is, virtual machines A to E are five virtual machines to be deployed, and the user sets the network between virtual machine A and virtual machine B.
  • the deployment traffic is 100M
  • the network deployment traffic between VM B and VM C is 200M
  • the network deployment traffic between VM A and VM C is 100M
  • the traffic of the department is 100M.
  • the user sends the number of the virtual machines and the network deployment traffic between the virtual machines to the cloud platform in the application request, and the deployment device in the cloud platform acquires between each of the five virtual machines to be deployed. Network deployment traffic.
  • the deployment device divides the virtual machines A to C into one group, and records them as the first group, and divides the virtual machines D and the virtual machines E into another group, and records them as the second group.
  • the deployment device deploys the virtual machines A to C in the first group on the first physical machine, but when the deployment device deploys the virtual machines D and E in the second group, it is found that the remaining resources of any physical machine are not less than the second
  • the sum of the resources required by the virtual machines D and E in the group so that the second group is re-divided into two groups, and the virtual machine D is re-divided into one group, which is recorded as the third group, and the virtual machine E is re-divided.
  • the other group record it as the fourth group.
  • the deployment device determines that the remaining resources of the second physical machine are not less than the resources required by the virtual machine D in the third group, so the virtual machine D in the third group is deployed on the second physical machine.
  • the deployment device finds that the remaining resources of any physical machine are not less than the resources required by the virtual machine E in the fourth group. Therefore, one virtual machine is selected from the deployed virtual machines A to D.
  • the network between the first physical machine and the second physical machine can be determined according to the network deployment traffic between each of the currently deployed virtual machines (the deployed virtual machines are virtual machines A to D). The sum of deployment traffic is 0.
  • the deployment device replaces the virtual machine A that has been deployed on the first physical machine with the virtual machine E in the fourth group (ie, The virtual machine A is deployed on the first physical machine and the virtual machine E is deployed on the first physical machine.
  • the network deployment traffic between the virtual machine E and the virtual machine D is 100 M. Therefore, the first physical machine and the first physical machine are replaced.
  • the sum of the network deployment traffic of the two physical machines is 100M, and the sum of the network deployment traffic between the first physical machine and the second physical machine before the replacement is 0, so the network traffic required between the physical machines after replacement is And 100M minus 0 is not less than the set threshold 20M, so that the virtual machine A deployed on the first physical machine is not replaced with the virtual machine E of the fourth group. Similarly, the virtual machines B and C deployed on the first physical machine are not replaced with the virtual machines E of the fourth group.
  • the deployment device When the selected deployed virtual machine is virtual machine D, then the deployment device will be deployed in the second
  • the virtual machine D on the physical machine is replaced with the virtual machine E in the fourth group, and the sum of the network deployment traffic between the first physical machine and the second physical machine is still 0 after the replacement, so the physical machines between the replacements are replaced.
  • the difference between the sum of the network deployment traffic and the sum of the network deployment traffic between the physical machines before the replacement is less than the set threshold of 20M. If the value of the revenue parameter of the virtual machine E is greater than the value of the revenue parameter of the virtual machine D, the device is deployed.
  • the virtual machine D that has been deployed on the second physical machine is replaced with the virtual machine E in the fourth group, that is, the virtual machine D is moved out of the second physical machine, and the virtual machine E is deployed on the second physical machine.
  • the deployment device may search for the physical machine that meets the specified condition for the replaced virtual machine, and if found, deploy the replaced virtual machine to the found physical machine. On the machine, if the VM is not found, the virtual machine that is replaced fails to be deployed, and the deployment failure message of the VM can be returned to the user.
  • the embodiment of the present invention further provides a corresponding virtual machine deployment apparatus, as shown in FIG. 2 .
  • FIG. 2 is a schematic structural diagram of a device for deploying a virtual machine according to an embodiment of the present disclosure, which specifically includes:
  • the obtaining module 201 is configured to obtain network deployment traffic between each of the two virtual machines to be deployed, where M is a positive integer greater than or equal to 2;
  • the dividing module 202 is configured to divide the M virtual machines to be deployed into N according to network deployment traffic between each of the M virtual machines to be deployed acquired by the acquiring module 201.
  • the group is configured to minimize network deployment traffic between the N groups, where N is a positive integer that is greater than or equal to 2 and less than or equal to M;
  • the deployment module 203 is configured to deploy the N groups of the partitioning module 202 to the K physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where K is greater than or equal to 1, a positive integer less than or equal to N.
  • the deployment module 203 is specifically configured to: deploy the N groups divided by the dividing module 202 according to the unit resource return value of the group from the largest to the smallest, and deploy the data to the K physical machines;
  • the revenue value is the ratio of the sum of the revenue parameter values of all the virtual machines to be deployed in the group, and the sum of the resource parameter values corresponding to the resources required by all the virtual machines to be deployed in the group.
  • the deployment module 203 is specifically configured to deploy the N groups that are divided by the dividing module 202 on K physical machines that meet the specified condition, where the specified condition is the remaining physical machine used to deploy the i-th group.
  • the resource parameter value corresponding to the resource is not less than the sum of the resource parameter values corresponding to the resources required by all the virtual machines to be deployed in the i-th group, and i is any positive integer between 1 and N.
  • the dividing module 202 is further configured to: for the i-th group of the N groups, when there is no physical machine that meets the specified condition, and the i-th group has more than one virtual to be deployed The machine to be deployed in the i-th group is divided into S groups, where S is greater than or equal to 2 and less than a positive integer of M-1;
  • the deployment module 203 is further configured to deploy the S groups that are divided by the dividing module 202 on the T physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where T Is a positive integer greater than or equal to 1, less than or equal to S.
  • the deployment module 203 is further configured to: for the i-th group of the N groups divided by the dividing module 202, when there is no physical machine that meets the specified condition, and the i-th group When only one virtual machine to be deployed is selected, one of the N groups except the i-th group is selected; if the selected deployed virtual machine is replaced with the i-th group After the virtual machine, the difference between the sum of the network deployment traffic between the K physical machines and the network deployment traffic between the K physical machines before the replacement is less than a set threshold, and the K is replaced When the sum of the revenue parameter values of the virtual machines deployed on the physical machines is greater than the sum of the revenue parameter values of the virtual machines deployed on the K physical machines before the replacement, replacing the selected ones with the virtual machines in the i-th group The deployed virtual machine.
  • FIG. 3 is a schematic structural diagram of a hardware device for deploying a virtual machine according to an embodiment of the present disclosure, which specifically includes:
  • the processor 301, the memory 302, the communication interface 303, and the bus 304 are connected to one another via a bus 304.
  • Bus 304 can be used to transfer data or signals between two devices, devices.
  • the bus may specifically include an address bus, a data bus, a control bus, etc., for convenience of representation, only one thick line is shown in FIG. 3, but does not mean that there is only one bus or one type of bus.
  • the communication interface 303 is configured to acquire a network part between each of the two virtual machines to be deployed.
  • Department traffic, M is a positive integer greater than or equal to 2.
  • the memory 302 is configured to store a program.
  • the program may include program code comprising computer operating instructions for implementing the methods provided by the above-described embodiments.
  • the memory 302 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory.
  • RAM random access memory
  • the processor 301 executes the program stored in the memory 302, and is used to implement the method provided by the embodiment of the present invention, including:
  • N is a positive integer greater than or equal to 2 and less than or equal to M;
  • the N groups are respectively deployed on the K physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where K is a positive integer equal to or greater than 1, and less than or equal to N.
  • the deployment device of the virtual machine provided by the embodiment of the present invention may be a device of various forms, such as being integrated on a chip or being implemented by a hardware circuit.
  • the embodiment of the present invention further provides a storage medium, where the computer program is used to implement a method for deploying a virtual machine according to an embodiment of the present invention.
  • the method for deploying the virtual machine includes:
  • N is a positive integer greater than or equal to 2 and less than or equal to M;
  • the N groups are respectively deployed on the K physical machines, so that the virtual machines to be deployed in the same group are deployed on the same physical machine, where K is a positive integer equal to or greater than 1, and less than or equal to N.
  • the computer program stored in the storage medium includes program code, the program code including computer operating instructions for implementing the method provided by the embodiments of the present invention.
  • the storage medium may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk storage.
  • the embodiment of the invention provides a method and a device for deploying a virtual machine.
  • the M virtual machines to be deployed are divided into N groups, so that N The network deployment traffic between groups is the smallest, and the virtual machines in the same group are deployed on the same physical machine.
  • the network deployment traffic between the N groups is the smallest, after the virtual machines in the same group are deployed on the same physical machine, the network traffic required between the physical machines is also the smallest, which can effectively save the physics. Network traffic between machines.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, read-only optical ROM (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape storage or other magnetic storage device or any other non-transportable medium that can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

本发明实施例提供一种虚拟机的部署方法及装置,根据M个待部署虚拟机中每两个虚拟机之间的网络部署流量,将M个待部署虚拟机分为N个组,使得N个组之间的网络部署流量最小,再将同一个组内的虚拟机部署在同一个物理机上。通过上述方法,由于N个组之间的网络部署流量最小,因此,将同一个组内的虚拟机部署在同一个物理机上后,物理机之间所需的网络流量也最小,可有效节省物理机之间的网络流量。

Description

一种虚拟机的部署方法及装置
本申请要求于2014年3月31日提交中国专利局、申请号为201410126765.X、发明名称为“一种虚拟机的部署方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种虚拟机的部署方法及装置。
背景技术
虚拟化云计算技术的兴起和发展正逐渐影响改变着整个计算机产业界和学术界,云计算带给IT全新的资源整合和使用模式,基于虚拟化的资源按需分配与调度可以提高云平台资源的利用率,提升云平台的服务质量,也降低云用户的总体使用成本。
目前,云平台通过聚集物理机硬件与网络资源,形成大规模计算资源池,虚拟机可部署于物理机上,云平台则通过资源调度系统,把物理机资源分配给虚拟机,通过虚拟机运行应用程序,实现向用户提供云计算服务。
由于每个物理机所能提供的资源都是有限的,物理机的数量也是有限的,因此,在现有技术中,在物理机上部署虚拟机时,通常考虑的是如何在最少的物理机上部署最多的虚拟机,用以达到物理机资源最大利用率的目的。
然而,在实际应用中,由于虚拟机之间往往也需要进行信息交互,因此,如果将需要大量信息交互的多个虚拟机部署在不同的物理机上,就会浪费物理机之间大量的网络流量来满足部署于这些虚拟机之间的交互。
发明内容
本发明实施例提供一种虚拟机的部署方法及装置,用以解决现有技术中跨 物理机的网络流量大的问题。
第一方面,提供一种虚拟机的部署方法,包括:
获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
根据所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的正整数;
将所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
结合第一方面,在第一方面的第一种可能的实现方式中,将所述N个组分别部署在K个物理机上,具体包括:
将所述N个组按照组的单位资源收益值从大到小的顺序,先后部署在K个物理机上;
其中,组的单位资源收益值为:
所述组内所有待部署虚拟机的收益参数值之和与所述组内所有待部署虚拟机所需资源对应的资源参数值之和的比值。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,将所述N个组分别部署在K个物理机上,具体包括:
将所述N个组部署在满足指定条件的K个物理机上,其中所述指定条件为用于部署第i组的物理机剩余的资源对应的资源参数值不小于所述第i组内所有待部署虚拟机所需资源对应的资源参数值之和,i为1到N之间的任意正整数。
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,当M大于2时,所述方法还包括:
针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组有大于1个待部署虚拟机时,将所述第i组内的待部署虚拟机划分为S个 组,其中S为大于等于2,小于M-1的正整数;
将所述S个组分别部署在T个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,T为大于等于1,小于等于S的正整数。
结合第一方面的第二种可能的实现方式,在第一方面的第四种可能的实现方式中,当M大于2时,所述方法还包括:
针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组只有1个待部署虚拟机时,选择所述N个组中除所述第i组之外任意一个组中一个已部署的虚拟机;
如果将所述选择的已部署的虚拟机替换为所述第i组内的虚拟机后,所述K个物理机之间的网络部署流量之和与替换前所述K个物理机之间的网络部署流量之和的差值小于设定阈值,且替换后所述K个物理机上部署的虚拟机的收益参数值之和大于替换前所述K个物理机上部署的虚拟机的收益参数值之和时,用所述第i组内的虚拟机替换所述选择的已部署的虚拟机。
第二方面,提供一种虚拟机的部署装置,包括:
获取模块,用于获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
划分模块,用于根据所述获取模块获取的所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的正整数;
部署模块,用于将所述划分模块划分的所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
结合第二方面,在第二方面的第一种可能的实现方式中,所述部署模块具体用于,将所述划分模块划分的所述N个组按照组的单位资源收益值从大到小的顺序,先后部署在K个物理机上;
其中,组的单位资源收益值为:所述组内所有待部署虚拟机的收益参数值之和与所述组内所有待部署虚拟机所需资源对应的资源参数值之和的比值。
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述部署模块具体用于,将所述划分模块划分的所述N个组部署在满足指定条件的K个物理机上,其中所述指定条件为用于部署第i组的物理机剩余的资源对应的资源参数值不小于所述第i组内所有待部署虚拟机所需资源对应的资源参数值之和,i为1到N之间的任意正整数。
结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,当M大于2时,所述划分模块还用于,针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组有大于1个待部署虚拟机时,将所述第i组内的待部署虚拟机划分为S个组,其中S为大于等于2,小于M-1的正整数;
所述部署模块还用于,将所述划分模块划分的所述S个组分别部署在T个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,T为大于等于1,小于等于S的正整数。
结合第二方面的第二种可能的实现方式,在第二方面的第四种可能的实现方式中,所述部署模块还用于,针对所述划分模块划分的所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组只有1个待部署虚拟机时,选择所述N个组中除所述第i组之外任意一个组中一个已部署的虚拟机;如果将所述选择的已部署的虚拟机替换为所述第i组内的虚拟机后,所述K个物理机之间的网络部署流量之和与替换前所述K个物理机之间的网络部署流量之和的差值小于设定阈值,且替换后所述K个物理机上部署的虚拟机的收益参数值之和大于替换前所述K个物理机上部署的虚拟机的收益参数值之和时,用所述第i组内的虚拟机替换所述选择的已部署的虚拟机。
本发明实施例提供一种虚拟机的部署方法及装置,根据M个待部署虚拟机中每两个虚拟机之间的网络部署流量,将M个待部署虚拟机分为N个组, 使得N个组之间的网络部署流量最小,再将同一个组内的虚拟机部署在同一个物理机上。通过上述方法,由于N个组之间的网络部署流量最小,因此,将同一个组内的虚拟机部署在同一个物理机上后,物理机之间所需的网络流量也最小,可有效节省物理机之间的网络流量。
附图说明
图1为本发明实施例提供的虚拟机部署方法;
图2为本申请实施例提供的虚拟机的部署装置结构示意图;
图3为本发明实施例提供的虚拟机的部署装置硬件结构示意图。
具体实施方式
本发明实施例提供一种部署虚拟机的方法,旨在使物理机之间的网络流量最小,以达到节省跨物理机网络流量的目的。该方法根据预设的每两个虚拟机之间的网络部署流量,将M个待部署虚拟机分为N个组,N个组之间的网络部署流量最小,再将同一个组内的虚拟机部署在同一个物理机上。两个虚拟机之间的网络部署流量是指两个虚拟机之间的可部署最大网络流量,该可部署最大网络流量可以是申请部署虚拟机的用户申请的,也可以是网络提供商指定的。
下面结合说明书附图,对本发明实施例进行详细描述。
图1为本发明实施例提供的虚拟机部署方法,具体包括以下步骤:
S101:获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量。
其中,M为大于等于2的正整数。
在本发明实施例中,可在云平台中预置部署装置,部署装置可获取待部署虚拟机中每两个虚拟机之间的网络部署流量。具体的,假设用户向云平台申请M个虚拟机时,可设定其申请的各虚拟机之间的网络部署流量,用户申请的这些虚拟机即为待部署虚拟机,部署装置则可根据用户向云平台提交的申请虚拟 机的申请请求,获取用户申请的M个待部署虚拟机中每两个虚拟机之间的网络部署流量。
例如,用户要申请5个虚拟机,分别为虚拟机A~E,也即,虚拟机A~E就是5个待部署虚拟机,用户设定虚拟机A与虚拟机B之间的网络部署流量为100M、虚拟机B与虚拟机C之间的网络部署流量为200M、虚拟机A与虚拟机C之间的网络部署流量为100M、虚拟机D与虚拟机E之间的网络部署流量为100M。用户将上述虚拟机的数量以及各虚拟机之间的网络部署流量携带在申请请求中发送给云平台,云平台中的部署装置则获取用户预设的这5个待部署虚拟机中每两个虚拟机之间的网络部署流量。
S102:根据M个待部署虚拟机中每两个虚拟机之间的网络部署流量,将M个待部署虚拟机划分为N个组,使得该N个组之间的网络部署流量最小。
其中,N为大于等于2,小于等于M的正整数,该N个组中任意两个组之间的网络部署流量为:第一组内的所有待部署虚拟机与第二组内的所有待部署虚拟机之间的网络部署流量之和。
继续沿用上例,部署装置确定了待部署虚拟机A~E中每两个虚拟机之间的网络部署流量后,针对虚拟机D和虚拟机E,可确定虚拟机A~C与虚拟机D和虚拟机E之间均不需要网络流量,也即,虚拟机A~C与虚拟机D和E之间的网络部署流量最小,因此,部署装置可将虚拟机A~C分为一个组,将虚拟机D和虚拟机E分为另一个组。这样,对于这两个组中的任意一个组来说,该组内的所有虚拟机与另一个组内的所有虚拟机之间所需的网络流量之和为最小,即为0。
S103:将N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上。
其中,K为大于等于1,小于等于N的正整数。
在本发明实施例中,由于步骤S102中每个组内的虚拟机与其他组内的虚拟机之间的网络部署流量最小,因此,将同一个组内的虚拟机部署在同一个物 理机上后,各物理机之间所需的网络流量也最小,可以减少因虚拟机之间的交互而浪费的网络流量,一个组内的虚拟机之间的大量交互只在其所在的物理机内部进行即可。
继续沿用上例,部署装置将虚拟机A~C分为一个组,将虚拟机D和E分为一个组后,可将虚拟机A~C部署在一个物理机上,将虚拟机D和E部署在另一个物理机上,从而,由于虚拟机A~C与虚拟机D和E之间不需要进行交互,因此,部署虚拟机A~C的物理机和部署虚拟机D和E的物理机之间也不需要进行交互,虚拟机A~C之间的交互可在部署虚拟机A~C的物理机内部进行,虚拟机D和E之间的交互可在部署虚拟机D和E的物理机内部进行,进而可节省这两个物理机之间的网络资源。
当然,部署装置也可将虚拟机A~E均部署在同一个物理机上,只要保证同一个组内的虚拟机部署在同一个物理机上即可。
进一步的,由于将一个虚拟机部署在一个物理机上后,该虚拟机需要使用该物理机上的资源(例如计算资源、存储资源等)来运行,因此,将M个待部署虚拟机分为N个组后,上述步骤S103中部署装置将N个组分别部署在K个物理机上的方法可以为:将N个组部署在满足指定条件的K个物理机上,其中该指定条件为用于部署第i组的物理机剩余的资源对应的资源参数值不小于该第i组内所有待部署虚拟机所需资源对应的资源参数值之和,i为1到N之间的任意正整数。也即,部署装置在部署一个组内的虚拟机时,在各物理机中,查找剩余的资源不小于该组内所有虚拟机所需的资源的和值(即,第二和值)的物理机,查找到的物理机即为满足指定条件的物理机,再将该组内的所有虚拟机都部署在查找到的物理机上。
更进一步的,由于对于一个组内的虚拟机来说,并不是所有的物理机都可以部署该组内的虚拟机(如,剩余的资源小于该组内虚拟机所需的资源的和值的物理机),因此,为了在节省物理机之间的网络流量的同时,兼顾虚拟机所带来的收益,在本发明实施例提供的上述部署方法中,对M个待部署虚拟机 分为N个组之后,可优先部署收益较大组内的虚拟机。具体的,部署装置对M个待部署虚拟机分为N个组之后,可将该N个组按照组的单位资源收益值从大到小的顺序,先后部署在K个物理机上。其中,一个组的单位资源收益值为:该组内所有待部署虚拟机的收益参数值之和,与该组内所有待部署虚拟机所需资源对应的资源参数值之和的比值。这样,即可保证单位资源收益值较大的组内的虚拟机可以被优先部署,进而提高了可以带来较大收益的组内的虚拟机被成功部署的几率。
另一方面,当M大于2时,所述N个组中的第i组内可能包括多个虚拟机;部署装置将M个待部署虚拟机分为N个组后,针对该N个组中的第i组,当不存在满足指定条件的物理机,且该第i组有大于1个待部署虚拟机时,也即,当所有的物理机剩余的资源均小于该第i组内所有虚拟机所需的资源的和值,且该第i组有大于1个待部署虚拟机时,部署装置则可将该第i组内的待部署虚拟机再划分为S个组,使得所述S个组之间的网络部署流量最小,其中,S为大于等于2,小于M-1的正整数,再将该S个组分别部署在T个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,T为大于等于1,小于等于S的正整数。
具体的,将第i组内的虚拟机再划分为S个组时,同样要根据该第i组内每两个待部署虚拟机之间的网络部署流量,按照S个组之间的网络部署流量最小的划分方式,将该第i组内的待部署虚拟机重新划分为S个组。
例如,假设第i组内有虚拟机A~C,其中,虚拟机A与虚拟机B之间的网络部署流量为100M,虚拟机B与虚拟机C之间的网络部署流量为200M,则当没有任何一个物理机剩余的资源不小于该第i组内所有虚拟机所需的资源的和值(即,虚拟机A~C所需的资源的和值)时,由于该第i组内有3个待部署虚拟机,因此部署装置将第i组内的虚拟机再划分为S个组。假设S为2,则:
部署装置如果将虚拟机A重新划分为一个组,记为第一组,将虚拟机B 和C重新划分为另一个组,记为第二组,则第一组中的虚拟机A只与第二组中的虚拟机B之间有100M的网络部署流量,因此重新划分的两个组之间的网络部署流量就是100M。如果将虚拟机B重新划分为一个组,将虚拟机A和C重新划分为另一个组,则由于虚拟机B与虚拟机A之间有100M网络部署流量,虚拟机B与虚拟机C之间有200M网络部署流量,因此重新划分的两个组之间的网络部署流量为100M+200M=300M。如果将虚拟机C重新划分为一个组,将虚拟机A和B重新划分为另一个组,则由于虚拟机B与虚拟机C之间有200M的网络部署流量,因此重新划分的两个组之间的网络部署流量为200M。可见,重新划分的两个组之间所需的网络流量最小的划分方式是第一种划分方式,第一种划分方式可使重新划分的组之间的网络部署流量为最小的100M,因此,采用第一种划分方式重新对该第i组内的虚拟机A~C分组,并在重新分组后,按照将同一个组内的虚拟机部署在同一个物理机上的方式,将重新分组后的虚拟机部署在T个物理机上。
另外,部署装置将M个待部署虚拟机分为N个组后,针对该N个组中的第i组,当不存在满足指定条件的物理机(即,所有的物理机剩余的资源均小于该第i组内所有虚拟机所需的资源的和值),且该第i组只有1个待部署虚拟机时,则可选择N个组中除第i组之外任意一个组中的一个已部署的虚拟机,如果将选择的该已部署的虚拟机替换为该第i组内的虚拟机后,所述K个物理机之间的网络部署流量之和与替换前所述K个物理机之间的网络部署流量之和的差值小于设定阈值,且替换后所述K个物理机上部署的虚拟机的收益参数值之和大于替换前所述K个物理机上部署的虚拟机的收益参数值之和时,采用该第i组内的虚拟机替换选择的该已部署的虚拟机。
例如,假设用户要申请5个虚拟机,分别为虚拟机A~E,也即,虚拟机A~E即为5个待部署虚拟机,用户设定虚拟机A与虚拟机B之间的网络部署流量为100M、虚拟机B与虚拟机C之间的网络部署流量为200M、虚拟机A与虚拟机C之间的网络部署流量为100M、虚拟机D与虚拟机E之间的网络部 署流量为100M。用户将上述虚拟机的数量以及各虚拟机之间的网络部署流量携带在申请请求中发送给云平台,云平台中的部署装置则获取这5个待部署虚拟机中每两个虚拟机之间的网络部署流量。
部署装置将虚拟机A~C分为一个组,记为第一组,将虚拟机D和虚拟机E分为另一个组,记为第二组。部署装置将第一组内的虚拟机A~C部署在第一物理机上,但部署装置在部署第二组内的虚拟机D和E时,发现没有任何物理机的剩余资源不小于该第二组内的虚拟机D和E所需的资源的和值,从而将第二组重新划分为两个组,将虚拟机D重新划分为一个组,记为第三组,将虚拟机E重新划分为另一个组,记为第四组。
针对第三组,部署装置确定第二物理机的剩余资源不小于第三组内的虚拟机D所需的资源,因此将第三组内的虚拟机D部署在第二物理机上。
针对第四组,部署装置发现仍没有任何物理机的剩余资源不小于该第四组内的虚拟机E所需的资源,因此,从已部署的虚拟机A~D中选择一个虚拟机。根据当前已部署的各虚拟机(已部署的虚拟机为虚拟机A~D)中每两个虚拟机之间的网络部署流量,可确定当前第一物理机和第二物理机之间的网络部署流量之和为0,。
假设设定阈值为20M,当选择的已部署的虚拟机是虚拟机A时,则部署装置如果将已部署在第一物理机上的虚拟机A替换为第四组中的虚拟机E(即,将虚拟机A迁出第一物理机,将虚拟机E部署在第一物理机上),则由于虚拟机E与虚拟机D之间的网络部署流量为100M,因此替换后第一物理机与第二物理机的网络部署流量之和为100M,而替换前的第一物理机与第二物理机之间的网络部署流量之和为0,因此替换后各物理机之间所需的网络流量之和100M减0不小于设定阈值20M,从而不将部署在第一物理机上的虚拟机A替换为第四组的虚拟机E。类似的,也不将部署在第一物理机上的虚拟机B、C替换为第四组的虚拟机E。
当选择的已部署的虚拟机是虚拟机D时,则部署装置如果将已部署在第二 物理机上的虚拟机D替换为第四组中的虚拟机E,则替换后第一物理机与第二物理机之间的网络部署流量之和仍为0,因此替换后各物理机之间的网络部署流量之和0减替换前各物理机之间的网络部署流量之和0的差值小于设定阈值20M,假设虚拟机E的收益参数值大于虚拟机D的收益参数值,则部署装置将已部署在第二物理机上的虚拟机D替换为第四组中的虚拟机E,即,将虚拟机D迁出第二物理机,将虚拟机E部署在第二物理机上。
后续的,对于被替换出来的虚拟机,部署装置则可针对该被替换出来的虚拟机查找满足指定条件的物理机,若查找到,则将该被替换出来的虚拟机部署在查找到的物理机上,若未查找到,则该被替换出来的虚拟机部署失败,可向用户返回该虚拟机的部署失败消息。
以上为本发明实施例提供的虚拟机的部署方法,基于同样的发明思路,本发明实施例还提供了相应的虚拟机部署装置,如图2所示。
图2为本申请实施例提供的虚拟机的部署装置结构示意图,具体包括:
获取模块201,用于获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
划分模块202,用于根据所述获取模块201获取的所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的正整数;
部署模块203,用于将所述划分模块202划分的所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
所述部署模块203具体用于,将所述划分模块202划分的所述N个组按照组的单位资源收益值从大到小的顺序,先后部署在K个物理机上;其中,组的单位资源收益值为:所述组内所有待部署虚拟机的收益参数值之和,与所述组内所有待部署虚拟机所需资源对应的资源参数值之和的比值。
所述部署模块203具体用于,将所述划分模块202划分的所述N个组部署在满足指定条件的K个物理机上,其中所述指定条件为用于部署第i组的物理机剩余的资源对应的资源参数值不小于所述第i组内所有待部署虚拟机所需资源对应的资源参数值之和,i为1到N之间的任意正整数。
当M大于2时,所述划分模块202还用于,针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组有大于1个待部署虚拟机时,将所述第i组内的待部署虚拟机划分为S个组,其中S为大于等于2,小于M-1的正整数;
所述部署模块203还用于,将所述划分模块202划分的所述S个组分别部署在T个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,T为大于等于1,小于等于S的正整数。
当M大于2时,所述部署模块203还用于,针对所述划分模块202划分的所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组只有1个待部署虚拟机时,选择所述N个组中除所述第i组之外一个已部署的虚拟机;如果将所述选择的已部署的虚拟机替换为所述第i组内的虚拟机后,所述K个物理机之间的网络部署流量之和与替换前所述K个物理机之间的网络部署流量之和的差值小于设定阈值,且替换后所述K个物理机上部署的虚拟机的收益参数值之和大于替换前所述K个物理机上部署的虚拟机的收益参数值之和时,用所述第i组内的虚拟机替换所述选择的已部署的虚拟机。
图3为本发明实施例提供的虚拟机的部署装置硬件结构示意图,具体包括:
处理器301、存储器302、通信接口303和总线304。处理器301、存储器302、通信接口303通过总线304相互连接。
总线304可以用于在两个设备、器件之间传输数据或信号。例如,总线具体可以包括地址总线、数据总线、控制总线等,为便于表示,图3中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口303,用于获取M个待部署虚拟机中每两个虚拟机之间的网络部 署流量,M为大于等于2的正整数。
存储器302,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括用于实现上述实施例提供的方法的计算机操作指令。存储器302可能包含高速随机存取存储器(random access memory,简称RAM)存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
处理器301执行存储器302所存放的程序,用于实现本发明实施例提供的方法,包括:
通过通信接口303获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
根据所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的的正整数;
将所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
本发明实施例提供的虚拟机的部署装置可以是各种形态的装置,如集成在一块芯片上或通过硬件电路搭建实现等。
本发明实施例还提供一种存储介质,该存储介质中存储计算机程序,该计算机程序用于实现本发明实施例提供的虚拟机的部署方法,例如,所述虚拟机的部署方法包括:
获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
根据所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的的正整数;
将所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
所述存储介质中存储的计算机程序包括程序代码,所述程序代码包括用于实现本发明实施例提供的方法的计算机操作指令。存储介质可能包含高速随机存取存储器(random access memory,简称RAM)存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
本发明实施例提供一种虚拟机的部署方法及装置,根据M个待部署虚拟机中每两个虚拟机之间的网络部署流量,将M个待部署虚拟机分为N个组,使得N个组之间的网络部署流量最小,再将同一个组内的虚拟机部署在同一个物理机上。通过上述方法,由于N个组之间的网络部署流量最小,因此,将同一个组内的虚拟机部署在同一个物理机上后,物理机之间所需的网络流量也最小,可有效节省物理机之间的网络流量。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器 (CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (10)

  1. 一种虚拟机的部署方法,其特征在于,包括:
    获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
    根据所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的正整数;
    将所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
  2. 如权利要求1所述的方法,其特征在于,将所述N个组分别部署在K个物理机上,具体包括:
    将所述N个组按照组的单位资源收益值从大到小的顺序,先后部署在K个物理机上;其中,组的单位资源收益值为:
    所述组内所有待部署虚拟机的收益参数值之和与所述组内所有待部署虚拟机所需资源对应的资源参数值之和的比值。
  3. 如权利要求1或2所述的方法,其特征在于,将所述N个组分别部署在K个物理机上,具体包括:
    将所述N个组部署在满足指定条件的K个物理机上,其中所述指定条件为用于部署第i组的物理机剩余的资源对应的资源参数值不小于所述第i组内所有待部署虚拟机所需资源对应的资源参数值之和,i为1到N之间的任意正整数。
  4. 如权利要求3所述的方法,其特征在于,当M大于2时,所述方法还包括:
    针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组有大于1个待部署虚拟机时,将所述第i组内的待部署虚拟机划分为S个组,其中S为大于等于2,小于M-1的正整数;
    将所述S个组分别部署在T个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,T为大于等于1,小于等于S的正整数。
  5. 如权利要求3所述的方法,其特征在于,当M大于2时,所述方法还包括:
    针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组只有1个待部署虚拟机时,选择所述N个组中除所述第i组之外任意一个组中一个已部署的虚拟机;
    如果将所述选择的已部署的虚拟机替换为所述第i组内的虚拟机后,所述K个物理机之间的网络部署流量之和与替换前所述K个物理机之间的网络部署流量之和的差值小于设定阈值,且替换后所述K个物理机上部署的虚拟机的收益参数值之和大于替换前所述K个物理机上部署的虚拟机的收益参数值之和时,用所述第i组内的虚拟机替换所述选择的已部署的虚拟机。
  6. 一种虚拟机的部署装置,其特征在于,包括:
    获取模块,用于获取M个待部署虚拟机中每两个虚拟机之间的网络部署流量,M为大于等于2的正整数;
    划分模块,用于根据所述获取模块获取的所述M个待部署虚拟机中每两个待部署虚拟机之间的网络部署流量,将所述M个待部署虚拟机划分为N个组,使得所述N个组之间的网络部署流量最小,其中N为大于等于2,小于等于M的正整数;
    部署模块,用于将所述划分模块划分的所述N个组分别部署在K个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,K为大于等于1,小于等于N的正整数。
  7. 如权利要求6所述的装置,其特征在于,所述部署模块具体用于,将所述划分模块划分的所述N个组按照组的单位资源收益值从大到小的顺序,先后部署在K个物理机上;其中,组的单位资源收益值为:所述组内所有待部署虚拟机的收益参数值之和与所述组内所有待部署虚拟机所需资源对应的资源 参数值之和的比值。
  8. 如权利要求6或7所述的装置,其特征在于,所述部署模块具体用于,将所述划分模块划分的所述N个组部署在满足指定条件的K个物理机上,其中所述指定条件为用于部署第i组的物理机剩余的资源对应的资源参数值不小于所述第i组内所有待部署虚拟机所需资源对应的资源参数值之和,i为1到N之间的任意正整数。
  9. 如权利要求8所述的装置,其特征在于,当M大于2时,所述划分模块还用于,针对所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组有大于1个待部署虚拟机时,将所述第i组内的待部署虚拟机划分为S个组,其中S为大于等于2,小于M-1的正整数;
    所述部署模块还用于,将所述划分模块划分的所述S个组分别部署在T个物理机上,使得同一个组内的待部署虚拟机部署在同一个物理机上,其中,T为大于等于1,小于等于S的正整数。
  10. 如权利要求8所述的装置,其特征在于,当M大于2时,所述部署模块还用于,针对所述划分模块划分的所述N个组中的第i组,当不存在满足指定条件的物理机,且所述第i组只有1个待部署虚拟机时,选择所述N个组中除所述第i组之外任意一个组中一个已部署的虚拟机;如果将所述选择的已部署的虚拟机替换为所述第i组内的虚拟机后,所述K个物理机之间的网络部署流量之和与替换前所述K个物理机之间的网络部署流量之和的差值小于设定阈值,且替换后所述K个物理机上部署的虚拟机的收益参数值之和大于替换前所述K个物理机上部署的虚拟机的收益参数值之和时,用所述第i组内的虚拟机替换所述选择的已部署的虚拟机。
PCT/CN2014/090451 2014-03-31 2014-11-06 一种虚拟机的部署方法及装置 WO2015149514A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410126765.X 2014-03-31
CN201410126765.XA CN103902353A (zh) 2014-03-31 2014-03-31 一种虚拟机的部署方法及装置

Publications (1)

Publication Number Publication Date
WO2015149514A1 true WO2015149514A1 (zh) 2015-10-08

Family

ID=50993692

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/090451 WO2015149514A1 (zh) 2014-03-31 2014-11-06 一种虚拟机的部署方法及装置

Country Status (2)

Country Link
CN (1) CN103902353A (zh)
WO (1) WO2015149514A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362380A (zh) * 2019-06-17 2019-10-22 东南大学 一种面向网络靶场的多目标优化虚拟机部署方法
CN111538560A (zh) * 2020-03-09 2020-08-14 西安电子科技大学 一种虚拟机部署方法、装置、电子设备及其存储介质

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902353A (zh) * 2014-03-31 2014-07-02 华为技术有限公司 一种虚拟机的部署方法及装置
CN105718299A (zh) * 2014-12-04 2016-06-29 中国移动通信集团广东有限公司 虚拟机的配置方法、装置及系统
CN108268301B (zh) * 2016-12-30 2021-09-03 中国移动通信集团上海有限公司 虚拟网络功能的虚拟机部署方法及装置
CN108289113A (zh) * 2017-01-10 2018-07-17 中兴通讯股份有限公司 vBNG系统多虚拟机负荷分担方法及vBNG系统设备
CN109298949B (zh) * 2018-12-04 2021-08-20 国网辽宁省电力有限公司大连供电公司 一种分布式文件系统的资源调度系统
CN110308970A (zh) * 2019-06-28 2019-10-08 南瑞集团有限公司 虚拟机的部署方法、装置
CN110990024B (zh) * 2019-11-28 2024-02-09 合肥讯飞数码科技有限公司 一种应用部署方法、装置、设备及存储介质
CN112379975A (zh) * 2020-12-04 2021-02-19 海光信息技术股份有限公司 一种虚拟机热迁移策略的生成系统及其生成方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070074199A1 (en) * 2005-09-27 2007-03-29 Sebastian Schoenberg Method and apparatus for delivering microcode updates through virtual machine operations
WO2012129400A2 (en) * 2011-03-23 2012-09-27 Color Labs, Inc. Sharing content among multiple devices
CN103176849A (zh) * 2013-03-12 2013-06-26 浙江大学 一种基于资源分类的虚拟机集群的部署方法
CN103902353A (zh) * 2014-03-31 2014-07-02 华为技术有限公司 一种虚拟机的部署方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070074199A1 (en) * 2005-09-27 2007-03-29 Sebastian Schoenberg Method and apparatus for delivering microcode updates through virtual machine operations
WO2012129400A2 (en) * 2011-03-23 2012-09-27 Color Labs, Inc. Sharing content among multiple devices
CN103176849A (zh) * 2013-03-12 2013-06-26 浙江大学 一种基于资源分类的虚拟机集群的部署方法
CN103902353A (zh) * 2014-03-31 2014-07-02 华为技术有限公司 一种虚拟机的部署方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362380A (zh) * 2019-06-17 2019-10-22 东南大学 一种面向网络靶场的多目标优化虚拟机部署方法
CN110362380B (zh) * 2019-06-17 2022-08-26 东南大学 一种面向网络靶场的多目标优化虚拟机部署方法
CN111538560A (zh) * 2020-03-09 2020-08-14 西安电子科技大学 一种虚拟机部署方法、装置、电子设备及其存储介质

Also Published As

Publication number Publication date
CN103902353A (zh) 2014-07-02

Similar Documents

Publication Publication Date Title
WO2015149514A1 (zh) 一种虚拟机的部署方法及装置
US11334382B2 (en) Technologies for batching requests in an edge infrastructure
US9851994B2 (en) Dynamically deployed virtual machine
WO2018010654A1 (zh) 一种虚拟机热迁移的方法、装置及系统
CN107968810B (zh) 一种服务器集群的资源调度方法、装置和系统
US20150113529A1 (en) Method, System and Apparatus for Creating Virtual Machine
TW201818261A (zh) 應用的擴容方法、裝置和系統
US8924561B2 (en) Dynamically resizing a networked computing environment to process a workload
JP6886964B2 (ja) 負荷平衡方法及び装置
US20160182320A1 (en) Techniques to generate a graph model for cloud infrastructure elements
US10356167B1 (en) Workload profiling
US9384027B2 (en) Selecting a host for a virtual machine using a hardware multithreading parameter
US20190243762A1 (en) Coordination of cache and memory reservation
WO2018086467A1 (zh) 一种云环境下应用集群资源分配的方法、装置和系统
WO2016041446A1 (zh) 一种资源分配方法、装置及设备
US11012316B2 (en) Methods and apparatus to generate and manage workload domains in virtual server racks
TW201702870A (zh) 一種資源分配方法和裝置
CN103856548A (zh) 动态资源调度方法和动态资源调度器
WO2017000645A1 (zh) 一种分配宿主机资源的方法和装置
WO2013082742A1 (zh) 资源调度方法、装置和系统
CN110018878B (zh) 一种分布式系统数据加载方法以及装置
CN106528189A (zh) 一种启动备份任务的方法、装置及电子设备
CN110716813A (zh) 数据流处理方法、装置、可读存储介质及处理器
CN109412865B (zh) 一种虚拟网络资源分配方法、系统及电子设备
US9690728B1 (en) Burst buffer appliance comprising multiple virtual machines

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase
122 Ep: pct application non-entry in european phase

Ref document number: 14888204

Country of ref document: EP

Kind code of ref document: A1