WO2015032201A1 - 虚拟机放置方法和装置 - Google Patents

虚拟机放置方法和装置 Download PDF

Info

Publication number
WO2015032201A1
WO2015032201A1 PCT/CN2014/075111 CN2014075111W WO2015032201A1 WO 2015032201 A1 WO2015032201 A1 WO 2015032201A1 CN 2014075111 W CN2014075111 W CN 2014075111W WO 2015032201 A1 WO2015032201 A1 WO 2015032201A1
Authority
WO
WIPO (PCT)
Prior art keywords
started
virtual machine
resource usage
physical host
service
Prior art date
Application number
PCT/CN2014/075111
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 WO2015032201A1 publication Critical patent/WO2015032201A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a virtual machine placement method and apparatus.
  • Server virtualization technology is a key technology based on the infrastructure layer in cloud computing.
  • multiple virtual machines virtual operating systems
  • a virtualized cluster manages at least two hosts in a unified manner, and abstracts physical resources into a resource pool composed of various resources such as storage, computing, and network through virtualization technology.
  • the virtual machine applies for resources on demand and is deployed to the cluster. in.
  • An important feature of a virtualized cluster is to dynamically select the appropriate placement location for the virtual machine to be started - the initial placement of the virtual machine: in management ' ⁇ according to the resource requirements of the virtual machine to be started, and the resource distribution of each host in the cluster In this case, select a suitable physical host to start the virtual machine, thereby achieving load balancing within the cluster, improving the resource utilization efficiency of each physical host, and ensuring that each physical host bears an appropriate load.
  • the main factors to consider when selecting the location of the virtual machine can include the resource requirements of the virtual machine to be started (which can be called resource usage) and the amount of resources available to the physical host in the cluster.
  • the clustering scheme of the virtualization vendor may include: DRS (D i s t r i i t t ed Res s Scheduling, distributed resource scheduling), by automatically balancing the load among the physical hosts, and adjusting the resource usage according to the service priority.
  • DRS places it on an appropriate physical host or generates placement recommendations based on the user's manual selection.
  • the method may include: determining that the placement is to be started according to the resource usage of the virtual machine to be started.
  • the specifications of the virtual machine can affect the maximum virtual resource usage.
  • the virtual machine specifications can be used to characterize the maximum resource usage of the virtual machine.
  • the specifications of the virtual machine can include: virtual machine processor (pro ce ssor ) capacity, virtual machine Memory and so on.
  • the resource usage of the virtual machine to be started can usually be set to the specification of the virtual machine, that is, the maximum resource usage that can be set to be allowed.
  • Embodiments of the present invention provide a method and an apparatus for calculating a resource usage amount, which improves the accuracy of computing resource usage, thereby effectively saving resources of a physical host.
  • a virtual machine placement method including:
  • the historical traffic load information of the service type is used to describe the load carried by the physical host when performing the service of the service type in the historical time; according to the historical traffic load of the virtual machine to be started The information calculates a resource usage amount required when the virtual machine to be started is started;
  • the virtual machine to be started is placed on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the calculating, by the historical service load information, the resource usage amount required when the to-be-started virtual machine is started includes: a reference probability distribution of a load amount carried by the type of service;
  • the reference probability distribution is not a preset probability distribution, and the function ⁇ ) is obtained by the non-parametric estimation method according to the F ( x );
  • is the physical business class of the said physical physics master machine in the history of the history of the execution of the business class
  • the type of business business carries the negative load capacity of the carrier
  • the determining, according to the ( ⁇ ), the resource usage amount required when the to-be-started virtual machine starts includes:
  • the resource usage amount required when the virtual machine to be started is started is determined as any value in the interval [ ( ) + , ( ) - ]. Wherein, the sum is a preset value.
  • the determining, according to the ( ⁇ ), the resource usage required when the virtual machine to be started is started includes:
  • Determining the amount of resource usage required to start the virtual machine to be started as an arbitrary value in the interval; the resource usage amount required to start the virtual machine to be started according to the determining, includes: Calculate the formula that satisfies the maximum value of ⁇ 111 .
  • Determining the amount of resource usage required when the virtual machine to be started is started is an arbitrary value in the interval
  • the determining, by the ( X ), the resource usage required when the to-be-started virtual machine is started includes:
  • the resource usage amount required when the virtual machine to be started is started is determined as the /(;; if the formula is not established, the resource usage amount required when the virtual machine to be started is started is determined as Said.
  • the determining, according to the determining, the resource usage required when the to-be-started virtual machine is started includes:
  • the resource usage amount required when the virtual machine to be started is started is determined. If the formula does not hold, the resource usage amount required when the virtual machine to be started is started is determined as the X 2 . ;
  • is the time at which the virtual machine to be started is started.
  • the calculating, by the historical service load information, the resource usage quantity required when the to-be-started virtual machine starts includes:
  • the resource usage amount required when the virtual machine to be started is started is determined as any value in the interval +, wherein, the above.
  • the preset value is used to start the virtual machine to be started.
  • the virtual machine according to the to-be-activated virtual machine Before the virtual machine to be started is placed on the corresponding physical host the method further includes:
  • the resource usage of the physical host includes: a processor capacity of the physical host, a usage rate of a processor of the physical host, a memory capacity of the physical host, and a One or more of the usage rates of the memory of the physical host; the placing the virtual machine to be started on the corresponding physical host according to the resource usage required when the virtual machine to be started is started, including:
  • the virtual machine to be started is placed on the determined physical host.
  • the method further includes:
  • the amount of resources that can be provided by the host running on the physical host is greater than the preset resource usage.
  • the method also includes:
  • a virtual machine placement apparatus including:
  • a first acquiring unit configured to acquire a service type of the virtual machine to be started
  • a second acquiring unit configured to acquire historical service load information of the service type, where the historical service load information is used to describe a load that is carried by the physical host when performing the service of the service type in the historical time;
  • a calculating unit configured to calculate, according to historical service load information of the virtual machine to be started, a resource usage amount required when the virtual machine to be started is started;
  • a placing unit configured to place the to-be-started virtual machine on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the computing unit includes:
  • the second second surely determines the fixed mode module block, and is used when the root is determined according to the description (( ⁇ )) according to the description, and the virtual machine is started.
  • the second second obtains the modulo module block, and is used to divide the distribution of the reference probability ratios into the pre-preset probability probability distribution distribution, and then Presetting the approximate probability rate distribution distribution to obtain the number of function functions corresponding to the said F ( x ) pair;
  • the third third does determine the fixed mode module block, and is used for the root according to the description (( XX )) as determined by the description (? XX ) to determine the start of the virtual virtual machine The amount of resources required to use the required amount;
  • the number of functions of the distribution function is divided into reference probability ratios, and ⁇ is the execution time of the physical host of the said physical history in the history of history. Describe the amount of negative load carried by the business type of the business type, and
  • the load is less than the probability of the X, the ( ⁇ ) is the first probability distribution function of the x, and the (the first probability distribution function is the ⁇ .
  • the second determining module includes:
  • a first calculation submodule configured to calculate a maximum likelihood estimation value of the W (the first determining submodule, configured to determine a resource usage amount required to start the virtual machine to be started as an interval [ ⁇ Any value in ⁇ , ( ⁇ );
  • the third determining module includes:
  • a second calculation submodule configured to calculate a maximum likelihood estimate of the W
  • a second determining submodule configured to determine, as the value of the resource usage required when the virtual machine to be started is started, any value in the interval [( x )+, W_ ].
  • the sum is a preset value.
  • the second determining module includes:
  • a third calculation sub-module configured to calculate a satisfaction formula (maximum value of ⁇ 111 ); a third determination sub-module, configured to determine a resource usage amount required to start the virtual machine to be started as an interval [ 3 ⁇ 4 + 3 ⁇ 4 Any value in , 3 ⁇ 4 _ ];
  • the third determining module includes: a fourth calculation sub-module, configured to calculate a maximum value of the satisfying formula ( ⁇ 111 ); a fourth determining sub-module, configured to determine a resource usage amount required when the virtual machine to be started is started as an arbitrary value in the interval ;
  • the second determining module includes:
  • a fifth calculation sub-module configured to calculate a maximum value that satisfies the formula ( ⁇ 111 ;
  • a first acquisition submodule configured to obtain a stored prediction model of the historical service load information of the to-be-started virtual machine, where the description is used to describe that the physical host performs the service of the service type during historical time. Distribution function of load;
  • the first judging sub-module is used to judge the formula x . Whether it is established;
  • a fifth determining submodule configured to determine, when the formula is established, the resource usage amount required when the virtual machine to be started is started is as described above;
  • a sixth determining submodule configured to determine, when the formula is not established, the resource usage amount required to start the virtual machine to be started as the
  • the third determining module includes:
  • a seventh calculation sub-module configured to calculate a maximum value that satisfies a formula ( ⁇ 111 );
  • a second acquisition sub-module configured to acquire the stored prediction model of the historical traffic load information of the to-be-started virtual machine Describe a distribution function of a load amount carried by the physical host when performing the service of the service type on a historical time;
  • the eighth calculation sub-module is used to calculate / ( ⁇ ;
  • the second judgment sub-module is used to judge the formula X. Whether it is established;
  • a seventh determining submodule configured to determine, when the formula is established, the resource usage required when the virtual machine to be started is started as the ( ⁇ ;
  • an eighth determining submodule configured to determine, when the formula is not established, the resource usage amount required when the virtual machine to be started is started is the X 2 . ; Where m is the specified tolerated service overload ratio, and the ⁇ is the time at which the virtual machine to be started is started.
  • the calculating unit includes: a third acquiring module, configured to acquire, by using the stored prediction model w of the historical service load information of the to-be-started virtual machine, The distribution function for describing a load amount carried by the physical host when performing the service of the service type on a historical time;
  • a fourth determining module configured to determine, when the virtual machine to be started is started, a resource usage amount as an interval [ ⁇ + ⁇ )- 06 ], where the ⁇ is a time to start the virtual machine to be started , the stated value is preset.
  • the apparatus further includes: an acquiring unit, Acquiring the resource usage of the physical host before the placement unit places the virtual machine to be started on the corresponding physical host according to the resource usage required by the placement unit when the virtual machine to be started is started, the physical
  • the resource usage of the host includes: one of a processor capacity of the physical host, a usage rate of a processor of the physical host, a capacity of a memory of the physical host, and a usage rate of a memory of the physical host or Multiple
  • the placement unit includes:
  • a fifth determining module configured to determine, according to resource usage of the physical host, a quantity of resources that the physical host can provide
  • a sixth determining module configured to determine, by the physical host that the amount of resources that can be provided is greater than the resource usage required when the virtual machine to be started is started, to be a physical host where the virtual machine to be started is placed;
  • a placement module configured to place the to-be-started virtual machine on the determined physical host.
  • the device further includes: Determining the physical host after the virtual machine to be started is placed on the corresponding physical host according to the resource usage amount required when the virtual machine to be started is started. Whether the variance of the resource usage of the machine is greater than the variance of the preset resource usage;
  • the first migration unit is configured to run on the host if the variance is greater than the preset resource usage, and the amount of resources that the other physical host can provide is greater than the preset resource usage.
  • the apparatus further includes: a second migration unit, configured to: when the placement unit is configured according to the resource usage required when the virtual machine to be started is started After the virtual machine is placed on the corresponding physical host, the started virtual machine is migrated to at least one specified physical host, and the number of the specified physical host is smaller than the number of all physical hosts in the cluster system;
  • a shutdown unit that shuts down a physical host that has not deployed a powered-on virtual machine.
  • a physical host including:
  • VMM virtual machine monitoring unit
  • the VMM is configured to obtain a service type of the virtual machine to be started, and obtain historical service load information of the service type, where the historical service load information is used to describe that the physical host performs the service of the service type during the historical time. Calculating the amount of resource usage required when the virtual machine to be started is started according to the historical service load information of the virtual machine to be started; and according to the resource usage required when the virtual machine to be started is started The virtual machine to be started is placed on the corresponding physical host.
  • the reference probability distribution is not a preset probability distribution, obtaining, according to the F ( x ), a resource usage amount required by the non-parametric estimation method according to the determining that the virtual machine to be started is started;
  • the reference probability distribution is a preset probability distribution
  • the function corresponding to the preset probability distribution And obtaining a function function number ( x ) corresponding to the FF pair; the root determining, according to the description ( x ), that the virtual function is to be activated The amount of resources required to use the machine when starting the machine is used;
  • the number of functions of the distribution function is divided into reference probability ratios, and ⁇ is the execution time of the physical host of the said physical history in the history of history. Describe the amount of negative load carried by the business type of the business type, and
  • the load is less than the probability of the X, the ( ⁇ ) is the first probability distribution function of the x, and the (the second probability distribution function of the ⁇ ).
  • the VMM is specifically configured to calculate the maximum likelihood estimation value when the virtual machine to be started is started.
  • the required resource usage is determined as any value in the interval [ ⁇ W + ⁇ -A];
  • the VMM is specifically configured to calculate the maximum likelihood estimation value ( x ) of the ( ⁇ ); determine the resource usage amount required when the virtual machine to be started is started as any of the interval +, _ ] Value.
  • the sum is a preset value.
  • the VMM is specifically configured to calculate a maximum value that satisfies the formula ⁇ > ⁇ 111 to start the virtual machine to be started.
  • the required resource usage is determined as any value in the interval [ + , _ ⁇ ⁇ ;
  • the VMM is specifically configured to calculate a maximum value in the interval that satisfies the formula (the maximum value of ⁇ 111 is used to determine the resource usage amount when the virtual machine to be started is started;
  • the sum is a preset value
  • m is a specified tolerant service overload ratio.
  • the VMM is specifically used to calculate a maximum value that satisfies the formula ⁇ ) ⁇ 111
  • the resource usage amount required when the virtual machine to be started is started is determined as the /(;; if the formula is not established, the resource usage amount required when the virtual machine to be started is started is determined as State
  • the VMM is specifically used to calculate a maximum value that satisfies the formula ( x ) ⁇ m . And obtaining, by the prediction model of the stored historical service load information of the to-be-started virtual machine, the distribution of the load amount carried by the physical host when performing the service of the service type in historical time function;
  • the resource usage amount required when the virtual machine to be started is started is determined as the ⁇ 2. ;
  • is the time at which the virtual machine to be started is started.
  • the VMM is specifically configured to obtain a stored prediction model of the historical service load information of the to-be-started virtual machine (0, the (for description) a distribution function of the load amount carried by the physical host when performing the service of the service type on the historical time;
  • Determining the resource usage amount required when the virtual machine to be started is started as an interval [f ⁇ t 0 ) + b 6 ⁇ t 0 )-b 6 ] ⁇ wherein the ⁇ is the startup of the virtual machine to be started At the moment, the stated value is a preset value.
  • the VMM is further used to Acquiring the resource usage of the physical host, the resource of the physical host, before the placing the virtual machine to be started on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the usage amount includes: one or more of a processor capacity of the physical host, a usage rate of a processor of the physical host, a capacity of a memory of the physical host, and a usage rate of a memory of the physical host;
  • the placing the virtual machine to be started on the corresponding physical host according to the resource usage required when the virtual machine to be started is started includes:
  • the virtual machine to be started is placed on the determined physical host.
  • the VMM is further used in Determining whether the variance of the resource usage of the physical host is greater than a preset resource usage amount, after the virtual machine to be started is placed on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the amount of resources that can be provided by the host running on the physical host is greater than the preset resource usage.
  • the VMM is further configured to place the to-be-started virtual machine in a corresponding manner according to a resource usage amount required when the virtual machine to be started is started. After the physical host is hosted, the started virtual machine is migrated to at least one designated physical host, and the number of the specified physical host is smaller than the number of all physical hosts in the cluster system;
  • a cluster system including one or more of the third aspect or the first possible implementation manner of the third aspect to any one of the tenth possible implementation manners Physical host, wherein the one or more physical hosts have a communication connection.
  • the method and device for placing a virtual machine according to the embodiment of the present invention after using the foregoing solution, calculating, according to the historical service load information of the virtual machine to be started, the resource usage amount required when the virtual machine to be started is started; The amount of resource usage required to start the virtual machine is placed on the corresponding physical host, and the current technology uses the specification of the virtual machine to be started as the resource usage of the virtual machine to be started. According to the historical service load information, the amount of resources required for starting the virtual machine to be started is more accurate, and the waste of physical host resources is effectively avoided.
  • FIG. 1 is a flow chart of a method for placing a virtual machine in the prior art
  • FIG. 2 is a flowchart of a virtual machine placement method according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of another virtual machine placement method according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a virtual machine placement apparatus according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of another virtual machine placement apparatus according to the embodiment.
  • FIG. 6 is a schematic structural diagram of a physical host according to the embodiment;
  • FIG. 7 is a schematic structural diagram of a system according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a cluster system provided by this embodiment.
  • FIG. 9 is a schematic structural diagram of another physical host according to the embodiment.
  • Virtual machine VM
  • Virtual machine software can simulate one or more virtual computers on a physical host. These virtual machines work like real computers.
  • the virtual machine can be installed with operating system and applications.
  • the virtual machine can also be used. Access network resources.
  • the virtual machine is like working on a real computer.
  • the hardware layer may include various hardware.
  • the hardware layer of a computing node may include a CPU (Central Processing Unit) and a memory, and may also include a high speed/low speed input/output (I/O) such as a network card and a memory.
  • I/O input/output
  • IOMMU Input/Output Memory Management Unit
  • IOMMU Input/Output Memory Management Unit
  • VMM Virtual Machine Manager
  • the virtual hardware platform provides various hardware resources for each virtual machine running on it, such as providing a virtual processor (such as a VCPU), a memory, a virtual disk, a virtual network card, and the like.
  • the virtual disk can correspond to a file of the VMM or a logical block device.
  • the virtual machine runs on the virtual hardware platform that VMM prepares for it, and one or more virtual machines run on the VMM. It should be noted that the virtual machine monitor of the present invention can also be understood as a host host.
  • the user starts a new virtual machine, or the failed virtual machine restarts, or the physical host enters maintenance mode.
  • the virtual machine is evacuated, etc., the virtual machine is started.
  • specific steps may include:
  • the specifications of the VM to be started are obtained, and the specifications of the VM to be started are used as the resource usage of the VM to be started.
  • the processor is used as an example.
  • the VM specification can be as follows: Two CPUs and 4GB of memory, then the CPU specification of the virtual machine is two physical CPU capabilities, and the memory specification is 4 GB capability;
  • the management center can also collect the CPU usage of the CPU and memory of each physical host in the cluster, which can include the CPU capacity of the physical host.
  • the physical host includes 16 CPUs, and the clock speed of each CPU is 2. 4GHZ.
  • the variance of the resource usage of the physical host is used as a target, and the full traversal algorithm is used to determine the virtual machine to be powered on.
  • the target physical host which can determine the physical host with smaller variance of resource usage as the target physical host;
  • the virtual machine performs business for most of the time, and may not reach the maximum resource usage (that is, it does not meet the specifications of the virtual machine), so the initial placement method may result in waste of physical resources.
  • the embodiment provides a virtual machine placement method, and the execution entity VMM of the method, as shown in FIG. 2, may include:
  • the load of the bearer is different when the services of different types of services are executed.
  • the service type of the VM to be started is obtained first.
  • the type of the service type is not limited, and is a technology that is well-known to those skilled in the art, and can be set according to actual needs, for example, a voice service, a data service, and the like, and details are not described herein.
  • the historical service load information may be used to describe the amount of load carried by the physical host when performing the service of the service type in the historical time.
  • the corresponding relationship between the executed service information (for example, the service type information) and the load amount carried in the execution of the service may be stored.
  • the executed service information for example, the service type information
  • the load amount carried in the execution of the service may be stored.
  • historical traffic load information for example, it may be, but is not limited to, storing historical traffic load information in a relationship list.
  • the content and the storage mode of the information stored in the virtual machine after the corresponding service is executed are not limited, and may be set according to actual needs, and details are not described herein again.
  • the historical service load information of the virtual machine to be started may be used to estimate the required time when the virtual machine to be started is started. Resource usage.
  • Different physical hosts have different resources.
  • the physical capacity of the virtual machine to be started can be determined according to the resource usage required when the virtual machine is started.
  • a host such as a physical host that places a virtual machine to be powered on, can provide more resources than or equal to the amount of resources required to start the virtual machine to be started.
  • This embodiment provides another virtual machine placement method, which is the method shown in FIG. 2. Further expansion and optimization, as shown in Figure 3, may include:
  • the load of the VMs to be started may be different.
  • the type of the service type is not limited, and is a technology that is well-known to those skilled in the art, and can be set according to actual needs, for example, a voice service, a data service, and the like, and details are not described herein.
  • the historical service load information may be, but is not limited to, used to describe the amount of load carried by the physical host when performing the service of the service type at the historical time.
  • the corresponding relationship between the executed service information (for example, the service type information) and the load amount carried in the execution of the service may be stored.
  • the executed service information for example, the service type information
  • the load amount carried in the execution of the service may be stored.
  • historical traffic load information for example, it may be, but is not limited to, storing historical traffic load information in a relationship list.
  • the content and manner of the information stored in the virtual machine after the corresponding service is executed are not limited, and may be set according to actual needs, and details are not described herein again.
  • the VMM can determine, according to the historical service load information, the amount of resources required to be started when the virtual machine is started (that is, but not limited to, when the physical host starts the virtual machine to be started, the VMM is executed.
  • the amount of load carried by the virtual machine during the service Therefore, the resources of the physical host can be accurately scheduled, and the resources of the physical host are avoided.
  • calculating, according to the historical service load information, the resource usage amount required when the to-be-started virtual machine is started may include:
  • the reference parameter probability distribution is distributed as a pre-preset probability probability distribution, then the number of function functions corresponding to the distribution from the pre-preset probability probability distribution And obtaining a number of function functions ( x ) corresponding to the described F ( x ) pair;
  • the usage amount is;
  • the number of functions of the distribution function is divided into reference probability, and ⁇ X is the business class of the physical operation of the main host machine in the historical time history.
  • the type of business business carries the negative load capacity of the carrier,
  • the load is less than the probability of the X, the ( ⁇ ) is the first probability distribution function of the x, and the (the second probability distribution function of the ⁇ ).
  • the non-parametric estimation method is not limited in this embodiment, and is a technology well known to those skilled in the art, and can be set according to actual needs, and details are not described herein again.
  • determining, according to the ( ⁇ ), the resource usage amount required when the to-be-started virtual machine starts may include:
  • the value is a preset value.
  • the resource usage amount required when the virtual machine to be started is started is determined as any value in the interval [( X )+, ( X )-], but not limited to the package can be set.
  • A U , that is, the resource usage required to start the virtual machine to be started is determined as or, ⁇ 0 can be set.
  • the value of the present embodiment is not limited, and may be set according to actual needs. For example, it may be, but not limited to, 1, 0.1, etc., and details are not described herein again.
  • calculating the maximum likelihood estimation value of the may include: The calculated likelihood function; takes the logarithm of the calculated likelihood function, and sorts it; derivates the collated likelihood function; solves the likelihood function after derivation, and the obtained solution is ⁇ ).
  • the method for calculating the maximum likelihood estimation value is not limited in this embodiment, and is a technique well known to those skilled in the art, and details are not described herein again.
  • determining, according to the ( ⁇ ), the resource usage amount required when the to-be-started virtual machine starts includes:
  • the resource usage amount required when the virtual machine to be started is started is determined as an arbitrary value in the interval.
  • the value is a preset value
  • m is a specified tolerated service overload ratio.
  • the value of the present embodiment is not limited, and may be set according to actual needs. For example, it may be, but not limited to, 0, 1, 0.1, and the like, and details are not described herein again.
  • determining, according to the G1 ( X ), the resource usage amount required when the to-be-started virtual machine is started may include:
  • is the time at which the virtual machine to be started is started.
  • the determining, according to the ( ⁇ ), the resource usage amount required when the to-be-started virtual machine starts includes:
  • the resource usage amount required when the virtual machine to be started is started is determined as any value in the interval [ ( ) + , ( ) - ]. Where is the default value.
  • the value of the present embodiment is not limited, and may be set according to actual needs. For example, it may be, but not limited to, 1, 0.1, etc., and details are not described herein again.
  • determining, according to the ( ⁇ ), the resource usage amount required when the to-be-started virtual machine starts includes:
  • Determining the amount of resource usage required when the virtual machine to be started is started is an arbitrary value in the interval
  • the value is a preset value
  • m is a specified tolerated service overload ratio
  • the amount of resource usage required is determined as ( X ),; or, ⁇ 0 is set.
  • the value of the present embodiment is not limited, and may be set according to actual needs. For example, it may be, but not limited to, 0, 1, 0.1, and the like, and details are not described herein again.
  • determining, according to the ( ⁇ ), the resource usage amount required when the to-be-started virtual machine is started may include:
  • the resource usage amount required when the virtual machine to be started is started is determined as the / ( ;
  • the resource usage amount required when the virtual machine to be started is started is determined as the X 2 . ;
  • is the time at which the virtual machine to be started is started.
  • calculating, according to the historical service load information, the resource usage amount required when the to-be-started virtual machine is started may include:
  • the amount of resource usage required to start the virtual machine to be started is determined as an arbitrary value in the interval [/( + , /( _ ⁇ ), where the time is to start the virtual machine to be started, Described as a preset value.
  • the value of the present embodiment is not limited, and may be set according to actual needs. For example, it may be, but not limited to, 1, 0.1, etc., and details are not described herein again.
  • the method for obtaining the prediction model of the historical service load information of the virtual machine to be started is not limited, and is a technology well known to those skilled in the art, and can be set according to actual needs.
  • it may be a neural network.
  • the prediction model acquires the predicted model of the historical traffic load information of the stored virtual machine to be started, and details are not described herein again.
  • nerve The prediction method of the network is a technique well known to those skilled in the art, and is described in this step.
  • the method for calculating the resource usage amount of the virtual machine to be started according to the historical service load information of the virtual machine to be started is not limited, and may be set according to actual needs, and details are not described herein again.
  • the resource usage of the physical host may include, but is not limited to, a processor capacity of the physical host, a usage rate of a processor of the physical host, a memory capacity of the physical host, and a memory usage of the physical host. One or more of them.
  • the processor may be, but not limited to, a CPU, a DSP, a microprocessor, or the like.
  • the VMM can obtain the maximum amount of resources that the physical host can provide, and can also obtain the current resource usage of the physical host, and subtract the current resource usage from the maximum resource quantity to obtain the current physical host. The amount of resources that can be provided.
  • the method for determining the amount of resources that the physical host can provide according to the resource usage of the physical host is not limited, and is a technology well known to those skilled in the art, and can be set according to actual needs, and details are not described herein again.
  • the VMM may determine, as a physical host that can be used to start the virtual machine, a physical host that can meet the resource usage required for starting the virtual machine to be started.
  • the amount of resources that the host can provide is greater than the amount of resources required to start the virtual machine to be started.
  • VLi can determine the physical host where the virtual machine to be started is placed with the goal of minimizing the number of hosts. Specifically, it may include:
  • the physical host can be divided into two parts: P 1 (including the started virtual machine) and P2 (excluding the started virtual machine); according to the physical host's resource idle amount from large to small or from small to large, to P
  • the physical host in 1 is sorted; the physical host with the least resource usage is preferentially selected as the designated physical host in P1; if the appropriate physical host is not selected in the above step, the idle physical host is selected in P2;
  • the instructions for executing the virtual machine start on the physical host.
  • Steps 301 to 307 are the steps of initially placing the virtual machine to be started. After the virtual machine to be started is placed in the determined physical host and started, the number of virtual machines started by the physical host is gradually increased, and the physical host can provide The amount of resources may be reduced. The physical host load is too large to reduce the performance of the physical host. Therefore, at least one virtual machine running on these physical hosts needs to be migrated to other physical hosts to release the physical host.
  • the resources in other words, may be to reduce the load of the physical host
  • the specific method can be seen in steps 308 and 309.
  • the method of selecting the other physical hosts among the plurality of physical hosts refer to the methods described in step 301 and step 307, which are described in this step.
  • step 308 Determine whether the amount of resources that the physical host can currently provide is smaller than the amount of resources required by at least one virtual machine running on the physical host. If it is less, step 309 is performed. If it is not less than, the process ends. on board.
  • the amount of resources that the other physical host can provide is greater than the amount of resources that the physical host can provide.
  • the VMM may be, but is not limited to, migrating at least one virtual machine to at least one virtual machine to a part of other physical hosts except the physical host.
  • the VMM can not only migrate the virtual machine by the method described in steps 308 and 309, but also migrate the virtual machine by the method described in steps 308 ', 309 '. 308 ', determining whether the variance of the resource usage of the physical host is greater than a variance of the preset resource usage. If it is greater, step 309 ' is performed, and if not greater, the process ends.
  • the variance is the expected value of the square of the difference between the actual value and the expected value.
  • the variance can usually be calculated by the following method.
  • the variance is the average of the square of the difference between each data and the mean, ie: Where J is the average of the sample, "for the number of samples, for the sample individual, ⁇ [J is the lower corner, is the variance.
  • the variance of the resource usage of the physical host may be calculated, but is not limited to: First, the VMM may obtain "sample x from the resource usage of the physical host, and then calculate the average value J of the samples, and finally , can be based on the formula Calculate the variance of the resource usage of the physical host.
  • the method for calculating the variance of the resource usage of the physical host is not limited, and is not known to those skilled in the art, and details are not described herein again.
  • the VMM may be, but is not limited to, migrating at least one virtual machine to at least one virtual machine to a part of other physical hosts except the physical host.
  • the VMM can not only migrate the virtual machine according to steps 308, 309, 308', and 309', but also migrate the virtual machine to the designated physical host according to the instructions. For details, refer to steps 310 and 31.
  • step 301 to step 307 can be used to determine which specific physical host to migrate the started virtual machine to.
  • the virtual machine to be started is placed on the host and started, if the amount of resources that the physical host can provide cannot meet the resource usage required by the virtual machine, the virtual machine can be migrated to other physical hosts, and other physical
  • the amount of resources that the main body can provide is greater than the amount of resources required by the virtual machine. In this way, the virtual machine can work normally.
  • the virtual machine can be migrated to the specified physical host according to the instructions.
  • the number of designated physical hosts is smaller than that in the cluster system. The number of all physical hosts and the physical hosts that have not deployed the powered-on virtual machines. This reduces the power consumption of the cluster by consolidating workloads into a few designated physical hosts and shutting down physical hosts that do not contain powered-on virtual machines.
  • This embodiment provides a virtual machine placement device, as shown in FIG. 4, which may include:
  • the first obtaining unit 41 is configured to acquire a service type of the virtual machine to be started.
  • the second obtaining unit 42 is configured to acquire the historical service load information of the service type, where the historical service load information is used to describe the load that is carried by the physical host when performing the service of the service type in the historical time;
  • the calculating unit 43 is configured to calculate, according to historical service load information of the virtual machine to be started, a resource usage amount required when the virtual machine to be started is started;
  • the placing unit 44 is configured to place the to-be-started virtual machine on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the apparatus may include:
  • the first obtaining unit 51 is configured to acquire a service type of the virtual machine to be started.
  • the second obtaining unit 52 is configured to obtain the historical service load information of the service type, where the historical service load information is used to describe the load carried by the physical host when performing the service of the service type in the historical time;
  • the calculating unit 53 is configured to calculate, according to historical service load information of the virtual machine to be started, a resource usage amount required when the virtual machine to be started is started;
  • the placing unit 54 is configured to place the to-be-started virtual machine on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the calculating unit 53 includes:
  • the judgment die module block 553322 is used to determine whether the distribution reference probability ratio distribution distribution cloth is a pre-preset probability probability distribution distribution;
  • the FF (( xx )) pass obtains the number of the function of the fetch function (( )) by the non-parametric parameter estimation estimation method method;
  • Determining a second set of two determined block 553,344 ,, die module for use according to the root according to the said predetermined ⁇ 11 determines that the determination be said to be the Launch intended virtual machine virtual machine from time to time by the Launch Need to use the required resource source to use the amount;
  • the second second acquisition modulo module block 553355 is used to divide the distribution of the reference probability ratios into the pre-preset probability probability distribution distribution, and then Pre-presets the probability ratio of the distribution of the number of function functions corresponding to the number of function functions (( xx )) corresponding to the pair of FF (( xx ));
  • the third third does determine the fixed mode module block 553366, which is used for determining, according to the description of the method, that the virtual machine is started when the virtual machine is started.
  • the amount of resources required to use the required amount
  • FF (( xx )) is the reference function probability distribution rate distribution function function number
  • is the physical state of the said subject matter master time in the historical history time The amount of negative load carried by the business of the business type of the business type mentioned in the executive bank
  • the load is less than the probability of the X, the ( ⁇ ) is the first probability distribution function of the ⁇ , and the (the first probability distribution function of the ⁇ ).
  • the second determining module 534 includes:
  • a first calculation sub-module 5341 configured to calculate the maximum likelihood estimation value first determining sub-module 5342, configured to determine a resource usage amount required for starting the virtual machine to be started as an interval [ ' + ⁇ Any value in ' ⁇ ';
  • the third determining module 536 includes:
  • a second calculation sub-module 5361 configured to calculate a maximum likelihood estimation value of the W (the second determination sub-module 5362, configured to determine a resource usage amount required to start the virtual machine to be started as an interval [ Any value in ( + , ⁇ )_ 0 2 ].
  • the sum is a preset value.
  • the second determining module 534 includes:
  • the third calculation sub-module 5343 is configured to calculate a maximum value that satisfies the formula ( ⁇ 111) , and a third determination sub-module 5344, configured to determine a resource usage amount when the virtual machine to be started is started as an interval [ 3 ⁇ 4] Any value in + 3 ⁇ 4 , 3 ⁇ 4_ 3 ⁇ 4 ];
  • the third determining module 536 includes:
  • the fourth calculation sub-module 5363 is configured to calculate a maximum value that satisfies the formula ( ⁇ 111 );
  • a fourth determining sub-module 5364 configured to determine, in the interval, the resource usage amount when the virtual machine to be started is started Any value;
  • the sum is a preset value
  • m is a specified tolerated service overload ratio.
  • the second determining module 534 includes:
  • a fifth calculation sub-module 5345 configured to calculate a maximum value that satisfies a formula ( ⁇ 111 ;
  • a first acquisition sub-module 5346 configured to obtain a stored prediction model of the historical traffic load information of the to-be-started virtual machine a distribution function for describing a load amount carried by the physical host when performing the service of the service type on a historical time;
  • the first judging sub-module 5348 is used to determine the formula ⁇ ⁇ . Whether it is established;
  • a fifth determining sub-module 5349 configured to determine, when the formula is established, the resource usage required when the virtual machine to be started is started as the (.);
  • the sixth determining submodule 53410 is configured to determine, when the formula is not established, the resource usage amount required when the virtual machine to be started is started, as described above. ;
  • the third determining module 536 includes:
  • a seventh calculation sub-module 5365 configured to calculate a maximum value that satisfies a formula ( ⁇ 111 );
  • a second acquisition sub-module 5366 configured to acquire a stored prediction model of the historical traffic load information of the to-be-started virtual machine ( And the distribution function used to describe the load amount carried by the physical host when performing the service of the service type in historical time;
  • the eighth calculation sub-module 5367 is used to calculate ⁇ ;
  • the second judging sub-module 5368 is used to determine the formula ⁇ ⁇ . Whether it is established;
  • a seventh determining sub-module 5369 configured to determine, when the formula is established, the resource usage required when the virtual machine to be started is started as the (.);
  • the eighth determining submodule 53610 is configured to determine, when the formula is not established, the resource usage amount required when the virtual machine to be started is started, as described above. ;
  • is to start the virtual to be started The moment of the machine.
  • the calculating unit 53 includes:
  • the third obtaining module 537 is configured to obtain the predicted model W of the historical service load information of the to-be-started virtual machine, where the w is used to describe that the physical host performs the service of the service type in historical time. The distribution function of the load carried at the time;
  • the fourth determining module 538 is configured to determine, according to the resource usage amount that is to be started when the virtual machine to be started is started, an interval [ ⁇ + ⁇ " ) - 06 ], where the ⁇ is to start the virtual to be started At the moment of the machine, the preset value.
  • the virtual machine placement apparatus provided in this embodiment further includes:
  • the obtaining unit 55 is configured to acquire the resource usage of the physical host before the placing unit places the virtual machine to be started on the corresponding physical host according to the resource usage amount required when the virtual machine is started.
  • the resource usage of the physical host includes: a processor capacity of the physical host, a usage rate of a processor of the physical host, a memory capacity of the physical host, and a memory usage of the physical host.
  • the placing unit 54 includes:
  • a fifth determining module 541, configured to determine, according to the resource usage of the physical host, a quantity of resources that the physical host can provide;
  • a sixth determining module 542 configured to determine, by the physical host that the amount of resources that can be provided is greater than the resource usage required when the virtual machine to be started is started, to be a physical host where the virtual machine to be started is placed;
  • the placement module 543 is configured to place the to-be-started virtual machine on the determined physical host. Further, the virtual machine placement apparatus provided in this embodiment may further include:
  • the determining unit 56 is configured to determine the resource usage of the physical host after the virtual machine to be started is placed on the corresponding physical host according to the resource usage amount required when the virtual machine to be started is started. Whether the variance is greater than the variance of the preset resource usage;
  • the first migration unit 57 is configured to: if the variance of the preset resource usage is greater than On the physical host, the amount of resources that the other physical host can provide is greater than the preset resource usage.
  • the virtual machine placement apparatus may further include:
  • the second migration unit 58 is configured to: after the placement unit places the to-be-started virtual machine on the corresponding physical host according to the resource usage amount required when the placement virtual machine is started, the virtual machine that is started Migrating to at least one specified physical host, the number of the specified physical hosts being less than the number of all physical hosts in the cluster system;
  • the shutdown unit 59 is configured to shut down a physical host that does not have a virtual machine that has been deployed.
  • the virtual machine to be started is placed on the host and started, if the amount of resources that the physical host can provide cannot meet the resource usage required by the virtual machine, the virtual machine can be migrated to other physical hosts, and other physical
  • the amount of resources that the main body can provide is greater than the amount of resources required by the virtual machine. In this way, the virtual machine can work normally.
  • the virtual machine can be migrated to the specified physical host according to the instructions.
  • the number of designated physical hosts is smaller than that in the cluster system. The number of all physical hosts and the physical hosts that have not deployed the powered-on virtual machines. This reduces the power consumption of the cluster by consolidating workloads into a few designated physical hosts and shutting down physical hosts that do not contain powered-on virtual machines.
  • This embodiment provides a physical host, as shown in FIG. 6, including:
  • VMM 62 a hardware layer 61 and a virtual machine monitoring unit VMM 62 running on the hardware layer, and At least one virtual machine 63 running on top of the VMM 62, wherein:
  • the VMM 62 is configured to obtain a service type of the virtual machine 63 to be started, and obtain historical service load information of the service type, where the historical service load information is used to describe that the physical host performs the service type service on a historical time. Calculating the amount of resources required to be started when the virtual machine 63 to be started is started according to the historical service load information of the virtual machine 63 to be started; and the resources required when the virtual machine 63 to be started is started.
  • the usage-initiated virtual machine 63 is placed on the corresponding physical host.
  • the corresponding physical host may be a physical host configured with the VMM 62, or a physical host in the system different from the physical host configured with the VMM 62.
  • the VMM 62 performing the corresponding steps in this embodiment may be disposed in the physical host shown in FIG. 6, and the virtual machine to be started may be determined to be placed in the physical host shown in FIG. 6, or may be placed in the system.
  • the VMM 62 that performs the corresponding steps in this embodiment may be placed in the same physical host as the virtual machine to be started, or may be placed in a different physical host.
  • the physical host may include:
  • the VMM 62 is configured to obtain a service type of the virtual machine 63 to be started, and obtain historical service load information of the service type, where the historical service load information is used to describe that the physical host performs the service type service on a historical time.
  • the amount of load carried; according to the virtual to be started The historical history of the machine 6633, the load-bearing information, and the source of resources required for the start-up of the start-up virtual virtual machine 6633
  • the amount of usage;; the root resource according to the description of the resource source required to start the virtual virtual machine 6633, and the usage amount will be The virtual virtual machine 6633 is placed and placed on the corresponding physical host computer. .
  • the non-parametric parameter estimation estimation method method obtains the number of functions of the function of the fetching function according to the requirements of the description, and the need for the start-up of the virtual virtual machine 6633 is determined.
  • the corresponding function function is distributed from the pre-preset probability probability distribution.
  • the number of functions obtained in the number is corresponding to the number of function functions (( xx )) corresponding to the FF pair;; the root is determined according to the description (( xx ))
  • the amount of resources required to start the virtual virtual machine 6633 is required to be used;
  • FF (( xx )) is the reference function probability distribution rate distribution function function number
  • is the physical state of the said subject matter master time in the historical history time The amount of negative load carried by the business of the business type of the business type mentioned in the executive bank
  • the load is less than the probability of the X, the ( ⁇ ) is the first probability distribution function of the ⁇ , the (the second probability distribution function of the ⁇ . Further, the VMM 62 is specifically used for calculation
  • the maximum likelihood estimation value is **; determining the resource usage amount required when the virtual machine 63 to be started is started is determined as an interval.
  • the VMM 62 is specifically used to calculate the maximum likelihood estimate ( x ) of the ( ⁇ ); the resources required when the virtual machine 63 to be started is started.
  • the usage amount is determined as any value in the interval [C3 ⁇ 4 (x) + , C3 ⁇ 4 (x)-6 2 ]. Wherein, the sum is a preset value.
  • V ⁇ 62 is specifically used to calculate a value that satisfies the formula (the maximum value of ⁇ 111 is used to determine the resource usage amount when the virtual machine 63 to be started is started is an arbitrary value in the interval; the VMM 62, specifically Used to calculate the maximum value that satisfies the formula ⁇ > ⁇ 111
  • the resource usage required to start the startup virtual machine 63 is determined as any value in the interval [ + , _ ;
  • the sum is a preset value
  • m is a specified tolerant service overload ratio.
  • the V-62 is specifically used to calculate a prediction model/W that satisfies the historical service load information of the to-be-started virtual machine 63 that satisfies the formula (the maximum value of ⁇ 111 , the /W is used to describe a distribution function of the load amount carried by the physical host when performing the service of the service type on the historical time;
  • the resource usage required when the virtual machine 63 to be started is started is determined as the ⁇ ;
  • the VMM 62 is specifically used to calculate a maximum value that satisfies the formula ⁇ > ⁇ 111 .
  • the resource usage required when the virtual machine 63 to be started is started is determined as the ⁇ ;
  • the resource usage amount required when the virtual machine 63 to be started is started is determined as the ⁇ 2. ;
  • is the time when the virtual machine 63 to be started is started.
  • the VMM 62 is specifically configured to obtain a stored prediction model of the historical service load information of the to-be-started virtual machine 63, where the physical host is used to describe a distribution function of the load amount carried when the service of the service type is executed in the historical time; determining the resource usage amount when the virtual machine 63 to be started is started is determined as the interval [f ⁇ t 0 ) + k, f ⁇ t 0 ) -b 6 ] ⁇ where ⁇ is the time at which the virtual machine 63 to be started is started, and the value is a preset value.
  • the VMM 62 is specifically configured to obtain, by using a prediction method of a neural network, a stored prediction model of the historical traffic load information of the virtual machine 63 to be activated.
  • the VMM 62 is further configured to acquire the physical host before the virtual machine 63 to be started is placed on the corresponding physical host according to the resource usage required when the virtual machine 63 to be started is started.
  • Resource usage the resource usage of the physical host includes: a processor capacity of the physical host, a usage rate of a processor of the physical host, a memory capacity of the physical host, and a memory of the physical host The one or more of the usage rates; the placing the virtual machine 63 to be started on the corresponding physical host according to the resource usage amount required when the virtual machine 63 to be started is started, includes:
  • the physical host that starts the virtual machine 63 is referred to; the virtual machine 63 to be started is placed on the determined physical host.
  • the VMM 62 is further configured to determine the physical host after the virtual machine 63 to be started is placed on the corresponding physical host according to the resource usage amount required when the virtual machine 63 to be started is started. Whether the amount of resources currently available is less than the amount of resources required by at least one virtual machine 63 running on the physical host;
  • the amount of resources required by the at least one virtual machine 63 on the physical host is smaller, the amount of resources that the other physical host can provide is greater than the amount of resources that the physical host can provide.
  • the VMM 62 is further configured to determine the physical host after the virtual machine 63 to be started is placed on the corresponding physical host according to the resource usage amount required when the virtual machine 63 to be started is started. Whether the variance of resource usage is greater than the default resource usage If the variance of the preset resource usage is greater than, the amount of resources that can be provided to the physical host on the physical host is greater than the preset resource usage.
  • the VMM 62 is further configured to: after the placing the virtual machine 63 to be started on the corresponding physical host according to the resource usage amount required when the virtual machine 63 to be started is started, the activated virtual The machine 63 migrates to at least one designated physical host, where the number of the specified physical hosts is less than the number of all physical hosts in the cluster system;
  • VMM 62 provided in this embodiment may be disposed on a physical host where the virtual machine 63 to be started is placed, or may be disposed on a physical host different from the physical host where the virtual machine 63 to be started is placed.
  • FIG. 7 it is a schematic diagram of a system mechanism, where three physical hosts (physical pherd 10 , physical host 20 , physical host 30 ) may be included, and the three physical hosts are included.
  • the VMM is set in the physical host 10, and the VMM 62 in the embodiment may be the VMM 12 in the physical host 10, or the VMM 62 in this embodiment may also be configured.
  • the VMM 22 in the physical host 20, or the VMM 62 in this embodiment may also be the VMM 32 in the physical host 30.
  • the system may further include a management server 40, which may be, but not limited to, a resource usage of the virtual machine and the physical host, and a current state of the virtual machine and the physical host, such as an idle state, a working state, and the like. , for VMM to obtain the corresponding information.
  • a management server 40 which may be, but not limited to, a resource usage of the virtual machine and the physical host, and a current state of the virtual machine and the physical host, such as an idle state, a working state, and the like. , for VMM to obtain the corresponding information.
  • the virtual machine to be started is placed on the host and started, if the amount of resources that the physical host can provide cannot meet the resource usage required by the virtual machine, the virtual machine can be migrated to other physical hosts, and other physical
  • the amount of resources that the main body can provide is greater than the amount of resources required by the virtual machine. In this way, the virtual machine can work normally.
  • the virtual machine can be migrated to the specified physical host according to the instructions.
  • the number of designated physical hosts is smaller than that in the cluster system. The number of all physical hosts and the physical hosts that have not deployed the powered-on virtual machines. In this way, workloads can be consolidated into a small number of designated physical hosts and physical hosts that do not contain powered-on virtual machines can be shut down to reduce the power consumption of the cluster.
  • a system embodiment is provided below that corresponds to the method and virtual device embodiments provided above.
  • the embodiment provides a clustering system. As shown in FIG. 8, the method includes: one or more physical hosts shown in FIG. 4 and FIG. 5, wherein the one or more physical hosts have a communication connection.
  • the virtual machine to be started is placed on the host and started, if the amount of resources that the physical host can provide cannot meet the resource usage required by the virtual machine, the virtual machine can be migrated to other physical hosts, and other physical
  • the amount of resources that the main body can provide is greater than the amount of resources required by the virtual machine. In this way, the virtual machine can work normally.
  • the virtual machine can be migrated to the specified physical host according to the instructions.
  • the number of designated physical hosts is smaller than that in the cluster system. The number of all physical hosts and the physical hosts that have not deployed the powered-on virtual machines. In this way, you can consolidate workloads into a few designated physical hosts and shut down virtual ones that do not contain boot The physical host of the machine to reduce the power consumption of the cluster.
  • Another embodiment of a physical device is provided below that corresponds to the virtual device embodiments and method embodiments provided above.
  • FIG. 9 illustrates a structure of another physical host 600 according to an embodiment of the present invention.
  • the physical host 600 includes: at least one processor 601, such as a CPU, at least one network interface 604 or other user interface 603, and a memory 605, at least one.
  • Communication bus 602. Communication bus 602 is used to implement connection communication between these components.
  • the physical host 600 optionally includes a user interface 603, including a display, keyboard or pointing device (e.g., mouse, trackball, touchpad or tactile display).
  • the memory 605 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the memory 605 can optionally include at least one storage device located remotely from the aforementioned processor 601.
  • memory 605 stores the following elements, executable modules or data structures, or a subset thereof, or their extension set:
  • Operating system 6051 which contains various system programs for implementing various basic services and handling hardware-based tasks;
  • Application module 6052 which contains various applications for implementing various application services. As shown in FIG. 4, the application module 6052 includes but is not limited to the first obtaining unit 41, the second obtaining unit 42, the calculating unit 43, and the placing unit 44.
  • each module in the application module 6052 refers to the corresponding modules in the embodiment shown in FIG. 5, and details are not described herein.
  • the processor 601 is configured to: acquire a service type of the virtual machine to be started by calling a program or an instruction stored in the memory 605;
  • the virtual machine to be started is placed on the corresponding physical host according to the resource usage required when the virtual machine to be started is started.
  • the processor 601 is specifically configured to calculate the maximum likelihood estimation value G[ ⁇ x).
  • the resource usage amount required when the virtual machine to be started is started is determined as an interval.
  • the processor 601 is specifically configured to calculate the maximum likelihood estimation value of the (the ; the resource usage required when the virtual machine to be started is started is determined as an interval [ G; (x) + , any value of C3 ⁇ 4(x)-6 2 ], wherein the sum is a preset value.
  • the processor 601 is specifically configured to calculate a maximum value that satisfies the formula ⁇ ) ⁇ 111
  • the resource usage amount required to start the virtual machine to be started is determined as any value in the interval [ 3 ⁇ 4+ , 3 ⁇ 4 - ]; the processor 601 is specifically configured to calculate the maximum value satisfying the formula ⁇ > ⁇ 111
  • the resource usage amount required to start the virtual machine to be started is determined as any value in the interval [+, 3 ⁇ 4_]; wherein, the sum is the preset value, and m is a specified tolerated service overload ratio. Further, the processor 601 is specifically configured to calculate a maximum value 10 that satisfies the formula ⁇ ) ⁇ 111 .
  • the resource usage amount required when the virtual machine to be started is started is determined as the /(;; if the formula is not established, the resource usage amount required when the virtual machine to be started is started is determined as Said ⁇ .;
  • the processor 601 is specifically configured to calculate a maximum value that satisfies the formula ⁇ > ⁇ 111 ; and obtain a stored prediction model ( / ) of the historical service load signal of the to-be-started virtual machine, where the description is used to describe the a distribution function of the load amount carried by the physical host when performing the service of the service type on the historical time;
  • the resource usage amount required when the virtual machine to be started is started is determined as the X 2 . ; Where m is the specified tolerated service overload ratio, and the ⁇ is the time at which the virtual machine to be started is started.
  • the processor 601 is specifically configured to obtain the predicted model of the historical service load information of the to-be-started virtual machine, where the physical host performs the service of the service type in historical time. The distribution function of the load carried at the time;
  • is the time at which the virtual machine to be started is started, and the value is a preset value.
  • the processor 601 is specifically configured to obtain, by using a prediction method of a neural network, a stored prediction model of the historical service load information of the to-be-started virtual machine.
  • the processor 601 is further configured to acquire the resource usage of the physical host, where the resource usage of the physical host includes: a processor capacity of the physical host, a usage rate of a processor of the physical host, One or more of a capacity of a memory of the physical host and a usage rate of the memory of the physical host;
  • the placing the virtual machine to be started on the corresponding physical host according to the resource usage required when the virtual machine to be started is started includes:
  • the virtual machine to be started is placed on the determined physical host.
  • the processor 610 is further configured to determine whether the amount of resources that the physical host can currently provide is smaller than the amount of resources required by the at least one virtual machine running on the physical host; if less than at least the physical host The amount of resources required by a virtual machine will be described to
  • the amount of resources that the host can provide is greater than the amount of resources that the physical host can provide.
  • the processor 610 is further configured to determine whether a variance of the resource usage of the physical host is greater than a variance of a preset resource usage amount; If the variance of the preset resource usage is greater than, the amount of resources that can be provided to the host running on the physical host is greater than the preset resource usage.
  • processor 6 01 is further configured to migrate the started virtual machine to at least one specified physical host, where the number of the specified physical hosts is less than the number of all physical hosts in the cluster system;
  • the resource usage amount required when the virtual machine to be started is started is calculated according to the historical service load information of the virtual machine to be started; and the resource usage required when the virtual machine to be started is started is used.
  • the virtual machine to be started is placed on the corresponding physical host, and the virtual machine to be started is calculated according to the historical service load information compared with the resource usage of the virtual machine to be started in the prior art.
  • the amount of resources required for startup is more accurate, effectively avoiding the waste of physical host resources.
  • the virtual machine to be started is placed on the host and started, if the amount of resources that the physical host can provide cannot meet the resource usage required by the virtual machine, the virtual machine can be migrated to other physical hosts, and other physical
  • the amount of resources that the main body can provide is greater than the amount of resources required by the virtual machine. In this way, the virtual machine can work normally.
  • the virtual machine can be migrated to the specified physical host according to the instructions.
  • the number of designated physical hosts is smaller than that in the cluster system. The number of all physical hosts and the physical hosts that have not deployed the powered-on virtual machines. This reduces the power consumption of the cluster by consolidating workloads into a few designated physical hosts and shutting down physical hosts that do not contain powered-on virtual machines.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. .
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer. , hard disk or CD, etc., including a number of instructions to make a computer device (can be an individual)
  • a computer, server, or network device, etc. performs the methods described in various embodiments of the present invention.

Abstract

本发明提供一种虚拟机放置方法和装置,涉及通信技术领域,解决了浪费物理主机的资源的问题。本发明的方法具体可以包括:获取待启动虚拟机的业务类型;获取业务类型的历史业务负载信息,历史业务负载信息用于描述物理主机在历史时间上执行业务类型的业务时承载的负载量;根据待启动虚拟机的历史业务负载信息计算待启动虚拟机启动时所需要的资源使用量;根据待启动虚拟机启动时所需要的资源使用量将待启动虚拟机放置在相应的物理主机上。本发明提供的方法可应用于虚拟机放置中。

Description

虚拟机放置方法和装置 本申请要求于 2 01 3 年 9 月 6 日提交中国专利局、 申请号为 2 01 3 1 04 04 8 1 5. 1 , 发明名称为 "虚拟机放置方法和装置" 的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域, 尤其涉及虚拟机放置方法和装置。
背景技术
服务器虚拟化技术是云计算中基于基础设施层的关键技术。通过对物 理服务器进行虚拟化, 实现在单台物理节点(之后可称为物理主机)上部 署多台虚拟机 (虚拟操作系统), 能够提高物理服务器的资源利用率, 降 低使用成本。 虚拟化集群是将这样的至少两个主机进行统一管理, 从而通 过虚拟化技术将物理资源抽象为存储、 计算、 网络等各种资源组成的资源 池, 虚拟机按需申请资源, 被部署到集群中。
虚拟化集群的一项重要特性是为待启动虚拟机动态选择合适的放置 位置——虚拟机的初始放置问题: 管理中' ^根据待启动虚拟机的资源需 求, 以及集群内各主机的资源分布情况, 选择合适的物理主机来启动虚拟 机, 从而实现集群范围内的负载均衡, 提高各物理主机的资源使用效率的 同时, 保证各物理主机都承担适当的负载。
虚拟机放置位置的选择需要考虑的主要因素可以包括:待启动虚拟机 的资源需求 (可称为资源使用量)、 集群中物理主机可用资源量。
目前虚拟化厂商的集群方案可以包括: DRS ( D i s t r i bu t ed Re s our ces Schedu l ing , 分布式资源调度)通过在物理主机间自动平衡负载, 根据业 务优先级调整资源使用量。 当集群中的某个虚拟机启动时, DRS会将其放 在一个适当的物理主机上, 或者根据用户的手动选择生成放置建议。
具体可以包括:可以根据待启动虚拟机的资源使用量确定放置待启动 虚拟机的物理主机。 虚拟机的规格可以影响虚拟的最大资源使用量, 虚拟 机的规格可以用于表征虚拟机的最大资源使用量, 虚拟机的规格可以包 括: 虚拟机的处理器 (p r o ce s s o r ) 容量、 虚拟机的内存等。 待启动虚拟 机的资源使用量通常可以被设置为虚拟机的规格,即可以被设置为允许的 最大资源使用量。
但实际上, 虚拟机执行业务的绝大部分的时间内, 可能不会达到最大 资源使用量, 因此初始放置的方法可能导致物理资源的浪费。
发明内容
本发明的实施例提供一种资源使用量的计算方法和装置,提升了计算 资源使用量的准确性, 进而有效的节省了物理主机的资源。
本发明的实施例采用如下技术方案:
第一方面, 提供一种虚拟机放置方法, 包括:
获取待启动虚拟机的业务类型;
获取所述业务类型的历史业务负载信息,所述历史业务负载信息用于 描述物理主机在历史时间上执行所述业务类型的业务时承载的负载量; 根据所述待启动虚拟机的历史业务负载信息计算所述待启动虚拟机 启动时所需要的资源使用量;
根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚 拟机放置在相应的物理主机上。
在第一种可能的实现方式中,所述根据所述历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量包括: 类型的业务时承载的负载量的参考概率分布; 若所述参考概率分布不为预设概率分布,则根据所述 F(x)通过非参数 估计方法获取函数 ^) ;
根据所述 (χ)确定所述待启动虚拟机启动时所需要的资源使用量; 若若所所述述参参考考概概率率分分布布为为预预设设概概率率分分布布,,则则从从预预设设概概率率分分布布对对应应的的函函数数 中中获获取取与与所所述述 FF 对对应应的的函函数数 WW;;
根根据据所所述述 确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时所所需需要要的的资资源源使使用用量量;; 其其中中,, 为为参参考考概概率率分分布布函函数数,, ^^为为所所述述物物理理主主机机在在历历史史时时间间上上执执 行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量,,
Figure imgf000004_0001
载量 小于所述 X的概率, 所述 (Χ)为所述 " x的第一概率分布函数, 所 述 (X)为所述 α 的第二 ^既率分布函数。 结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述根据所述 ( χ )确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算所述 ^的极大似然估计值 G; ^;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间
[^w+^ w- 中的任意数值; 所述根据所述 确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算所述 G2 ^的极大似然估计值 ^;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [ ( ) + , ( ) - ]中的任意数值。 其中, 所述 和所述 为预设值。
结合第一方面的第一种可能的实现方式, 在第三种可能的实现方式 中, 所述根据所述 ( χ )确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算满足公式 ( ≤111的 的最大值
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 中的任意数值; 所述根据所述 确定所述待启动虚拟机启动时所需要的资源使用 量, 包括: 计算满足公式 ( ≤111的 的最大值 。;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 中的任意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。 结合第一方面的第一种可能的实现方式, 在第四种可能的实现方式 中, 所述根据所述 ( X )确定所述待启动虚拟机启动时所需要的资源使用 量包括:
计算满足公式 ( ≤111的 的最大值
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算/ ( ;
判断公式 ^ ^。是否成立;
若公式成立,则将所述待启动虚拟机启动时所需要的资源使用量确定 为所述 /( ; 若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 。;
所述根据所述 确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算满足公式 ( ≤111的 的最大值 。;
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述/ W用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算/ ( ;
判断公式 ^ ^。是否成立;
若公式成立,则将所述待启动虚拟机启动时所需要的资源使用量确定 若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 X2。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
结合第一方面, 在第五种可能的实现方式中, 所述根据所述历史业务 负载信息计算所述待启动虚拟机启动时所需要的资源使用量, 包括:
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述/ W用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 + 中的任意数值, 其中, 所述。为启动所述待启动虚拟机 的时刻, 所述 为预设值。
结合第一方面或第一方面的第一种可能的实现方式至第五种可能的 实现方式中任一种方式, 在第六种可能的实现方式中, 在所述根据所述待 启动虚拟机启动时所需要的资源使用量将所述待启动虚拟机放置在相应 的物理主机上之前, 所述方法还包括:
获取所述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物理主机的处理器容量、 所述物理主机的处理器的使用率、 所述物理 主机的内存的容量以及所述物理主机的内存的使用率中的一种或多种; 所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启 动虚拟机放置在相应的物理主机上, 包括:
根据所述物理主机的资源使用量确定物理主机能够提供的资源量; 将所述能够提供的资源量大于所述待启动虚拟机启动时所需要的资 源使用量的物理主机, 确定为放置所述待启动虚拟机的物理主机;
将所述待启动虚拟机放置在确定的物理主机上。
结合第一方面或第一方面的第一种可能的实现方式至第六种可能的 实现方式中任意一种方式, 在第七种可能的实现方式中, 在所述根据所述 待启动虚拟机启动时所需要的资源使用量将所述待启动虚拟机放置在相 应的物理主机上之后, 所述方法还包括:
判断所述物理主机的资源使用量的方差是否大于预设资源使用量的 方差;
若大于所述预设资源使用量的方差,则将运行在所述物理主机上的至 主机能够提供的资源量大于所述预设资源使用量。
结合第一方面, 在第八种可能的实现方式中, 在所述根据所述待启动 虚拟机启动时所需要的资源使用量将所述待启动虚拟机放置在相应的物 理主机上之后, 所述方法还包括:
将已启动的虚拟机迁移到至少一个指定的物理主机中,所述指定的物 理主机的数量小于集群系统中所有物理主机的数量;
关闭未部署有已启动的虚拟机的物理主机。
第二方面, 提供一种虚拟机放置装置, 包括:
第一获取单元, 用于获取待启动虚拟机的业务类型;
第二获取单元, 用于获取所述业务类型的历史业务负载信息, 所述历 史业务负载信息用于描述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量;
计算单元,用于根据待启动虚拟机的历史业务负载信息计算所述待启 动虚拟机启动时所需要的资源使用量;
放置单元,用于根据所述待启动虚拟机启动时所需要的资源使用量将 所述待启动虚拟机放置在相应的物理主机上。
在第一种可能的实现方式中, 计算单元, 包括:
第一确定模块, 用于根据公式 F(X)=P(a X)确定所述物理主机在历史 时间上执行所述业务类型的业务时承载的负载量的参考概率分布; 第一获取模块, 用于若所述参考概率分布不为预设概率分布, 则根据 所所述述 FF (( ))通通过过非非参参数数估估计计方方法法获获取取函函数数 (( ));;
第第二二确确定定模模块块,, 用用于于根根据据所所述述 (( Χχ ))确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时所所 需需要要的的资资源源使使用用量量;;
第第二二获获取取模模块块,, 用用于于若若所所述述参参考考概概率率分分布布为为预预设设概概率率分分布布,, 则则从从预预设设 概概率率分分布布对对应应的的函函数数中中获获取取与与所所述述 F(x)对对应应的的函函数数 ;;
第第三三确确定定模模块块,, 用用于于根根据据所所述述 (( XX ))确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时所所 需需要要的的资资源源使使用用量量;;
其其中中,, 为为参参考考概概率率分分布布函函数数,, ^^为为所所述述物物理理主主机机在在历历史史时时间间上上执执 行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量,,
Figure imgf000008_0001
载量 小于所述 X的概率, 所述 (Χ)为所述 " x的第一概率分布函数, 所 述 ( 为所述 Χ的第一概率分布函数。
结合第二方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述第二确定模块, 包括:
第一计算子模块, 用于计算所述 W的极大似然估计值 ( ; 第一确定子模块,用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 [^^^, (^^]中的任意数值;
所述第三确定模块, 包括:
第二计算子模块, 用于计算所述 W的极大似然估计值 ;
第二确定子模块,用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 [ (x) + , W _ ]中的任意数值。
其中, 所述 和所述 为预设值。
结合第二方面的第一种可能的实现方式, 在第三种可能的实现方式 中, 所述第二确定模块, 包括:
第三计算子模块, 用于计算满足公式 ( ≤111的 的最大值 。; 第三确定子模块,用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 [¾ + ¾¾ _ ]中的任意数值;
所述第三确定模块, 包括: 第四计算子模块, 用于计算满足公式 ( ≤111的 的最大值 。; 第四确定子模块,用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 中的任意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。 结合第二方面的第一种可能的实现方式, 在第四种可能的实现方式 中, 所述第二确定模块, 包括:
第五计算子模块, 用于计算满足公式 ( ≤111的 的最大值 ;
第一获取子模块,用于获取存储的所述待启动虚拟机的所述历史业务 负载信息的预测模型 所述 用于描述所述物理主机在历史时间上 执行所述业务类型的业务时承载的负载量的分布函数;
第六计算子模块, 用于计算 ;
第一判断子模块, 用于判断公式 x。是否成立;
第五确定子模块, 用于若公式成立, 则将所述待启动虚拟机启动时所 需要的资源使用量确定为所述 );
第六确定子模块, 用于若公式不成立, 则将所述待启动虚拟机启动时 所需要的资源使用量确定为所述
所述第三确定模块, 包括:
第七计算子模块, 用于计算满足公式 ( ≤111的 的最大值 。; 第二获取子模块,用于获取存储的所述待启动虚拟机的所述历史业务 负载信息的预测模型 所述 用于描述所述物理主机在历史时间上 执行所述业务类型的业务时承载的负载量的分布函数;
第八计算子模块, 用于计算/ (^;
第二判断子模块, 用于判断公式 X。是否成立;
第七确定子模块, 用于若公式成立, 则将所述待启动虚拟机启动时所 需要的资源使用量确定为所述 (^;
第八确定子模块, 用于若公式不成立, 则将所述待启动虚拟机启动时 所需要的资源使用量确定为所述 X2。; 其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
结合第二方面, 在第五种可能的实现方式中, 所述计算单元, 包括: 第三获取模块,用于获取存储的所述待启动虚拟机的所述历史业务负 载信息的预测模型 w , 所述 用于描述所述物理主机在历史时间上执 行所述业务类型的业务时承载的负载量的分布函数;
第四确定模块,用于将所述待启动虚拟机启动时所需要的资源使用量 确定为区间 [^^+^ )—06] , 其中, 所述^为启动所述待启动虚拟机的 时刻, 所述 为预设值。
结合第二方面或第二方面的第一种可能的实现方式至第五种可能的 实现方式中任一种方式, 在第六种可能的实现方式中, 所述装置还包括: 获取单元,用于在所述放置单元根据所述待启动虚拟机启动时所需要 的资源使用量将所述待启动虚拟机放置在相应的物理主机上之前,获取所 述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物理主 机的处理器容量、 所述物理主机的处理器的使用率、 所述物理主机的内存 的容量以及所述物理主机的内存的使用率中的一种或多种;
所述放置单元, 包括:
第五确定模块,用于根据所述物理主机的资源使用量确定物理主机能 够提供的资源量;
第六确定模块,用于将所述能够提供的资源量大于所述待启动虚拟机 启动时所需要的资源使用量的物理主机,确定为放置所述待启动虚拟机的 物理主机;
放置模块, 用于将所述待启动虚拟机放置在确定的物理主机上。
结合第二方面或第二方面的第一种可能的实现方式至第六种可能的 实现方式中任意一种方式,在第七种可能的实现方式中,所述装置还包括: 判断单元,用于在所述根据所述待启动虚拟机启动时所需要的资源使 用量将所述待启动虚拟机放置在相应的物理主机上之后,判断所述物理主 机的资源使用量的方差是否大于预设资源使用量的方差;
第一迁移单元, 用于若大于所述预设资源使用量的方差, 则将运行在 主机上, 所述其他物理主机能够提供的资源量大于所述预设资源使用量。
结合第二方面, 在第八种可能的实现方式中, 所述装置还包括: 第二迁移单元,用于在所述放置单元根据所述待启动虚拟机启动时所 需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上之后,将 已启动的虚拟机迁移到至少一个指定的物理主机中,所述指定的物理主机 的数量小于集群系统中所有物理主机的数量;
关闭单元, 用于关闭未部署有已启动的虚拟机的物理主机。
第三方面, 提供一种物理主机, 包括:
硬件层和运行在所述硬件层之上的虚拟机监控单元 VMM , 以及运行在 所述 VMM之上的至少一个虚拟机, 其中:
所述 VMM, 用于获取待启动虚拟机的业务类型; 获取所述业务类型的 历史业务负载信息,所述历史业务负载信息用于描述物理主机在历史时间 上执行所述业务类型的业务时承载的负载量;根据所述待启动虚拟机的历 史业务负载信息计算所述待启动虚拟机启动时所需要的资源使用量;根据 所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚拟机放置 在相应的物理主机上。
在第一种可能的实现方式中, 所述 VMM , 具体用于根据公式 F(x)=P(a x)确定所述物理主机在历史时间上执行所述业务类型的业务时 承载的负载量的参考概率分布;判断所述参考概率分布是否为预设概率分 布;
若所述参考概率分布不为预设概率分布,则根据所述 F(x)通过非参数 估计方法获取函数 根据所述 确定所述待启动虚拟机启动时所 需要的资源使用量;
若所述参考概率分布为预设概率分布,则从预设概率分布对应的函数 中中获获取取与与所所述述 FF 对对应应的的函函数数 (x);; 根根据据所所述述 (x)确确定定所所述述待待启启动动虚虚拟拟 机机启启动动时时所所需需要要的的资资源源使使用用量量;;
其其中中,, 为为参参考考概概率率分分布布函函数数,, ^^为为所所述述物物理理主主机机在在历历史史时时间间上上执执 行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量,,
Figure imgf000012_0001
载量 小于所述 X的概率, 所述 (Χ)为所述 " x的第一概率分布函数, 所 述 ( 为所述 χ的第二概率分布函数。
结合第三方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述 VMM , 具体用于计算所述 的极大似然估计值 将所述待 启动虚拟机启动时所需要的资源使用量确定为区间 [^W + ^^ -A]中的 任意数值;
所述 VMM, 具体还用于计算所述 (χ)的极大似然估计值 (x) ; 将所述 待启动虚拟机启动时所需要的资源使用量确定为区间 + , _ ] 中的任意数值。
其中, 所述 和所述 为预设值。
结合第三方面的第一种可能的实现方式, 在第三种可能的实现方式 中, 所述 VMM , 具体用于计算满足公式 ^>≤111的 的最大值 将所述待 启动虚拟机启动时所需要的资源使用量确定为区间 [ + , _ ^ ^中的任意 数值;
所述 VMM , 具体用于计算满足公式 ( ≤111的 的最大值 将所述 待启动虚拟机启动时所需要的资源使用量确定为区间 中的任 意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。 结合第三方面的第一种可能的实现方式, 在第四种可能的实现方式 中, 所述 VMM , 具体用于计算满足公式 ^)≤111的 的最大值
获取存储的所述待启动虚拟机的所述历史业务负载信, g的预测模型 所述 ( 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数; 计算 ( ;
判断公式 ^ ^是否成立;
若公式成立,则将所述待启动虚拟机启动时所需要的资源使用量确定 为所述 /( ; 若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 ;
所述 VMM, 具体还用于计算满足公式 (x)≤ m的 的最大值 。; 获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算 ( ;
判断公式 ^ ^。是否成立;
立,则将所述待启动虚拟机启动时所需要的资源使用量确定
Figure imgf000013_0001
若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 χ2。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
结合第三方面, 在第五种可能的实现方式中, 所述 VMM, 具体用于获 取存储的所述待启动虚拟机的所述历史业务负载信息的预测模型 (0, 所 述 ( 用于描述所述物理主机在历史时间上执行所述业务类型的业务时 承载的负载量的分布函数;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [f{t0) + b6 {t0)-b6] ^ 其中, 所述 ^为启动所述待启动虚拟机的时刻, 所述 为预设值。
结合第三方面或第三方面的第一种可能的实现方式至第五种可能的 实现方式中任一种方式, 在第六种可能的实现方式中, 所述 VMM, 还用于 在所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动 虚拟机放置在相应的物理主机上之前, 获取所述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物理主机的处理器容量、 所述物理 主机的处理器的使用率、所述物理主机的内存的容量以及所述物理主机的 内存的使用率中的一种或多种;
所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启 动虚拟机放置在相应的物理主机上, 包括:
根据所述物理主机的资源使用量确定物理主机能够提供的资源量; 将所述能够提供的资源量大于所述待启动虚拟机启动时所需要的资 源使用量的物理主机, 确定为放置所述待启动虚拟机的物理主机;
将所述待启动虚拟机放置在确定的物理主机上。
结合第三方面或第三方面的第一种可能的实现方式至第六种可能的 实现方式中任意一种方式, 在第七种可能的实现方式中, 所述 VMM , 还用 于在所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启 动虚拟机放置在相应的物理主机上之后,判断所述物理主机的资源使用量 的方差是否大于预设资源使用量的方差;
若大于所述预设资源使用量的方差,则将运行在所述物理主机上的至 主机能够提供的资源量大于所述预设资源使用量。
结合第三方面, 在第八种可能的实现方式中, 所述 VMM , 还用于在所 述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚拟 机放置在相应的物理主机上之后,将已启动的虚拟机迁移到至少一个指定 的物理主机中,所述指定的物理主机的数量小于集群系统中所有物理主机 的数量;
关闭未部署有已启动的虚拟机的物理主机。
第四方面, 提供一种集群系统, 包括一个或多个第三方面或第三方面 的第一种可能的实现方式至第十种可能的实现方式中任一种方式中所述 的物理主机, 其中所述一个或多个物理主机之间具有通信连接。 本发明实施例提供的虚拟机放置方法和装置, 采用上述方案后, 根据 所述待启动虚拟机的历史业务负载信息计算所述待启动虚拟机启动时所 需要的资源使用量;并根据所述待启动虚拟机启动时所需要的资源使用量 将所述待启动虚拟机放置在相应的物理主机上,与现有技术以待启动虚拟 机的规格作为待启动虚拟机的资源使用量相比,根据历史业务负载信息计 算的待启动虚拟机启动时所需的资源使用量更加准确,有效的避免了物理 主机资源的浪费。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对 实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员 来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附 图。
图 1为现有技术中虚拟机放置方法的流程图;
图 2为本实施例提供的一种虚拟机放置方法的流程图;
图 3为本实施例提供的另一种虚拟机放置方法的流程图;
图 4为本实施例提供的一种虚拟机放置装置的结构示意图;
图 5为本实施例提供的另一种虚拟机放置装置的结构示意图; 图 6为本实施例提供的一种物理主机的结构示意图;
图 7为本实施例提供的一种系统的结构示意图;
图 8本实施例提供的一种集群系统的结构示意图;
图 9为本实施例提供的另一种物理主机的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进 行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没 有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的 范围。
为了方便理解本发明实施例, 首先在此介绍本发明实施例描述中会引 入的几个要素;
虚拟机 VM:
通过虚拟机软件可以在一台物理主机上模拟出一台或者多台虚拟的 计算机, 而这些虚拟机就像真正的计算机那样进行工作, 虚拟机上可以安 装操作系统和应用程序, 虚拟机还可访问网络资源。 对于在虚拟机中运行 的应用程序而言, 虚拟机就像是在真正的计算机中进行工作。
硬件层:
虚拟化环境运行的硬件平台。 其中, 硬件层可包括多种硬件, 例如某 计算节点的硬件层可包括 CPU ( Central Processing Unit, 中央处理器) 和 内存, 还可以包括网卡、 存储器等等高速 /低速输入 /输出 ( I/O , Input/Output ) 设备, 及具有特定处理功能的其它设备, 如输入输出内存 管理单元( IOMMU, Input/Output Memory Management Unit ) ,其中 IOMMU 可用于虚拟机物理地址和 Host物理地址的转换。
虚拟机监控器 (VMM , Virtual Machine Manager ):
作为管理层, 用以完成硬件资源的管理、 分配; 为虚拟机呈现虚拟硬 件平台; 实现虚拟机的调度和隔离。 其中, 虚拟硬件平台对其上运行的各 个虚拟机提供各种硬件资源, 如提供虚拟处理器 (如 VCPU )、 内存、 虚 拟磁盘、 虚拟网卡等等。 其中, 该虚拟磁盘可对应 VMM的一个文件或者 一个逻辑块设备。 虚拟机则运行在 VMM 为其准备的虚拟硬件平台上, VMM上运行一个或多个虚拟机。 需要说明的是, 本发明的虚拟机监控器 也可以理解成宿主机 Host„
为了便于对实施例的理解,下面对现有技术中管理中心初始放置待启 动虚拟机的方法进行简单介绍。
用户开启新的虚拟机、 或故障虚拟机重启、 或物理主机进入维护模式 时虚拟机撤离等情况均会触发虚拟机的启动;
如图 1所示, 具体步骤可以包括:
获取待启动虚拟机的规格,以待启动虚拟机的规格作为待启动虚拟机 启动时所需的资源使用量, 以处理器为 CPU为例进行说明, 虚拟机规格定 义可以为: 虚拟机配置为两个 CPU和 4GB内存, 那么该虚拟机的 CPU规格 为两个物理 CPU能力, 内存规格为 4GB能力;
管理中心还可以定时收集集群中每个物理主机的 CPU 和内存的资源 使用量, 可以包括物理主机的 CPU容量 (例如, 物理主机包括 16个 CPU , 每个 CPU的主频为 2. 4GHZ , 那么该物理主机的容量为 16 * 2. 4 = 38. 4GHz )、 主机 CPU使用率、 主机内存容量、 主机内存使用率等;
根据新开启虚拟机的规格以及集群中每个物理主机的资源使用量(即 物理主机的规格), 以物理主机的资源使用量的方差为目标, 采用全遍历 的算法, 确定放置待启动虚拟机的目标物理主机, 可以将资源使用量的方 差较小的物理主机确定为目标物理主机;
在选定的目标物理主机上执行虚拟机启动的指令。
但实际上, 虚拟机执行业务的业务绝大部分的时间内, 可能不会达到 到最大资源使用量 (即不达到虚拟机的规格), 因此初始放置的方法可能 导致物理资源的浪费。
为了解决上述问题, 本实施例提供一种虚拟机放置方法, 该方法的执 行主体 VMM , 如图 2所示, 可以包括:
201、 获取待启动虚拟机的业务类型。
执行不同业务类型的业务时所带来的承载的负载是不同的,为了获取 待启动虚拟机的负载信息, 首先获取待启动虚拟机的业务类型。
本实施例对业务类型的种类不作限定, 为本领域技术人员熟知的技 术, 且可以根据实际需要进行设定, 例如, 可以为语音业务、数据业务等, 在此不再赘述。
202、 获取业务类型的历史业务负载信息。 其中,历史业务负载信息可以用于描述物理主机在历史时间上执行所 述业务类型的业务时承载的负载量。
作为本实施例的一种实施方式, 在虚拟机执行完相应的业务后, 可以 存储执行的相应的业务信息(如, 可以包括业务类型信息)与执行该业务 时承载的负载量的对应关系, 以得到历史业务负载信息, 如, 可以但不限 于将历史业务负载信息存储在一个关系列表中。
本实施例对在虚拟机执行完相应的业务后存储的信息的内容与存储 方式不作限定, 可以根据实际需要进行设定, 在此不再赘述。
203、 根据所述待启动虚拟机的历史业务负载信息计算所述待启动虚 拟机启动时所需要的资源使用量。
作为本实施例的一种实施方式,为了可以准确的获取待启动虚拟机启 动时所需要的资源使用量,可以根据待启动虚拟机的历史业务负载信息来 估计待启动虚拟机启动时所需要的资源使用量。
204、 根据所述待启动虚拟机启动时所需要的资源使用量将所述待启 动虚拟机放置在相应的物理主机上。
不同的物理主机空闲的资源不同,为了使选取的物理主机可以有足够 的资源供待启动虚拟机使用,则可以根据待启动虚拟机启动时所需要的资 源使用量确定放置待启动虚拟机的物理主机, 如, 放置待启动虚拟机的物 理主机可提供的资源量大于或等于待启动虚拟机启动时所需要的资源使 用量。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。
本实施例提供另一种虚拟机放置方法,该方法是对图 2所示的方法的 进一步扩展和优化, 如图 3所示, 可以包括:
301、 获取待启动虚拟机的业务类型。
执行不同业务类型的业务时所承载的负载量可能不同,为了获取待启 动虚拟机的负载信息, 首先可以获取待启动虚拟机的业务类型。
本实施例对业务类型的种类不作限定, 为本领域技术人员熟知的技 术, 且可以根据实际需要进行设定, 例如, 可以为语音业务、数据业务等, 在此不再赘述。
302、 获取业务类型的历史业务负载信息。
其中,历史业务负载信息可以但不限于用于描述物理主机在历史时间 上执行所述业务类型的业务时承载的负载量。
作为本实施例的一种实施方式, 在虚拟机执行完相应的业务后, 可以 存储执行的相应的业务信息(如, 可以包括业务类型信息)与执行该业务 时承载的负载量的对应关系, 以得到历史业务负载信息, 如, 可以但不限 于将历史业务负载信息存储在一个关系列表中。
本实施例对在虚拟机执行完相应的业务后存储的信息的内容与方式 不作限定, 可以根据实际需要进行设定, 在此不再赘述。
303、 根据所述待启动虚拟机的历史业务负载信息计算所述待启动虚 拟机启动时所需要的资源使用量。
作为本实施例的一种实施方式, VMM可以根据历史业务负载信息确定 待启动虚拟机启动时所需要的资源使用量(即可以但不限于为物理主机在 启动待启动虚拟机时, 执行待启动虚拟机的业务时所承载的负载量), 这 样, 可以准确的调度物理主机的资源, 避免了浪费物理主机的资源。
进一步的,根据所述历史业务负载信息计算所述待启动虚拟机启动时 所需要的资源使用量可以包括:
根据公式^ = 5(" 确定所述物理主机在历史时间上执行所述业务 类型的业务时承载的负载量的参考概率分布; 若若所所述述参参考考概概率率分分布布不不为为预预设设概概率率分分布布,,则则根根据据所所述述 FF (( 通通过过非非参参数数 估估计计方方法法获获取取函函数数
根根据据所所述述 ((Χχ))确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时所所需需要要的的资资源源使使用用量量;; 若若所所述述参参考考概概率率分分布布为为预预设设概概率率分分布布,,则则从从预预设设概概率率分分布布对对应应的的函函数数 中中获获取取与与所所述述 F(x)对对应应的的函函数数 (x);;
根根据据所所述述 确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时所所需需要要的的资资源源使使用用量量;; 其其中中,, 为为参参考考概概率率分分布布函函数数,, ^X为为所所述述物物理理主主机机在在历历史史时时间间上上执执 行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量,,
Figure imgf000020_0001
载量 小于所述 X的概率, 所述 (Χ)为所述 " x的第一概率分布函数, 所 述 ( 为所述 χ的第二概率分布函数。
本实施例对非参数估计方法不作限定, 为本领域技术人员熟知的技 术, 且可以根据实际需要进行设定, 在此不再赘述。
进一步的, 根据所述 ( Χ )确定所述待启动虚拟机启动时所需要的资 源使用量, 可以包括:
计算所述 ( )的极大似然估计值 G; ( );
将所述待启动虚拟机启动时所需要的资源使用量确定为区间
[^w+^^w^]中的任意数值;
其中, 所述 为预设值。
作为本实施例的一种实施方式,将所述待启动虚拟机启动时所需要的 资源使用量确定为区间 [ (X) + , (X)- ]中的任意数值可以但不限于包 可以设置 A = U , 即, 将待启动虚拟机启动时所需要的资源使用量确定 为 或者, 可以设置 ≠0
本实施例对 的数值不作限定, 可以根据实际需要进行设定, 例如, 可以但不限于为 1、 0. 1等, 在此不再赘述。
作为本实施例的一种实施方式, 计算所述 ( 的极大似然估计值 可以包括: 计算 的似然函数; 对计算出的似然函数取对数, 并整理; 对整 理后的似然函数求导; 解求导后的似然函数, 得到的解即为 ^)。
本实施对计算所述 的极大似然估计值 的方法不作限定, 为 本领域技术人员熟知的技术, 在此不再赘述。
进一步的, 根据所述 ( χ )确定所述待启动虚拟机启动时所需要的资 源使用量, 包括:
计算满足公式 ( ≤111的 的最大值
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 中的任意数值。 其中, 所述 为预设值, m为指定的容忍业务过载比例。
作为本实施例的一种实施方式,将所述待启动虚拟机启动时所需要的 资源使用量确定为区间 中的任意数值可以但不限于包括: 设置 = 0 , 即, 将待启动虚拟机启动时所需要的资源使用量确定为 (X),; 或者, 设置 ≠0。
本实施例对 的数值不作限定, 可以根据实际需要进行设定, 例如, 可以但不限于为 0、 1、 0. 1等, 在此不再赘述。
进一步的, 根据所述 Gl ( X )确定所述待启动虚拟机启动时所需要的资 源使用量可以包括:
计算满足公式 ( ≤111的 的最大值
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述 ( 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算 /( ;
判断公式 ^ ^。是否成立;
立,则将所述待启动虚拟机启动时所需要的资源使用量确定
Figure imgf000021_0001
若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 。
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
进一步的, 所述根据所述 (Χ)确定所述待启动虚拟机启动时所需要 的资源使用量, 包括:
计算所述 W的极大似然估计值 (X);
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [ ( ) + , ( ) - ]中的任意数值。 其中, 为预设值。
本实施例对 的数值不作限定, 可以根据实际需要进行设定, 例如, 可以但不限于为 1、 0. 1等, 在此不再赘述。
进一步的, 根据所述 (Χ)确定所述待启动虚拟机启动时所需要的资 源使用量, 包括:
计算满足公式 ( ≤111的 的最大值 。;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 中的任意数值;
其中, 所述 为预设值, m为指定的容忍业务过载比例。
作为本实施例的一种实施方式,将所述待启动虚拟机启动时所需要的 资源使用量确定为区间 中的任意数值可以但不限于包括: 设置 = G , 即, 将待启动虚拟机启动时所需要的资源使用量确定为 (X),; 或者, 设置 ≠0
本实施例对 的数值不作限定, 可以根据实际需要进行设定, 例如, 可以但不限于为 0、 1、 0. 1等, 在此不再赘述。
进一步的, 根据所述 (χ)确定所述待启动虚拟机启动时所需要的资 源使用量可以包括:
计算满足公式 ( ≤111的 的最大值 。;
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述 ( 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算 /( ;
判断公式 ^ ^。是否成立;
若公式成立,则将所述待启动虚拟机启动时所需要的资源使用量确定 为所述 /( ;
若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 X2。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
进一步的,根据所述历史业务负载信息计算所述待启动虚拟机启动时 所需要的资源使用量可以包括:
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 所述/ W用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [/( + ,/( _^]中的任意数值, 其中, 所述。为启动所述待启动虚拟机 的时刻, 所述 为预设值。
具体的, 确定启动待启动虚拟机的时刻^ , 然后, 计算 VMM可 以设置 = () , 即将待启动虚拟机启动时所需要的资源使用量确定为 ) ; 或者, 设置 ≠()
本实施例对 的数值不作限定, 可以根据实际需要进行设定, 例如, 可以但不限于为 1、 0. 1等, 在此不再赘述。
本实施例对获取存储的待启动虚拟机的历史业务负载信息的预测模 型 的方法不作限定, 为本领域技术人员熟知的技术, 且可以根据实际 需要进行设定, 例如, 可以为采用神经网络的预测方法获取存储的待启动 虚拟机的历史业务负载信息的预测模型 在此不再赘述。 其中, 神经 网络的预测方法为本领域技术人员熟知的技术, 在此步骤赘述。 本实施例对根据所述待启动虚拟机的历史业务负载信息计算所述待 启动虚拟机启动时所需要的资源使用量的方法不作限定,可以根据实际需 要进行设定, 在此不再赘述。
304、 获取物理主机的资源使用量。
物理主机的资源使用量可以但不限于包括:所述物理主机的处理器容 量、 所述物理主机的处理器的使用率、 所述物理主机的内存的容量以及所 述物理主机的内存的使用率中的一种或多种。
其中,处理器可以但不限于为: CPU、DSP( D i g i t a l S i ngna l Proce s s or , 微处理器) 等。
305、 根据所述物理主机的资源使用量确定物理主机能够提供的资源 量。
作为本实施例的一种实施方式, VMM可以获取物理主机能够提供的最 大资源量, 并还可以获取物理主机当前的资源使用量, 将最大资源量减去 当前的资源使用量, 得到物理主机当前能够提供的资源量。
本实施例对根据所述物理主机的资源使用量确定物理主机能够提供 的资源量是方法不作限定, 为本领域技术人员熟知的技术, 且可以根据实 际需要进行设定, 在此不再赘述。
306、 将所述能够提供的资源量大于所述待启动虚拟机启动时所需要 的资源使用量的物理主机, 确定为放置所述待启动虚拟机的物理主机。
307、 将所述待启动虚拟机放置在确定的物理主机上。
作为本实施例的一种实施方式, VMM可以将能够满足待启动虚拟机启 动时所需要的资源使用量的物理主机确定为放置待启动虚拟机的物理主 机, 如, 放置待启动虚拟机的物理主机可提供的资源量大于待启动虚拟机 启动时所需要的资源使用量。
进一步的, V丽可以以最小化主机数目为目标确定放置待启动虚拟机 的物理主机。 具体可以包括:
可以将物理主机分为两个部分: P 1 (包含启动的虚拟机)和 P2 (不包含 启动的虚拟机);按照物理主机的资源空闲量从大到小或从小到大的顺序, 对 P 1 中的物理主机进行排序;在 P 1 中优先选择资源使用最少的物理主机 作为指定的物理主机; 如果上述步骤没有选出合适的物理主机, 则在 P2 中选择空闲的物理主机; 在选定的物理主机上执行虚拟机启动的指令。
步骤 301至步骤 307为初始放置待启动虚拟机的步骤,在将待启动虚 拟机放置在确定的物理主机中并启动后, 由于, 物理主机启动的虚拟机的 数量逐渐增加, 物理主机可以提供的资源量可能会随之减少, 物理主机的 负载量过大会降低该物理主机的性能, 因此, 需要将运行在这些物理主机 上的至少一个虚拟机迁移至其他物理主机中,以释放该物理主机中的资源 (换言之, 可以为减小该物理主机的负载), 具体方法可以参见步骤 308 和步骤 309。 在多个物理主机中选择所述其他物理主机的方法可以参见步 骤 301和步骤 307中描述的方法, 在此步骤赘述。
308、 判断所述物理主机当前能够提供的资源量是否小于运行在所述 物理主机上的至少一个虚拟机要求的资源量。 若小于, 则执行步骤 309 , 若不小于, 则流程结束。 机上。
其中,所述其他物理主机能够提供的资源量大于所述物理主机能够提 供的资源量。
作为本实施例的一种实施方式, VMM可以但不限于将至少一个虚拟机 将至少一个虚拟机迁移至除所述物理主机外的部分其他物理主机上。
执行步骤 31 0。
进一步的, VMM不仅可以通过步骤 308、 309 中记载的方法迁移虚拟 机, 还可以通过步骤 308 ' 、 309 ' 中记载的方法迁移虚拟机。 308 ' 、 判断所述物理主机的资源使用量的方差是否大于预设资源使 用量的方差。 若大于, 则执行步骤 309 ' , 若不大于, 则流程结束。
方差是实际值与期望值之差平方的期望值, 在实际计算中, 通常可以 用以下方法计算方差。
方差是各个数据与平均数之差的平方的平均数,即:
Figure imgf000026_0001
其中, J为样本的平均值, "为样本的数量, 为样本个体, ^ [ J为 下角标, 为方差。
本实施例中, 计算物理主机的资源使用量的方差可以但不限于包括: 首先, VMM 可以从物理主机的资源使用量中获取"个样本 x 然后, 再 计 算 " 个 样 本 的 平 均 值 J , 最 后 , 可 以 根 据 公 式
Figure imgf000026_0002
计算物理主机的资源使用量的方差 。 本实施例对计算物理主机的资源使用量的方差是方法不作限定,为本 领域技术人员熟知的技术, 在此不再赘述。
309 ' 、 将运行在所述物理主机上的至少一个虚拟机迁移至除所述物 理主机外的其他物理主机上。
其中, 其他物理主机能够提供的资源量大于所述预设资源使用量。 作为本实施例的一种实施方式, VMM可以但不限于将至少一个虚拟机 将至少一个虚拟机迁移至除所述物理主机外的部分其他物理主机上。
进一步的, VMM不仅可以根据步骤 308、 309、 308 ' 以及 309 ' 迁移 虚拟机, 还可以根据指示将虚拟机迁移至指定的物理主机中, 具体步骤可 以参见步骤 310和 31 1。
31 0、 将已启动的虚拟机迁移到至少一个指定的物理主机中。 进一步的, 指定的物理主机的数量小于集群中所有物理主机的数量。 作为本实施例的一种实施方式,可以根据步骤 3 01至步骤 3 07中描述 的方法确定将已启动的虚拟机迁移到哪个指定的物理主机中
3 1 1、 关闭未包含有启动的虚拟机的物理主机。
在集群中的物理主机处于低利用率期间(即可以为群集的资源需求减 少), 此时, 可以把工作负载整合到少数几台指定的物理主机中, 并关闭 未包含有启动的虚拟机的物理主机, 以降低群集的电力消耗。 在集群中的 物理主机处于高利用率期间, 工作负载的资源需求增加, 可以将已关闭的 物理主机重新联机以确保符合服务级别。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。
另外, 在将待启动虚拟机放置在屋里主机上并启动后, 若物理主机可 提供的资源量不能满足虚拟机要求的资源使用量,则可以将虚拟机迁移至 其他物理主机上,其他物理主体能够提供的资源量大于虚拟机要求的资源 使用量, 这样, 可以使虚拟机可以正常的工作; 还可以根据指示将虚拟机 迁移至指定物理主机上,指定的物理主机的数量小于集群系统中所有物理 主机的数量, 并关闭未部署有已启动的虚拟机的物理主机。 这样, 可以把 工作负载整合到少数几台指定的物理主机中,并关闭未包含有启动的虚拟 机的物理主机, 以降低群集的电力消耗。 下面提供一些虚拟装置实施例,该虚拟装置实施例分别于上述提供的 相应的方法实施例相对应。
本实施例提供一种虚拟机放置装置, 如图 4所示, 可以包括: 第一获取单元 41 , 用于获取待启动虚拟机的业务类型;
第二获取单元 42 , 用于获取所述业务类型的历史业务负载信息, 所 述历史业务负载信息用于描述物理主机在历史时间上执行所述业务类型 的业务时承载的负载量;
计算单元 43 , 用于根据待启动虚拟机的历史业务负载信息计算所述 待启动虚拟机启动时所需要的资源使用量;
放置单元 44 , 用于根据所述待启动虚拟机启动时所需要的资源使用 量将所述待启动虚拟机放置在相应的物理主机上。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。
本实施例提供另一种虚拟机放置装置,该装置是对图 4所示的装置的 进一步扩展和优化, 如图 5所示, 可以包括:
第一获取单元 51 , 用于获取待启动虚拟机的业务类型;
第二获取单元 52 , 用于获取所述业务类型的历史业务负载信息, 所 述历史业务负载信息用于描述物理主机在历史时间上执行所述业务类型 的业务时承载的负载量;
计算单元 53 , 用于根据待启动虚拟机的历史业务负载信息计算所述 待启动虚拟机启动时所需要的资源使用量;
放置单元 54 , 用于根据所述待启动虚拟机启动时所需要的资源使用 量将所述待启动虚拟机放置在相应的物理主机上。
进一步的, 计算单元 53 , 包括:
第一确定模块 531 ,用于根据公式 F(x)=jP(a x)确定所述物理主机在历 史时间上执行所述业务类型的业务时承载的负载量的参考概率分布; 判判断断模模块块 553322,, 用用于于判判断断所所述述参参考考概概率率分分布布是是否否为为预预设设概概率率分分布布;; 第第一一获获取取模模块块 553333,, 用用于于若若所所述述参参考考概概率率分分布布不不为为预预设设概概率率分分布布,, 则则 根根据据所所述述 FF((xx))通通过过非非参参数数估估计计方方法法获获取取函函数数 (( ));;
第第二二确确定定模模块块 553344,, 用用于于根根据据所所述述 ^^11确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时 所所需需要要的的资资源源使使用用量量;;
第第二二获获取取模模块块 553355,, 用用于于若若所所述述参参考考概概率率分分布布为为预预设设概概率率分分布布,, 则则从从 预预设设概概率率分分布布对对应应的的函函数数中中获获取取与与所所述述 FF((xx))对对应应的的函函数数 ((xx));;
第第三三确确定定模模块块 553366,,用用于于根根据据所所述述 ^^))确确定定所所述述待待启启动动虚虚拟拟机机启启动动时时 所所需需要要的的资资源源使使用用量量;;
其其中中,, FF((xx))为为参参考考概概率率分分布布函函数数,, ^^为为所所述述物物理理主主机机在在历历史史时时间间上上执执 行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量,,
Figure imgf000029_0001
载量 小于所述 X的概率, 所述 (χ)为所述 " χ的第一概率分布函数, 所 述 ( 为所述 Χ的第一概率分布函数。
进一步的, 第二确定模块 534, 包括:
第一计算子模块 5341, 用于计算所述 的极大似然估计值 第一确定子模块 5342, 用于将所述待启动虚拟机启动时所需要的资 源使用量确定为区间 [ ' + ^ ' ^]中的任意数值;
所述第三确定模块 536, 包括:
第二计算子模块 5361, 用于计算所述 W的极大似然估计值 ( ; 第二确定子模块 5362, 用于将所述待启动虚拟机启动时所需要的资 源使用量确定为区间 [ ( + , ^)_0 2]中的任意数值。
其中, 所述 和所述 为预设值。
进一步的, 第二确定模块 534, 包括:
第三计算子模块 5343, 用于计算满足公式 ( ≤111的 的最大值 。; 第三确定子模块 5344, 用于将所述待启动虚拟机启动时所需要的资 源使用量确定为区间 [¾+ ¾¾_ ¾]中的任意数值;
所述第三确定模块 536, 包括: 第四计算子模块 5363, 用于计算满足公式 ( ≤111的 的最大值 。; 第四确定子模块 5364, 用于将所述待启动虚拟机启动时所需要的资 源使用量确定为区间 中的任意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。 进一步的, 第二确定模块 534, 包括:
第五计算子模块 5345, 用于计算满足公式 ( ≤111的 的最大值 ; 第一获取子模块 5346, 用于获取存储的所述待启动虚拟机的所述历 史业务负载信息的预测模型 所述 用于描述所述物理主机在历史 时间上执行所述业务类型的业务时承载的负载量的分布函数;
第六计算子模块 5347, 用于计算 ^);
第一判断子模块 5348, 用于判断公式 ^^ ^。是否成立;
第五确定子模块 5349, 用于若公式成立, 则将所述待启动虚拟机启 动时所需要的资源使用量确定为所述 (。);
第六确定子模块 53410, 用于若公式不成立, 则将所述待启动虚拟机 启动时所需要的资源使用量确定为所述 。;
所述第三确定模块 536, 包括:
第七计算子模块 5365, 用于计算满足公式 ( ≤111的 的最大值 。; 第二获取子模块 5366, 用于获取存储的所述待启动虚拟机的所述历 史业务负载信息的预测模型 ( , 所述 用于描述所述物理主机在历史 时间上执行所述业务类型的业务时承载的负载量的分布函数;
第八计算子模块 5367, 用于计算 ^ ;
第二判断子模块 5368, 用于判断公式 ^^ ^。是否成立;
第七确定子模块 5369, 用于若公式成立, 则将所述待启动虚拟机启 动时所需要的资源使用量确定为所述 (。);
第八确定子模块 53610, 用于若公式不成立, 则将所述待启动虚拟机 启动时所需要的资源使用量确定为所述 。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
进一步的, 计算单元 53 , 包括:
第三获取模块 537 , 用于获取存储的所述待启动虚拟机的所述历史业 务负载信息的预测模型 W , 所述 w用于描述所述物理主机在历史时间 上执行所述业务类型的业务时承载的负载量的分布函数;
第四确定模块 538 , 用于将所述待启动虚拟机启动时所需要的资源使 用量确定为区间 [^^ + ^· " )—06] , 其中, 所述^为启动所述待启动虚拟 机的时刻, 所述 为预设值。
进一步的, 本实施例提供的虚拟机放置装置还包括:
获取单元 55 , 用于在所述放置单元根据所述待启动虚拟机启动时所 需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上之前,获 取所述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物 理主机的处理器容量、 所述物理主机的处理器的使用率、 所述物理主机的 内存的容量以及所述物理主机的内存的使用率中的一种或多种;
所述放置单元 54 , 包括:
第五确定模块 541 , 用于根据所述物理主机的资源使用量确定物理主 机能够提供的资源量;
第六确定模块 542 , 用于将所述能够提供的资源量大于所述待启动虚 拟机启动时所需要的资源使用量的物理主机,确定为放置所述待启动虚拟 机的物理主机;
放置模块 543 , 用于将所述待启动虚拟机放置在确定的物理主机上。 进一步的, 本实施例提供的虚拟机放置装置还可以包括:
判断单元 56 , 用于在所述根据所述待启动虚拟机启动时所需要的资 源使用量将所述待启动虚拟机放置在相应的物理主机上之后,判断所述物 理主机的资源使用量的方差是否大于预设资源使用量的方差;
第一迁移单元 57 , 用于若大于所述预设资源使用量的方差, 则将运 物理主机上,所述其他物理主机能够提供的资源量大于所述预设资源使用 量。
进一步的, 本实施例提供的虚拟机放置装置还可以包括:
第二迁移单元 58 , 用于在所述放置单元根据所述待启动虚拟机启动 时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上之 后, 将已启动的虚拟机迁移到至少一个指定的物理主机中, 所述指定的物 理主机的数量小于集群系统中所有物理主机的数量;
关闭单元 59 , 用于关闭未部署有已启动的虚拟机的物理主机。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。
另外, 在将待启动虚拟机放置在屋里主机上并启动后, 若物理主机可 提供的资源量不能满足虚拟机要求的资源使用量,则可以将虚拟机迁移至 其他物理主机上,其他物理主体能够提供的资源量大于虚拟机要求的资源 使用量, 这样, 可以使虚拟机可以正常的工作; 还可以根据指示将虚拟机 迁移至指定物理主机上,指定的物理主机的数量小于集群系统中所有物理 主机的数量, 并关闭未部署有已启动的虚拟机的物理主机。 这样, 可以把 工作负载整合到少数几台指定的物理主机中,并关闭未包含有启动的虚拟 机的物理主机, 以降低群集的电力消耗。 下面提供一些实体装置实施例,该实体装置实施例与上述提供的虚拟 装置实施例和方法实施例相对应。
本实施例提供一种物理主机, 如图 6所示, 包括:
硬件层 61和运行在所述硬件层之上的虚拟机监控单元 VMM 62 , 以及 运行在所述 VMM 62之上的至少一个虚拟机 63 , 其中:
所述 VMM 62 , 用于获取待启动虚拟机 63的业务类型; 获取所述业务 类型的历史业务负载信息,所述历史业务负载信息用于描述物理主机在历 史时间上执行所述业务类型的业务时承载的负载量;根据所述待启动虚拟 机 63的历史业务负载信息计算所述待启动虚拟机 63启动时所需要的资源 使用量; 根据所述待启动虚拟机 63启动时所需要的资源使用量将所述待 启动虚拟机 63放置在相应的物理主机上。
本实施例中, 相应的物理主机可以是设置有 VMM 62的物理主机, 也 可以是系统中与设置有 VMM 62的物理主机不同的物理主机。
换言之, 本实施例执行相应步骤的 VMM 62可以设置于图 6所示的物 理主机中, 待启动虚拟机可以被确定放置在图 6所示的物理主机中, 也可 以被放置在系统中的其他物理主机中,即本实施例执行相应步骤的 VMM 62 可以与待启动虚拟机可以被放置在同一个物理主机中,也可以被放置在不 同物理主机中。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。
本实施例提供另一种物理主机,该物理主机是对图 6所示的物理主机 的进一步扩展和优化, 如图 6所示, 可以包括:
硬件层 61和运行在所述硬件层之上的虚拟机监控单元 VMM 62 , 以及 运行在所述 VMM 62之上的至少一个虚拟机 63 , 其中:
所述 VMM 62 , 用于获取待启动虚拟机 63的业务类型; 获取所述业务 类型的历史业务负载信息,所述历史业务负载信息用于描述物理主机在历 史时间上执行所述业务类型的业务时承载的负载量;根据所述待启动虚拟 机机 6633的的历历史史业业务务负负载载信信息息计计算算所所述述待待启启动动虚虚拟拟机机 6633启启动动时时所所需需要要的的资资源源 使使用用量量;; 根根据据所所述述待待启启动动虚虚拟拟机机 6633启启动动时时所所需需要要的的资资源源使使用用量量将将所所述述待待 启启动动虚虚拟拟机机 6633放放置置在在相相应应的的物物理理主主机机上上。。
进进一一步步的的,, VVMMMM 6622 ,, 具具体体用用于于根根据据公公式式 FF((xx))==PP((aa xx))确确定定所所述述物物理理主主 机机在在历历史史时时间间上上执执行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量的的参参考考概概率率分分
若若所所述述参参考考概概率率分分布布不不为为预预设设概概率率分分布布,,则则根根据据所所述述 FF((xx))通通过过非非参参数数 估估计计方方法法获获取取函函数数 根根据据所所述述 确确定定所所述述待待启启动动虚虚拟拟机机 6633启启动动时时 所所需需要要的的资资源源使使用用量量;;
若若所所述述参参考考概概率率分分布布为为预预设设概概率率分分布布,,则则从从预预设设概概率率分分布布对对应应的的函函数数 中中获获取取与与所所述述 FF 对对应应的的函函数数 ((xx));; 根根据据所所述述 ((xx))确确定定所所述述待待启启动动虚虚拟拟 机机 6633启启动动时时所所需需要要的的资资源源使使用用量量;;
其其中中,, FF((xx))为为参参考考概概率率分分布布函函数数,, ^^为为所所述述物物理理主主机机在在历历史史时时间间上上执执 行行所所述述业业务务类类型型的的业业务务时时承承载载的的负负载载量量,,
Figure imgf000034_0001
载量 小于所述 X的概率, 所述 (χ)为所述 " χ的第一概率分布函数, 所 述 ( 为所述 χ的第二概率分布函数。 进一步的, VMM 62 , 具体用于计算所述 的极大似然估计值 ^*; 将所述待启动虚拟机 63 启动时所需要的资源使用量确定为区间
[ 'W w- 中的任意数值; 所述 VMM 62 , 具体还用于计算所述 (χ)的极大似然估计值 (x) ; 将 所述待启动虚拟机 63 启动时所需要的资源使用量确定为 区间 [C¾ (x) + ,C¾ (x)-62]中的任意数值。 其中, 所述 和所述 为预设值。
进一步的, V丽 62 , 具体用于计算满足公式 ( ≤111的 的最大值 将所述待启动虚拟机 63 启动时所需要的资源使用量确定为区间 中的任意数值; 所述 VMM 62 , 具体用于计算满足公式 ^>≤111的 的最大值 将所 述待启动虚拟机 63 启动时所需要的资源使用量确定为区间 [ +_ 中的任意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。 进一步的, V丽 62 , 具体用于计算满足公式 ( ≤111的 的最大值 获取存储的所述待启动虚拟机 63的所述历史业务负载信息的预测模 型/ W , 所述/ W用于描述所述物理主机在历史时间上执行所述业务类型 的业务时承载的负载量的分布函数;
计算/ ( ;
判断公式 ^ ^。是否成立;
若公式成立, 则将所述待启动虚拟机 63启动时所需要的资源使用量 确定为所述 ^^;
若公式不成立, 则将所述待启动虚拟机 63启动时所需要的资源使用 量确定为所述 χι。;
所述 VMM 62 , 具体还用于计算满足公式 ^>≤111的 的最大值 。; 获取存储的所述待启动虚拟机 63的所述历史业务负载信息的预测模 型/ (0 , 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型 的业务时承载的负载量的分布函数;
计算 /( ;
判断公式 ^ ^。是否成立;
若公式成立, 则将所述待启动虚拟机 63启动时所需要的资源使用量 确定为所述 ^^;
若公式不成立, 则将所述待启动虚拟机 63启动时所需要的资源使用 量确定为所述 χ2。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机 63的时刻。
进一步的, VMM 62 , 具体用于获取存储的所述待启动虚拟机 63的所 述历史业务负载信息的预测模型 , 所述 用于描述所述物理主机在 历史时间上执行所述业务类型的业务时承载的负载量的分布函数; 将所述待启动虚拟机 63 启动时所需要的资源使用量确定为区间 [f{t0) + k,f {t0 ) -b6] ^ 其中, 所述^为启动所述待启动虚拟机 63的时刻, 所 述 为预设值。
进一步的, VMM 62 , 具体用于采用神经网络的预测方法获取存储的所 述待启动虚拟机 63的所述历史业务负载信息的预测模型 ^)。
进一步的, VMM 62 , 还用于在所述根据所述待启动虚拟机 63启动时 所需要的资源使用量将所述待启动虚拟机 63放置在相应的物理主机上之 前, 获取所述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物理主机的处理器容量、 所述物理主机的处理器的使用率、 所述物理 主机的内存的容量以及所述物理主机的内存的使用率中的一种或多种; 所述根据所述待启动虚拟机 63启动时所需要的资源使用量将所述待 启动虚拟机 63放置在相应的物理主机上, 包括:
根据所述物理主机的资源使用量确定物理主机能够提供的资源量; 将所述能够提供的资源量大于所述待启动虚拟机 63启动时所需要的 资源使用量的物理主机, 确定为放置所述待启动虚拟机 63的物理主机; 将所述待启动虚拟机 63放置在确定的物理主机上。
进一步的, VMM 62 , 还用于在所述根据所述待启动虚拟机 63启动时 所需要的资源使用量将所述待启动虚拟机 63放置在相应的物理主机上之 后,判断所述物理主机当前能够提供的资源量是否小于运行在所述物理主 机上的至少一个虚拟机 63要求的资源量;
若小于所述物理主机上的至少一个虚拟机 63要求的资源量, 则将所 其他物理主机能够提供的资源量大于所述物理主机能够提供的资源量。
进一步的, VMM 62 , 还用于在所述根据所述待启动虚拟机 63启动时 所需要的资源使用量将所述待启动虚拟机 63放置在相应的物理主机上之 后,判断所述物理主机的资源使用量的方差是否大于预设资源使用量的方 若大于所述预设资源使用量的方差,则将运行在所述物理主机上的至 物理主机能够提供的资源量大于所述预设资源使用量。
进一步的, VMM 62 , 还用于在所述根据所述待启动虚拟机 63启动时 所需要的资源使用量将所述待启动虚拟机 63放置在相应的物理主机上之 后, 将已启动的虚拟机 63迁移到至少一个指定的物理主机中, 所述指定 的物理主机的数量小于集群系统中所有物理主机的数量;
关闭未部署有已启动的虚拟机 63的物理主机。
进一步的, 本实施例提供的 VMM 62可以设置于放置待启动虚拟机 63 的物理主机上, 或, 还可以设置于与放置待启动虚拟机 63的物理主机不 同的物理主机上。
作为本实施例的一种实施方式, 如图 7所示, 为系统机构示意图, 其 中, 可以包括三个物理主机 (物理知己 1 0、 物理主机 20、 物理主机 30 ), 在这三个物理主机中均设置有 VMM , 若待启动虚拟机被确定放置在物理主 机 1 0 中, 则本实施例中的 VMM 62可以为物理主机 1 0 中的 VMM12 , 或, 本实施例中的 VMM 62还可以为物理主机 20 中的 VMM 22 , 或, 本实施例 中的 VMM 62还可以为物理主机 30中的 VMM 32。
另外, 如图 7 所示, 系统中还可以包括管理服务器 40 , 可以但不限 于存储有虚拟机与物理主机的资源使用量、 虚拟机与物理主机当前的状 态, 如, 空闲状态、 工作状态等, 以供 VMM 获取相应的信息。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。 另外, 在将待启动虚拟机放置在屋里主机上并启动后, 若物理主机可 提供的资源量不能满足虚拟机要求的资源使用量,则可以将虚拟机迁移至 其他物理主机上,其他物理主体能够提供的资源量大于虚拟机要求的资源 使用量, 这样, 可以使虚拟机可以正常的工作; 还可以根据指示将虚拟机 迁移至指定物理主机上,指定的物理主机的数量小于集群系统中所有物理 主机的数量, 并关闭未部署有已启动的虚拟机的物理主机。 这样, 可以把 工作负载整合到少数几台指定的物理主机中,并关闭未包含有启动的虚拟 机的物理主机, 以降低群集的电力消耗。 下面提供一个系统实施例,该系统实施例与上述提供的方法和虚拟装 置实施例相对应。
本实施例提供一种集群系统, 如图 8 所示, 包括: 一个或多个图 4 和图 5所示的物理主机, 其中, 所述一个或多个物理主机之间具有通信连 接。
采用上述方案后,根据所述待启动虚拟机的历史业务负载信息计算所 述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚拟机启 动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上, 与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用量相比, 根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使用量更 加准确, 有效的避免了物理主机资源的浪费。
另外, 在将待启动虚拟机放置在屋里主机上并启动后, 若物理主机可 提供的资源量不能满足虚拟机要求的资源使用量,则可以将虚拟机迁移至 其他物理主机上,其他物理主体能够提供的资源量大于虚拟机要求的资源 使用量, 这样, 可以使虚拟机可以正常的工作; 还可以根据指示将虚拟机 迁移至指定物理主机上,指定的物理主机的数量小于集群系统中所有物理 主机的数量, 并关闭未部署有已启动的虚拟机的物理主机。 这样, 可以把 工作负载整合到少数几台指定的物理主机中,并关闭未包含有启动的虚拟 机的物理主机, 以降低群集的电力消耗。 下面提供另一个实体装置实施例,该实体装置实施例与上述提供的虚 拟装置实施例和方法实施例相对应。
图 9描述了本发明实施例提供的另一种物理主机 600的结构,该物理 主机 600 包括: 至少一个处理器 601, 例如 CPU, 至少一个网络接口 604 或者其他用户接口 603, 存储器 605, 至少一个通信总线 602。 通信总线 602用于实现这些组件之间的连接通信。 该物理主机 600可选的包含用户 接口 603, 包括显示器, 键盘或者点击设备 (例如, 鼠标, 轨迹球 ( trackball ) , 触感板或者触感显示屏)。 存储器 605可能包含高速 RAM 存储器, 也可能还包括非不稳定的存储器 (non-volatile memory), 例如 至少一个磁盘存储器。存储器 605可选的可以包含至少一个位于远离前述 处理器 601的存储装置。
在一些实施方式中, 存储器 605存储了如下的元素, 可执行模块或者 数据结构, 或者他们的子集, 或者他们的扩展集:
操作系统 6051, 包含各种系统程序, 用于实现各种基础业务以及处理 基于硬件的任务;
应用程序模块 6052, 包含各种应用程序, 用于实现各种应用业务。 如图 4所示, 应用程序模块 6052中包括但不限第一获取单元 41、 第二 获取单元 42、 计算单元 43以及放置单元 44。
应用程序模块 6052中各模块的具体实现参见图 5所示实施例中的相应 模块, 在此不赘述。
在本发明实施例中, 通过调用存储器 605存储的程序或指令, 处理器 601用于: 获取待启动虚拟机的业务类型;
获取所述业务类型的历史业务负载信息,所述历史业务负载信息用于 描述物理主机在历史时间上执行所述业务类型的业务时承载的负载量; 根据所述待启动虚拟机的历史业务负载信息计算所述待启动虚拟机 启动时所需要的资源使用量;
根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚 拟机放置在相应的物理主机上。
在上述各个实施例中, 进一步地, 所述处理器 601 , 具体用于根据公 式^ = 5(" 确定所述物理主机在历史时间上执行所述业务类型的业务 时承载的负载量的参考概率分布; 若所述参考概率分布不为预设概率分布,则根据所述 F(x)通过非参数 估计方法获取函数 ^);
根据所述 (χ)确定所述待启动虚拟机启动时所需要的资源使用量; 若所述参考概率分布为预设概率分布,则从预设概率分布对应的函数 中获取与所述 F(x)对应的函数 (x);
根据所述 确定所述待启动虚拟机启动时所需要的资源使用量; 其中, 为参考概率分布函数, ^为所述物理主机在历史时间上执 行所述业务类型的业务时承载的负载量, Ρ(α x)为在所述历史时间上负 载量 小于所述 X的概率, 所述 (χ)为所述 " χ的第一概率分布函数, 所 述 为所述 χ的第二概率分布函数。
进一步的, 处理器 601 , 具体用于计算所述 的极大似然估计值 G[{x). 将所述待启动虚拟机启动时所需要的资源使用量确定为区间
[ W+A W- 中的任意数值; 处理器 601 , 具体用于计算所述 ( 的极大似然估计值 ( ; 将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [G;(x) + ,C¾(x)-62]中的任意数值。 其中, 所述 和所述 为预设值。
进一步的, 处理器 601, 具体用于计算满足公式 ^)≤111的 的最大值 将所述待启动虛拟机启动时所需要的资源使用量确定为区间 [¾+¾- ]中的任意数值; 处理器 601, 具体用于计算满足公式 ^>≤111的 的最大值
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [ + ,¾_ ]中的任意数值; 其中, 所述 ^和所述 为预设值, m为指定的容忍业务过载比例。 进一步的, 处理器 601, 具体用于计算满足公式 ^)≤111的 的最大值 10 ·
获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 (/), 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算/ ( ;
判断公式 ^是否成立;
若公式成立,则将所述待启动虚拟机启动时所需要的资源使用量确定 为所述 /( ; 若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 ^。;
处理器 601, 具体用于计算满足公式 ^>≤111的 的最大值 ; 获取存储的所述待启动虚拟机的所述历史业务负载信, 的预测模型 (/), 所述 用于描述所述物理主机在历史时间上执行所述业务类型的 业务时承载的负载量的分布函数;
计算/ (0;
判断公式 ^^ ^是否成立;
立,则将所述待启动虚拟机启动时所需要的资源使用量确定
Figure imgf000041_0001
若公式不成立,则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 X2。; 其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟 机的时刻。
进一步的, 处理器 601 , 具体用于获取存储的所述待启动虚拟机的所 述历史业务负载信息的预测模型 , 所述 用于描述所述物理主机在 历史时间上执行所述业务类型的业务时承载的负载量的分布函数;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间
+ 中的任意数值, 其中, 所述^为启动所述待启动虚拟机 的时刻, 所述 为预设值。
进一步的, 处理器 601 , 具体用于采用神经网络的预测方法获取存储 的所述待启动虚拟机的所述历史业务负载信息的预测模型 ( 。
进一步的, 处理器 601 , 还用于获取所述物理主机的资源使用量, 所 述物理主机的资源使用量包括: 所述物理主机的处理器容量、 所述物理主 机的处理器的使用率、所述物理主机的内存的容量以及所述物理主机的内 存的使用率中的一种或多种;
所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启 动虚拟机放置在相应的物理主机上, 包括:
根据所述物理主机的资源使用量确定物理主机能够提供的资源量; 将所述能够提供的资源量大于所述待启动虚拟机启动时所需要的资 源使用量的物理主机, 确定为放置所述待启动虚拟机的物理主机;
将所述待启动虚拟机放置在确定的物理主机上。
进一步的, 处理器 6 01 , 还用于判断所述物理主机当前能够提供的资 源量是否小于运行在所述物理主机上的至少一个虚拟机要求的资源量; 若小于所述物理主机上的至少一个虚拟机要求的资源量,则将所述至
主机能够提供的资源量大于所述物理主机能够提供的资源量。
进一步的, 处理器 6 01 , 还用于判断所述物理主机的资源使用量的方 差是否大于预设资源使用量的方差; 若大于所述预设资源使用量的方差,则将运行在所述物理主机上的至 主机能够提供的资源量大于所述预设资源使用量。
进一步的, 处理器 6 01 , 还用于将已启动的虚拟机迁移到至少一个指 定的物理主机中,所述指定的物理主机的数量小于集群系统中所有物理主 机的数量;
关闭未部署有已启动的虚拟机的物理主机。
可见, 采用上述方案后, 根据所述待启动虚拟机的历史业务负载信息 计算所述待启动虚拟机启动时所需要的资源使用量;并根据所述待启动虚 拟机启动时所需要的资源使用量将所述待启动虚拟机放置在相应的物理 主机上,与现有技术以待启动虚拟机的规格作为待启动虚拟机的资源使用 量相比,根据历史业务负载信息计算的待启动虚拟机启动时所需的资源使 用量更加准确, 有效的避免了物理主机资源的浪费。
另外, 在将待启动虚拟机放置在屋里主机上并启动后, 若物理主机可 提供的资源量不能满足虚拟机要求的资源使用量,则可以将虚拟机迁移至 其他物理主机上,其他物理主体能够提供的资源量大于虚拟机要求的资源 使用量, 这样, 可以使虚拟机可以正常的工作; 还可以根据指示将虚拟机 迁移至指定物理主机上,指定的物理主机的数量小于集群系统中所有物理 主机的数量, 并关闭未部署有已启动的虚拟机的物理主机。 这样, 可以把 工作负载整合到少数几台指定的物理主机中,并关闭未包含有启动的虚拟 机的物理主机, 以降低群集的电力消耗。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到 本发明可借助软件加必需的通用硬件的方式来实现, 当然也可以通过硬 件, 但很多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技 术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式 体现出来, 该计算机软件产品存储在可读取的存储介质中, 如计算机的软 盘, 硬盘或光盘等, 包括若干指令用以使得一台计算机设备(可以是个人 计算机, 服务器, 或者网络设备等) 执行本发明各个实施例所述的方法。 以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应所述以权利要求的保护范围为准。

Claims

权 利 要 求 书
1、 一种虚拟机放置方法, 其特征在于, 包括:
获取待启动虚拟机的业务类型;
获取所述业务类型的历史业务负载信息, 所述历史业务负载信息用于 描述物理主机在历史时间上执行所述业务类型的业务时承载的负载量; 根据所述待启动虚拟机的历史业务负载信息计算所述待启动虚拟机启 动时所需要的资源使用量;
根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚拟 机放置在相应的物理主机上。
2、 根据权利要求 1所述的虚拟机放置方法, 其特征在于, 所述根据所 述历史业务负载信息计算所述待启动虚拟机启动时所需要的资源使用量包 括:
根据公式^ = 5(" 确定所述物理主机在历史时间上执行所述业务 类型的业务时承载的负载量的参考概率分布; 若所述参考概率分布不为预设概率分布, 则根据所述 通过非参数 估计方法获取函数
根据所述 (χ)确定所述待启动虚拟机启动时所需要的资源使用量; 若所述参考概率分布为预设概率分布, 则从预设概率分布对应的函数 中获取与所述 F 对应的函数 (χ);
根据所述 确定所述待启动虚拟机启动时所需要的资源使用量; 其中, F(x)为参考概率分布函数, ^为所述物理主机在历史时间上执行 所述业务类型的业务时承载的负载量, Ρ(α χ)为在所述历史时间上负载量
"小于所述 ^的概率, 所述 ^)为所述 " ^的第一概率分布函数, 所述 ( 为所述 X的第二概率分布函数。
3、 根据权利要求 2所述的虚拟机放置方法, 其特征在于, 所述根据所 述 确定所述待启动虚拟机启动时所需要的资源使用量, 包括: 计算所述 Gl W的极大似然估计值 G W;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [G;(X) ,G;(X)— 中的任意数值;
所述根据所述 G2 (X)确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算所述 G X的极大似然估计值 ); 将所述待启动虚拟机启动时所需要的资源使用量确定为区间
[G; (x) + ¾ , (X) - ]中的任意数值, 其中, 所述 和所述 为预设值。
4、 根据权利要求 2所述的虚拟机放置方法, 其特征在于, 所述根据所 述 ( 确定所述待启动虚拟机启动时所需要的资源使用量, 包括:
计算满足公式 Gl (x)≤ m的 的最大值 ;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 63 ]中的任意数值; 所述根据所述 确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算满足公式 ( x)≤ m的 X的最大值 χ2。;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 中的任意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。
5、 根据权利要求 2所述的虚拟机放置方法, 其特征在于, 所述根据所 述 ^)确定所述待启动虚拟机启动时所需要的资源使用量包括:
计算满足公式 Gl (x)≤ m的 的最大值 ;
获取存储的所述待启动虛拟机的所述历史业务负载信息的预测模型 所述 用于描述所述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量的分布函数;
计算 判断公式 ^ ^。是否成立;
立, 则将所述待启动虚拟机启动时所需要的资源使用量确定
Figure imgf000047_0001
若公式不成立, 则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 。;
所述根据所述 (χ)确定所述待启动虚拟机启动时所需要的资源使用 量, 包括:
计算满足公式 ( ≤111的 的最大值 Χ2。;
获取存储的所述待启动虚拟机的所述历史业务负载信息的预测模型 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量的分布函数;
计算/ ( ;
判断公式 ^ ^。是否成立;
立, 则将所述待启动虚拟机启动时所需要的资源使用量确定
Figure imgf000047_0002
若公式不成立, 则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟机 的时刻。
6、 根据权利要求 1所述的虚拟机放置方法, 其特征在于, 所述根据所 述历史业务负载信息计算所述待启动虚拟机启动时所需要的资源使用量, 包括:
获取存储的所述待启动虚拟机的所述历史业务负载信息的预测模型 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量的分布函数;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [/( + ,/( _ ]中的任意数值, 其中, 所述^为启动所述待启动虚拟机的 时刻, 所述 为预设值。
7、 根据权利要求 1至 6中任意一项所述的虚拟机放置方法, 其特征在 于, 在所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启 动虚拟机放置在相应的物理主机上之前, 所述方法还包括:
获取所述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物理主机的处理器容量、 所述物理主机的处理器的使用率、 所述物理 主机的内存的容量以及所述物理主机的内存的使用率中的一种或多种; 所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动 虚拟机放置在相应的物理主机上, 包括:
根据所述物理主机的资源使用量确定物理主机能够提供的资源量; 将所述能够提供的资源量大于所述待启动虚拟机启动时所需要的资源 使用量的物理主机, 确定为放置所述待启动虚拟机的物理主机;
将所述待启动虚拟机放置在确定的物理主机上。
8、 根据权利要求 1至 7任一项所述的虚拟机放置方法, 其特征在于, 在所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚 拟机放置在相应的物理主机上之后, 所述方法还包括:
判断所述物理主机的资源使用量的方差是否大于预设资源使用量的方 差;
若大于所述预设资源使用量的方差, 则将运行在所述物理主机上的至 主机能够提供的资源量大于所述预设资源使用量。
9、 根据权利要求 1所述的虚拟机放置方法, 其特征在于, 在所述根据 所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚拟机放置在 相应的物理主机上之后, 所述方法还包括:
将已启动的虚拟机迁移到至少一个指定的物理主机中, 所述指定的物 理主机的数量小于集群系统中所有物理主机的数量;
关闭未部署有已启动的虚拟机的物理主机。
10、 一种虚拟机放置装置, 其特征在于, 包括:
第一获取单元, 用于获取待启动虚拟机的业务类型;
第二获取单元, 用于获取所述业务类型的历史业务负载信息, 所述历 史业务负载信息用于描述物理主机在历史时间上执行所述业务类型的业务 时承载的负载量;
计算单元, 用于根据待启动虚拟机的历史业务负载信息计算所述待启 动虚拟机启动时所需要的资源使用量;
放置单元, 用于根据所述待启动虚拟机启动时所需要的资源使用量将 所述待启动虚拟机放置在相应的物理主机上。
11、 根据权利要求 10所述的虚拟机放置装置, 其特征在于, 所述计算 单元, 包括:
第一确定模块, 用于根据公式^ = 5(" 确定所述物理主机在历史时 间上执行所述业务类型的业务时承载的负载量的参考概率分布; 第一获取模块, 用于若所述参考概率分布不为预设概率分布, 则根据 所述 F W通过非参数估计方法获取函数 (x);
第二确定模块, 用于根据所述 确定所述待启动虚拟机启动时所需 要的资源使用量;
第二获取模块, 用于若所述参考概率分布为预设概率分布, 则从预设 概率分布对应的函数中获取与所述 F(x)对应的函数 ;
第三确定模块, 用于根据所述 ^>确定所述待启动虚拟机启动时所需 要的资源使用量;
其中, 为参考概率分布函数, X为所述物理主机在历史时间上执行 所述业务类型的业务时承载的负载量, ρ(α χ)为在所述历史时间上负载量 "小于所述 X的概率, 所述 ^>为所述 " χ的第一概率分布函数, 所述 ( 为所述 " 的第一概率分布函数。
12、 根据权利要求 11所述的虚拟机放置装置, 其特征在于, 所述第二 确定模块, 包括:
第一计算子模块, 用于计算所述 W的极大似然估计值 ( ; 第一确定子模块, 用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 [^ +^, ( 中的任意数值;
所述第三确定模块, 包括:
第二计算子模块, 用于计算所述 W的极大似然估计值 第二确定子模块, 用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 [ ( + , ( - ]中的任意数值;
其中, 所述 和所述 为预设值。
13、 根据权利要求 11所述的虚拟机放置装置, 其特征在于, 所述第二 确定模块, 包括:
第三计算子模块, 用于计算满足公式 ( x )≤ m的 的最大值 。; 第三确定子模块, 用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 中的任意数值;
所述第三确定模块, 包括:
第四计算子模块, 用于计算满足公式 ( ≤111的 的最大值 。; 第四确定子模块, 用于将所述待启动虚拟机启动时所需要的资源使用 量确定为区间 中的任意数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。
14、 根据权利要求 11所述的虚拟机放置装置, 其特征在于, 所述第二 确定模块, 包括:
第五计算子模块, 用于计算满足公式 ( ≤111的 的最大值 ;
第一获取子模块, 用于获取存储的所述待启动虚拟机的所述历史业务 负载信息的预测模型 ,所述 用于描述所述物理主机在历史时间上执 行所述业务类型的业务时承载的负载量的分布函数;
第六计算子模块, 用于计算 (。);
第一判断子模块, 用于判断公式 。 x。是否成立; 第五确定子模块, 用于若公式成立, 则将所述待启动虚拟机启动时所 需要的资源使用量确定为所述 ) ;
第六确定子模块, 用于若公式不成立, 则将所述待启动虚拟机启动时 所需要的资源使用量确定为所述 Χι。;
所述第三确定模块, 包括:
第七计算子模块, 用于计算满足公式 ( ≤111的 的最大值 。; 第二获取子模块, 用于获取存储的所述待启动虚拟机的所述历史业务 负载信息的预测模型 ,所述 用于描述所述物理主机在历史时间上执 行所述业务类型的业务时承载的负载量的分布函数;
第八计算子模块, 用于计算
第二判断子模块, 用于判断公式 。 x。是否成立;
第七确定子模块, 用于若公式成立, 则将所述待启动虚拟机启动时所 需要的资源使用量确定为所述 ( );
第八确定子模块, 用于若公式不成立, 则将所述待启动虚拟机启动时 所需要的资源使用量确定为所述 。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟机 的时刻。
1 5、 根据权利要求 1 0所述的虚拟机放置装置, 其特征在于, 所述计算 单元, 包括:
第三获取模块, 用于获取存储的所述待启动虚拟机的所述历史业务负 载信息的预测模型 W ,所述 / ( 用于描述所述物理主机在历史时间上执行 所述业务类型的业务时承载的负载量的分布函数;
第四确定模块, 用于将所述待启动虚拟机启动时所需要的资源使用量 确定为区间
Figure imgf000051_0001
, 其中, 所述。为启动所述待启动虚拟机的时 刻, 所述 为预设值。
1 6、 根据权利要求 1 0至 1 5 中任意一项所述的虚拟机放置装置, 其特 征在于, 所述装置还包括: 获取单元, 用于在所述放置单元根据所述待启动虚拟机启动时所需要 的资源使用量将所述待启动虚拟机放置在相应的物理主机上之前, 获取所 述物理主机的资源使用量, 所述物理主机的资源使用量包括: 所述物理主 机的处理器容量、 所述物理主机的处理器的使用率、 所述物理主机的内存 的容量以及所述物理主机的内存的使用率中的一种或多种;
所述放置单元, 包括:
第五确定模块, 用于根据所述物理主机的资源使用量确定物理主机能 够提供的资源量;
第六确定模块, 用于将所述能够提供的资源量大于所述待启动虚拟机 启动时所需要的资源使用量的物理主机, 确定为放置所述待启动虚拟机的 物理主机;
放置模块, 用于将所述待启动虚拟机放置在确定的物理主机上。
1 7、 根据权利要求 1 0至 1 6 中任一项所述的虚拟机放置装置, 其特征 在于, 所述装置还包括:
判断单元, 用于在所述根据所述待启动虚拟机启动时所需要的资源使 用量将所述待启动虚拟机放置在相应的物理主机上之后, 判断所述物理主 机的资源使用量的方差是否大于预设资源使用量的方差;
第一迁移单元, 用于若大于所述预设资源使用量的方差, 则将运行在 机上, 所述其他物理主机能够提供的资源量大于所述预设资源使用量。
1 8、 根据权利要求 1 0所述的虚拟机放置装置, 其特征在于, 所述装置 还包括:
第二迁移单元, 用于在所述放置单元根据所述待启动虚拟机启动时所 需要的资源使用量将所述待启动虚拟机放置在相应的物理主机上之后, 将 已启动的虚拟机迁移到至少一个指定的物理主机中, 所述指定的物理主机 的数量小于集群系统中所有物理主机的数量;
关闭单元, 用于关闭未部署有已启动的虚拟机的物理主机。
19、 一种物理主机, 其特征在于, 包括: 硬件层和运行在所述硬件层 之上的虚拟机监控单元 VMM, 以及运行在所述 VMM之上的至少一个虚拟机, 其中:
所述 VMM , 用于获取待启动虚拟机的业务类型; 获取所述业务类型的 历史业务负载信息, 所述历史业务负载信息用于描述物理主机在历史时间 上执行所述业务类型的业务时承载的负载量; 根据所述待启动虚拟机的历 史业务负载信息计算所述待启动虚拟机启动时所需要的资源使用量; 根据 所述待启动虚拟机启动时所需要的资源使用量将所述待启动虚拟机放置在 相应的物理主机上。
20、 根据权利要求 19所述的物理主机, 其特征在于, 所述 VMM , 具体 用于根据公式 F(x)=P(a x)确定所述物理主机在历史时间上执行所述业务 类型的业务时承载的负载量的参考概率分布; 判断所述参考概率分布是否 为预设概率分布;
若所述参考概率分布不为预设概率分布, 则根据所述 F(x)通过非参数 估计方法获取函数 ( ; 根据所述 ^>确定所述待启动虚拟机启动时所需 要的资源使用量;
若所述参考概率分布为预设概率分布, 则从预设概率分布对应的函数 中获取与所述 F (x)对应的函数 (x); 根据所述 (x)确定所述待启动虚拟机 启动时所需要的资源使用量;
其中, F(x)为参考概率分布函数, ^为所述物理主机在历史时间上执行 所述业务类型的业务时承载的负载量, Ρ(α χ)为在所述历史时间上负载量 "小于所述 ^的概率, 所述 ( 为所述 " ^的第一概率分布函数, 所述 ( 为所述 X的第二概率分布函数。
21、 根据权利要求 20所述的物理主机, 其特征在于, 所述 VMM, 具体 用于计算所述 的极大似然估计值 将所述待启动虚拟机启动时所 需要的资源使用量确定为区间 + 中的任意数值;
所述 VMM, 具体还用于计算所述 (x)的极大似然估计值 (x) ; 将所述 待启动虚拟机启动时所需要的资源使用量确定为区间 [^(Χ) + ¾, (Χ)_ ¾]中 的任意数值;
其中, 所述 和所述 ^为预设值。
22、 根据权利要求 20所述的物理主机, 其特征在于, 所述 VMM, 具体 用于计算满足公式 ( ≤111的 的最大值¾; 将所述待启动虚拟机启动时所 需要的资源使用量确定为区间 中的任意数值;
所述 VMM, 具体用于计算满足公式 ^>≤111的 的最大值 将所述待 启动虚拟机启动时所需要的资源使用量确定为区间 [ 。 + , 。 _ W中的任意 数值;
其中, 所述 和所述 为预设值, m为指定的容忍业务过载比例。
23、 根据权利要求 20所述的物理主机, 其特征在于, 所述 VMM, 具体 用于计算满足公式 ( ≤111的 的最大值¾;
获取存储的所述待启动虚拟机的所述历史业务负载信息的预测模型 所述/ W用于描述所述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量的分布函数;
计算 ( ;
判断公式 ^ ^是否成立;
立, 则将所述待启动虚拟机启动时所需要的资源使用量确定
Figure imgf000054_0001
若公式不成立, 则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 。;
所述 V MM , 具体还用于计算满足公式 G x )≤ m的 的最大值 。; 获取存储的所述待启动虚拟机的所述历史业务负载信息的预测模型 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量的分布函数;
计算 ( ;
判断公式 ^ 是否成立; 若公式成立, 则将所述待启动虚拟机启动时所需要的资源使用量确定 为所述 /( ;
若公式不成立, 则将所述待启动虚拟机启动时所需要的资源使用量确 定为所述 。;
其中, m为指定的容忍业务过载比例, 所述^为启动所述待启动虚拟机 的时刻。
24、 根据权利要求 19所述的物理主机, 其特征在于, 所述 VMM, 具体 用于获取存储的所述待启动虚拟机的所述历史业务负载信息的预测模型 所述/ ( 用于描述所述物理主机在历史时间上执行所述业务类型的业 务时承载的负载量的分布函数;
将所述待启动虚拟机启动时所需要的资源使用量确定为区间 [f {t0 ) + b6,f {t0 ) -b6] ^其中,所述^为启动所述待启动虚拟机的时刻,所述 为 预设值。
25、 根据权利要求 19至 24 中任一项所述的物理主机, 其特征在于, 所述 VMM , 还用于在所述根据所述待启动虚拟机启动时所需要的资源使用 量将所述待启动虚拟机放置在相应的物理主机上之前, 获取所述物理主机 的资源使用量, 所述物理主机的资源使用量包括: 所述物理主机的处理器 容量、 所述物理主机的处理器的使用率、 所述物理主机的内存的容量以及 所述物理主机的内存的使用率中的一种或多种;
所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动 虚拟机放置在相应的物理主机上, 包括:
根据所述物理主机的资源使用量确定物理主机能够提供的资源量; 将所述能够提供的资源量大于所述待启动虚拟机启动时所需要的资源 使用量的物理主机, 确定为放置所述待启动虚拟机的物理主机;
将所述待启动虚拟机放置在确定的物理主机上。
26、 根据权利要求 19至 25 中任一项所述的物理主机, 其特征在于, 所述 VMM , 还用于在所述根据所述待启动虚拟机启动时所需要的资源使用 量将所述待启动虚拟机放置在相应的物理主机上之后, 判断所述物理主机 的资源使用量的方差是否大于预设资源使用量的方差;
若大于所述预设资源使用量的方差, 则将运行在所述物理主机上的至 主机能够提供的资源量大于所述预设资源使用量。
27、 根据权利要求 19所述的物理主机, 其特征在于, 所述 VMM, 还用 于在所述根据所述待启动虚拟机启动时所需要的资源使用量将所述待启动 虚拟机放置在相应的物理主机上之后, 将已启动的虚拟机迁移到至少一个 指定的物理主机中, 所述指定的物理主机的数量小于集群系统中所有物理 主机的数量;
关闭未部署有已启动的虚拟机的物理主机。
28、 一种集群系统, 其特征在于, 包括一个或多个如权利要求 19 至 27任一项所述的物理主机, 其中所述一个或多个物理主机之间具有通信连 接。
PCT/CN2014/075111 2013-09-06 2014-04-10 虚拟机放置方法和装置 WO2015032201A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310404815.1 2013-09-06
CN201310404815.1A CN103473115B (zh) 2013-09-06 2013-09-06 虚拟机放置方法和装置

Publications (1)

Publication Number Publication Date
WO2015032201A1 true WO2015032201A1 (zh) 2015-03-12

Family

ID=49797984

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/075111 WO2015032201A1 (zh) 2013-09-06 2014-04-10 虚拟机放置方法和装置

Country Status (2)

Country Link
CN (1) CN103473115B (zh)
WO (1) WO2015032201A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473115B (zh) * 2013-09-06 2017-04-05 华为技术有限公司 虚拟机放置方法和装置
CN105786619B (zh) * 2016-02-24 2019-08-06 中国联合网络通信集团有限公司 虚拟机分配方法及装置
CN107341029B (zh) * 2017-05-27 2020-06-05 北京奇艺世纪科技有限公司 系统资源部署策略的获取方法、装置及电子设备
CN107368351B (zh) * 2017-07-25 2021-03-19 苏州浪潮智能科技有限公司 一种虚拟机配置自动升级扩容方法和装置
CN109309584A (zh) * 2018-09-03 2019-02-05 郑州云海信息技术有限公司 一种虚拟机密度配置方法、装置、终端及存储介质
CN109254832A (zh) * 2018-09-11 2019-01-22 郑州云海信息技术有限公司 一种虚拟机启动方法、装置、存储介质和计算机设备质
CN109412841A (zh) * 2018-09-30 2019-03-01 北京金山云网络技术有限公司 虚拟机资源的调整方法、装置和云平台
CN109992356B (zh) * 2019-04-10 2021-11-16 北京隆普智能科技有限公司 一种自动启动虚拟机的方法及其系统
CN111491006B (zh) * 2020-03-03 2021-11-02 天津大学 负载感知的云计算资源弹性分配系统及方法
CN113641461A (zh) * 2021-10-14 2021-11-12 云宏信息科技股份有限公司 Kvm虚拟化系统资源配置方法、介质及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123084A (zh) * 2011-01-19 2011-07-13 浪潮(北京)电子信息产业有限公司 云计算操作系统中资源调度方法及系统
CN103023936A (zh) * 2011-09-23 2013-04-03 中国科学院声学研究所 一种多层次网络系统及基于该网络系统的任务执行方法
CN103067425A (zh) * 2011-10-20 2013-04-24 中国移动通信集团公司 虚拟机创建方法、虚拟机管理系统及相关设备
CN103473115A (zh) * 2013-09-06 2013-12-25 华为技术有限公司 虚拟机放置方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005309644A (ja) * 2004-04-20 2005-11-04 Hitachi Ltd リソース制御方法及びそのシステム
CN102232282B (zh) * 2010-10-29 2014-03-26 华为技术有限公司 一种实现数据中心资源负载均衡的方法及装置
CN102646052B (zh) * 2011-02-16 2016-01-27 中国移动通信集团公司 一种虚拟机部署方法、装置及系统
TWI456502B (zh) * 2011-12-01 2014-10-11 Univ Tunghai 虛擬機叢集之動態資源分配方法
CN102446115B (zh) * 2012-01-09 2014-06-18 浙江大学 一种虚拟机的动态部署方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123084A (zh) * 2011-01-19 2011-07-13 浪潮(北京)电子信息产业有限公司 云计算操作系统中资源调度方法及系统
CN103023936A (zh) * 2011-09-23 2013-04-03 中国科学院声学研究所 一种多层次网络系统及基于该网络系统的任务执行方法
CN103067425A (zh) * 2011-10-20 2013-04-24 中国移动通信集团公司 虚拟机创建方法、虚拟机管理系统及相关设备
CN103473115A (zh) * 2013-09-06 2013-12-25 华为技术有限公司 虚拟机放置方法和装置

Also Published As

Publication number Publication date
CN103473115B (zh) 2017-04-05
CN103473115A (zh) 2013-12-25

Similar Documents

Publication Publication Date Title
US11714667B2 (en) Automated scaling of application in virtual data centers
WO2015032201A1 (zh) 虚拟机放置方法和装置
EP3606008B1 (en) Method and device for realizing resource scheduling
US9727355B2 (en) Virtual Hadoop manager
US10101798B2 (en) Reducing power consumption in a server cluster
US10824215B2 (en) Managing power budget of multiple computing node clusters in a computing rack system
US10241674B2 (en) Workload aware NUMA scheduling
US11714668B2 (en) Supporting quality-of-service for virtual machines based on operational events
US9223623B2 (en) Dynamic service resource control
US9292060B1 (en) Allowing clients to limited control on power consumed by the cloud while executing the client's tasks
WO2014029219A1 (zh) 虚拟化集群整合方法、装置及虚拟化集群系统
JP2016103113A5 (zh)
WO2018086467A1 (zh) 一种云环境下应用集群资源分配的方法、装置和系统
US9417902B1 (en) Managing resource bursting
EP3000024B1 (en) Dynamically provisioning storage
TW201324357A (zh) 虛擬機叢集之綠能管理方法
TW201347459A (zh) 管理方法及其系統
US9438466B1 (en) Migrating virtual machines between oversubscribed and undersubscribed compute devices
US9348391B1 (en) Managing resource power states in shared environments
CN104391736B (zh) 虚拟机的休眠模式设置方法和装置
CN109800084A (zh) 释放虚拟机资源的方法及终端设备
TW201327205A (zh) 硬體效能的管理方法及雲端運算系統
Shirvani et al. Server consolidation schemes in cloud computing environment: a review
TW201337766A (zh) 虛擬機資源整合系統及方法
Marcu et al. Power consumption and temperature measurement of virtualization solutions

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

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

Country of ref document: EP

Kind code of ref document: A1