WO2016106747A1 - 虚拟机能耗确定方法、物理机和网络系统 - Google Patents

虚拟机能耗确定方法、物理机和网络系统 Download PDF

Info

Publication number
WO2016106747A1
WO2016106747A1 PCT/CN2014/096057 CN2014096057W WO2016106747A1 WO 2016106747 A1 WO2016106747 A1 WO 2016106747A1 CN 2014096057 W CN2014096057 W CN 2014096057W WO 2016106747 A1 WO2016106747 A1 WO 2016106747A1
Authority
WO
WIPO (PCT)
Prior art keywords
energy consumption
physical machine
feature information
machine
virtual machine
Prior art date
Application number
PCT/CN2014/096057
Other languages
English (en)
French (fr)
Inventor
黄荷姣
顾崇林
梁良
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2014/096057 priority Critical patent/WO2016106747A1/zh
Priority to CN201480038254.0A priority patent/CN106170744B/zh
Publication of WO2016106747A1 publication Critical patent/WO2016106747A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/28Supervision thereof, e.g. detecting power-supply failure by out of limits supervision

Definitions

  • the embodiments of the present invention relate to the field of information technologies, and in particular, to a virtual machine energy consumption determining method, a physical machine, and a network system.
  • the data center based on cloud computing technology provides virtual machine services for more and more users.
  • the data center usually provides virtual machine services by a group of servers.
  • the data center needs to manage and monitor the virtual machine in order to better provide virtual machine services for users.
  • the provider of the virtual machine service needs to measure the energy consumption of each virtual machine so as to follow each user. Actual energy consumption is charged.
  • the existing virtual machine energy calculation method first selects some typical physical resources on the physical machine, such as CPU, storage device, and network I/O as functional units for dividing the energy consumption of the physical machine system, and each functional unit according to experience. Select one or more event counters that can reflect the workload of the functional unit, such as CPU utilization, collect real-time statistics of these event counters on the physical machine, and aggregate statistics according to one or more event counters corresponding to each functional unit.
  • some typical physical resources on the physical machine such as CPU, storage device, and network I/O as functional units for dividing the energy consumption of the physical machine system, and each functional unit according to experience.
  • Select one or more event counters that can reflect the workload of the functional unit, such as CPU utilization, collect real-time statistics of these event counters on the physical machine, and aggregate statistics according to one or more event counters corresponding to each functional unit.
  • Modeling the total energy consumption of the physical machine to obtain a model of the statistical information of each functional unit and the physical machine energy consumption the model includes the energy consumption coefficient corresponding to the unit workload of each functional unit, and then, according to all event counters
  • the virtual machine identifier included in the statistics information obtains the statistics of various event counters corresponding to each virtual machine, and the function information of each virtual machine is obtained according to the statistical information of the event counter corresponding to each function module of each virtual machine.
  • Energy consumption, each event meter of each functional module corresponding to each virtual machine Energy summer to obtain the energy consumption of each virtual machine.
  • the embodiment of the invention provides a virtual machine energy consumption determining method, a physical machine and a network system, which are used to solve the problem that the virtual machine energy consumption determining method in the prior art has low accuracy.
  • a first aspect of the present invention provides a method for determining a virtual machine energy consumption, including:
  • the feature information includes at least one event information or at least one resource information
  • the energy consumption of the virtual machine running on the physical machine is determined according to the energy consumption model of the physical machine.
  • the determining, according to the feature information on the physical machine, and the non-mapped basic energy consumption of the physical machine, determining the energy consumption of the physical machine specifically includes:
  • the feature matrix includes at least one of matrix elements: CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix includes at least one of the following matrix elements: number of executed instructions, number of LLCs, and an interrupt counter Count of.
  • the determining, according to an energy consumption model of the physical machine, determining a capability of a virtual machine running on the physical machine Consumption including:
  • the energy consumption of the first virtual machine is determined according to the energy consumption corresponding to the feature information of the first virtual machine and the variable energy consumption component corresponding to the feature information of the first virtual machine.
  • variable energy consumption component corresponding to the feature information of the first virtual machine is determined according to the variable energy consumption factor set in the physical machine energy consumption model, including:
  • variable energy consumption factor set according to the physical energy consumption model, characteristic information of the first virtual machine, feature information of an intermediate layer of the physical machine, and all virtual machines running on the physical machine
  • the characteristic information determines a variable energy consumption component corresponding to the feature information of the first virtual machine.
  • the unmapped basic energy consumption determines the set parameter matrix and the set variable energy consumption factor, including:
  • the energy consumption model of the physical machine is:
  • P total is the energy consumption of the physical machine
  • P static is the non-mapping basic energy consumption of the physical machine
  • elements R 1 , R 2 , ..., R n in the matrix R total are the characteristic information of the physical machine
  • the elements a 1 , a 2 , . . . , a n in the T are the set parameter matrix in the physical machine energy consumption model, where a 1 is an energy consumption parameter corresponding to the feature information R 1 .
  • a 2 is an energy consumption parameter corresponding to the feature information R 2
  • a n is an energy consumption parameter corresponding to the feature information R n
  • a 0 is the set variable energy consumption factor in the physical machine energy consumption model
  • the feature information and the non-mapped base energy consumption of the physical machine are determined.
  • the parameter matrix according to the setting in the physical machine energy consumption model Determining, by the feature information of the first virtual machine, the energy consumption corresponding to the feature information of the first virtual machine, specifically:
  • variable energy consumption factor and the set according to the physical energy consumption model Determining the variable energy consumption component corresponding to the feature information of the first virtual machine, the feature information of the first virtual machine, the feature information of the intermediate layer of the physical machine, and the feature information of all the virtual machines running on the physical machine Specifically, including:
  • variable energy consumption component corresponding to the feature information of the jth first virtual machine running on the physical machine, where a 0 is the set variable energy consumption factor in the physical machine energy consumption model,
  • nth type of feature information of the jth first virtual machine running on the physical machine m is the number of virtual machines running on the physical machine,
  • n is the number of the feature information.
  • the physical machine and the first virtual machine running on the physical machine The value of the CPU resource belongs to the preset first CPU resource utilization interval, and the minimum value of the preset first CPU resource utilization interval is not less than 50%, or
  • the values of the memory resources of the physical machine and the first virtual machine running on the physical machine are all pre- a first memory resource utilization interval, and the minimum value of the preset first memory resource utilization interval is not less than 50%, or
  • the value of the IO resource of the first virtual machine running on the physical machine and the physical machine belongs to a preset first IO resource utilization interval, and the minimum value of the preset first IO resource utilization interval is not Less than 50%;
  • the feature matrix includes at least one of the following matrix elements: CPU resources
  • the memory resource, the input/output IO resource, and the network traffic, or the feature matrix includes at least one of the following matrix elements: an executed instruction number, an LLC number, and a count of an interrupt counter;
  • Determining the energy consumption of the virtual machine running on the physical machine according to the energy consumption model of the physical machine includes:
  • the second The parameter information of the virtual machine is used to determine a parameter matrix for setting the energy consumption of the second virtual machine and the set variable energy consumption factor, which specifically includes:
  • the utilization interval of the CPU resources includes a preset first CPU resource utilization interval, a second CPU resource utilization interval, and a third CPU resource utilization interval, and the memory resource
  • the utilization interval includes a preset first memory utilization interval, a second memory utilization interval, and a third memory utilization interval
  • the utilization interval of the IO resource includes a preset first IO resource utilization interval, Two IO resource utilization intervals and a third IO resource utilization interval.
  • the method further includes:
  • the feature information according to the physical machine, an energy consumption model of the physical machine, and the The energy consumption of the physical machine, calculating the first energy consumption deviation specifically including:
  • the model is determined, specifically including:
  • the first modification of the energy consumption of the virtual machine running on the physical machine according to the virtual machine correcting energy consumption includes:
  • a second aspect of the present invention provides a physical machine comprising:
  • a receiver configured to acquire feature information on the physical machine, where the feature information includes at least one event information or at least one resource information;
  • a processor configured to determine, according to feature information on the physical machine, and an unmapped basic energy consumption of the physical machine, an energy consumption model of the physical machine; the non-mapped basic energy consumption is an unoperated virtual physical machine The energy consumption of the feature information is not mapped to the energy consumption of the machine.
  • the processor is further configured to determine, according to an energy consumption model of the physical machine, energy consumption of a virtual machine running on the physical machine.
  • the processor is specifically configured to:
  • the feature matrix includes at least one of matrix elements: CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix includes at least one of the following matrix elements: number of executed instructions, number of LLCs, and an interrupt counter Count of.
  • the receiver is further configured to acquire feature information of the first virtual machine for the first virtual machine running on the physical machine;
  • the processor is configured to determine, according to the parameter matrix set in the physical machine energy consumption model and the feature information of the first virtual machine, energy consumption corresponding to the feature information of the first virtual machine; Determining, according to the set variable energy consumption factor in the physical machine energy consumption model, a variable energy consumption component corresponding to the feature information of the first virtual machine; and, further, according to the feature of the first virtual machine The energy consumption corresponding to the information and the variable energy consumption component corresponding to the feature information of the first virtual machine determine the energy consumption of the first virtual machine.
  • the receiver is further configured to acquire feature information of the intermediate layer of the physical machine and the physical Characteristic information of all virtual machines running on the machine;
  • the processor is further configured to: according to the set variable energy consumption factor in the physical machine energy consumption model, feature information of the first virtual machine, feature information of an intermediate layer of the physical machine, and The characteristic information of all the virtual machines running on the physical machine is determined, and the variable energy consumption component corresponding to the feature information of the first virtual machine is determined.
  • the receiver is further configured to obtain at least one set of historical parameter matrices and The historical variable energy consumption factor, each set of the historical parameter matrix and the historical variable energy consumption factor is determined according to a set of historical feature information and a historical energy consumption of the physical machine and a non-mapped basic energy consumption of the physical machine;
  • the processor is further configured to: select, from at least one set of historical parameter matrices and historical variable energy consumption factors, a historical parameter matrix and history corresponding to historical feature information that the feature information of the physical machine satisfies a preset matching condition
  • a variable energy consumption factor is used as the set parameter matrix and the set variable energy consumption factor in the energy consumption model of the physical machine.
  • the processor is further configured to: Calculating the first energy consumption deviation according to the characteristic information of the physical machine, the energy consumption model of the physical machine, and the energy consumption of the physical machine; calculating the physical machine according to the first energy consumption deviation and the first energy consumption deviation distribution coefficient The virtual machine of the running virtual machine corrects the energy consumption, the first energy consumption deviation distribution coefficient is determined according to the energy consumption model of the physical machine; and the virtual machine running on the physical machine is modified according to the first virtual machine The first revision of the energy consumption.
  • a third aspect of the present invention provides a network system, comprising: one or more physical machines and a plurality of thin terminals according to any one of the second aspects, wherein
  • the physical machine is used to:
  • the energy consumption of the virtual machine running on the physical machine is determined according to the energy consumption model of the physical machine.
  • the embodiment of the invention provides a method for determining energy consumption of a virtual machine, a physical machine and a network system, which improves the accuracy of determining the energy consumption of the virtual machine.
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for determining energy consumption of a virtual machine according to the present invention
  • FIG. 2 is a second flowchart of Embodiment 1 of the method shown in FIG. 1;
  • FIG. 3 is a third flowchart of Embodiment 1 of the method shown in FIG. 1;
  • Embodiment 4 is a flowchart of Embodiment 2 of a method for determining energy consumption of a virtual machine according to the present invention
  • FIG. 5 is a flowchart of Embodiment 3 of a method for determining energy consumption of a virtual machine according to the present invention
  • Figure 6 is a second flow chart of the method shown in Figure 5;
  • FIG. 7 is a flowchart of Embodiment 4 of a method for determining energy consumption of a virtual machine according to the present invention.
  • FIG. 8 is a second flowchart of Embodiment 4 of the method shown in FIG. 7;
  • FIG. 9 is a flowchart of Embodiment 5 of a method for determining energy consumption of a virtual machine according to the present invention.
  • FIG. 10 is a schematic structural diagram of Embodiment 1 of a virtual machine determining apparatus according to the present invention.
  • FIG. 11 is a schematic structural diagram of Embodiment 1 of a physical machine according to the present invention.
  • FIG. 12 is a schematic structural diagram of Embodiment 1 of a network system according to the present invention.
  • FIG. 1 is a flowchart of Embodiment 1 of a method for determining energy consumption of a virtual machine according to the present invention
  • FIG. 2 is a second flowchart of Embodiment 1 of the method shown in FIG. 1
  • FIG. 3 is a first embodiment of the method shown in FIG.
  • a third flowchart, as shown in FIG. 1 to FIG. 3, the steps of the embodiment of the present invention include:
  • S101 Acquire feature information on a physical machine, where the feature information includes at least one event information or at least one resource information.
  • the event information may be a value of an event such as an instruction number, an LLC number, and an interrupt counter
  • the resource information may be a value of a resource such as a CPU resource, a memory resource, an input/output IO resource, and a network traffic. Since the feature information on the physical machine may include tens or even hundreds, the value of all the feature information cannot be collected in the process of determining the energy consumption of the virtual machine. Therefore, the embodiment of the present invention determines the energy consumption of the virtual machine. Select at least one type of feature information, for example, a value of a CPU resource having a large energy weight may be selected.
  • S102 Determine, according to feature information on the physical machine, and a non-mapped basic energy consumption of the physical machine, an energy consumption model of the physical machine; where the non-mapped basic energy consumption is an unoperated virtual machine of a physical machine The energy consumption of the feature information is not mapped in the energy consumption.
  • the energy consumption of the physical machine may be mapped into two parts, some of which are related to the feature information on the physical machine, and the combination of the feature information affects the unit energy consumption of each resource or event, and another part and feature. Information is irrelevant, for example, the energy consumption of a fan.
  • the energy consumption of the physical machine may be referred to as the basic energy consumption of the physical machine, and may include energy consumption mapped to the feature information and energy consumption independent of the feature information, wherein the energy mapped to the feature information
  • the consumption includes two parts: an energy consumption corresponding to the collected at least one characteristic information, and an energy consumption not mapped to the collected at least one characteristic information; the energy consumption irrelevant to the characteristic information is a non-mapping Basic energy consumption.
  • the non-mapped basic energy consumption of the physical machine is determined according to the energy consumption of the physical machine idle state and the characteristic information of the physical machine idle state.
  • the energy consumption of the physical machine can be measured by an electric meter.
  • the foregoing step S102 may specifically include S1021 and S1022:
  • S1022 Determine a sum of a product of the feature matrix and the transposed matrix of the set parameter matrix, a set variable energy consumption factor, and an idle energy consumption of the physical machine as an energy consumption model of the physical machine.
  • the feature matrix includes at least one of the following matrix elements: CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix includes at least one of the following matrix elements: number of executed instructions, LLC number, Interrupt counter count.
  • the elements in the feature matrix may be variables representing at least one resource information or at least one type of event information.
  • the energy consumption model of the physical machine can be:
  • P total is the energy consumption of the physical machine
  • P static is the non-mapping basic energy consumption of the physical machine
  • elements R 1 , R 2 , ..., R n in the matrix R total are the characteristic information of the physical machine
  • the elements a 1 , a 2 , . . . , a n in the T are the set parameter matrix in the physical machine energy consumption model, where a 1 is an energy consumption parameter corresponding to the feature information R 1 .
  • a 2 is an energy consumption parameter corresponding to the feature information R 2
  • a n is an energy consumption parameter corresponding to the feature information R n
  • a 0 is the set variable energy consumption factor in the physical machine energy consumption model ; energy model parameter matrix of the physical machine in the set of the elements a 1, a 2, ..., a n , and the variable energy factor a 0 is set according to the physical machine
  • the feature information and the non-mapped base energy consumption of the physical machine are determined.
  • the parameter matrix and the set variable energy consumption factor may be determined according to S1021.
  • the steps of S1021-01 and S1021-02 are implemented:
  • S1021-01 acquiring at least one set of historical parameter matrices and historical variable energy consumption factors, each set of the historical parameter matrix and the historical variable energy consumption factor according to a set of historical feature information and a historical energy consumption of the physical machine and a physical machine Non-mapping basic energy consumption determination;
  • the preset matching condition may be that the sum of the squares of the deviations is the smallest.
  • the historical feature information and the historical energy consumption of the physical machine may be predetermined on another physical machine having the same hardware system and operating system configuration as the physical machine to which the virtual machine to which the virtual machine is to be determined to be determined, and used for An electric power meter needs to be configured on the physical machine that acquires the energy consumption of the physical machine. In this way, the physical power meter to which the virtual machine to which the virtual machine consumes energy is determined may not need to be configured with an electric power meter.
  • the embodiment of the present invention further includes:
  • S103 can be implemented by using S1031-S1034:
  • S1011 Obtain feature information of the first virtual machine for the first virtual machine running on the physical machine.
  • the feature information of the first virtual machine running on the physical machine may include at least one event information or at least one resource information, and the feature information may be collected by a hypervisor of the physical machine.
  • S1032 Determine, according to the parameter matrix set in the physical machine energy consumption model and the feature information of the first virtual machine, the energy consumption corresponding to the feature information of the first virtual machine.
  • the set parameter matrix and the feature information of the first virtual machine Calculating energy consumption corresponding to the feature information of the first virtual machine; wherein The energy consumption corresponding to the feature information of the jth first virtual machine running on the physical machine, J th feature information of the first virtual machine running on said physical machine; a 1, a 2, ... , a n is the parameter matrix of the energy model the physical machine elements in the set; n is The number of feature information.
  • S1033 can be implemented with S1033-1 and S1033-2:
  • S1033-1 Acquire feature information of an intermediate layer of the physical machine and feature information of all virtual machines running on the physical machine.
  • the feature information of the middle layer of the physical machine refers to the feature information consumed by the middle layer itself that the physical machine runs in order to run the virtual machine.
  • variable energy consumption factor set in the physical machine energy consumption model feature information of the first virtual machine, feature information of an intermediate layer of the physical machine, and running on the physical machine
  • the characteristic information of all the virtual machines determines the variable energy consumption component corresponding to the feature information of the first virtual machine.
  • it can be based on Calculating a variable energy consumption component corresponding to the feature information of the first virtual machine.
  • variable energy consumption component corresponding to the feature information of the jth first virtual machine running on the physical machine, where a 0 is the set variable energy consumption factor in the physical machine energy consumption model,
  • nth type of feature information of the jth first virtual machine running on the physical machine m is the number of virtual machines running on the physical machine,
  • n is the number of the feature information.
  • the energy consumption corresponding to the feature information of the first virtual machine and the variable energy consumption component corresponding to the feature information of the first virtual machine are determined as the energy consumption of the first virtual machine.
  • the virtual machine energy consumption determining method determines the energy consumption model of the physical machine according to the feature information on the physical machine and the non-mapped basic energy consumption of the physical machine, and the non-mapping foundation
  • the energy consumption is not the energy consumption of the feature information in the energy consumption of the non-running virtual machine of the physical machine, and the energy consumption of the virtual machine running on the physical machine is determined according to the physical machine energy consumption model, because the physical
  • the determination of the energy consumption parameter matrix corresponding to the feature information in the machine energy consumption model takes into account the influence of the characteristic information of the basic energy consumption of the physical machine on the total energy consumption of the physical machine, and the physical machine energy consumption is related to the characteristic information.
  • the energy consumption parameter is more accurate, therefore, the implementation of the present invention
  • the example provides a more accurate method for determining the energy consumption of a virtual machine.
  • the method for determining the energy consumption of the virtual machine in the embodiment of the present invention can obtain the real-time energy consumption of the physical machine without the energy consumption measuring device such as the electric machine installed in the physical machine running stage, and reduce the equipment of the physical machine supplier. cost of investment.
  • Embodiment 4 is a flowchart of Embodiment 2 of a method for determining energy consumption of a virtual machine according to the present invention. Based on the method shown in FIG. 1 to FIG. 3, as shown in FIG. 4, the steps of the embodiment of the present invention include:
  • the feature information on the physical machine may include a value of a CPU resource, a value of a memory resource, and a value of an IO resource,
  • S1021-01 obtains at least one set of historical parameter matrices and historical variable energy consumption factors, and each set of the historical parameter matrix and the historical variable energy consumption factor are based on a set of historical feature information and historical energy consumption and physics of the physical machine.
  • the non-mapping basic energy consumption of the machine is determined, which may specifically include:
  • the combination of the utilization interval of the preset feature information is a combination of a CPU resource utilization interval of the preset physical machine, a utilization interval of the memory resource, and a utilization interval of the IO resource, where the physical machine is
  • the utilization interval of the CPU resource includes a preset first CPU resource utilization interval, a second CPU resource utilization interval, and a third CPU resource utilization interval
  • the memory resource utilization interval includes a preset first memory utilization.
  • the rate interval, the second memory utilization interval, and the third memory utilization interval, the utilization interval of the IO resource includes a preset first IO resource utilization interval, a second IO resource utilization interval, and a third IO resource utilization Rate range.
  • the consumption factor as the set parameter matrix and the set variable energy consumption factor in the energy consumption model of the physical machine, may specifically include:
  • S1021-12 selecting, from at least one set of historical parameter matrices and historical variable energy consumption factors, a value of a CPU resource in the feature information of the physical machine, a value of a memory resource, and a utilization interval to which the value of the IO resource belongs Combining the historical parameter matrix corresponding to the same historical feature information and the historical variable energy consumption factor as the set parameter matrix in the energy consumption model of the physical machine and the set Change the energy factor.
  • the preset first, second, and third CPU resource utilization intervals may be CPU resource utilization rates of 50% to 100%, 30% to 50%, and 0% to 30%, respectively.
  • the preset memory resource utilization interval and the preset IO resource utilization interval may be set according to the setting of the CPU resource utilization interval, which is not limited by the present invention.
  • the CPU resource utilization rate of the physical machine is 50% to 100%
  • the energy consumption state of the physical machine can be called CPU-intensive.
  • the memory resource utilization rate of the physical machine is 50% to 100%, it can be called The energy consumption state of the physical machine is memory-intensive.
  • the physical device's IO resource utilization is 50% to 100%, the energy consumption state of the physical machine can be called IO-intensive.
  • the embodiment of the present invention determines the virtual machine energy consumption by dividing the historical parameter matrix determined by the historical feature information of the utilization level interval and the historical variable energy consumption factor, and selects the utilization rate of the historical feature information of the feature information of the current physical machine.
  • the horizontal interval combination combines the same historical parameter matrix and the historical variable energy consumption factor to determine the physical machine energy consumption model, and further determines the energy consumption of the virtual machine according to the physical machine energy consumption model, and the energy consumption state of the physical machine reflected by the physical machine energy consumption model It is closer to the energy consumption state corresponding to the current feature information of the physical machine, so that the determination of the virtual machine energy consumption is more accurate.
  • FIG. 5 is a flowchart of Embodiment 3 of a method for determining energy consumption of a virtual machine according to the present invention
  • FIG. 6 is a second flowchart of the method shown in FIG. 5, based on the method shown in FIG. 1 to FIG.
  • the steps of the embodiment of the present invention include:
  • the values of the CPU resources of the first virtual machine running on the physical machine and the physical machine belong to a preset first CPU resource utilization interval, and the The preset minimum value of the first CPU resource utilization interval is not less than 50%, or
  • the value of the memory resource of the first virtual machine running on the physical machine and the physical machine belongs to a preset first memory resource utilization interval, and the minimum value of the preset first memory resource utilization interval is not Less than 50%, or,
  • the value of the IO resource of the first virtual machine running on the physical machine and the physical machine belongs to a preset first IO resource utilization interval, and the minimum value of the preset first IO resource utilization interval is not Less than 50%;
  • the S102 determines the energy consumption model of the physical machine according to the feature information on the physical machine and the non-mapped basic energy consumption of the physical machine, and may further include S1023 and S1024:
  • the value of the CPU resource of the first virtual machine and the value of the CPU resource of the physical machine are both relative to the total available resources of the physical machine, for example, the physical The value of the CPU resource of the machine is 80%, and there are two virtual machines running on the physical machine. The values of the CPU resources of the two virtual machines may be 30% and 50%. Further, when the value of the CPU resource of the first virtual machine and the value of the CPU resource of the physical machine are 70% and 80%, respectively, and the preset first CPU utilization interval is 50% to 100%, the physical machine And the value of the CPU resource of the first virtual machine belongs to the first CPU resource utilization interval.
  • the surface physical machine is actually in a CPU-intensive energy consumption state, and the energy consumption state is determined by the first Caused by a virtual machine. Therefore, the first virtual machine continues to use the physical machine energy consumption model determined according to the feature information of the physical machine to determine the energy consumption of the first virtual machine, and for the virtual machine other than the first virtual machine on the physical machine, It may be referred to as a second virtual machine, and it is more accurate to determine its energy consumption using the energy consumption model of the physical machine determined according to the feature information of the second virtual machine.
  • S1023 may specifically include:
  • S1023-2 Select, from the at least one historical parameter matrix and the historical variable energy consumption factor, a historical parameter corresponding to the same historical feature information combination of the utilization level interval to which the feature information of the second virtual machine running on the physical machine belongs
  • the matrix and the historical variable energy consumption factor are the set parameter matrix and the set variable energy consumption factor in the energy consumption model of the physical machine for calculating the energy consumption of the second virtual machine.
  • the utilization interval combination includes the utilization interval of the CPU resource, the utilization interval of the memory resource, and the utilization interval of the IO resource, and the utilization ratio of the CPU resource includes a preset first CPU resource utilization rate.
  • the interval, the second CPU resource utilization interval, and the third CPU resource utilization interval, the memory resource utilization interval includes a preset first memory utilization interval, a second memory utilization interval, and a third memory utilization interval.
  • the utilization interval of the IO resource includes a preset first IO resource utilization interval, a second IO resource utilization interval, and a third IO resource utilization interval.
  • the feature matrix includes at least one of the following matrix elements: CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix includes at least one of the following matrix elements: number of executed instructions, LLC number, Interrupt counter count.
  • determining, according to the energy consumption model of the physical machine, the energy consumption of the virtual machine running on the physical machine further comprising:
  • S1035 Determine, according to the energy consumption model of the physical machine used to calculate energy consumption of the second virtual machine, determine energy consumption of a second virtual machine running on the physical machine.
  • the method for calculating the energy consumption of the second virtual machine by S1035 is similar to that of S1032 and S1033, except that the set parameter matrix and the set variable energy in the physical machine energy consumption model in S1032 and S1033 are different.
  • the consumption factor is calculated by using the set parameter matrix and the set variable energy consumption factor in the physical machine energy consumption model determined by S1023 for calculating the energy consumption of the second virtual machine.
  • FIG. 7 is a flowchart of Embodiment 4 of a method for determining energy consumption of a virtual machine according to the present invention
  • FIG. 8 is a second flowchart of Embodiment 4 of the method shown in FIG. 7 , based on the method shown in FIG. 1 to FIG.
  • the steps of the embodiment of the present invention include:
  • step S103 the method further includes:
  • S104 may specifically include S1041 and S1042.
  • P calculate is the theoretical energy consumption of the physical machine
  • elements R 1 , R 2 , ..., R n in R total are n kinds of characteristic information of the physical machine
  • (a total ) element a in T 1 , a 2 , . . . , a n is the set parameter matrix in the physical machine energy consumption model
  • a 0 is the set variable energy consumption factor in the physical machine energy consumption model
  • ⁇ P is the first deviation energy consumption
  • P calculate is the theoretical energy consumption of the physical machine
  • P measure is the measured energy consumption of the physical machine
  • the first energy consumption deviation may be a positive value or a negative value.
  • it can be based on Calculating a virtual machine corrected energy consumption of the jth virtual machine on the physical machine; wherein the first energy consumption deviation distribution coefficient The elements a 1 , a 2 , . . . , a n in the parameter matrix set in the energy consumption model of the physical machine, respectively.
  • the pre-acquired historical parameter matrix and the historical variable energy consumption factor correspond to The degree of matching between the historical feature information and the current feature information of the physical machine may be deviated, that is, may not be completely matched, and correspondingly, the energy consumption model of the physical machine for calculating the virtual machine energy consumption determined according to the current feature information of the physical machine There may also be deviations between the set parameter matrix and the set variable energy consumption factor.
  • the method of the embodiment of the present invention allocates the energy consumption deviation to the virtual machine according to the ratio of the energy consumption parameter corresponding to each feature information to the total physical machine theoretical energy consumption, that is, corrects the virtual machine energy consumption, so that the determined virtual The energy consumption of the machine is more accurate. Further, for the scenes in which the historical parameter matrix and the historical variable energy consumption factor data are obtained in advance, the energy consumption of the virtual machine can be more accurately determined, and the historical characteristic information of the physical machine before determining the virtual machine energy consumption is reduced.
  • FIG. 9 is a flowchart of Embodiment 5 of a method for determining energy consumption of a virtual machine according to the present invention.
  • the virtual machine energy consumption determining method in the embodiment of the present invention may include:
  • the feature information may be resource information, such as data of a resource such as a CPU resource, a memory resource, an IO resource, or a network traffic, or an event information, such as an executed instruction number, an LLC number, and an interrupt counter. count.
  • resource information such as data of a resource such as a CPU resource, a memory resource, an IO resource, or a network traffic
  • event information such as an executed instruction number, an LLC number, and an interrupt counter. count.
  • each set of the historical parameter matrix and the historical variable energy consumption factor are based on a set of historical feature information and a historical energy consumption of the physical machine and a non-mapping of the physical machine.
  • the basic energy consumption is determined.
  • the elements R 1 , R 2 , . . . , R n in the feature matrix R may be variables representing resources such as CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix R
  • the elements R 1 , R 2 , ..., R n may be variables representing events such as the number of executed instructions, the number of LLCs, and the count of the interrupt counter.
  • the unmapped basic energy consumption P static of the physical machine may be obtained according to the energy consumption in the idle state of the physical machine and the feature information in the idle state of the physical machine.
  • variable energy consumption component corresponding to the feature information of the jth first virtual machine running on the physical machine, where a 0 is the set variable energy consumption factor in the physical machine energy consumption model,
  • nth type of feature information of the jth first virtual machine running on the physical machine m is the number of virtual machines running on the physical machine,
  • n is the number of the feature information.
  • S509 Determine a sum of a variable energy consumption component corresponding to the energy consumption corresponding to the feature information of the first virtual machine and the feature information of the first virtual machine as the energy consumption of the first virtual machine.
  • the method may further include:
  • P calculate is the theoretical energy consumption of the physical machine
  • elements R 1 , R 2 , ..., R n in R total are n kinds of characteristic information of the physical machine
  • elements a 1 and a in A T 2 , ..., a n is the set parameter matrix in the physical machine energy consumption model
  • a 0 is the set variable energy consumption factor in the physical machine energy consumption model
  • P static is The non-mapped base energy of the physical machine.
  • the first energy consumption deviation distribution coefficient is an element a 1 , a 2 , . . . , a n in the parameter matrix A set in the energy consumption model of the physical machine.
  • P j is the energy consumption of the jth virtual machine running on the physical machine before the correction
  • ⁇ P j is the virtual machine corrected energy consumption of the jth virtual machine on the physical machine.
  • FIG. 10 is a schematic structural diagram of Embodiment 1 of a virtual machine determining apparatus according to the present invention.
  • the virtual machine energy consumption determining apparatus of the embodiment of the present invention may specifically perform the method shown in FIG. 1 to FIG. 9, and includes: an obtaining module 91 and a processing module 92.
  • the obtaining module 91 is configured to acquire feature information on a physical machine, where the feature information includes at least one event information or at least one resource information;
  • the processing module 92 is configured to determine an energy consumption model of the physical machine according to the feature information on the physical machine and the non-mapped basic energy consumption of the physical machine; the non-mapped basic energy consumption is a physical machine The energy consumption of the virtual machine is not mapped to the energy consumption of the feature information; and is also used to determine the energy consumption of the virtual machine running on the physical machine according to the energy consumption model of the physical machine.
  • the processing module 92 can be specifically configured to:
  • the feature matrix includes at least one of matrix elements: CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix includes at least one of the following matrix elements: number of executed instructions, number of LLCs, and an interrupt counter Count of.
  • the obtaining module 91 is configured to acquire, for the first virtual machine running on the physical machine, feature information of the first virtual machine, where the processing module 92 is configured to use the physical device according to the physical Determining the energy consumption corresponding to the feature information of the first virtual machine, and determining the setting in the physical energy consumption model according to the set parameter matrix in the machine energy consumption model and the feature information of the first virtual machine a variable energy consumption factor, the variable energy consumption component corresponding to the feature information of the first virtual machine is determined; and is further configured to use the energy consumption corresponding to the feature information of the first virtual machine and the first virtual Machine The variable energy consumption component corresponding to the feature information determines the energy consumption of the first virtual machine.
  • the obtaining module 91 may be configured to acquire feature information of an intermediate layer of the physical machine and feature information of all virtual machines running on the physical machine; the processing module 92 may be configured to be used according to the The set variable energy consumption factor in the physical machine energy consumption model, feature information of the first virtual machine, feature information of an intermediate layer of the physical machine, and feature information of all virtual machines running on the physical machine Determining a variable energy consumption component corresponding to the feature information of the first virtual machine.
  • the obtaining module 91 is further configured to obtain at least one set of historical parameter matrices and historical variable energy consumption factors, each set of the historical parameter matrix and the historical variable energy consumption factor according to a set of historical feature information and The historical energy consumption of the physical machine and the non-mapped basic energy consumption of the physical machine are determined; the processing module 92 is configured to select, from at least one set of historical parameter matrices and historical variable energy consumption factors, characteristic information of the physical machine a historical parameter matrix and a historical variable energy consumption factor corresponding to the historical feature information satisfying the preset matching condition, as the set parameter matrix and the set variable energy consumption factor in the energy consumption model of the physical machine .
  • the obtaining module 91 is further configured to obtain the measured energy consumption corresponding to the feature information of the physical machine; the processing module 92 may be configured to use, according to the feature information of the physical machine, the physical machine The energy consumption model and the measured energy consumption of the physical machine, calculating a first energy consumption deviation; calculating a virtual machine correction energy of the virtual machine running on the physical machine according to the first energy consumption deviation and the first energy consumption deviation distribution coefficient The first energy consumption deviation distribution coefficient is determined according to the energy consumption model of the physical machine; and the first virtual machine corrects the energy consumption to perform a first modification on the energy consumption of the virtual machine running on the physical machine.
  • FIG. 11 is a schematic structural diagram of Embodiment 1 of a physical machine according to the present invention.
  • the physical machine in the embodiment of the present invention may specifically perform the method shown in FIG. 1 to FIG. 8, and includes: a receiver 1 and a processor 2.
  • the receiver 1 is configured to acquire feature information on a physical machine, where the feature information includes at least one event information or at least one resource information;
  • the processor 2 is configured to determine, according to feature information on the physical machine, and an unmapped basic energy consumption of the physical machine, an energy consumption model of the physical machine; the unmapped basic energy consumption is physical The energy consumption of the feature information is not mapped to the energy consumption of the machine when the virtual machine is not running.
  • the processor 2 is further configured to determine, according to an energy consumption model of the physical machine, energy consumption of a virtual machine running on the physical machine.
  • the processor 2 is specifically configured to:
  • the feature matrix includes at least one of matrix elements: CPU resources, memory resources, input and output IO resources, and network traffic, or the feature matrix includes at least one of the following matrix elements: number of executed instructions, number of LLCs, and an interrupt counter Count of.
  • the receiver 1 is further configured to acquire feature information of the first virtual machine for a first virtual machine running on the physical machine
  • the processor 2 is configured to: Determining, according to the parameter matrix set in the physical machine energy consumption model and the feature information of the first virtual machine, energy consumption corresponding to the feature information of the first virtual machine;
  • the variable energy consumption factor of the setting determines a variable energy consumption component corresponding to the feature information of the first virtual machine; and is further configured to use the energy consumption and the corresponding energy information according to the feature information of the first virtual machine Determining the energy consumption of the first virtual machine by using a variable energy consumption component corresponding to the feature information of the first virtual machine.
  • the receiver 1 is further configured to acquire feature information of an intermediate layer of the physical machine and feature information of all virtual machines running on the physical machine; the processor 2 And a variable energy consumption factor according to the setting in the physical machine energy consumption model, characteristic information of the first virtual machine, feature information of an intermediate layer of the physical machine, and running on the physical machine.
  • the characteristic information of all the virtual machines determines the variable energy consumption component corresponding to the feature information of the first virtual machine.
  • the receiver 1 is further configured to acquire at least one set of historical parameter matrices and historical variable energy consumption factors, each set of the historical parameter matrix and the historical variable energy consumption factor according to A set of historical feature information and a historical energy consumption of the physical machine and a non-mapped basic energy consumption of the physical machine;
  • the processor 2 is further configured to select and select from at least one set of historical parameter matrices and historical variable energy consumption factors The feature information of the physical machine satisfies a historical parameter matrix corresponding to historical feature information of a preset matching condition and a historical variable energy consumption factor, as the setting in the energy consumption model of the physical machine The parameter matrix and the set variable energy factor.
  • the processor 2 is further configured to calculate the first energy according to the feature information of the physical machine, the energy consumption model of the physical machine, and the energy consumption of the physical machine. Calculating the virtual machine correction energy consumption of the virtual machine running on the physical machine according to the first energy consumption deviation and the first energy consumption deviation distribution coefficient, wherein the first energy consumption deviation distribution coefficient is based on the energy of the physical machine
  • the consumption model determines; correcting the energy consumption according to the first virtual machine to perform a first modification on the energy consumption of the virtual machine running on the physical machine.
  • FIG. 12 is a schematic structural diagram of Embodiment 1 of a network system according to the present invention.
  • the network system 300 may include: one or more physical machines 100 and a plurality of thin terminals 200 as shown in any one of FIG. 11, wherein the physical machine 100 can be run on One or more virtual machines, one of the virtual machines corresponding to one thin terminal 200;
  • the physical machine 100 can be used to:
  • the energy consumption of the virtual machine running on the physical machine is determined according to the energy consumption model of the physical machine.
  • network system 300 can include at least two physical machines 100.
  • One of the physical machines 100 can be used to determine the historical parameter matrix and the historical variable energy consumption factor in the methods shown in FIGS. 1 to 5 to determine the parameter matrix and settings set in the methods shown in FIGS. 1 to 5.
  • Variable energy consumption factor so that other physical machines in the network system 300 can directly determine the set parameter matrix and the set variable energy consumption by using a historical parameter matrix and a historical variable energy consumption factor.
  • a specific method for determining the energy consumption of the virtual machine to be determined according to the set parameter matrix and the physical energy consumption model determined by the set variable energy consumption factor which can be specifically referred to FIG. 1 to FIG.
  • the description of the method embodiment shown in FIG. 5 is omitted here.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Supply And Distribution Of Alternating Current (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种虚拟机能耗确定方法、物理机和网络系统,该方法包括:获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息(S101);根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗(S102);根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗(S103)。该虚拟机能耗确定方法、物理机和网络系统能够提高虚拟机能耗确定的准确度。

Description

虚拟机能耗确定方法、物理机和网络系统 技术领域
本发明实施例涉及信息技术领域,尤其涉及一种虚拟机能耗确定方法、物理机和网络系统。
背景技术
随着云计算技术的不断发展,服务器虚拟化技术得到了广泛应用,基于云计算技术的数据中心为越来越多的用户提供虚拟机服务,数据中心通常是由一组服务器提供虚拟机服务,数据中心需要对虚拟机进行调度管理和监控,以便更好的为用户提供虚拟机服务,并且,虚拟机服务的提供商也需要对每个虚拟机的能耗进行测量,以便对每个用户按照实际能耗进行计费。
现有的虚拟机能耗计算方法,首先是在物理机上选择一些典型的物理资源,如CPU、存储设备、网络I/O作为划分物理机系统能耗的功能单元,根据经验为每个功能单元选择一个或多个能够体现该功能单元的工作量的事件计数器,例如CPU利用率,实时采集物理机上这些事件计数器的统计信息,根据各个功能单元对应的一个或多个事件计数器的汇总的统计信息与物理机的总能耗进行建模,得到每个功能单元的统计信息与物理机能耗的模型,模型中包括每个功能单元的单位工作量对应的能耗系数,然后,根据所有事件计数器的统计信息中包含的虚拟机标识,获得每个虚拟机对应的各种事件计数器的统计信息,按照每个虚拟机的各功能模块对应的事件计数器的统计信息得到每个虚拟机的各功能模块对应的能耗,对每个虚拟机对应的各个功能模块的各个事件计数器的能耗求和,得到每个虚拟机的能耗。
这种方式根据由经验选择特定功能单元对应的事件计数器的汇总的统计信息计算得到的物理机功能单元的能耗不准确,进一步地,根据这些事件计数器的统计信息计算的虚拟机的能耗也是不准确的,因此,由现有技术计算得到的虚拟机能耗的准确度较低。
发明内容
本发明实施例提供一种虚拟机能耗确定方法、物理机和网络系统,用以提解决现有技术中虚拟机能耗确定方法准确度较低的问题。
本发明的第一方面提供一种虚拟机能耗确定方法,包括:
获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗;
根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
结合第一方面,在第一方面的第一种可能的实现方式中,所述根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,具体包括:
根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子;
将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗,包括:
对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息;
根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗;
根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量;
根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实 现方式中,所述根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量,包括:
获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息;
根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
结合第一方面的第一种至第二种任一种可能的实现方式,在第一方面的第四种可能的实现方式中,所述根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子,具体包括:
获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;
从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
结合第一方面的第一种至第四种任一种可能的实现方式,在第一方面的第五种可能的实现方式中,所述物理机的能耗模型为:
Figure PCTCN2014096057-appb-000001
其中,Ptotal为物理机的能耗,Pstatic为物理机的非映射基础能耗;矩阵Rtotal中的元素R1、R2、……、Rn为所述物理机的特征信息;矩阵(Atotal)T中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,其中,a1为特征信息R1对应的能耗参数,a2为特征信息R2对应的能耗参数,……,an为特征信息Rn对应的能耗参数;a0为所述物理机能耗模型中的所述设定的可变能耗因子;所述物理机的能耗模型中的所述设定的参数矩阵中的元素a1、 a2、…、an和所述设定的可变能耗因子a0根据所述物理机的特征信息和所述物理机的非映射基础能耗确定。
结合第一方面的第二种至第三种任一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗,具体包括:
根据
Figure PCTCN2014096057-appb-000002
计算所述第一虚拟机的特征信息对应的能耗;
其中,所述
Figure PCTCN2014096057-appb-000003
为所述物理机上运行的第j个第一虚拟机的特征信息对应的能耗,
Figure PCTCN2014096057-appb-000004
为所述物理机上运行的第j个第一虚拟机的特征信息;a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵中的元素;n为所述特征信息的数量。
结合第一方面的第二种可能的实现方式,在第一方面的第七种可能的实现方式中,所述根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量,具体包括:
根据
Figure PCTCN2014096057-appb-000005
计算所述第一虚拟机的特征信息对应的可变能耗分量;
其中,所述
Figure PCTCN2014096057-appb-000006
为所述物理机上运行的第j个第一虚拟机的特征信息对应的可变能耗分量,a0为所述物理机能耗模型中的所述设定的可变能耗因子,
Figure PCTCN2014096057-appb-000007
为所述物理机上运行的第j个第一虚拟机的第n种特征信息;m为所述物理机上运行的虚拟机的个数,
Figure PCTCN2014096057-appb-000008
为所述所述物理机的中间层的第i种特征信息,n为所述特征信息的数量。
结合第一方面的第一种至第七种任一种可能的实现方式,在第一方面的第八种可能的实现方式中,若所述物理机和所述物理机上运行的第一虚拟机的CPU资源的值均属于预设的第一CPU资源利用率区间,且所述预设的第一CPU资源利用率区间的最小值不低于50%,或者,
所述物理机和所述物理机上运行的第一虚拟机的内存资源的值均属于预 设的第一内存资源利用率区间,且所述预设的第一内存资源利用率区间的最小值不低于50%,或者,
所述物理机和所述物理机上运行的第一虚拟机的IO资源的值均属于预设的第一IO资源利用率区间,且所述预设的第一IO资源利用率区间的最小值不低于50%;
则所述根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,还包括:
根据所述物理机上运行的除所述第一虚拟机之外的第二虚拟机的特征信息,确定用于计算所述第二虚拟机的能耗的设定的参数矩阵和设定的可变能耗因子;
将特征矩阵与所述用于计算所述第二虚拟机的设定的参数矩阵的转置矩阵的乘积、用于计算所述第二虚拟机的能耗的设定的可变能耗因子与所述物理机空闲能耗之和,确定为用于计算所述第二虚拟机的能耗的所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数;
所述根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗,还具体包括:
根据所述用于计算所述第二虚拟机的能耗的所述物理机的能耗模型,确定所述物理机上运行的第二虚拟机的能耗。
结合第一方面的第八种可能的实现方式,在第一方面的第九种可能的实现方式中,所述根据所述物理机上运行的除所述第一虚拟机之外的任一第二虚拟机的特征信息,确定用于计算所述第二虚拟机的能耗的设定的参数矩阵和设定的可变能耗因子,具体包括:
获取所述第二虚拟机的特征信息;
从至少一个历史参数矩阵和历史可变能耗因子中,选择与所述物理机上运行的第二虚拟机的特征信息所属的利用率水平区间组合相同的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为用于计算所述第二虚拟机的能耗的物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子;所述利用率区间组合包括所述CPU资源的利用率区间、内存资源的利用 率区间、IO资源的利用率区间,所述CPU资源的利用率区间包括预设的第一CPU资源利用率区间、第二CPU资源利用率区间、第三CPU资源利用率区间,所述内存资源的利用率区间包括预设的第一内存利用率区间、第二内存利用率区间、第三内存利用率区间,所述IO资源的利用率区间包括预设的第一IO资源利用率区间、第二IO资源利用率区间、第三IO资源利用率区间。
结合第一方面的第一种至第九种任一种可能的实现方式,在第一方面的第十种可能的实现方式中,还包括:
根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差;
根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定;
根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
结合第一方面的第十种可能的实现方式,在第一方面的第十一种可能的实现方式中,所述根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差,具体包括:
获取所述物理机的特征信息对应的实测能耗;
根据Pcaculate=Rtotal·(Atotal)T+a0+Pstatic计算物理机的理论能耗,其中,Pcalculate为所述物理机的理论能耗,Rtotal中的元素R1、R2、……、Rn为所述物理机的n种特征信息,(Atotal)T中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,a0为所述物理机能耗模型中的所述设定的可变能耗因子,Pstatic为所述物理机的非映射基础能耗;根据△P=Pcalculate-Pmeasure计算第一能耗偏差,其中,△P为第一偏差能耗,Pcalculate为所述物理机的理论能耗,Pmeasure为所述物理机的实测能耗;
所述根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定,具体包括:
根据
Figure PCTCN2014096057-appb-000009
计算所述物理机上第j个虚拟机的虚拟机修正能耗;其中,第一能耗偏差分配系数
Figure PCTCN2014096057-appb-000010
分别为所述物理机的能耗模型中的设定的参数矩阵中的元素a1、a2、…、an
所述根据所述虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正,具体包括:
根据(Pj)′=Pj+△Pj得到修正后的所述物理机上运行的第j个虚拟机的能耗,其中,(Pj)′为修正后的所述物理机上运行的第j个虚拟机的能耗、Pj为修正前的所述物理机上运行的第j个虚拟机的能耗、△Pj为所述物理机上第j个虚拟机的虚拟机修正能耗。
本发明的第二方面提供一种物理机,包括:
接收器,用于获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
处理器,用于根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗。
所述处理器,还用于根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
结合第二方面,在第二方面的第一种可能的实现方式中,所述处理器,具体用于:
根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子;
将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实 现方式中,所述接收器,还用于对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息;
所述处理器,用于根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗;还用于根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量;以及,还用于根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,所述接收器,还用于获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息;
所述处理器,还用于根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
结合第二方面的第二种至第三种任一种可能的实现方式,在第二方面的第四种可能的实现方式中,所述接收器,还用于获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;
所述处理器,还用于从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
结合第二方面,第二方面的第一种至第四种任一种可能的实现方式,在第二方面的第五种可能的实现方式中,所述处理器,还用于:根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差;根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定;根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
本发明的第三方面还提供一种网络系统,包括:一个或多个如第二方面任一所述的物理机和多个瘦终端,其中,
所述物理机上运行一个或多个虚拟机,一个所述虚拟机对应一个瘦终端;
所述物理机用于:
获取所述物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗;
根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
本发明实施例提供了一种虚拟机能耗确定方法、物理机和网络系统,提高了虚拟机能耗确定的准确度。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明提供的虚拟机能耗确定方法实施例一的流程图;
图2为图1所示方法实施例一的第二种流程图;
图3为图1所示方法实施例一的第三种流程图;
图4为本发明提供的虚拟机能耗确定方法实施例二的流程图;
图5为本发明提供的虚拟机能耗确定方法实施例三的流程图;
图6为图5所示方法的第二种流程图;
图7为本发明提供的虚拟机能耗确定方法实施例四的流程图;
图8为图7所示方法实施例四的第二种流程图;
图9为本发明提供的虚拟机能耗确定方法实施例五的流程图;
图10为本发明提供的一种虚拟机确定装置的实施例一的结构示意图;
图11为本发明提供的一种物理机的实施例一的结构示意图;
图12为本发明提供的一种网络系统的实施例一的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为本发明提供的虚拟机能耗确定方法实施例一的流程图,图2为图1所示方法实施例一的第二种流程图,图3为图1所示方法实施例一的第三种流程图,如图1至图3所示,本发明实施例的步骤包括:
S101、获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
需要说明的是,所述事件信息可以为指令数、LLC数、中断计数器的计数等事件的值,所述资源信息可以为CPU资源、内存资源、输入输出IO资源和网络流量等资源的值,由于物理机上的特征信息可以包括数十种甚至数百种,在确定虚拟机能耗的过程中通常无法全部采集到所有特征信息的值,因此,本发明实施例确定虚拟机能耗的过程中,选择至少一种特征信息,例如,可以选择能耗权重较大的CPU资源的值。
S102、根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗。
需要说明的是,所述物理机的能耗可以映射为两部分,其中一部分与物理机上的特征信息有关,并且,特征信息的组合会影响到各个资源或事件的单位能耗,另一部分与特征信息无关,例如,风扇的能耗。
当物理机未运行虚拟机时,物理机的能耗可以称为物理机的基础能耗,可以包括映射至特征信息的能耗和与特征信息无关的能耗,其中,映射至特征信息的能耗包括两部分:映射至采集的所述至少一种特征信息对应的能耗,以及未映射至采集的所述至少一种特征信息对应的能耗;与特征信息无关的能耗即为非映射基础能耗。
在S102根据所述物理机上的特征信息,以及所述物理机的非映射基础能 耗,确定所述物理机的能耗模型之前,包括:
根据物理机空闲状态时的能耗和物理机空闲状态时的特征信息,确定物理机的非映射基础能耗。
需要说明的是,物理机的能耗可以采用电表测量得到。
可选的,可参考图2,上述步骤S102可以具体包括S1021和S1022:
S1021、根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子。
S1022、将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型。
其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
需要说明的是,所述特征矩阵中的元素可以为代表至少一种资源信息或者至少至少一种事件信息的变量。举例来说,所述物理机的能耗模型可以为:
Figure PCTCN2014096057-appb-000011
其中,Ptotal为物理机的能耗,Pstatic为物理机的非映射基础能耗;矩阵Rtotal中的元素R1、R2、……、Rn为所述物理机的特征信息;矩阵(Atotal)T中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,其中,a1为特征信息R1对应的能耗参数,a2为特征信息R2对应的能耗参数,……,an为特征信息Rn对应的能耗参数;a0为所述物理机能耗模型中的所述设定的可变能耗因子;所述物理机的能耗模型中的所述设定的参数矩阵中的元素a1、a2、…、an和所述设定的可变能耗因子a0根据所述物理机的特征信息和所述物理机的非映射基础能耗确定。
需要说明的是,可参考图3,S1021所述根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子,可以具体采用S1021-01和S1021-02的步骤实现:
S1021-01、获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;
S1021-02、从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
其中,所述预设的匹配条件可以是偏差的平方和最小。
可选的,历史特征信息和物理机的历史能耗可以在与待确定虚拟机能耗的虚拟机所归属的物理机的硬件系统和操作系统配置相同的另一台物理机上预先确定,用于获取物理机能耗的物理机上需要配置电功率计。这样,待确定虚拟机能耗的虚拟机所归属的物理机上可以不需要配置电功率计。
在确定物理机能耗模型之后,本发明实施例还包括:
S103、根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
可选的,可参考图2,S103可以采用S1031-S1034实现:
S1031、对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息。
需要说明的是,所述物理机上运行的第一虚拟机的特征信息,可以包括至少一种事件信息或者至少一种资源信息,所述特征信息可以通过物理机的中间层(hypervisor)采集得到。
S1032、根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗。
举例来说,可以根据设定的参数矩阵和第一虚拟机的特征信息,采用
Figure PCTCN2014096057-appb-000012
计算所述第一虚拟机的特征信息对应的能耗;其中,所述
Figure PCTCN2014096057-appb-000013
为所述物理机上运行的第j个第一虚拟机的特征信息对应的能耗,
Figure PCTCN2014096057-appb-000014
Figure PCTCN2014096057-appb-000015
为所述物理机上运行的第j个第一虚拟机的特征信息;a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵中的元素;n为所述特征信息的数量。
S1033、根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第 一虚拟机的特征信息对应的可变能耗分量。
其中,可参考图3,S1033可以采用S1033-1和S1033-2实现:
S1033-1、获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息。
需要说明的是,所述物理机的中间层的特征信息是指物理机为了运行虚拟机而运行的中间层本身所消耗的特征信息。
S1033-2、根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
举例来说,可以根据
Figure PCTCN2014096057-appb-000016
计算所述第一虚拟机的特征信息对应的可变能耗分量。
其中,所述
Figure PCTCN2014096057-appb-000017
为所述物理机上运行的第j个第一虚拟机的特征信息对应的可变能耗分量,a0为所述物理机能耗模型中的所述设定的可变能耗因子,
Figure PCTCN2014096057-appb-000018
为所述物理机上运行的第j个第一虚拟机的第n种特征信息;m为所述物理机上运行的虚拟机的个数,
Figure PCTCN2014096057-appb-000019
为所述所述物理机的中间层的第i种特征信息,n为所述特征信息的数量。
S1034、根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
需要说明的是,将所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量求和确定为所述第一虚拟机的能耗。
本发明实施例提供的虚拟机能耗确定方法,通过根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗,并根据所述物理机能耗模型确定所述物理机上运行的虚拟机的能耗,由于该物理机能耗模型中与特征信息对应的能耗参数矩阵的确定考虑了物理机的基础能耗中的特征信息对特征信息的水平变化对物理机总能耗的影响,物理机能耗中与特征信息有关的能耗参数更准确,因此,本发明实施 例提供了一种更准确的虚拟机能耗确定方法。进一步地,采用本发明实施例的确定虚拟机能耗的方法,在物理机运行阶段可以不必在物理机安装电表等能耗测量设备获取物理机的实时能耗,降低了物理机供应商的设备投资成本。
图4为本发明提供的虚拟机能耗确定方法实施例二的流程图,在图1至图3所示方法的基础上,如图4所示,本发明实施例的步骤包括:
与图1至图3所示方法不同的是,若所述物理机上的特征信息中可以包括CPU资源的值、内存资源的值、IO资源的值,
则S1021-01所述获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定,可以具体包括:
S1021-11、获取至少一组历史参数矩阵和历史可变能耗因子,所述至少一组历史参数矩阵和历史可变能耗因子根据满足预设的特征信息的利用率区间组合条件的至少一组物理机的历史特征信息、物理机的历史特征信息对应的历史能耗和物理机的非映射基础能耗确定。
其中,所述预设的特征信息的利用率区间组合条件为预设的物理机的CPU资源的利用率区间、内存资源的利用率区间、IO资源的利用率区间的组合,所述物理机的CPU资源的利用率区间包括预设的第一CPU资源利用率区间、第二CPU资源利用率区间、第三CPU资源利用率区间,所述内存资源的利用率区间包括预设的第一内存利用率区间、第二内存利用率区间、第三内存利用率区间,所述IO资源的利用率区间包括预设的第一IO资源利用率区间、第二IO资源利用率区间、第三IO资源利用率区间。
S1021-02所述从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子,可以具体包括:
S1021-12、从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息中的CPU资源的值、内存资源的值、IO资源的值所属的利用率区间的组合相同的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和所述设定的可 变能耗因子。
需要说明的是,所述预设的第一、第二和第三CPU资源利用率区间可以是分别是CPU资源利用率为50%至100%、30%至50%,0%至30%,相应的,所述预设的内存资源利用率区间和所述预设的IO资源利用率区间的设置可以参考CPU资源利用率区间的设置,本发明不做限制。当物理机的CPU资源利用率为50%至100%时,可以称之为物理机的能耗状态为CPU密集型,当物理机的内存资源利用率为50%至100%时,可以称之为物理机的能耗状态为内存密集型,当物理机的IO资源利用率为50%至100%时,可以称之为物理机的能耗状态为IO密集型。
本发明实施例通过划分利用率水平区间的历史特征信息确定的历史参数矩阵和历史可变能耗因子确定虚拟机能耗,并选择与当前物理机的特征信息的历史特征信息所述的利用率水平区间组合相同的历史参数矩阵和历史可变能耗因子确定物理机能耗模型,并进一步根据该物理机能耗模型确定虚拟机的能耗,由于该物理机能耗模型体现的物理机的能耗状态更接近物理机当前的特征信息对应的能耗状态,使得虚拟机能耗的确定更准确。
图5为本发明提供的虚拟机能耗确定方法实施例三的流程图,图6为图5所示方法的第二种流程图,在图1至图4所示方法的基础上,如图5所示,本发明实施例的步骤包括:
与图1至图4所示方法不同的是,若所述物理机和所述物理机上运行的第一虚拟机的CPU资源的值均属于预设的第一CPU资源利用率区间,且所述预设的第一CPU资源利用率区间的最小值不低于50%,或者,
所述物理机和所述物理机上运行的第一虚拟机的内存资源的值均属于预设的第一内存资源利用率区间,且所述预设的第一内存资源利用率区间的最小值不低于50%,或者,
所述物理机和所述物理机上运行的第一虚拟机的IO资源的值均属于预设的第一IO资源利用率区间,且所述预设的第一IO资源利用率区间的最小值不低于50%;
则S102所述根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,还可以包括S1023和S1024:
S1023、根据所述物理机上运行的除所述第一虚拟机之外的第二虚拟机的特征信息,确定用于计算所述第二虚拟机的能耗的设定的参数矩阵和设定的可变能耗因子;
需要说明的是,所述第一虚拟机的CPU资源的值与所述物理机的CPU资源的值均是相对于所述物理机总的CPU可用资源而言的,举例来说,所述物理机的CPU资源的值为80%,所述物理机上运行有两个虚拟机,两个虚拟机的CPU资源的值可以是30%和50%。进一步地,当第一虚拟机的CPU资源的值和物理机的CPU资源的值分别为70%和80%,预设的第一CPU利用率区间为50%至100%,则所述物理机和所述第一虚拟机的CPU资源的值均属于第一CPU资源利用率区间,这种情况实际上表面物理机处于CPU密集型的能耗状态,而这种能耗状态是由该第一虚拟机造成的。因此,对该第一虚拟机继续使用根据物理机的特征信息确定的物理机能耗模型确定该第一虚拟机的能耗,而对物理机上除所述第一虚拟机之外的其他虚拟机,可称为第二虚拟机,使用根据第二虚拟机的特征信息确定的物理机的能耗模型确定其能耗将更准确。
具体的,可参考图6,S1023可以具体包括:
S1023-1、获取所述第二虚拟机的特征信息;
S1023-2、从至少一个历史参数矩阵和历史可变能耗因子中,选择与所述物理机上运行的第二虚拟机的特征信息所属的利用率水平区间组合相同的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为用于计算所述第二虚拟机的能耗的物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
其中,所述利用率区间组合包括所述CPU资源的利用率区间、内存资源的利用率区间、IO资源的利用率区间,所述CPU资源的利用率区间包括预设的第一CPU资源利用率区间、第二CPU资源利用率区间、第三CPU资源利用率区间,所述内存资源的利用率区间包括预设的第一内存利用率区间、第二内存利用率区间、第三内存利用率区间,所述IO资源的利用率区间包括预设的第一IO资源利用率区间、第二IO资源利用率区间、第三IO资源利用率区间。
S1024、将特征矩阵与所述用于计算所述第二虚拟机的设定的参数矩阵的转置矩阵的乘积、用于计算所述第二虚拟机的能耗的设定的可变能耗因子与 所述物理机空闲能耗之和,确定为用于计算所述第二虚拟机的能耗的所述物理机的能耗模型。
其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
相应地,S103所述根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗,还具体包括:
S1035、根据所述用于计算所述第二虚拟机的能耗的所述物理机的能耗模型,确定所述物理机上运行的第二虚拟机的能耗。
其中,S1035计算第二虚拟机的能耗的方法与S1032和S1033类似,所不同的是,S1032和S1033中所述物理机能耗模型中的所述设定的参数矩阵和设定的可变能耗因子,采用S1023确定的用于计算所述第二虚拟机的能耗的物理机能耗模型中的所述设定的参数矩阵和设定的可变能耗因子计算。
本发明实施例的其他技术方案和技术效果与图1至图2所示方法相同,此处不再赘述。
图7为本发明提供的虚拟机能耗确定方法实施例四的流程图,图8为图7所示方法实施例四的第二种流程图,在图1至图6所示方法的基础上,如图7至图8所示,本发明实施例的步骤包括:
在步骤S103之后,还包括:
S104、根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差。
其中,可参考图8,S104可以具体包括S1041和S1042。
S1041、获取所述物理机的特征信息对应的实测能耗。
S1042、根据Pcaculate=Rtotal·(Atotal)T+a0+Pstatic计算物理机的理论能耗。
其中,Pcalculate为所述物理机的理论能耗,Rtotal中的元素R1、R2、……、Rn为所述物理机的n种特征信息,(Atotal)T中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,a0为所述物理机能耗模型中的所述设定的可变能耗因子,Pstatic为所述物理机的非映射基础能耗
S1043、根据△P=Pcalculate-Pmeasure计算第一能耗偏差。
其中,△P为第一偏差能耗,Pcalculate为所述物理机的理论能耗,Pmeasure为所述物理机的实测能耗。
其中,所述第一能耗偏差可以为正值,也可以为负值。
S105、根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定。
举例来说,可以根据
Figure PCTCN2014096057-appb-000020
计算所述物理机上第j个虚拟机的虚拟机修正能耗;其中,第一能耗偏差分配系数
Figure PCTCN2014096057-appb-000021
分别为所述物理机的能耗模型中的设定的参数矩阵中的元素a1、a2、…、an
S106、根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
举例来说,可以采用(Pj)′=Pj+△Pj得到修正后的所述物理机上运行的第j个虚拟机的能耗,其中,(Pj)′为修正后的所述物理机上运行的第j个虚拟机的能耗、Pj为修正前的所述物理机上运行的第j个虚拟机的能耗、△Pj为所述物理机上第j个虚拟机的虚拟机修正能耗。
需要说明的是,由于预先采集的历史特征信息数据较少,或者预先采集的历史特征信息未覆盖到物理机当前的特征信息,则预先获取的历史参数矩阵和历史可变能耗因子所对应的历史特征信息与物理机当前的特征信息的匹配程度可能存在偏差,即不能完全匹配,相应的,根据物理机当前的特征信息确定的用于计算虚拟机能耗的物理机的能耗模型中的设定的参数矩阵和设定的可变能耗因子也可能存在偏差。本发明实施例的方法将这部分能耗偏差按照各特征信息对应的能耗参数占总的物理机理论能耗的比例分配给各个虚拟机,即对虚拟机能耗进行修正,使得确定的虚拟机的能耗更准确。进一步地,对于预先获取历史参数矩阵和历史可变能耗因子数据较少的场景,也能更准确的确定虚拟机的能耗,减少了确定虚拟机能耗前的对物理机的历史特征信息的数据采集工作和根据大量历史特征信息确定历史参数矩阵和历史可变能耗因子的工作。
下面采用几个具体的例子对本发明提供的虚拟机能耗确定方法进行具体说明。
图9为本发明提供的虚拟机能耗确定方法实施例五的流程图。
如图9所示,本发明实施例的虚拟机能耗确定方法可以包括:
S501、获取物理机上的至少一种特征信息,记为Rtotal
其中,可选的,所述特征信息可以是资源信息,如CPU资源、内存资源、IO资源、网络流量等资源的数据,也可以是事件信息,如执行的指令数、LLC数、中断计数器的计数。
S502、获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定。
S503、从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵A和设定的可变能耗因子a0
S504、将
Figure PCTCN2014096057-appb-000022
确定为所述物理机的能耗模型。
其中,所述特征矩阵R中的元素R1、R2、……、Rn可以为代表CPU资源、内存资源、输入输出IO资源和网络流量等资源的变量,或者,所述特征矩阵R中的元素R1、R2、……、Rn可以为代表执行的指令数、LLC数、中断计数器的计数等事件的变量。其中,所述物理机的非映射基础能耗Pstatic可以预先根据物理机空闲状态时的能耗和物理机空闲状态时的特征信息获取。
S505、对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息。
S506、根据
Figure PCTCN2014096057-appb-000023
确定所述第一虚拟机的特征信息对应的能耗
Figure PCTCN2014096057-appb-000024
S507、获取所述物理机的中间层的特征信息RHyper和所述物理机上运行的所有虚拟机的特征信息
Figure PCTCN2014096057-appb-000025
S508、根据
Figure PCTCN2014096057-appb-000026
确定所述第一虚拟机的特征信息对应的可变能耗分量
Figure PCTCN2014096057-appb-000027
其中,所述
Figure PCTCN2014096057-appb-000028
为所述物理机上运行的第j个第一虚拟机的特征信息对应的可变能耗分量,a0为所述物理机能耗模型中的所述设定的可变能耗因子,
Figure PCTCN2014096057-appb-000029
为所述物理机上运行的第j个第一虚拟机的第n种特征信息;m为所述物理机上运行的虚拟机的个数,
Figure PCTCN2014096057-appb-000030
为所述所述物理机的中间层的第i种特征信息,n为所述特征信息的数量。
S509、将所述第一虚拟机的特征信息对应的能耗与所述第一虚拟机的特征信息对应的可变能耗分量之和确定为所述第一虚拟机的能耗。
可选的,在S509之后,还可以包括:
S510、获取所述物理机的特征信息对应的实测能耗Pmeasure
S511、根据Pcaculate=Rtotal·AT+a0+Pstatic计算物理机的理论能耗Pcalculate
其中,Pcalculate为所述物理机的理论能耗,Rtotal中的元素R1、R2、……、Rn为所述物理机的n种特征信息,AT中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,a0为所述物理机能耗模型中的所述设定的可变能耗因子,Pstatic为所述物理机的非映射基础能耗。
S512、根据△P=Pcalculate-Pmeasure计算第一能耗偏差△P。
S513、根据
Figure PCTCN2014096057-appb-000031
计算所述物理机上运行的虚拟机的虚拟机修正能耗△Pj
其中,所述第一能耗偏差分配系数为所述物理机的能耗模型中的设定的参数矩阵A中的元素a1、a2、…、an
S514、采用(Pj)′=Pj+△Pj得到修正后的所述物理机上运行的第j个虚拟机的能耗(Pj)′。
其中,Pj为修正前的所述物理机上运行的第j个虚拟机的能耗、△Pj为所述物理机上第j个虚拟机的虚拟机修正能耗。
本发明实施例的其他技术方案和技术效果与图1至图4所示方法相同,此处不再赘述。
图10为本发明提供的一种虚拟机确定装置的实施例一的结构示意图。
如图10所示,本发明实施例的虚拟机能耗确定装置具体可以执行图1至图9所示的方法,包括:获取模块91和处理模块92。
所述获取模块91,用于获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
所述处理模块92,用于根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗;还用于根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
其中,所述处理模块92,可以具体用于:
根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子;
将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
可选的,所述获取模块91,可以用于对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息;所述处理模块92,用于第一根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗;还用于根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量;以及,还用于根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机 的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
可选的,所述获取模块91,可以用于获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息;所述处理模块92,可以用于根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
可选的,所述获取模块91,还可以用于获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;所述处理模块92,用于从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
可选的,所述获取模块91,还可以用于获取所述物理机的特征信息对应的实测能耗;所述处理模块92,可以用于根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的实测能耗,计算第一能耗偏差;根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定;根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
本发明实施例其他技术方案和技术效果与图1至图5所示方法相同,此处不再赘述。
图11为本发明提供的一种物理机的实施例一的结构示意图。
如图11所示,本发明实施例的物理机具体可以执行图1至图8所示的方法,包括:接收器1和处理器2。
所述接收器1,用于获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
所述处理器2,用于根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理 机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗。
所述处理器2,还用于根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
可选的,所述处理器2,具体用于:
根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子;
将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
在一种可选的实施方式中,所述接收器1,还用于对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息;所述处理器2,用于根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗;还用于根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量;以及,还用于根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
在另一种可选的实施方式中,所述接收器1,还用于获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息;所述处理器2,还用于根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
在第三种可选的实施方式中,所述接收器1,还用于获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;所述处理器2,还用于从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定 的参数矩阵和设定的可变能耗因子。
在第四种可选的实施方式中,所述处理器2,还用于根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差;根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定;根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
本发明实施例其他技术方案和技术效果与图1至图5所示方法相同,此处不再赘述。
图12为本发明提供的一种网络系统的实施例一的结构示意图。
如图12所示,本发明实施例提供的网络系统300,可以包括:一个或多个图11所示任一所述的物理机100和多个瘦终端200,其中,物理机100可以上运行一个或多个虚拟机,一个所述虚拟机对应一个瘦终端200;
所述物理机100可以用于:
获取所述物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗;
根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
本发明实施例其他技术方案和技术效果与图1至图5所示方法相同,此处不再赘述。
可选的,网络系统300可以包括至少两个物理机100。
其中一个物理机100可以用于确定图1至图5所示方法中的历史参数矩阵和历史可变能耗因子,用以确定图1至图5所示方法中设定的参数矩阵和设定的可变能耗因子,以使所述网络系统300中其他的物理机可以直接使用历史参数矩阵和历史可变能耗因子确定所述设定的参数矩阵和所述设定的可变能耗因子,并根据所述设定的参数矩阵和所述设定的可变能耗因子确定的物理机能耗模型,确定待确定的虚拟机能耗的具体方法具体可参见图1至图 5所示方法实施例的说明,此处不再赘述。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (19)

  1. 一种虚拟机能耗确定方法,其特征在于,包括:
    获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
    根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗;
    根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,具体包括:
    根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子;
    将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗,包括:
    对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息;
    根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗;
    根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量;
    根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量,包括:
    获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息;
    根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
  5. 根据权利要求2或3所述的方法,其特征在于,所述根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子,具体包括:
    获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;
    从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
  6. 根据权利要求2-5任一项所述的方法,其特征在于,所述物理机的能耗模型为:
    Figure PCTCN2014096057-appb-100001
    其中,Ptotal为物理机的能耗,Pstatic为物理机的非映射基础能耗;矩阵Rtotal中的元素R1、R2、……、Rn为所述物理机的特征信息;矩阵(Atotal)T中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,其中,a1为特征信息R1对应的能耗参数,a2为特征信息R2对应的能耗参数,……,an为特征信息Rn对应的能耗参数;a0为所述物理机能耗模型中的所述设定的可变能耗因子;所述物理机的能耗模型中的所述设定的参数矩阵中的元素a1、a2、…、an和所述设定的可变能耗因子a0根据所述物理机的特征信息和所述物理机的非映射基础能耗确定。
  7. 根据权利要求3或4所述的方法,其特征在于,所述根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗,具体包括:
    根据
    Figure PCTCN2014096057-appb-100002
    计算所述第一虚拟机的特征信息对应的能耗;
    其中,所述
    Figure PCTCN2014096057-appb-100003
    为所述物理机上运行的第j个第一虚拟机的特征信息对应的能耗,
    Figure PCTCN2014096057-appb-100004
    为所述物理机上运行的第j个第一虚拟机的特征信息;a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵中的元素;n为所述特征信息的数量。
  8. 根据权利要求4所述的方法,其特征在于,所述根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量,具体包括:
    根据
    Figure PCTCN2014096057-appb-100005
    计算所述第一虚拟机的特征信息对应的可变能耗分量;
    其中,所述
    Figure PCTCN2014096057-appb-100006
    为所述物理机上运行的第j个第一虚拟机的特征信息对应的可变能耗分量,a0为所述物理机能耗模型中的所述设定的可变能耗因子,
    Figure PCTCN2014096057-appb-100007
    为所述物理机上运行的第j个第一虚拟机的第n种特征信息;m为所述物理机上运行的虚拟机的个数,
    Figure PCTCN2014096057-appb-100008
    为所述所述物理机的中间层的第i种特征信息,n为所述特征信息的数量。
  9. 根据权利要求2-8任一项所述的方法,其特征在于,若所述物理机和所述物理机上运行的第一虚拟机的CPU资源的值均属于预设的第一CPU资源利用率区间,且所述预设的第一CPU资源利用率区间的最小值不低于50%,或者,
    所述物理机和所述物理机上运行的第一虚拟机的内存资源的值均属于预设的第一内存资源利用率区间,且所述预设的第一内存资源利用率区间的最小值不低于50%,或者,
    所述物理机和所述物理机上运行的第一虚拟机的IO资源的值均属于预设的第一IO资源利用率区间,且所述预设的第一IO资源利用率区间的最小值不低于50%;
    则所述根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型,还包括:
    根据所述物理机上运行的除所述第一虚拟机之外的第二虚拟机的特征信息,确定用于计算所述第二虚拟机的能耗的设定的参数矩阵和设定的可变能耗因子;
    将特征矩阵与所述用于计算所述第二虚拟机的设定的参数矩阵的转置矩阵的乘积、用于计算所述第二虚拟机的能耗的设定的可变能耗因子与所述物理机空闲能耗之和,确定为用于计算所述第二虚拟机的能耗的所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数;
    所述根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗,还具体包括:
    根据所述用于计算所述第二虚拟机的能耗的所述物理机的能耗模型,确定所述物理机上运行的第二虚拟机的能耗。
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述物理机上运行的除所述第一虚拟机之外的任一第二虚拟机的特征信息,确定用于计算所述第二虚拟机的能耗的设定的参数矩阵和设定的可变能耗因子,具体包括:
    获取所述第二虚拟机的特征信息;
    从至少一个历史参数矩阵和历史可变能耗因子中,选择与所述物理机上运行的第二虚拟机的特征信息所属的利用率水平区间组合相同的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为用于计算所述第二虚拟机的能耗的物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子;所述利用率区间组合包括所述CPU资源的利用率区间、内存资源的利用率区间、IO资源的利用率区间,所述CPU资源的利用率区间包括预设的第一CPU资源利用率区间、第二CPU资源利用率区间、第三CPU资源利用率区间,所述内存资源的利用率区间包括预设的第一内存利用率区间、第二内存利用率区间、第三内存利用率区间,所述IO资源的利用率区间包括预设的第一IO资源利用率区间、第二IO资源利用率区间、第三IO资源利用率区间。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,还包括:
    根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差;
    根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定;
    根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
  12. 根据权利要求11所述的方法,其特征在于,
    所述根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差,具体包括:
    获取所述物理机的特征信息对应的实测能耗;
    根据Pcaculate=Rtotal·(Atotal)T+a0+Pstatic计算物理机的理论能耗,其中,Pcalculate为所述物理机的理论能耗,Rtotal中的元素R1、R2、……、Rn为所述物理机的n种特征信息,(Atotal)T中的元素a1、a2、…、an为所述物理机能耗模型中的所述设定的参数矩阵,a0为所述物理机能耗模型中的所述设定的可变能耗因子,Pstatic为所述物理机的非映射基础能耗;根据ΔP=Pcalculate-Pmeasure计算第一能耗偏差,其中,ΔP为第一偏差能耗,Pcalculate为所述物理机的理论能耗,Pmeasure为所述物理机的实测能耗;
    所述根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定,具体包括:
    根据
    Figure PCTCN2014096057-appb-100009
    计算所述物理机上第j个虚拟机的虚拟机修正能耗;其中,第一能耗偏差分配系数
    Figure PCTCN2014096057-appb-100010
    分别为所述物理机的能耗模型中的设定的参数矩阵中的元素a1、a2、…、an
    所述根据所述虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正,具体包括:
    根据(Pj)′=Pj+ΔPj得到修正后的所述物理机上运行的第j个虚拟机的能 耗,其中,(Pj)′为修正后的所述物理机上运行的第j个虚拟机的能耗、Pj为修正前的所述物理机上运行的第j个虚拟机的能耗、ΔPj为所述物理机上第j个虚拟机的虚拟机修正能耗。
  13. 一种物理机,其特征在于,包括:
    接收器,用于获取物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
    处理器,用于根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗。
    所述处理器,还用于根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
  14. 根据权利要求13所述的物理机,其特征在于,所述处理器,具体用于:
    根据所述物理机上的特征信息、所述物理机的非映射基础能耗确定设定的参数矩阵和设定的可变能耗因子;
    将特征矩阵与所述设定的参数矩阵的转置矩阵的乘积、设定的可变能耗因子与所述物理机空闲能耗之和,确定为所述物理机的能耗模型;其中,所述特征矩阵包括以下至少一种矩阵元素:CPU资源、内存资源、输入输出IO资源和网络流量,或者,所述特征矩阵包括以下至少一种矩阵元素:执行的指令数、LLC数、中断计数器的计数。
  15. 根据权利要求14所述的物理机,其特征在于,
    所述接收器,还用于对于所述物理机上运行的第一虚拟机,获取所述第一虚拟机的特征信息;
    所述处理器,用于根据所述物理机能耗模型中的设定的参数矩阵和所述第一虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的能耗;还用于根据所述物理机能耗模型中的设定的可变能耗因子,确定所述第一虚拟机的特征信息对应的可变能耗分量;以及,还用于根据所述第一虚拟机的特征信息对应的能耗和所述第一虚拟机的特征信息对应的可变能耗分量,确定所述第一虚拟机的能耗。
  16. 根据权利要求15所述的物理机,其特征在于,
    所述接收器,还用于获取所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息;
    所述处理器,还用于根据所述物理机能耗模型中的所述设定的可变能耗因子、所述第一虚拟机的特征信息、所述物理机的中间层的特征信息和所述物理机上运行的所有虚拟机的特征信息,确定所述第一虚拟机的特征信息对应的可变能耗分量。
  17. 根据权利要求13或14所述的物理机,其特征在于,
    所述接收器,还用于获取至少一组历史参数矩阵和历史可变能耗因子,每组所述历史参数矩阵和历史可变能耗因子根据一组历史特征信息和物理机的历史能耗和物理机的非映射基础能耗确定;
    所述处理器,还用于从至少一组历史参数矩阵和历史可变能耗因子中,选择与所述物理机的特征信息满足预设的匹配条件的历史特征信息对应的历史参数矩阵和历史可变能耗因子,作为所述物理机的能耗模型中的所述设定的参数矩阵和设定的可变能耗因子。
  18. 根据权利要求13-17任一项所述的物理机,其特征在于,所述处理器,还用于:根据所述物理机的特征信息、所述物理机的能耗模型和所述物理机的能耗,计算第一能耗偏差;根据第一能耗偏差和第一能耗偏差分配系数,计算所述物理机上运行的虚拟机的虚拟机修正能耗,所述第一能耗偏差分配系数根据所述物理机的能耗模型确定;根据所述第一虚拟机修正能耗对所述物理机上运行的虚拟机的能耗进行第一修正。
  19. 一种网络系统,包括:一个或多个如权利要求13-18任一所述的物理机和多个瘦终端,其中,
    所述物理机上运行一个或多个虚拟机,一个所述虚拟机对应一个瘦终端;
    所述物理机用于:
    获取所述物理机上的特征信息,所述特征信息包括至少一种事件信息或至少一种资源信息;
    根据所述物理机上的特征信息,以及所述物理机的非映射基础能耗,确定所述物理机的能耗模型;所述非映射基础能耗为物理机的未运行虚拟机时的能耗中未映射到所述特征信息的能耗;
    根据所述物理机的能耗模型,确定所述物理机上运行的虚拟机的能耗。
PCT/CN2014/096057 2014-12-31 2014-12-31 虚拟机能耗确定方法、物理机和网络系统 WO2016106747A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2014/096057 WO2016106747A1 (zh) 2014-12-31 2014-12-31 虚拟机能耗确定方法、物理机和网络系统
CN201480038254.0A CN106170744B (zh) 2014-12-31 2014-12-31 虚拟机能耗确定方法、物理机和网络系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/096057 WO2016106747A1 (zh) 2014-12-31 2014-12-31 虚拟机能耗确定方法、物理机和网络系统

Publications (1)

Publication Number Publication Date
WO2016106747A1 true WO2016106747A1 (zh) 2016-07-07

Family

ID=56284017

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/096057 WO2016106747A1 (zh) 2014-12-31 2014-12-31 虚拟机能耗确定方法、物理机和网络系统

Country Status (2)

Country Link
CN (1) CN106170744B (zh)
WO (1) WO2016106747A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488213A (zh) * 2020-04-16 2020-08-04 中国工商银行股份有限公司 容器部署方法及装置、电子设备和计算机可读存储介质
CN112379766A (zh) * 2020-11-25 2021-02-19 航天通信中心 数据处理方法、装置、非易失性存储介质和处理器
CN114363185A (zh) * 2022-03-17 2022-04-15 阿里云计算有限公司 虚拟资源处理方法以及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107369122A (zh) * 2017-08-18 2017-11-21 潘金文 一种高效的建筑能耗分析系统
CN109144231B (zh) * 2018-09-11 2021-07-16 联想(北京)有限公司 一种虚拟化电力管理方法及设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101907917A (zh) * 2010-07-21 2010-12-08 中国电信股份有限公司 一种测量虚拟机能耗的方法和系统
CN102759979A (zh) * 2011-04-29 2012-10-31 国际商业机器公司 一种虚拟机能耗估计方法及装置
KR20120133572A (ko) * 2011-05-31 2012-12-11 국립대학법인 울산과학기술대학교 산학협력단 클라우드 시스템에서 가상 머신의 에너지 기반 과금 및 스케줄링 장치 및 방법
CN103914119A (zh) * 2014-04-17 2014-07-09 国家电网公司 一种虚拟机能耗电力计量方法及系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7856549B2 (en) * 2007-01-24 2010-12-21 Hewlett-Packard Development Company, L.P. Regulating power consumption
US8862914B2 (en) * 2010-02-26 2014-10-14 Microsoft Corporation Virtual machine power consumption measurement and management
CN103001992B (zh) * 2011-09-19 2018-01-09 中兴通讯股份有限公司 虚拟桌面实现系统及其使用方法
US9098309B2 (en) * 2011-09-23 2015-08-04 Qualcomm Incorporated Power consumption optimized translation of object code partitioned for hardware component based on identified operations
CN102662750A (zh) * 2012-03-23 2012-09-12 上海交通大学 基于弹性虚拟机池的虚拟机资源优化控制方法及其系统
CN103034525A (zh) * 2012-12-07 2013-04-10 湖南工程学院 云计算环境中一种基于性能计数器的虚拟机功耗测量方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101907917A (zh) * 2010-07-21 2010-12-08 中国电信股份有限公司 一种测量虚拟机能耗的方法和系统
CN102759979A (zh) * 2011-04-29 2012-10-31 国际商业机器公司 一种虚拟机能耗估计方法及装置
KR20120133572A (ko) * 2011-05-31 2012-12-11 국립대학법인 울산과학기술대학교 산학협력단 클라우드 시스템에서 가상 머신의 에너지 기반 과금 및 스케줄링 장치 및 방법
CN103914119A (zh) * 2014-04-17 2014-07-09 国家电网公司 一种虚拟机能耗电力计量方法及系统

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488213A (zh) * 2020-04-16 2020-08-04 中国工商银行股份有限公司 容器部署方法及装置、电子设备和计算机可读存储介质
CN111488213B (zh) * 2020-04-16 2024-04-02 中国工商银行股份有限公司 容器部署方法及装置、电子设备和计算机可读存储介质
CN112379766A (zh) * 2020-11-25 2021-02-19 航天通信中心 数据处理方法、装置、非易失性存储介质和处理器
CN112379766B (zh) * 2020-11-25 2024-04-26 航天通信中心 数据处理方法、装置、非易失性存储介质和处理器
CN114363185A (zh) * 2022-03-17 2022-04-15 阿里云计算有限公司 虚拟资源处理方法以及装置
CN114363185B (zh) * 2022-03-17 2022-10-04 阿里云计算有限公司 虚拟资源处理方法以及装置

Also Published As

Publication number Publication date
CN106170744A (zh) 2016-11-30
CN106170744B (zh) 2019-07-19

Similar Documents

Publication Publication Date Title
WO2016106747A1 (zh) 虚拟机能耗确定方法、物理机和网络系统
WO2020143164A1 (zh) 一种网络资源的分配方法及设备
US10552761B2 (en) Non-intrusive fine-grained power monitoring of datacenters
CN104809051B (zh) 用于预测计算机应用中的异常和故障的方法和装置
US20180239852A1 (en) Efficient forecasting for hierarchical energy systems
US8660868B2 (en) Energy benchmarking analytics
CN108710540B (zh) 一种分布式集群中的资源调度方法、装置及设备
US11769099B2 (en) Apparatuses, computer-implemented methods, and computer program products for improved monitored building environment monitoring and scoring
KR20210003093A (ko) 단일 측정 유닛으로 이종의 컴퓨팅 자원들의 사용량을 정량화하는 방법
EP3968159A1 (en) Performance monitoring in a distributed storage system
US9215151B1 (en) Dynamic sampling rate adjustment for rate-limited statistical data collection
EP2625615A2 (en) Systems and methods for power consumption profiling and auditing
US11906180B1 (en) Data center management systems and methods for compute density efficiency measurements
CN104407688A (zh) 基于树回归的虚拟化云平台能耗测量方法及系统
EP3433740A1 (en) Control device for estimation of power consumption and energy efficiency of application containers
TW201917671A (zh) 用電分析伺服器及其用電分析方法
US20180241644A1 (en) Server performance evaluation through single value server performance index
CN110896357B (zh) 流量预测方法、装置和计算机可读存储介质
CN102902344A (zh) 基于随机任务的云计算系统能耗优化方法
CN107656851A (zh) 一种基于部件能耗模型的云服务器能耗测算方法及系统
WO2015127664A1 (zh) 能耗监控方法及装置
Gupta et al. Long range dependence in cloud servers: a statistical analysis based on google workload trace
CN114500339A (zh) 一种节点带宽监测方法、装置、电子设备及存储介质
US20160132975A1 (en) Identifying high usage periods
CN109995551B (zh) 云计算系统的业务计量方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14909553

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

Country of ref document: EP

Kind code of ref document: A1