Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
See also Fig. 1 a, be the logical organization synoptic diagram of a kind of desktop virtual system of the embodiment of the invention, as shown in Figure 1a, the desktop virtual system of the embodiment of the invention comprises: many physical hosts 10,20,30 (also can be called professional main frame, illustrate with three physical hosts among the figure, but be not limited thereto) and management server 40, wherein, every physical host comprises that hardware layer is (among the figure with 11,21,31 signals), operate in the virtual machine monitoring unit VMM (with 12,22,32 illustrate among the figure) on the described hardware layer, operate at least one virtual machine on the described virtual machine monitoring unit VMM (among the figure with VM1, VM2, the VM3 signal, but be not limited thereto), and at least one probe is (among the figure with 13,23,33 signals need to prove, the deployment way of probe is not limited thereto), wherein:
Described probe is used for: the particular event information of collecting corresponding virtual machine;
The particular event information here can comprise that hardware uses information and/or virtual machine user operation information;
Virtual machine monitoring unit VMM 12,22,32 are used for: the particular event information of the virtual machine of collecting according to probe, and the virtual machine that management server 40 provides is idle tactful, determine the current state of the virtual machine that this particular event information is associated, and to management server 40 output corresponding virtual machine status informations, wherein, described virtual machine state information represents that virtual machine is in idle state or non-idle state;
And, management server 40 is used for: when all virtual machines of the host of institute are idle state on the virtual machine state information that obtains is represented by host's physical host (such as physical host 10), sent standby command to this by host's physical host (such as physical host 10);
Accordingly, virtual machine monitoring unit VMM 12 is further used for: the standby command that receiving management server 40 issues, and to the corresponding standby command of hardware layer 11 transmissions, be the ACPI-S3 state to control and to make this physical host 10 enter the holding state that suspends to internal memory.
The ACPI-S3 state here refers to the S3 state of ACPI, and namely Suspend to RAM (suspending to internal memory) state is called for short STR; The system that is about to enters operating state data before the STR and all is stored in the internal memory and goes.Under the STR state, power supply still continues as the most necessary power devices such as internal memory, do not lose to guarantee data, and other equipment all is in closed condition, and the power consumption of system is extremely low.In case Power button (host power switch) is triggered, or by the mouse-keyboard event, network interface card event etc., system just is waken up, and reads data immediately and return to STR duty before from internal memory.Wherein, ACPI refers to Advanced Configuration and Power Interface, ACPI; This is a kind of power management standard of the common exploitation of Intel, Microsoft and Toshiba; ACPI is according to the height of degree of power conservation, and one has six kinds of states of S0~S5.ACPI-S3 is a kind of in the holding state, its internal memory power supply, and CPU etc. do not power, and energy consumption is saved and is reached more than 80%;
Under a kind of implementation, as shown in Figure 1a, probe 13,23,33 specifically are embedded in the corresponding virtual machine, and the concrete hardware that is used for the corresponding virtual machine of collection uses the user's operation information of information and/or corresponding virtual machine;
Accordingly, virtual machine monitoring unit VMM 12,22,32 specifically are used for: according to probe 13,23,33 hardware of collecting use information and/or user's operation information, and the virtual machine that management server 40 provides is idle tactful, determines the current state of the virtual machine that described hardware use information and/or user's operation information are associated, to management server 40 output corresponding virtual machine status informations, wherein, described virtual machine state information represents that virtual machine is in idle state or non-idle state.
Under another kind of implementation, described probe comprises that the front end probe that is embedded in the corresponding virtual machine is (among Fig. 1 a with 13,23,33 signals) and be deployed in rear end probe (not shown) among the described virtual machine monitoring unit VMM, wherein, described front end probe is used for collecting the user's operation information of corresponding virtual machine; Described rear end probe is used for collecting the hardware use information of corresponding virtual machine;
Accordingly, virtual machine monitoring unit VMM 12,22,32 specifically are used for: the user's operation information of the corresponding virtual machine of collecting according to the front end probe and the hardware of the corresponding virtual machine that the rear end probe is collected use information, and the virtual machine that management server 40 provides is idle tactful, determine the current state of the virtual machine that described hardware use information and user's operation information are associated, to management server 40 output corresponding virtual machine status informations, wherein, described virtual machine state information represents that virtual machine is in idle state or non-idle state.
Need to prove, the hardware use information of the virtual machine is here represented the hardware event that takes place on the described virtual machine, described hardware event includes but not limited to: mouse event, KeyEvent, network I/O event and magnetic disc i/o event etc., the user's operation information of the virtual machine is here represented the Action Events that takes place on the described virtual machine, and described Action Events includes but not limited to: " leave unused " operation that the user carries out virtual machine, " standby " operation, " dormancy " operation and " disconnection " are operated etc.;
The idle strategy of the virtual machine of the embodiment of the invention comprises: a kind of or combination in any in virtual machine section standby time, the idle classification of virtual machine, the idle decision condition of virtual machine hardware use information and idle these the four kinds of conditions of decision condition of virtual machine user operation information; Specifically can determine flexibly according to practical application.
Illustrate: the idle strategy of virtual machine is: " the idle classification of virtual machine is for leaving unused "+" section 18:00-23:00 standby time "+" 30 minutes no events of mouse+keyboard " || " user's standby operation "; If virtual machine A belongs to the classification of can leaving unused, and current slot is in 18:00-23:00, and virtual machine A 30 minutes no mouse button mark events, and perhaps virtual machine A is held capable standby operation by the user, then virtual machine A is in idle state, otherwise virtual machine A is in non-idle state; Need to prove, here "+" expression " with " relation, " || " expression " or " relation.
Wherein, virtual machine section standby time refers to the time section that virtual machine can leave unused, as 20:00-06:00; Whether the idle classification of virtual machine refers to virtual machine and can leave unused; For leaving unused classification, no matter whether other condition satisfies, this virtual machine A can not be left unused so as virtual machine A;
The idle decision condition of virtual machine hardware use information refers to according to the virtual machine hardware that reports and uses the occurrence frequency of the represented hardware event of information to judge whether virtual machine can leave unused, various virtual machine hardware events can combination in any be used, and described hardware event includes but not limited to mouse event, KeyEvent, network I/O event and magnetic disc i/o event etc.;
The idle decision condition of virtual machine user operation information refers to judges whether the virtual machine that is performed the represented operation of described virtual machine user operation information can leave unused; Concrete, if leaving unused, represented being operating as of the virtual machine user operation information that reports operate, then this virtual machine can leave unused; If the operation in the scheduled operation scope that is operating as that the virtual machine user operation information that reports is represented then determines according to the operation alternative rule of setting whether this virtual machine can leave unused; Concrete, if set virtual machine " standby ", " dormancy " or " disconnections " operation can be alternative with " leave unused " operation, then is performed standby ", " dormancy " or " disconnection " virtual machine of operating can leave unused; If set virtual machine " standby ", " dormancy " or " disconnections " operation can not be alternative with " leave unused " operation, then is performed standby ", " dormancy " or " disconnection " virtual machine virtual machine of operating can not leave unused; The scheduled operation scope here comprises " standby " operation, " dormancy " operation or " disconnection " operation.
Need to prove, in order to strengthen the dirigibility of the idle strategy of virtual machine, at different virtual machine sections standby time and/or the idle classification of virtual machine, the idle decision condition of corresponding virtual machine hardware use information and/or the idle decision condition of virtual machine user operation information can be different.
Under a kind of implementation, virtual machine monitoring unit VMM 12,22,32 specifically are used for: when the associated virtual machine of reporting information belongs to the classification of can leaving unused, and current slot is in the first standby time section, and hardware event does not take place in first threshold in the time in this virtual machine, perhaps, the hardware event occurrence frequency is less than the first threshold frequency, perhaps, this virtual machine is performed idle operation, and perhaps the operation and this operation that are performed in the scheduled operation scope of this virtual machine can be alternative with " leave unused " operation, but then determine the current idle state that is in of this virtual machine, and represent the virtual machine state information of idle states to management server 40 outputs; The hardware event here comprises one or more in mouse event, KeyEvent, network I/O event and the magnetic disc i/o event;
Under another kind of implementation, virtual machine monitoring unit VMM 12,22,32 specifically are used for: when the associated virtual machine of reporting information belongs to the classification of can leaving unused, and current slot is in the second standby time section, and hardware event does not take place in this virtual machine in second threshold time, perhaps, the hardware event occurrence frequency is less than second threshold frequency, perhaps, this virtual machine is performed idle operation, and perhaps the operation and this operation that are performed in the scheduled operation scope of this virtual machine can be alternative with " leave unused " operation, but then determine the current idle state that is in of this virtual machine, and represent the virtual machine state information of idle states to management server 40 outputs;
Under another kind of implementation, virtual machine monitoring unit VMM 12,22,32 specifically are used for: when the associated virtual machine of reporting information belongs to the classification of can leaving unused, and operation and this operation that this virtual machine is performed in the scheduled operation scope can not substitute with " leaving unused " operation, determine that then current being in of this virtual machine can not idle state, and to management server 40 output expressions can not idle state virtual machine state information;
Under another kind of implementation, virtual machine monitoring unit VMM 12,22,32 specifically are used for: when the associated virtual machine of reporting information belongs to the classification of can not leaving unused, determine that then current being in of this virtual machine can not idle state, and to management server 40 output expressions can not idle state virtual machine state information;
Should be understood that the granularity of the category division of virtual machine is not limited to: the classification of can leaving unused and the classification of can not leaving unused.Under the situation of more fine-grained management, the classification of can leaving unused can further be divided into different subclass, A for example, B, C.
Further, as shown in Figure 1a, in the desktop virtual system of the embodiment of the invention, management server 40 is further used for: according to described virtual machine state information and virtual machine (vm) migration strategy, determine to need virtual machine and migration target physical main frame that being in of migration can not idle state, and send the migration order to the virtual machine host's of needs migration physical host; Wherein, described migration order comprises the virtual machine sign ID of needs migration and the destination host information of migration.The virtual machine sign ID here is unique character string sequence that VMM distributes for each virtual machine, is used for the unique identification virtual machine; Under the Xen framework, be called uuid; The destination host information of migration specifically can be the IP address of the professional main frame of purpose.
Accordingly, virtual machine monitoring unit VMM 12,22,32 are further used for: according to the migration order that management server 40 sends, described virtual machine sign ID corresponding virtual machine is moved on the professional main frame of purpose of the professional host information correspondence of described purpose.
Introduce down the virtual machine (vm) migration strategy below:
Described virtual machine (vm) migration strategy comprises: virtual machine (vm) migration time section, virtual machine (vm) migration decision condition and the selected condition of migration target service main frame; Illustrate: as in virtual machine (vm) migration time section, with " non-idle state " virtual machine number less than 2 and total virtual machine number greater than the virtual machine (vm) migration of " non-idle state " on the professional main frame of physical host host's mean virtual machine number to " non-idle state " professional main frame that virtual machine proportion is the highest and resource utilization is minimum.
Wherein, the virtual machine (vm) migration decision condition refers to according to current virtual machine state and the host's of current virtual machine institute physical host status information judges the whether needs migration of current virtual machine, and the current virtual machine host's of institute physical host status information comprises a kind of or combination in any in the total virtual machine number, " idle state " virtual machine number, mean virtual machine number of the host of institute on the current virtual machine host's of institute the physical host;
The selected condition of target service main frame refers to the target physical main frame of selecting migration according to physical host status information in the desktop virtual environment, and this physical host status information comprises a kind of or combination in any in the total virtual machine number, " non-idle state " virtual machine number/proportion, professional host resource utilization factor of the host of institute on the physical host; Concrete, select to satisfy in the following condition one or multinomial physical host as the target physical main frame of migration;
A. in desktop virtual environment on this physical host total virtual machine of the host of institute count maximum, perhaps on this physical host total virtual machine number of the host of institute greater than the first threshold number;
B. " non-idle state " virtual machine proportion maximum of the host of institute on this physical host in desktop virtual environment, perhaps on this physical host " non-idle state " virtual machine proportion of the host of institute greater than first threshold number percent;
C. this physical host resource utilization is minimum in desktop virtual environment, and perhaps this physical host resource utilization is lower than second threshold percentage.
Should be understood that in the embodiment of the invention, in order to strengthen the dirigibility of migration, at different virtual machine (vm) migration time sections, corresponding virtual machine migration decision condition and/or the selected condition of migration target service main frame can be different.
Further, see also Fig. 1 b, for the physics of a kind of desktop virtual system of the embodiment of the invention is disposed synoptic diagram, shown in Fig. 1 b, in the desktop virtual system of the embodiment of the invention, management server 40 is further used for: the response user operation of logining virtual machine issues to this virtual machine host's physical host (as physical host 10) and to wake instruction up;
Accordingly, the hardware layer 11 of this this physical host 10 is used for: response management server 40 sends wakes instruction up, and the internal memory that operation is hung up activates the corresponding virtual machine, but makes this virtual machine enter operation state.
Need to prove that waking instruction up is the instruction that management server 40 directly sends to the physical host hardware layer; Received by hardware layer (specifically can be network interface card), and triggering CPU powers on, load operating.
In sum, the embodiment of the invention provides a kind of desktop virtual system, disposes probe in each virtual machine, collects the particular event information of corresponding virtual machine by probe; Virtual machine monitoring unit VMM is according to the particular event information of the virtual machine of described probe collection and the idle strategy of virtual machine that management server provides, determine the current state of the virtual machine that described particular event information is associated, and to described management server output corresponding virtual machine status information; When all virtual machines of the host of institute are idle state on management server perceives by host's physical host, sent standby command to this by host's physical host; VMM receives the standby command that described management server issues, and sends corresponding standby command to hardware layer, to control and to make this physical host enter the holding state that suspends to internal memory; As seen, scheme by the embodiment of the invention, can identify the operating position of virtual machine, thereby for example, in enterprise After Hours, can make all virtual machines of the host of institute on self be the physical host stand-by energy-saving of idle state, simultaneously, owing to be in the physical host of the holding state that suspends to internal memory, its internal memory power supply, internal storage state information completely; Professional main frame is waken up, the directly internal memory operation from hanging up, return to the preceding state of standby rapidly, so when reaching energy-saving effect, when avoiding for example enterprise's working, a large amount of virtual machines " thermophoresis " or a large amount of virtual machine load the network traffic congestion phenomenon that causes, and then have guaranteed the reliable and stable and high-performance of virtual machine, have improved the end-user experience satisfaction.Further, by embodiment of the invention scheme, for example at still needing work those nights, be marked as the virtual machine of " non-idle state ", can " thermophoresis " to other professional main frame; Because this type of virtual machine negligible amounts in the desktop virtual system of the embodiment of the invention, " thermophoresis " can not produce the network traffic congestion phenomenon.
See also Fig. 2, structural representation for a kind of physical host of the embodiment of the invention, this physical host can be applicable in the desktop virtual system, as shown in Figure 2, this physical host comprises: hardware layer 11, operate in the virtual machine monitoring unit VMM 12 on the hardware layer 11 and operate at least one virtual machine on the virtual machine monitoring unit VMM 12 (among the figure with VM1, the VM2 signal, include but not limited to this), and at least one probe (is illustrated with probe 13 among the figure, but need to prove that the deployment way of probe is not limited thereto), wherein:
Probe 13 is used for: the particular event information of collecting corresponding virtual machine;
Virtual machine monitoring unit VMM 12 is used for: the particular event information of the virtual machine of collecting according to probe 13, and the idle strategy of the virtual machine that obtains, determine the current state of the virtual machine that this particular event information is associated, and to management server 40 output corresponding virtual machine status informations, and be used for the standby command that receiving management server 40 sends, and send corresponding standby command to hardware layer.Wherein, described virtual machine state information represents that this virtual machine is in idle state or non-idle state; The obtain manner of the idle strategy of the virtual machine here, it can be the idle strategy of virtual machine that management server 40 answers the request of physical host to issue, also can be that management server 40 active push are given physical host, also can be the idle strategy of predetermined virtual machine, etc.
Hardware layer 11 is used for the described standby command of response, and controlling and making this physical host enter the holding state that suspends to internal memory is the ACPI-S3 state.
Need to prove that under a kind of implementation, probe 13 is embedded in the corresponding virtual machine, specifically is to be embedded among the operating system of user Guest OS of corresponding virtual machine, have two kinds of level: a, with drive the same level of Drive; B, with use the same level of Application; The probe 13 concrete hardware that are used for the corresponding virtual machine of collection use the user's operation information of information and/or corresponding virtual machine;
Accordingly, virtual machine monitoring unit VMM 12 specifically is used for: the hardware of the corresponding virtual machine of collecting according to probe 13 uses information and/or user's operation information, and the virtual machine that management server 40 provides is idle tactful, determine the current state of the virtual machine that this hardware use information and/or user's operation information are associated, to management server 40 output corresponding virtual machine status informations, wherein, described virtual machine state information represents that virtual machine is in idle state or non-idle state.Concrete, export each virtual machine state information by message communication or shared file access mode to management server 40;
Need to prove, the hardware use information of the virtual machine is here represented the hardware event that takes place on the described virtual machine, described hardware event includes but not limited to: mouse event, KeyEvent, network I/O event and magnetic disc i/o event etc., the user's operation information of the virtual machine is here represented the Action Events that takes place on the described virtual machine, and described Action Events includes but not limited to: " leave unused " operation that the user carries out virtual machine, " standby " operation, " dormancy " operation and " disconnection " are operated etc.; As to the replenishing of this device, described virtual machine can provide " leave unused " option of operation or menu, and the confession user initiatively carries out the virtual machine operation of " leaving unused ";
Under another implementation, as shown in Figure 3, virtual machine VM1, be deployed with front end probe 13aa among the VM2 respectively, be deployed with rear end probe 13b among the virtual machine monitoring unit VMM12 of physical host, front end probe 13aa and rear end probe 13b can pass through the communication of event channel mode, in other words, probe comprises the front end probe 13aa that is embedded in the corresponding virtual machine and the rear end probe 13b that is deployed among the virtual machine monitoring unit VMM, wherein, front end probe 13aa specifically is used for collecting the user's operation information of corresponding virtual machine; Rear end probe 13b specifically is used for collecting the hardware use information of corresponding virtual machine; Should be understood that probe not necessarily will be divided into " front end probe " and " rear end probe ".
Accordingly, virtual machine monitoring unit VMM12 specifically is used for: the user's operation information of the corresponding virtual machine of collecting according to front end probe 13a and the hardware of the corresponding virtual machine that rear end probe 13b collects use information, and the virtual machine that management server 40 provides is idle tactful, determine the current state of the virtual machine that this hardware use information and user's operation information are associated, to management server 40 output corresponding virtual machine status informations, wherein, described virtual machine state information represents that virtual machine is in idle state or non-idle state.
More excellent, virtual machine monitoring unit 12 is further used for the migration order that receiving management server 40 sends, and the virtual machine sign ID corresponding virtual machine that comprises in the described migration order is moved on the professional main frame of purpose of the professional host information correspondence of purpose that comprises in the described migration order.And hardware layer 11 is further used for: receiving management server 40 sends wakes instruction up, respond the described instruction that wakes up, the internal memory that operation is hung up, and activation corresponding virtual machine, but make this virtual machine enter operation state.Concrete, wake instruction up and be the instruction that management server directly sends to the hardware layer of physical host; Received by hardware layer (specifically can be network interface card), and triggering CPU powers on, load operating.
Introducing probe below is to collect virtual machine hardware by the following method to use information and/or virtual machine user operation information:
1, the user's operation information of corresponding virtual machine: be that probe passes through to intercept and capture corresponding user operation case to the event handling function of Guest OS registration corresponding operating;
2, mouse and the keypad information in the hardware use information of corresponding virtual machine: probe is intercepted and captured corresponding event by the event handling function to Guest OS registration mouse and keyboard; Network I/O information: be that probe passes through to intercept and capture network I/O event to the corresponding interface that drives of Guest OS registration; Magnetic disc i/o information: be that probe passes through to intercept and capture the magnetic disc i/o event to the corresponding interface that drives of Guest OS registration;
After virtual machine hardware uses information and/or virtual machine user operation information to collect, can be passed to virtual machine monitoring unit VMM 12,22,32 by modes such as event channel or message communications;
Introduce the idle strategy of virtual machine below:
The idle strategy of the virtual machine here comprises: a kind of or combination in any in virtual machine section standby time, the idle classification of virtual machine, the idle decision condition of virtual machine hardware use information and idle these the four kinds of conditions of decision condition of virtual machine user operation information; Specifically can determine flexibly according to practical application.
Illustrate: the idle strategy of virtual machine is: " the idle classification of virtual machine is for leaving unused "+" section 18:00-23:00 standby time "+" 30 minutes no events of mouse+keyboard " || " user's standby operation "; If virtual machine A belongs to the classification of can leaving unused, and current slot is in 18:00-23:00, and virtual machine A 30 minutes no mouse button mark events, and perhaps virtual machine A is held capable standby operation by the user, then virtual machine A is in idle state, otherwise virtual machine A is in non-idle state; Need to prove, here "+" expression " with " relation, " || " expression " or " relation.
Wherein, virtual machine section standby time refers to the time section that virtual machine can leave unused, as 20:00-06:00; Whether the idle classification of virtual machine refers to virtual machine and can leave unused; For leaving unused classification, no matter whether other condition satisfies, this virtual machine A can not be left unused so as virtual machine A;
The idle decision condition of virtual machine hardware use information refers to according to the virtual machine hardware that reports and uses the occurrence frequency of the represented hardware event of information to judge whether virtual machine can leave unused, various virtual machine hardware events can combination in any be used, and described hardware event includes but not limited to mouse event, KeyEvent, network I/O event and magnetic disc i/o event etc.;
The idle decision condition of virtual machine user operation information refers to judges whether the virtual machine that is performed the represented operation of described virtual machine user operation information can leave unused; Concrete, if leaving unused, represented being operating as of the virtual machine user operation information that reports operate, then this virtual machine can leave unused; If the operation in the scheduled operation scope that is operating as that the virtual machine user operation information that reports is represented then determines according to the operation alternative rule of setting whether this virtual machine can leave unused; Concrete, if set virtual machine " standby ", " dormancy " or " disconnections " operation can be alternative with " leave unused " operation, then is performed standby ", " dormancy " or " disconnection " virtual machine of operating can leave unused; If set virtual machine " standby ", " dormancy " or " disconnections " operation can not be alternative with " leave unused " operation, then is performed standby ", " dormancy " or " disconnection " virtual machine virtual machine of operating can not leave unused; The scheduled operation scope here comprises " standby " operation, " dormancy " operation or " disconnection " operation.
Need to prove, in order to strengthen the dirigibility of the idle strategy of virtual machine, at different virtual machine sections standby time and/or the idle classification of virtual machine, the idle decision condition of corresponding virtual machine hardware use information and/or the idle decision condition of virtual machine user operation information can be different.
Under a kind of implementation, virtual machine monitoring unit VMM 12 specifically is used for: when the associated virtual machine of reporting information belongs to the classification of can leaving unused, and current slot is in the first standby time section, and hardware event does not take place in first threshold in the time in this virtual machine, perhaps, the hardware event occurrence frequency is less than the first threshold frequency, perhaps, this virtual machine is performed idle operation, perhaps the operation and this operation that are performed in the scheduled operation scope of this virtual machine can be alternative with " leave unused " operation, but then determine the current idle state that is in of this virtual machine, and to the virtual machine state information of management server 40 output expression idle states, and be used for the standby command that receiving management server 40 issues, and send corresponding standby command to hardware layer, to control and to make this physical host enter the ACPI-S3 state; The hardware event here comprises one or more in mouse event, KeyEvent, network I/O event and the magnetic disc i/o event;
Under another kind of implementation, virtual machine monitoring unit VMM 12 specifically is used for: when the associated virtual machine of reporting information belongs to the classification of can leaving unused, and current slot is in the second standby time section, and hardware event does not take place in this virtual machine in second threshold time, perhaps, the hardware event occurrence frequency is less than second threshold frequency, perhaps, this virtual machine is performed idle operation, perhaps the operation and this operation that are performed in the scheduled operation scope of this virtual machine can be alternative with " leave unused " operation, but then determine the current idle state that is in of this virtual machine, and to the virtual machine state information of management server 40 output expression idle states, and be used for the standby command that receiving management server 40 issues, and send corresponding standby command to hardware layer, with control and make this physical host enter the ACPI-S3 state, and be used for the standby command that receiving management server 40 issues, and to the corresponding standby command of hardware layer transmission, to control and to make this physical host enter the ACPI-S3 state;
Under another kind of implementation, virtual machine monitoring unit VMM 12 specifically is used for: when the associated virtual machine of reporting information belongs to the classification of can leaving unused, and operation and this operation that this virtual machine is performed in the scheduled operation scope can not substitute with " leaving unused " operation, determine that then current being in of this virtual machine can not idle state, and to management server 40 output expression can not idle state virtual machine state information, and be used for the standby command that receiving management server 40 issues, and to the corresponding standby command of hardware layer transmission, to control and to make this physical host enter the ACPI-S3 state;
Under another kind of implementation, virtual machine monitoring unit VMM 12 specifically is used for: when the associated virtual machine of reporting information belongs to the classification of can not leaving unused, determine that then current being in of this virtual machine can not idle state, and to management server 40 output expression can not idle state virtual machine state information, and be used for the standby command that receiving management server 40 issues, and to the corresponding standby command of hardware layer transmission, to control and to make this physical host enter the ACPI-S3 state;
Should be understood that the granularity of the category division of virtual machine is not limited to: the classification of can leaving unused and the classification of can not leaving unused.Under the situation of more fine-grained management, the classification of can leaving unused can further be divided into different subclass, A for example, B, C.
But about the as above description of the specific implementation reference method embodiment of functional unit.
Each unit of embodiment of the invention device can be integrated in one, and also can separate deployment.Said units can be merged into a unit, also can further split into a plurality of subelements.
In sum, the embodiment of the invention provides a kind of physical host, disposes probe in each virtual machine, collects the particular event information of corresponding virtual machine by probe; Virtual machine monitoring unit VMM is according to the particular event information of the virtual machine of described probe collection and the idle strategy of virtual machine that obtains, determine the current state of the virtual machine that described particular event information is associated, and to described management server output corresponding virtual machine status information; When all virtual machines of the host of institute are idle state on management server perceives by host's physical host, sent standby command to this by host's physical host; VMM receives the standby command that described management server issues, and sends corresponding standby command to hardware layer, to control and to make this physical host enter the holding state that suspends to internal memory; As seen, scheme by the embodiment of the invention, can identify the operating position of virtual machine, thereby for example, in enterprise After Hours, can make all virtual machines of the host of institute on self be the physical host stand-by energy-saving of idle state, simultaneously, owing to be in the physical host of the holding state that suspends to internal memory, its internal memory power supply, internal storage state information completely; Professional main frame is waken up, the directly internal memory operation from hanging up, return to the preceding state of standby rapidly, so when reaching energy-saving effect, when avoiding for example enterprise's working, a large amount of virtual machines " thermophoresis " or a large amount of virtual machine load the network traffic congestion phenomenon that causes, and then have guaranteed the reliable and stable and high-performance of virtual machine, have improved the end-user experience satisfaction.Further, by embodiment of the invention scheme, for example at still needing work those nights, be marked as the virtual machine of " non-idle state ", can " thermophoresis " to other professional main frame; Because this type of virtual machine negligible amounts in the desktop virtual system of the embodiment of the invention, " thermophoresis " can not produce the network traffic congestion phenomenon.
See also Fig. 4, be the structural representation of a kind of management server of the embodiment of the invention, as shown in Figure 4, management server 40 comprises policy management element 41 and cloud administrative unit 42, wherein:
Policy management element 41, it is idle tactful to be used for managing virtual machines, and issues the idle strategy of this virtual machine to physical host, and the idle strategy of this virtual machine supplies described physical host in order to determine the state of host's virtual machine on this physical host; Need to prove, when generally being system initialization, issue the idle strategy of virtual machine by policy management element 41.The particular content of the idle strategy of the virtual machine here sees also previous embodiment, repeats no more here.
Cloud administrative unit 42, when the state that is used for all virtual machines of the host of institute on the virtual machine state information that obtains is represented by host's physical host is idle state, sent standby command to this by host's physical host, described standby command is used for control and makes this physical host enter the holding state that suspends to internal memory.Wherein, described virtual machine state information represents that virtual machine is in " idle state " or " non-idle state ";
Under a kind of implementation, policy management element 41 is further used for the managing virtual machines migration strategy; The particular content of the virtual machine (vm) migration strategy here sees also previous embodiment, repeats no more here.
Cloud administrative unit 42 is further used for: according to the virtual machine state information and the virtual machine (vm) migration strategy that obtain, determine to need virtual machine and the professional main frame of migration purpose that being in of migration can not idle state, and send the migration order to the virtual machine host's of needs migration physical host; Wherein, described migration order comprises the virtual machine sign ID of needs migration and the destination host information of migration.The virtual machine sign ID here is unique character string sequence that VMM distributes for each virtual machine, is used for the unique identification virtual machine; For example, under the Xen framework, be called uuid; The destination host information of the migration here specifically can be the IP address of the professional main frame of purpose.
Under a kind of implementation, cloud administrative unit 42 is further used for: the response user logins the operational order of virtual machine, issues to this virtual machine host's physical host and wakes instruction up, but describedly wake instruction up and be used for making this virtual machine enter operation state; Need to prove, shown in Fig. 1 b, the user logins corresponding virtual machine by SC or TC, corresponding operational order is delivered to management server 40 (specifically being cloud administrative unit 42), and management server 40 (specifically being cloud administrative unit 42) responds this operational order, to this virtual machine host's physical host 10,20,30 issue and wake instruction up, specifically are to issue to the hardware layer of this virtual machine host's physical host by internet message to wake instruction up, describedly wake instruction up and wake instruction up for network interface card.
In actual applications, the management server of the embodiment of the invention can be physical server or virtual machine.
But about the as above description of the specific implementation reference method embodiment of functional unit.
Each unit of embodiment of the invention device can be integrated in one, and also can separate deployment.Said units can be merged into a unit, also can further split into a plurality of subelements.
In sum, the embodiment of the invention provides a kind of management server, when the state of all virtual machines of the host of institute is " idle state " state on the virtual machine state information that obtains is represented by host's physical host, sent standby command to this by host's physical host, make to respond this standby command by physical host to enter the holding state that suspends to internal memory be the ACPI-S3 state; As seen, by the scheme of the embodiment of the invention, can make partial service main frame stand-by energy-saving, simultaneously, owing to be in the professional main frame of ACPI-S3 state, its internal memory power supply, internal storage state information completely; Professional main frame is waken up, the directly internal memory operation from hanging up, return to the preceding state of standby rapidly, so when reaching energy-saving effect, when avoiding for example enterprise's working, a large amount of virtual machines " thermophoresis " or a large amount of virtual machine load the network traffic congestion phenomenon that causes, and then have guaranteed the reliable and stable and high-performance of virtual machine, have improved the end-user experience satisfaction.
Further, by embodiment of the invention scheme, for example at still needing work those nights, be marked as the virtual machine of " non-idle state ", can " thermophoresis " to other professional main frame; Because this type of virtual machine negligible amounts in the desktop virtual system of the embodiment of the invention, " thermophoresis " can not produce the network traffic congestion phenomenon.
See also Fig. 5, the schematic flow sheet of the power-economizing method under a kind of desktop virtual environment is provided for the embodiment of the invention, this method can be applied to the physical host in the desktop virtual system shown in Fig. 1 a and 1b, this physical host comprises: hardware layer, operate in virtual machine monitoring unit VMM and at least one virtual machine that operates on the virtual machine monitoring unit VMM on the hardware layer, and at least one probe, as shown in Figure 5, this method can comprise the steps:
S501, the particular event information of collecting corresponding virtual machine by probe;
The particular event information of the virtual machine that S502, basis are collected, and the idle strategy of the virtual machine that obtains, determine the current state of the virtual machine that this particular event information is associated, to management server output corresponding virtual machine status information, wherein, described virtual machine state information represents that virtual machine is in idle state or non-idle state;
Here the acquisition mode of the idle strategy of virtual machine, it can be the idle strategy of virtual machine that management server initiatively issues, also can be the idle strategy of virtual machine that management server answers the request of physical host to issue, also can be the idle strategy of predetermined virtual machine, etc.
The idle strategy of the virtual machine here comprises: a kind of or combination in any in virtual machine section standby time, the idle classification of virtual machine, the idle decision condition of virtual machine hardware use information and idle these the four kinds of conditions of decision condition of virtual machine user operation information; Specifically can determine flexibly according to practical application.Detailed description for the idle strategy of virtual machine please refer to previous embodiment, repeats no more here.
The standby command that S503, receiving management server send, and send corresponding standby command to hardware layer is with control and to make this virtual machine host's physical host enter the holding state that suspends to internal memory be the ACPI-S3 state.
Under a kind of implementation, S501 specifically comprises: collect the hardware of described virtual machine and use information and/or user's operation information by being embedded in probe in the corresponding virtual machine; Accordingly, S502 specifically comprises: according to hardware use information and/or the user's operation information of corresponding virtual machine and the idle strategy of virtual machine that management server provides of the corresponding virtual machine of collecting, determine the current state of the virtual machine that described hardware use information and/or user's operation information are associated, to described management server output corresponding virtual machine status information.
Under another kind of implementation, S501 specifically comprises: the user's operation information of collecting corresponding virtual machine by the front end probe that is deployed in the corresponding virtual machine, and collect the hardware of corresponding virtual machine and use information by being deployed in rear end probe among the virtual machine monitoring unit VMM; Accordingly, S502 specifically comprises: the idle strategy of virtual machine that the user's operation information of the corresponding virtual machine of collecting according to described front end probe and the hardware of the corresponding virtual machine that described rear end probe is collected use information and management server to provide, determine the current state of the virtual machine that described hardware use information and user's operation information are associated, to described management server output corresponding virtual machine status information.
Preferable, in the method for the embodiment of the invention, further comprise: the migration order that the receiving management server sends, the virtual machine sign ID corresponding virtual machine that comprises in the described migration order is moved on the professional main frame of purpose of the professional host information correspondence of purpose that comprises in the described migration order.Wherein, described migration order comprises the virtual machine sign ID of needs migration and the destination host information of migration.The virtual machine sign ID here is unique character string sequence that VMM distributes for each virtual machine, is used for the unique identification virtual machine; As, under the Xen framework, be called uuid; The destination host information of migration specifically can be the IP address of the professional main frame of purpose.
Further, the method of the embodiment of the invention further comprises: the receiving management server sends wakes instruction up, respond this and wake instruction up, the internal memory that operation is hung up, activate the corresponding virtual machine, but make this virtual machine enter operation state, operation that the user logins virtual machine issues for management server responds in the instruction that wakes up here.
The hardware use information of described virtual machine is represented the hardware event that takes place on the described virtual machine, and described hardware event comprises: one or more in mouse event, KeyEvent, network I/O event and the magnetic disc i/o event; The user's operation information of described virtual machine is represented the Action Events that takes place on the described virtual machine, and described Action Events comprises: one or more in idle operation, standby operation, sleep operation and the opening operation that the user carries out virtual machine;
The idle strategy of described virtual machine comprises: a kind of or combination in any in virtual machine section standby time, the idle classification of virtual machine, the idle decision condition of virtual machine hardware use information and the idle decision condition of virtual machine user operation information;
Wherein, described virtual machine section standby time refers to the time section that virtual machine can leave unused; Whether the idle classification of described virtual machine refers to virtual machine and can leave unused; The idle decision condition of described virtual machine hardware use information refers to according to described virtual machine hardware and uses the occurrence frequency of the represented hardware event of information to judge whether virtual machine can leave unused; The idle decision condition of described virtual machine user operation information refers to judges whether the virtual machine that is performed the represented operation of described virtual machine user operation information can leave unused.Concrete content and realization can repeat no more here with reference to the description of previous embodiment.
Under a kind of implementation, the idle strategy of virtual machine that uses information and/or user's operation information and obtain according to the hardware collected, determine the current state of the virtual machine that this hardware use information and/or user's operation information are associated, to management server output corresponding virtual machine status information, specifically comprise:
When using information and/or the associated virtual machine of user's operation information, the hardware of collecting belongs to the classification of to leave unused, and current slot is in the first standby time section, and hardware event does not take place in first threshold in the time in this virtual machine, perhaps, the hardware event occurrence frequency is less than the first threshold frequency, perhaps, this virtual machine is performed idle operation, perhaps the operation and this operation that are performed in the scheduled operation scope of this virtual machine can be alternative with " leave unused " operation, but then determine the current idle state that is in of this virtual machine, and represent the virtual machine state information of idle state to management server output; The hardware event here comprises one or more in mouse event, KeyEvent, network I/O event and the magnetic disc i/o event;
Perhaps, when using information and/or the associated virtual machine of user's operation information, the hardware of collecting belongs to the classification of to leave unused, and current slot is in the second standby time section, and hardware event does not take place in this virtual machine in second threshold time, perhaps, the hardware event occurrence frequency is less than second threshold frequency, perhaps, this virtual machine is performed idle operation, perhaps the operation and this operation that are performed in the scheduled operation scope of this virtual machine can be alternative with " leave unused " operation, but then determine the current idle state that is in of this virtual machine, and represent the virtual machine state information of idle state to management server output; Wherein, described scheduled operation scope comprises standby operation, sleep operation or opening operation.
Perhaps, when using information and/or the associated virtual machine of user's operation information, the hardware of collecting belongs to the classification of to leave unused, and operation and this operation that this virtual machine is performed in the scheduled operation scope can not substitute with " leaving unused " operation, determine that then current being in of this virtual machine can not idle state, and to management server output expression can not idle state virtual machine state information;
Perhaps, when using information and/or the associated virtual machine of user's operation information, the hardware of collecting belongs to the classification of to leave unused, determine that then current being in of this virtual machine can not idle state, and to management server output expression can not idle state virtual machine state information.
In sum, the embodiment of the invention provides the power-economizing method under a kind of desktop virtual environment, disposes probe in each virtual machine, collects the particular event information of corresponding virtual machine by probe; The particular event information of the virtual machine of collecting according to described probe and the idle strategy of virtual machine that management server provides are determined the current state of the virtual machine that described particular event information is associated, and to management server output corresponding virtual machine status information; When the standby command of receiving that management server issues, send corresponding standby command to hardware layer, to control and to make this physical host enter the holding state that suspends to internal memory; As seen, scheme by the embodiment of the invention, can identify the operating position of virtual machine, thereby for example, in enterprise After Hours, can make all virtual machines of the host of institute on self be the physical host stand-by energy-saving of idle state, simultaneously, owing to be in the physical host of the holding state that suspends to internal memory, its internal memory power supply, internal storage state information completely; Professional main frame is waken up, the directly internal memory operation from hanging up, return to the preceding state of standby rapidly, so when reaching energy-saving effect, when avoiding for example enterprise's working, a large amount of virtual machines " thermophoresis " or a large amount of virtual machine load the network traffic congestion phenomenon that causes, and then have guaranteed the reliable and stable and high-performance of virtual machine, have improved the end-user experience satisfaction.
Further, by embodiment of the invention scheme, for example at still needing work those nights, be marked as the virtual machine of " non-idle state ", can " thermophoresis " to other professional main frame; Because this type of virtual machine negligible amounts in the desktop virtual system of the embodiment of the invention, " thermophoresis " can not produce the network traffic congestion phenomenon.
Introduce down the method for the embodiment of the invention in detail below in conjunction with practical application:
See also Fig. 6, be the schematic flow sheet of the power-economizing method under another desktop virtual environment of the embodiment of the invention, can be applied in desktop virtual system working environment, in the scene of user's quitting time section internal trigger virtual machine standby flow process, as shown in Figure 6, this method comprises:
S601, flow process begin;
In original state, the virtual machine operation on the professional main frame is normal.
S602, user are by TC (Thin Client, thin client) or SC (Software Client, software terminal) accesses virtual machine desktop, and manual execution virtual machine leaves unused and operates;
Need to prove that described virtual machine can provide " leaving unused " option of operation or menu, initiatively carry out the virtual machine operation of " leaving unused " for the user;
The probe that embeds in the virtual machine of S603, professional main frame is collected the hardware use information of this virtual machine and the user's operation information of this virtual machine, and uses information and user's operation information to pass to the VMM of professional main frame on the hardware of this virtual machine;
In the present embodiment, the hardware use information of this virtual machine is represented the hardware event that takes place on this virtual machine, described hardware event comprises mouse event, KeyEvent, network I/O event and magnetic disc i/o event etc., the user's operation information of this virtual machine represents that the Action Events that takes place on the described virtual machine, this Action Events are " leaving unused " Action Events that the user carries out virtual machine.
Need to prove, do not have clear and definite precedence relationship between the S602 here and the S603, should be understood that, behind virtual machine activation, collect action and carry out always;
The VMM of S604, professional main frame uses information and virtual machine user operation information and in conjunction with the idle strategy of virtual machine that management server issues, determines the state of virtual machine on this VMM layer according to virtual machine hardware, and notice management server virtual machine state information; Wherein, virtual machine state information represents that the corresponding virtual machine is in " idle state ", perhaps " non-idle state ";
Whether all virtual machines that S605, management server are monitored host on this business main frame all are in idle state, when the virtual machine state information that obtains represents that the minority virtual machine of host on this business main frame is in " non-idle state ", change step S606; Otherwise, when the virtual machine state information that obtains represents that all virtual machines of host on this business main frame all are in " idle state ", change step S609;
Need to prove that the monitoring here can be periodic monitor, also can be cycle monitoring, also can be real-time monitoring.
S607, judge whether host's the virtual machine that is in " non-idle state " satisfies the virtual machine (vm) migration strategy on this physical host, when not satisfying, change step S605; Otherwise, change step S607;
Described virtual machine (vm) migration strategy comprises: virtual machine (vm) migration time section, virtual machine (vm) migration decision condition and the selected condition of migration target service main frame; Introduction about the particular content of virtual machine (vm) migration strategy sees also previous embodiment, repeats no more here:
Illustrate: if current slot is in the virtual machine (vm) migration time section, on this physical host the host be in " non-idle state " virtual machine number less than 2 and this physical host on total virtual machine number of host greater than default mean virtual machine number, and have non-idle state in the desktop virtual system " virtual machine proportion is the highest and resource utilization is minimum another physical host, then host's " non-idle state " virtual machine that is in satisfies the virtual machine (vm) migration strategy on this physical host; Otherwise then host's " non-idle state " virtual machine that is in does not satisfy the virtual machine (vm) migration strategy on this physical host.
S607, management server send the migration order to the VMM of this physical host;
Wherein, described migration order comprises the virtual machine sign ID of needs migration and the destination host information of migration.The virtual machine sign ID here is unique character string sequence that VMM distributes for each virtual machine, is used for the unique identification virtual machine; As under the Xen framework, being called uuid; The destination host information of migration specifically can be the IP address of the professional main frame of purpose.
The VMM of S608, this physical host responds this migration order, and " non-idle state " virtual machine (being described virtual machine sign ID corresponding virtual machine) that is in of host on this physical host is moved on the professional main frame of " non-idle state " purpose that virtual machine proportion is the highest and resource utilization is minimum (being the professional main frame of purpose of the professional host information correspondence of described purpose).
S609, management server issue standby command to the VMM of this business main frame;
After the VMM of S610, this business main frame receives standby command, issue corresponding standby command to the processor of the hardware layer of this business main frame, with control and make this physical host enter the holding state that suspends to internal memory;
S611, this physical host enter the holding state that suspends to internal memory;
The processor that the holding state here refers to professional main frame operates in the ACPI-S3 pattern, and except internal memory kept activating, all the other equipment such as processor, hard disk, network interface card all descended electricity, or with faint electric weight operation;
S612, flow process finish.
In sum, the embodiment of the invention provides the power-economizing method under a kind of desktop virtual environment, one " probe " is set in virtual machine, collect virtual machine hardware by " probe " and use information and/or virtual machine user operation information, use the idle strategy of information and/or user's operation information and virtual machine according to described hardware, determine the current state of virtual machine, and output virtual machine state information, wherein, described state comprises " idle state " or " non-idle state "; And receiving the standby command that issues, send standby command to hardware layer, to control and to make this physical host enter the ACPI-S3 state; As seen, by the scheme of the embodiment of the invention, can identify the operating position of virtual machine, thereby for example, in enterprise After Hours, can make partial service main frame stand-by energy-saving, simultaneously, owing to be in the professional main frame of ACPI-S3 state, its internal memory power supply, internal storage state information completely; Professional main frame is waken up, the directly internal memory operation from hanging up, return to the preceding state of standby rapidly, so when reaching energy-saving effect, when avoiding for example enterprise's working, a large amount of virtual machines " thermophoresis " or a large amount of virtual machine load the network traffic congestion phenomenon that causes, and then have guaranteed the reliable and stable and high-performance of virtual machine, have improved the end-user experience satisfaction.
Further, by embodiment of the invention scheme, the virtual machine that has only a small amount of " not idle state " on the professional main frame is carried out migration operation, make the virtual machine of these " not idle states " accumulate on the professional main frame of minority, thereby can allow more professional main frame stand-by energy-saving; Because this type of virtual machine negligible amounts in the desktop virtual system of the embodiment of the invention, " migration " can not produce the network traffic congestion phenomenon.
See also Fig. 7, be the schematic flow sheet of the power-economizing method under another desktop virtual environment of the embodiment of the invention, can be applied in desktop virtual system working environment, wake the scene of flow process at user's work hours section internal trigger virtual machine up, as shown in Figure 7, this method comprises:
S701, flow process begin;
S702, be on duty the period, when the user need use virtual machine, at first login terminal, this final link is received on the management server.
The terminal form can be the web page, also can make client-side program.
S703, management server check the state of this virtual machine; When this virtual machine is in idle state, change step S704; Otherwise, change step S707;
S704, management server check the state of this host's of virtual machine institute professional main frame, when this host's of virtual machine institute professional main frame standby, change step S705; Otherwise, change step S706;
S705, management server wake instruction up to the hardware layer transmission of this business main frame, to wake this business main frame up; Describedly wake instruction up and wake instruction up for network interface card;
The promoter treats that to treating that wake-up master sends the packet of a specific format network interface card of wake-up master has special processing of circuit logic to handle this packet, sends starting-up signal by dedicated connection then, notice mainboard starting up.This technology require promoter and the person of being waken up to be in same subnet, and the promoter need know the person's of being waken up MAC Address.
Directly move the internal memory of hanging up after S706, the professional host wake-up, activate certainly host's corresponding virtual machine on one's body, but make this virtual machine enter operation state.
S707, login virtual machine.
S708, flow process finish.
In sum, the embodiment of the invention provides the power-economizing method under a kind of desktop virtual environment, owing to be in the professional main frame of ACPI-S3 state, its internal memory power supply, internal storage state information completely; Professional main frame is waken up, the directly internal memory operation from hanging up, return to the preceding state of standby rapidly, so when reaching energy-saving effect, when avoiding for example enterprise's working, a large amount of virtual machines " thermophoresis " or a large amount of virtual machine load the network traffic congestion phenomenon that causes, and then have guaranteed the reliable and stable and high-performance of virtual machine, have improved the end-user experience satisfaction.
Need to prove, the saying of first, second that previous embodiment adopts in describing, the meaning of unqualified order is only distinguished for convenient.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, be to instruct relevant hardware (as processor) to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
The above only is the specific embodiment of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.