CN104391736A - Method for setting up sleep mode of virtual machine and device - Google Patents

Method for setting up sleep mode of virtual machine and device Download PDF

Info

Publication number
CN104391736A
CN104391736A CN201410689734.5A CN201410689734A CN104391736A CN 104391736 A CN104391736 A CN 104391736A CN 201410689734 A CN201410689734 A CN 201410689734A CN 104391736 A CN104391736 A CN 104391736A
Authority
CN
China
Prior art keywords
virtual machine
described virtual
idle condition
resource service
conditioned
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201410689734.5A
Other languages
Chinese (zh)
Other versions
CN104391736B (en
Inventor
周磊
钱国新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Hangzhou Huawei Digital Technologies Co Ltd
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 Hangzhou Huawei Digital Technologies Co Ltd filed Critical Hangzhou Huawei Digital Technologies Co Ltd
Priority to CN201410689734.5A priority Critical patent/CN104391736B/en
Publication of CN104391736A publication Critical patent/CN104391736A/en
Application granted granted Critical
Publication of CN104391736B publication Critical patent/CN104391736B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention provides a method for setting up a sleep mode of a virtual machine and a device, wherein the method comprises the following steps: confirm whether the virtual machine running at present is in an idle state; when the virtual machine is in the idle state, set up the virtual machine to be in the sleep mode. Therefore, the virtual machine does not occupy the internal storage and CPU of a physical host any more, and thus saves the quantity of electricity consumed by the physical host.

Description

The park mode method to set up of virtual machine and device
Technical field
The embodiment of the present invention relates to communication technical field, particularly relates to a kind of park mode method to set up and device of virtual machine.
Background technology
Server virtualization technology is the gordian technique based on infrastructure layer in cloud computing.This technology, by carrying out virtual to the resource of physical server, realizes in single server deploy multiple stage virtual machine (English: Virtual Machine, abbreviation: VM), thus the resource utilization improving server, reduction use cost.Virtual cluster is that multiple stage virtual machine is formed an organic whole, carry out unified management, by Intel Virtualization Technology by abstract for the physical resource resource pool for the various resource composition such as storage, calculating, network, provide virtual machine to user by the mode of on-demand application resource; Wherein, a key property of virtual cluster is that (English: Dynamic Resources Scheduling is called for short: DRS) dynamic resource scheduling.
In prior art, the DRS of virtual cluster generally comprises load balancing and distributed power supply management (English: Distributed power management, abbreviation: DPM) two processes.The detailed process of DRS is: trigger DRS by timer or event and dispatch, and checks current virilization cluster load balance degree, if load balancing degrees does not meet the threshold value of user's setting, then carries out load balancing, balancing cluster load; After load balancing is complete, then perform DPM, be divided into Gao Zaiqu and Di Zai district by All hosts, main frame in Gao Zai district is powered on assessment, lower electricity assessment is carried out to main frame in Di Zai district; The suggestion that load balancing and DPM produce above is carried out integrating and performing.
But a lot of virtual machine is in idle condition in some time period, these virtual machines still occupy internal memory and central processing unit (English: Central Processing Unit, abbreviation: CPU), cause server electric energy serious waste.
Summary of the invention
The embodiment of the present invention provides a kind of park mode method to set up and device of virtual machine, for saving the electric quantity consumption of physical host.
First aspect, the embodiment of the present invention provides a kind of park mode method to set up of virtual machine, comprising: determine whether the virtual machine of current operation is in idle condition;
When described virtual machine is in idle condition, arranging described virtual machine is park mode.
In the first possible implementation of first aspect, describedly determine whether the virtual machine of current operation is in idle condition, comprising:
Determine whether the resource service condition of the described virtual machine of current operation meets pre-conditioned, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the central processor CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk;
When the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition;
When the resource service condition of described virtual machine do not meet described pre-conditioned time, determine that described virtual machine is not in idle condition.
In conjunction with the first possible implementation of first aspect, in the implementation that the second of first aspect is possible, the described resource service condition when described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprising:
When the resource service condition of described virtual machine meet described pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.
In conjunction with the first possible implementation of first aspect or the possible implementation of the second of first aspect, in the third possible implementation of first aspect, the described resource service condition when described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprising:
When the resource service condition of described virtual machine meets the described pre-conditioned and input operation do not existed within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.
In conjunction with the first of first aspect or first aspect to the third possible implementation any one, in the 4th kind of possible implementation of first aspect, described determine whether the virtual machine of current operation is in idle condition before, also comprise:
Determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation.
In conjunction with the first of first aspect or first aspect to the 4th kind of possible implementation any one, in the 5th kind of possible implementation of first aspect, describedly determine whether the virtual machine of current operation is in idle condition and comprises:
When default timing arrives, determine whether described virtual machine is in idle condition.
In conjunction with the first of first aspect or first aspect to the 5th kind of possible implementation any one, in the 6th kind of possible implementation of first aspect, described to arrange described virtual machine be park mode, comprising:
Suspend the operation work of described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
In conjunction with the first of first aspect or first aspect to the 6th kind of possible implementation any one, in the 7th kind of possible implementation of first aspect, if the quantity being in the virtual machine of idle condition current is multiple, and described to arrange described virtual machine be park mode, comprising:
According to the priority order from high to low of described virtual machine, setting gradually described virtual machine is park mode.
In conjunction with the first of first aspect or first aspect to the 7th kind of possible implementation any one, in the 8th kind of possible implementation of first aspect, describedly arrange after described virtual machine is park mode, also comprise:
When arriving the default start-up time of described virtual machine, described virtual machine is set for running mode of operation.
Second aspect, the embodiment of the present invention provides a kind of park mode setting device of virtual machine, comprising:
Determining unit, for determining whether the virtual machine of current operation is in idle condition;
Processing unit, for when described determining unit determines that described virtual machine is in idle condition, arranging described virtual machine is park mode.
In the first possible implementation of second aspect, described determining unit specifically for, determine whether the resource service condition of the described virtual machine of current operation meets pre-conditioned, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the central processor CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk; When the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition; When the resource service condition of described virtual machine do not meet described pre-conditioned time, determine that described virtual machine is not in idle condition.
In conjunction with the first possible implementation of second aspect, in the implementation that the second of second aspect is possible, described determining unit is used for, when determine the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprise: described determining unit specifically for, when determine the resource service condition of described virtual machine meet pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.
In conjunction with the first possible implementation of second aspect or the possible implementation of the second of second aspect, in the third possible implementation of second aspect, described determining unit is used for, when determining that the resource service condition of described virtual machine meets pre-conditioned, determine that described virtual machine is in idle condition, comprise: described determining unit specifically for, when determining that the resource service condition of described virtual machine meets the described pre-conditioned and input operation do not existed within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.
In conjunction with the first of second aspect or second aspect to the third possible implementation any one, in the 4th kind of possible implementation of second aspect, described determining unit, also for before determining whether the described virtual machine of current operation is in idle condition, determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation.
In conjunction with the first of second aspect or second aspect to the 4th kind of possible implementation any one, in the 5th kind of possible implementation of second aspect, described determining unit is for determining whether the described virtual machine of current operation is in idle condition and comprises: described determining unit specifically for, when default timing arrives, determine whether described virtual machine is in idle condition.
In conjunction with the first of second aspect or second aspect to the 5th kind of possible implementation any one, in the 6th kind of possible implementation of second aspect, described processing unit specifically for, suspend the operation work of described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
In conjunction with the first of second aspect or second aspect to the 6th kind of possible implementation any one, in the 7th kind of possible implementation of second aspect, if the current quantity being in the virtual machine of idle condition that described determining unit is determined is multiple, described processing unit specifically for, according to the priority order from high to low of described virtual machine, setting gradually described virtual machine is park mode.
In conjunction with the first of second aspect or second aspect to the 7th kind of possible implementation any one, in the 8th kind of possible implementation of second aspect, described processing unit is also for after arranging described virtual machine and being park mode, when arriving the default start-up time of described virtual machine, described virtual machine is set for running mode of operation.
The embodiment of the present invention provides a kind of park mode method to set up and device of virtual machine, and during by determining that the virtual machine of current operation is in idle condition, arranging described virtual machine is park mode.Make this virtual machine no longer take internal memory and the CPU of physical host, thus save the electric quantity consumption of physical host.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of the park mode method to set up embodiment one of virtual machine of the present invention;
Fig. 2 is the process flow diagram of the park mode method to set up embodiment two of virtual machine of the present invention;
Fig. 3 is the process flow diagram of the park mode method to set up embodiment three of virtual machine of the present invention;
Fig. 4 is the structural representation of the park mode setting device embodiment one of virtual machine of the present invention;
Fig. 5 is the structural representation of the park mode setting device embodiment two of virtual machine of the present invention.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the process flow diagram of the park mode method to set up embodiment one of virtual machine of the present invention, and as shown in Figure 1, the method for the present embodiment can comprise:
S101, determine whether the virtual machine of current operation is in idle condition.
S102, when described virtual machine is in idle condition, arranging described virtual machine is park mode.
In the present embodiment, can determination portion to be deployed on physical host and whether the current virtual machine running duty that is in is in idle condition.When determining this virtual machine process idle condition, namely representing does not have user to use this virtual machine, now this virtual machine being in idle condition can take internal memory and the CPU of physical host, the power consumption of this physical host is caused to increase, therefore in order to save the electric quantity consumption of physical host, this virtual machine is set to park mode, and the virtual machine of process park mode will not take internal memory and the CPU of physical host, and then can save the electric quantity consumption of physical host.When determining that this virtual machine is not in idle condition, then this virtual machine is left intact, process ends.
Alternatively, when default timing arrives, determine whether described virtual machine is in idle condition.When current time is for presetting timing, then determine whether the virtual machine of current operation is in idle condition.Such as, performed at interval of one hour in 12:00 ~ morning 6:00 in evening and determine whether the virtual machine of current operation is in the step of idle condition, default timing can comprise 12:00 in evening, morning 1:00, morning 2:00, morning 3:00, morning 4:00, morning 5:00, morning 6:00.
In a kind of feasible implementation, described this virtual machine that arranges is that park mode comprises: the operation work suspending described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
Alternatively, if when determining that the current quantity being in the virtual machine of idle condition is multiple, can according to the priority of virtual machine order from high to low, setting gradually virtual machine is dormant state.Such as: the quantity being in the virtual machine of idle condition if current is 3, be respectively virtual machine 1, virtual machine 2, virtual machine 3, and the priority of virtual machine 3 is greater than the priority of virtual machine 2, the priority of virtual machine 2 is greater than the priority of virtual machine 1, virtual machine 3 can be first set for dormant state, virtual machine 2 is set for dormant state again, then virtual machine 3 is set for dormant state.Multiple virtual machine is set gradually for dormant state can avoid excessive input/output port (English: Input/Output, abbreviation: I/O) load.
The park mode method to set up of the virtual machine that the embodiment of the present invention provides, during by determining that the virtual machine of current operation is in idle condition, arranging described virtual machine is park mode.Make this virtual machine no longer take internal memory and the CPU of physical host, thus save the electric quantity consumption of physical host.
Fig. 2 is the process flow diagram of the park mode method to set up embodiment two of virtual machine of the present invention, and as shown in Figure 2, the method for the present embodiment can comprise:
S201, determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned.If not, then perform S202, if so, then perform S203.
In the present embodiment, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk.If when determining that the virtual machine of current operation does not meet pre-conditioned, performing S202, when determining that the virtual machine of current operation meets pre-conditioned, performing S203.
If the resource service condition of Dummy comprises the occupancy of the CPU of virtual machine, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the occupancy of the CPU of the virtual machine of current operation is less than default occupancy threshold value.If be less than, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, if be not less than, then determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
If the resource service condition of virtual machine comprises the rate of change of the use value of the internal memory of virtual machine, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the rate of change of the use value of the internal memory of the virtual machine of current operation is less than default rate of change threshold value.If be less than, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, if be not less than, then determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
If the resource service condition of virtual machine comprises the operating frequency of virtual machine to disk, wherein, this disk is the disk of the physical host that this virtual machine takies, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the virtual machine of current operation is less than predetermined registration operation frequency threshold to the operating frequency of disk.If be less than, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, if be not less than, then determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
If the resource service condition of virtual machine comprises the rate of change of the use value of the occupancy of the CPU of virtual machine and the internal memory of virtual machine, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the occupancy of the CPU of the virtual machine of current operation is less than default occupancy threshold value, and whether the rate of change of the use value of the internal memory of the virtual machine of current operation is less than default rate of change threshold value.If the occupancy of CPU is less than default occupancy threshold value, and the rate of change of the use value of internal memory is less than default rate of change threshold value, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, otherwise determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
If the resource service condition of virtual machine comprises the occupancy of the CPU of virtual machine and virtual machine to the operating frequency of disk, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the occupancy of the CPU of the virtual machine of current operation is less than default occupancy threshold value, and whether the virtual machine of current operation is less than predetermined registration operation frequency threshold to the operating frequency of disk.If the occupancy of CPU is less than default occupancy threshold value, and the operating frequency of virtual machine to disk is less than predetermined registration operation frequency threshold, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, otherwise determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
If the resource service condition of virtual machine comprises the rate of change of the use value of the internal memory of virtual machine and virtual machine to the operating frequency of disk, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the rate of change of the use value of the internal memory of the virtual machine of current operation is less than default rate of change threshold value, and whether the virtual machine of current operation is less than predetermined registration operation frequency threshold to the operating frequency of disk.If the rate of change of the use value of internal memory is less than default rate of change threshold value, and the operating frequency of virtual machine to disk is less than predetermined registration operation frequency threshold, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, otherwise determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
If the resource service condition of virtual machine comprises the occupancy of the CPU of virtual machine, the rate of change of use value of the internal memory of virtual machine and virtual machine to the operating frequency of disk, then determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned comprising: determine whether the virtual machine whether rate of change that whether occupancy of the CPU of the virtual machine of current operation is less than the use value of the internal memory of the virtual machine of default occupancy threshold value and current operation is less than default rate of change threshold value and current operation is less than predetermined registration operation frequency threshold to the operating frequency of disk.If the rate of change that the occupancy of CPU is less than the use value of default occupancy threshold value and internal memory is less than default rate of change threshold value and the operating frequency of virtual machine to disk is less than predetermined registration operation frequency threshold, then determine that the resource service condition of the virtual machine of current operation meets pre-conditioned, otherwise determine that the resource service condition of the virtual machine of current operation does not meet pre-conditioned.
S202, determine that described virtual machine is not in idle condition.
In the present embodiment, when determining that the resource service condition of virtual machine does not meet pre-conditioned, determine that this virtual machine is not in idle condition, then do not need virtual machine to be set to dormant state, then process ends.
S203, determine that described virtual machine is in idle condition.
In the present embodiment, when determining that the resource service condition of virtual machine meets pre-conditioned, determine that this virtual machine is in idle condition, then need virtual machine to be set to dormant state, then perform S204.
S204, to arrange described virtual machine be park mode.
Particularly, the operation work of described virtual machine can be suspended, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
Alternatively, the method for the present embodiment can also comprise:
S205, when arriving the default start-up time of described virtual machine, arrange described virtual machine for run mode of operation.
In the present embodiment, after virtual machine is set to park mode, if when current time arrives and presets start-up time, this virtual machine can be set to run mode of operation, by the internal memory of the date restoring to this virtual machine that belong to this virtual machine in hard disk and recover the operation context data of this virtual machine.This default start-up time can be the time that user often starts this virtual machine.
If preset start-up time when arriving, to need to recover virtual machine be the quantity of the virtual machine running mode of operation when being multiple, then put in queue by the plurality of virtual machine, successively the plurality of virtual machine is reverted to operation mode of operation.Particularly, according to the priority of virtual machine order from high to low, virtual machine can be set gradually for running mode of operation.
In current time, user is had to manually boot a virtual machine, but the default start-up time of this virtual machine is not when arriving, then give start-up by hand mark on this virtual machine band, the priority of the virtual machine with start-up by hand mark is set to the highest, according to priority from when setting gradually this virtual machine to low order for running mode of operation, at first user's virtual machine manually is initiatively set to run mode of operation.
Alternatively, the described resource service condition when described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprise: when the resource service condition of described virtual machine meet pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.It should be noted that, determine current whether exist user log in described virtual machine with determine whether the resource service condition of virtual machine meets pre-conditioned execution sequence in no particular order.
Alternatively, when the resource service condition of described virtual machine meets pre-conditioned, determine that described virtual machine is in idle condition, comprise: when the resource service condition of described virtual machine meets input operation that is pre-conditioned and that do not exist within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.It should be noted that, determine current whether exist user log in described virtual machine with determine whether to exist within the predetermined registration operation time to the execution sequence of the input operation of described virtual machine in no particular order.
Alternatively, when the resource service condition of described virtual machine meets pre-conditioned, determine that described virtual machine is in idle condition, comprise: pre-conditioned, currently there is not user when the resource service condition of described virtual machine meets and log in described virtual machine and the input operation that do not exist within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.It should be noted that determine currently whether there is user and log in described virtual machine, determine whether the resource service condition of virtual machine meets pre-conditioned and determine whether to exist within the predetermined registration operation time to the execution sequence of the input operation of described virtual machine in no particular order.
Alternatively, described determine whether the virtual machine of current operation is in idle condition before, also comprise: determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that current needs that user is arranged are in the virtual machine running mode of operation.Particularly, when user wishes to retain virtual machine for running mode of operation, then user can arrange certain user and makes an exception the time period, wherein, this user can use unified application programming interface (English: Application Programming Interface, be called for short: API) interface arranges and retains virtual machine and be in and run the user of mode of operation and make an exception the time period, thus can avoid the restriction of the method that this embodiment of the present invention provides.Such as, make an exception in the time period if current time falls into user, then can determine that user needs to retain virtual machine is that to run the virtual machine of mode of operation be the first virtual machine, therefore, before determining whether the virtual machine of current operation is in idle condition, determine that this virtual machine is current and whether belong to the first virtual machine, if this virtual machine belongs to the first virtual machine, then illustrate that user does not wish that this virtual machine is set to park mode, then do not perform and determine whether this virtual machine is in the step of idle condition; If this virtual machine does not belong to the first virtual machine, then perform and determine whether this virtual machine is in the step of idle condition.
In the present embodiment, by determining whether the virtual of current operation is in idle condition according to the resource service condition of virtual machine, when this virtual machine is in idle condition, arranging described virtual machine is park mode.Make this virtual machine no longer take internal memory and the CPU of physical host, thus save the electric quantity consumption of physical host.
Fig. 3 is the process flow diagram of the park mode method to set up embodiment three of virtual machine of the present invention, and as shown in Figure 3, the method for the present embodiment can comprise:
S301, when default timing arrives, determine that the virtual machine of current operation is current and whether belong to the first virtual machine.If so, then process ends, if not, then performs S302.
In the present embodiment, when default timing arrives, need the virtual machine some being in idle condition that park mode is set, therefore before determining whether the virtual machine of current operation is in idle condition, need the virtual machine determining current operation whether to belong to the first virtual machine, this first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation, if the virtual machine of current operation belongs to the first virtual machine, then do not need to perform S302, process ends; If the virtual machine of current operation does not belong to the first virtual machine, then perform S302.
S302, determine whether the resource service condition of described virtual machine meets pre-conditioned.If not, then perform S307, if so, then perform S303.
In the present embodiment, determine whether the resource service condition of described virtual machine meets the concrete implementation of S201 in pre-conditioned concrete implementation and the inventive method embodiment two similar, see the relevant record in the inventive method embodiment two, can repeat no more in detail herein.
When determining that the resource service condition of this virtual machine does not meet pre-conditioned, then performing S307, when determining that the resource service condition of this virtual machine meets pre-conditioned, also needing further to perform S303.
S303, determine currently whether there is user and log in described virtual machine.If not, then perform S304, if so, then perform S307.
In the present embodiment, determine currently whether have user to log in this virtual machine, namely judged whether that user connects this virtual machine, if there is user to log in this virtual machine, then illustrate that this virtual machine current has connection, then perform S307, if do not have user to log in this virtual machine, do not connected by explanation this virtual machine current, then perform S304.Wherein, can judge that user logs in this virtual machine by RDP.
S304, determine the input operation that whether exists within the predetermined registration operation time this virtual machine.If not, then perform S305, if so, then perform S307.
In the present embodiment, determine the input operation whether existed within the predetermined registration operation time this virtual machine, it is 15 minutes for the predetermined registration operation time, then determine the input operation whether existed in 15 minutes before current point in time this virtual machine, such as whether at the keyboard operation of depositing this virtual machine or mouse action, if so, then perform S307, if not, then S305 is performed.Wherein, how to realize judging whether that existence has in perception in QEMU analog machine, virtual machine the method for the input operation of this virtual machine and filtration drive etc. is installed.
S305, determine that described virtual machine is in idle condition.
In the present embodiment, when determine the resource service condition of described virtual machine meet pre-conditioned, determine current do not exist user log in described virtual machine and determine the input operation do not existed within the predetermined registration operation time this virtual machine time, determine that this virtual machine is in idle condition.
S306, to arrange described virtual machine be park mode.
In the present embodiment, the specific implementation process of S306 see the relevant record in S205 in S102 in the inventive method embodiment one or the inventive method embodiment two, can repeat no more herein.
S307, determine that described virtual machine is not in idle condition.
In the present embodiment, when determining following at least one: determine the resource service condition of described virtual machine meet pre-conditioned, determine that the current user of existence logs in described virtual machine, determines at predetermined registration operation time memory in the input operation to this virtual machine, time, determine that this virtual machine is not in idle condition.
In the present embodiment, during by determining that the current current needs not belonging to user's setting of the virtual machine of current operation are in the virtual machine running mode of operation, and when determine the resource service condition of this virtual machine meet pre-conditioned, determine current do not exist user log in described virtual machine, determine the input operation do not existed within the predetermined registration operation time this virtual machine time, determine that this virtual machine is in idle condition, then arranging this virtual machine is park mode.Make this virtual machine no longer take internal memory and the CPU of physical host, thus save the electric quantity consumption of physical host.
Fig. 4 is the structural representation of the park mode setting device embodiment one of virtual machine of the present invention, as shown in Figure 4, the device of the present embodiment can comprise: determining unit 11 and processing unit 12, wherein, determining unit 11, for determining whether the virtual machine of current operation is in idle condition; Processing unit 12, for when determining unit 11 determines that described virtual machine is in idle condition, arranging described virtual machine is park mode.
Alternatively, determining unit 11 specifically for, determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk; When the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition; When the resource service condition of described virtual machine do not meet described pre-conditioned time, determine that described virtual machine is not in idle condition.
Alternatively, determining unit 11 for, when determine the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprise: determining unit 11 specifically for, when determine the resource service condition of described virtual machine meet pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.
Alternatively, determining unit 11 for, when determining that the resource service condition of described virtual machine meets pre-conditioned, determine that described virtual machine is in idle condition, comprise: determining unit 11 specifically for, when determining that the resource service condition of described virtual machine meets input operation that is pre-conditioned and that do not exist within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.
Alternatively, determining unit 11, also for before determining whether the virtual machine of current operation is in idle condition, determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation.
Alternatively, determining unit 11 is for determining whether the virtual machine of current operation is in idle condition and comprises: determining unit 11 specifically for, when default timing arrives, determine whether described virtual machine is in idle condition.
Alternatively, processing unit 12 specifically for, suspend the operation work of described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
Alternatively, if the current quantity being in the virtual machine of idle condition that determining unit 11 is determined is multiple, processing unit 12 specifically for, according to the priority order from high to low of described virtual machine, setting gradually described virtual machine is park mode.
Alternatively, processing unit 12, also for after arranging described virtual machine and being park mode, when arriving the default start-up time of described virtual machine, arranges described virtual machine for running mode of operation.
The device of the present embodiment, may be used for the technical scheme performing the above-mentioned each embodiment of the method for the present invention, it realizes principle and technique effect is similar, repeats no more herein.
Fig. 5 is the structural representation of the park mode setting device embodiment two of virtual machine of the present invention, as shown in Figure 5, and storer 21 and processor 22; Wherein, storer 21 is for storing the code of the park mode method to set up performing virtual machine; Storer 21 can comprise nonvolatile memory (Non-volatileMemory).Processor 22 can be a CPU, or specific integrated circuit (English: ApplicationSpecific Integrated Circuit, be called for short: ASIC), or be configured to the one or more integrated circuit implementing the embodiment of the present invention.Processor 22, for calling described code, performs and operates as follows: determine whether the virtual machine of current operation is in idle condition; When described virtual machine is in idle condition, arranging described virtual machine is park mode.
Alternatively, processor 22 is for determining whether the virtual machine of current operation is in idle condition, comprise: processor 22 specifically for, determine whether the resource service condition of the virtual machine of current operation meets pre-conditioned, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk; When the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition; When the resource service condition of described virtual machine do not meet described pre-conditioned time, determine that described virtual machine is not in idle condition.
Alternatively, processor 22 for, when determine the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprise: processor 22 specifically for, when determine the resource service condition of described virtual machine meet pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.
Alternatively, processor 22 for, when determining that the resource service condition of described virtual machine meets pre-conditioned, determine that described virtual machine is in idle condition, comprise: processor 22 specifically for, when determining that the resource service condition of described virtual machine meets input operation that is pre-conditioned and that do not exist within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.
Alternatively, processor 22 also for, before determining whether the virtual machine of current operation is in idle condition, determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation.
Alternatively, processor 22 is for determining whether the virtual machine of current operation is in idle condition and comprises: processor 22 specifically for, when default timing arrives, determine whether described virtual machine is in idle condition.
Alternatively, processor 22 is park mode for arranging described virtual machine, comprise: processor 22 specifically for, suspend the operation work of described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
Alternatively, if processor 22 determines that the current quantity being in the virtual machine of idle condition is multiple, processor 22 is park mode for arranging described virtual machine, comprise: processor 22 specifically for, according to the priority order from high to low of described virtual machine, setting gradually described virtual machine is park mode.
Alternatively, processor 22, also for after arranging described virtual machine and being park mode, when arriving the default start-up time of described virtual machine, arranges described virtual machine for running mode of operation.
The device of the present embodiment, may be used for the technical scheme performing the above-mentioned each embodiment of the method for the present invention, it realizes principle and technique effect is similar, repeats no more herein.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each embodiment of the method can have been come by the hardware that programmed instruction is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: read-only memory is (English: Read-Only Memory, be called for short: ROM), random access memory (English: Random Access Memory, be called for short: RAM), magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (18)

1. a park mode method to set up for virtual machine, is characterized in that, comprising:
Determine whether the virtual machine of current operation is in idle condition;
When described virtual machine is in idle condition, arranging described virtual machine is park mode.
2. method according to claim 1, is characterized in that, describedly determines whether the virtual machine of current operation is in idle condition, comprising:
Determine whether the resource service condition of the described virtual machine of current operation meets pre-conditioned, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the central processor CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk;
When the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition;
When the resource service condition of described virtual machine do not meet described pre-conditioned time, determine that described virtual machine is not in idle condition.
3. method according to claim 2, is characterized in that, the described resource service condition when described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprising:
When the resource service condition of described virtual machine meet described pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.
4. according to the method in claim 2 or 3, it is characterized in that, the described resource service condition when described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprising:
When the resource service condition of described virtual machine meets the described pre-conditioned and input operation do not existed within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.
5. the method according to claim 1-4 any one, is characterized in that, described determine whether the virtual machine of current operation is in idle condition before, also comprise:
Determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation.
6. the method according to claim 1-5 any one, is characterized in that, describedly determines whether the virtual machine of current operation is in idle condition and comprises:
When default timing arrives, determine whether described virtual machine is in idle condition.
7. the method according to claim 1-6 any one, is characterized in that, described to arrange described virtual machine be park mode, comprising:
Suspend the operation work of described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
8. the method according to claim 1-7 any one, is characterized in that, the quantity being in the virtual machine of idle condition if current is multiple, and described to arrange described virtual machine be park mode, comprising:
According to the priority order from high to low of described virtual machine, setting gradually described virtual machine is park mode.
9. the method according to claim 1-8 any one, is characterized in that, describedly arranges after described virtual machine is park mode, also comprises:
When arriving the default start-up time of described virtual machine, described virtual machine is set for running mode of operation.
10. a park mode setting device for virtual machine, is characterized in that, comprising:
Determining unit, for determining whether the virtual machine of current operation is in idle condition;
Processing unit, for when described determining unit determines that described virtual machine is in idle condition, arranging described virtual machine is park mode.
11. devices according to claim 10, it is characterized in that, described determining unit specifically for, determine whether the resource service condition of the described virtual machine of current operation meets pre-conditioned, the resource service condition of described virtual machine comprises following at least one: the rate of change of the occupancy of the central processor CPU of described virtual machine, the use value of internal memory, described virtual machine are to the operating frequency of disk; When the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition; When the resource service condition of described virtual machine do not meet described pre-conditioned time, determine that described virtual machine is not in idle condition.
12. devices according to claim 11, it is characterized in that, described determining unit is used for, when determine the resource service condition of described virtual machine meet described pre-conditioned time, determine that described virtual machine is in idle condition, comprise: described determining unit specifically for, when determine the resource service condition of described virtual machine meet pre-conditioned and current do not exist user log in described virtual machine time, determine that described virtual machine is in idle condition.
13. devices according to claim 11 or 12, it is characterized in that, described determining unit is used for, when determining that the resource service condition of described virtual machine meets pre-conditioned, determine that described virtual machine is in idle condition, comprise: described determining unit specifically for, when determining that the resource service condition of described virtual machine meets the described pre-conditioned and input operation do not existed within the predetermined registration operation time described virtual machine, determine that described virtual machine is in idle condition.
14. devices according to claim 10-13 any one, it is characterized in that, described determining unit, also for before determining whether the described virtual machine of current operation is in idle condition, determine that described virtual machine is current and do not belong to the first virtual machine, described first virtual machine is that the current needs that user is arranged are in the virtual machine running mode of operation.
15. devices according to claim 10-14 any one, it is characterized in that, described determining unit is for determining whether the described virtual machine of current operation is in idle condition and comprises: described determining unit specifically for, when default timing arrives, determine whether described virtual machine is in idle condition.
16. devices according to claim 10-15 any one, it is characterized in that, described processing unit specifically for, suspend the operation work of described virtual machine, and by the information that stores in the internal memory of described virtual machine and run context information store in the hard disk of described virtual machine place physical host.
17. devices according to claim 10-16 any one, it is characterized in that, if the current quantity being in the virtual machine of idle condition that described determining unit is determined is multiple, described processing unit specifically for, according to the priority order from high to low of described virtual machine, setting gradually described virtual machine is park mode.
18. devices according to claim 10-17 any one, it is characterized in that, described processing unit, also for after arranging described virtual machine and being park mode, when arriving the default start-up time of described virtual machine, arranges described virtual machine for running mode of operation.
CN201410689734.5A 2014-11-25 2014-11-25 The park mode method to set up and device of virtual machine Active CN104391736B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410689734.5A CN104391736B (en) 2014-11-25 2014-11-25 The park mode method to set up and device of virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410689734.5A CN104391736B (en) 2014-11-25 2014-11-25 The park mode method to set up and device of virtual machine

Publications (2)

Publication Number Publication Date
CN104391736A true CN104391736A (en) 2015-03-04
CN104391736B CN104391736B (en) 2018-04-10

Family

ID=52609644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410689734.5A Active CN104391736B (en) 2014-11-25 2014-11-25 The park mode method to set up and device of virtual machine

Country Status (1)

Country Link
CN (1) CN104391736B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729070A (en) * 2017-10-16 2018-02-23 燕山大学 Scheduling virtual machine system and method based on dual rate and work and sleep
CN107810488A (en) * 2017-08-11 2018-03-16 深圳前海达闼云端智能科技有限公司 A kind of method of state management of virtual machine, device and intelligent terminal
CN108459882A (en) * 2017-02-21 2018-08-28 佳能株式会社 Electronic equipment and its control method
CN108776617A (en) * 2018-06-08 2018-11-09 山东超越数控电子股份有限公司 It is a kind of that target identification method is prefetched based on access frequency and dynamic priority
WO2019103280A1 (en) * 2017-11-23 2019-05-31 삼성전자(주) Electronic device and method for managing computing resources of at least one cloud server for providing cloud service

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662750A (en) * 2012-03-23 2012-09-12 上海交通大学 Virtual machine resource optimal control method and control system based on elastic virtual machine pool
CN103546509A (en) * 2012-07-13 2014-01-29 云联(北京)信息技术有限公司 Resource-saving cloud service system and resource saving method
CN103561089A (en) * 2013-10-30 2014-02-05 华为技术有限公司 Virtual machine desktop log-in method, device and system
CN103701889A (en) * 2013-12-20 2014-04-02 国云科技股份有限公司 Data center energy saving method on basis of cloud computing
CN103701870A (en) * 2013-12-12 2014-04-02 上海兆民云计算科技有限公司 Method for reducing power consumption generated in connection of desktop cloud terminal and server
CN103823712A (en) * 2014-03-17 2014-05-28 杭州华三通信技术有限公司 Data flow processing method and device for multi-CPU virtual machine system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662750A (en) * 2012-03-23 2012-09-12 上海交通大学 Virtual machine resource optimal control method and control system based on elastic virtual machine pool
CN103546509A (en) * 2012-07-13 2014-01-29 云联(北京)信息技术有限公司 Resource-saving cloud service system and resource saving method
CN103561089A (en) * 2013-10-30 2014-02-05 华为技术有限公司 Virtual machine desktop log-in method, device and system
CN103701870A (en) * 2013-12-12 2014-04-02 上海兆民云计算科技有限公司 Method for reducing power consumption generated in connection of desktop cloud terminal and server
CN103701889A (en) * 2013-12-20 2014-04-02 国云科技股份有限公司 Data center energy saving method on basis of cloud computing
CN103823712A (en) * 2014-03-17 2014-05-28 杭州华三通信技术有限公司 Data flow processing method and device for multi-CPU virtual machine system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108459882A (en) * 2017-02-21 2018-08-28 佳能株式会社 Electronic equipment and its control method
CN108459882B (en) * 2017-02-21 2022-04-05 佳能株式会社 Electronic device and control method thereof
CN107810488A (en) * 2017-08-11 2018-03-16 深圳前海达闼云端智能科技有限公司 A kind of method of state management of virtual machine, device and intelligent terminal
CN107729070A (en) * 2017-10-16 2018-02-23 燕山大学 Scheduling virtual machine system and method based on dual rate and work and sleep
WO2019103280A1 (en) * 2017-11-23 2019-05-31 삼성전자(주) Electronic device and method for managing computing resources of at least one cloud server for providing cloud service
US11698813B2 (en) 2017-11-23 2023-07-11 Samsung Electronics Co., Ltd. Electronic device and method for managing computing resources of at least one cloud server for providing cloud service
CN108776617A (en) * 2018-06-08 2018-11-09 山东超越数控电子股份有限公司 It is a kind of that target identification method is prefetched based on access frequency and dynamic priority

Also Published As

Publication number Publication date
CN104391736B (en) 2018-04-10

Similar Documents

Publication Publication Date Title
CA2741088C (en) Methods of achieving cognizant power management
CN102326132B (en) Power management to maximize reduced power state for virtual machine platforms
US8752060B2 (en) Multi-CPU domain mobile electronic device and operation method thereof
CN104391736A (en) Method for setting up sleep mode of virtual machine and device
EP2715539B1 (en) Distributed computing framework
US20180024854A1 (en) Technologies for virtual machine migration
US9558025B2 (en) Inter-board virtualization management for managing hardware resources corresponding to interrupts
CN108023958B (en) Resource scheduling system based on cloud platform resource monitoring
JP2012506597A5 (en)
US10198189B2 (en) Data allocation among devices with different data rates
CN102314377A (en) The method of accelerator and the migration of realization virtual support machine thereof
Li et al. An energy-efficient scheduling approach based on private clouds
CN103210379A (en) Server system, management method and device
CN103810020A (en) Virtual machine elastic scaling method and device
US20110239019A1 (en) Method and system for managing power consumption of a computing device
US8810584B2 (en) Smart power management in graphics processing unit (GPU) based cluster computing during predictably occurring idle time
CN105868004B (en) Scheduling method and scheduling device of service system based on cloud computing
US20120144389A1 (en) Optimizing virtual image deployment for hardware architecture and resources
CN104539708A (en) Capacity reduction method, device and system for cloud platform resources
CN103984602A (en) VM (virtual machine) resource scheduling method, device and system
CN103902364A (en) Physical resource management method and device and intelligent terminal
CN104346211A (en) Method and system for realizing virtual machine migration under cloud computing
CN110471769B (en) Resource management method and device for virtual machine
CN103885811A (en) Device, system and method for system-wide online migration of virtual machine system
CN107197013B (en) Energy-saving system for enhancing cloud computing environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200416

Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee after: HUAWEI TECHNOLOGIES Co.,Ltd.

Address before: 301, A building, room 3, building 301, foreshore Road, No. 310053, Binjiang District, Zhejiang, Hangzhou

Patentee before: Huawei Technologies Co.,Ltd.

TR01 Transfer of patent right