CN101916207B - Energy saving method, device and system under desktop virtual environment - Google Patents
Energy saving method, device and system under desktop virtual environment Download PDFInfo
- Publication number
- CN101916207B CN101916207B CN2010102653818A CN201010265381A CN101916207B CN 101916207 B CN101916207 B CN 101916207B CN 2010102653818 A CN2010102653818 A CN 2010102653818A CN 201010265381 A CN201010265381 A CN 201010265381A CN 101916207 B CN101916207 B CN 101916207B
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- information
- idle
- hardware
- state
- 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.)
- Active
Links
Images
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
本发明实施例公开一种桌面虚拟化环境下的节能方法、装置及系统,其中,该方法包括:通过探针收集对应虚拟机的特定事件信息;根据收集到的虚拟机的特定事件信息及获取的虚拟机闲置策略,确定该特定事件信息所关联的虚拟机的当前状态,向管理服务器输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示该虚拟机处于闲置状态或非闲置状态;接收所述管理服务器发送的待机命令,并向硬件层发送对应的待机指令,以控制并使该虚拟机宿主的物理主机进入挂起到内存的待机状态;从而在达到节能效果的同时,避免了大量虚拟机热迁移或大量虚拟机加载导致的网络流量拥塞现象。
The embodiment of the present invention discloses an energy-saving method, device, and system in a desktop virtualization environment, wherein the method includes: collecting specific event information corresponding to a virtual machine through a probe; virtual machine idle policy, determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine state information to the management server, wherein the virtual machine state information indicates that the virtual machine is in an idle state or a non-idle state ; receiving the standby command sent by the management server, and sending a corresponding standby command to the hardware layer, so as to control and make the physical host of the virtual machine host enter the standby state of suspending memory; thereby achieving the energy-saving effect while avoiding Network traffic congestion caused by live migration of a large number of virtual machines or loading of a large number of virtual machines.
Description
技术领域 technical field
本发明实施例涉及虚拟化技术领域,特别是涉及一种桌面虚拟化环境下的节能方法、装置及系统。The embodiments of the present invention relate to the technical field of virtualization, and in particular, to an energy-saving method, device and system in a desktop virtualization environment.
背景技术 Background technique
虚拟化技术使得可以在一台物理服务器上安装多个不同的操作系统,并实现各个操作系统的隔离,即使一个操作系统或操作系统上的应用异常亦不会对其它操作系统产生影响。虚拟化技术在传统的操作系统和物理硬件资源之间架设一层“虚拟机监控单元(Virtual Machine Monitor,VMM)”,实现对物理硬件资源,如处理器、内存、存储、网络和其它外设资源的控制和管理;传统的操作系统运行在VMM之上,失去对物理资源的控制访问权,称之为虚拟机(Virtual Machine,VM);VMM向虚拟机提供虚拟硬件环境,供虚拟机正确运行,并实现对虚拟机的调度、管理和隔离。Virtualization technology makes it possible to install multiple different operating systems on a physical server and realize the isolation of each operating system. Even if an operating system or an application exception on an operating system is abnormal, it will not affect other operating systems. Virtualization technology sets up a layer of "Virtual Machine Monitor (Virtual Machine Monitor, VMM)" between the traditional operating system and physical hardware resources to realize the monitoring of physical hardware resources, such as processors, memory, storage, networks and other peripherals. Control and management of resources; the traditional operating system runs on the VMM and loses control and access to physical resources, which is called a virtual machine (Virtual Machine, VM); VMM provides a virtual hardware environment for the virtual machine to correctly Run, and realize the scheduling, management and isolation of virtual machines.
虚拟化技术对传统的企业桌面办公环境带来了巨大挑战:个人办公电脑被虚拟机取代,终端用户通过瘦客户机(Thin Client,TC)或软件终端(Software Client,SC)访问虚拟机桌面办公;企业通过虚拟化管理软件将物理服务器、存储设备和网络设备集中管控起来,并部署虚拟机和管理服务器,形成桌面虚拟化系统。Virtualization technology has brought great challenges to the traditional enterprise desktop office environment: personal office computers are replaced by virtual machines, and end users access the virtual machine desktop office through thin client (Thin Client, TC) or software terminal (Software Client, SC) Enterprises use virtualization management software to centrally manage and control physical servers, storage devices and network devices, and deploy virtual machines and management servers to form a desktop virtualization system.
目前,在桌面虚拟化环境下,虚拟机的节能管理有如下两种方案:Currently, in the desktop virtualization environment, there are two solutions for energy-saving management of virtual machines:
1.如在夜间大量虚拟机是不需要运行任何业务,关闭所有虚拟机并下电相应的物理主机;1. If a large number of virtual machines do not need to run any business at night, shut down all virtual machines and power off the corresponding physical hosts;
2.通过动态负载平衡机制,将低负载的虚拟机集中迁移(使用热迁移”技术)到少数的物理机上,当物理机上不再有虚拟机时,将该物理机下电。2. Centrally migrate low-load virtual machines (using "hot migration" technology) to a small number of physical machines through the dynamic load balancing mechanism, and power off the physical machines when there are no more virtual machines on the physical machines.
发明人在实现本发明的过程中,发现:现有方案一中,在桌面虚拟化环境下,当大量用户同时需要使用虚拟机(如上班高峰期)时,物理主机需要从存储网络中加载大量虚拟机,容易导致网络流量拥塞,虚拟机启动缓慢或启动失败;以及现有方案二中,虚拟机资源使用比较平稳,物理主机的平均资源负载比较平稳,因此能够下电的物理主机极少,节能效果不高;而且,如上班高峰期时将触发大量虚拟机迁移,大量的“热迁移”较易导致网络流量拥塞。In the process of implementing the present invention, the inventor found that: in the
发明内容 Contents of the invention
本发明实施例提供一种桌面虚拟化环境下的节能方法、装置以及桌面虚拟化系统,以在达到节能效果的同时,避免大量虚拟机热迁移或大量虚拟机加载导致的网络流量拥塞现象。Embodiments of the present invention provide an energy-saving method, device, and desktop virtualization system in a desktop virtualization environment, so as to avoid network traffic congestion caused by hot migration or loading of a large number of virtual machines while achieving energy-saving effects.
一方面,本发明实施例提供一种桌面虚拟化系统,包括多台物理主机和管理服务器,其中每台物理主机包括硬件层,运行在所述硬件层之上的虚拟机监控单元VMM,运行在所述虚拟机监控单元VMM之上的至少一个虚拟机,以及至少一个探针,其中:On the one hand, an embodiment of the present invention provides a desktop virtualization system, including multiple physical hosts and management servers, wherein each physical host includes a hardware layer, and a virtual machine monitoring unit VMM running on the hardware layer runs on At least one virtual machine on the virtual machine monitoring unit VMM, and at least one probe, wherein:
所述探针用于:收集对应虚拟机的特定事件信息;所述虚拟机监控单元VMM用于:根据所述探针收集的虚拟机的特定事件信息,及获取的虚拟机闲置策略,确定所述特定事件信息所关联的虚拟机的当前状态,向所述管理服务器输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态;The probe is used to: collect specific event information corresponding to the virtual machine; the virtual machine monitoring unit VMM is used to: determine the specific event information of the virtual machine collected by the probe and the obtained idle policy of the virtual machine. The current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine state information to the management server, wherein the virtual machine state information indicates that the virtual machine is in an idle state or a non-idle state;
所述管理服务器用于:当获得的虚拟机状态信息表示被宿主的物理主机上所宿主的所有虚拟机均为闲置状态时,向该被宿主的物理主机发送待机命令;The management server is configured to: send a standby command to the hosted physical host when the obtained virtual machine state information indicates that all virtual machines hosted on the hosted physical host are idle;
所述虚拟机监控单元VMM进一步用于:接收所述管理服务器下发的待机命令,并向所述硬件层发送对应的待机指令,以控制并使该物理主机进入挂起到内存的待机状态。The virtual machine monitoring unit VMM is further configured to: receive a standby command issued by the management server, and send a corresponding standby command to the hardware layer, so as to control and make the physical host enter a standby state of suspending to memory.
另一方面,本发明实施例提供一种物理主机,所述物理主机包括:硬件层,运行在所述硬件层之上的虚拟机监控单元VMM,运行在所述虚拟机监控单元VMM之上的至少一个虚拟机,以及至少一个探针,其中:On the other hand, an embodiment of the present invention provides a physical host, and the physical host includes: a hardware layer, a virtual machine monitoring unit VMM running on the hardware layer, and a virtual machine monitoring unit VMM running on the virtual machine monitoring unit VMM At least one virtual machine, and at least one probe where:
所述探针用于:收集对应虚拟机的特定事件信息;The probe is used to: collect specific event information corresponding to the virtual machine;
所述虚拟机监控单元VMM用于:根据所述探针收集的虚拟机的特定事件信息,及获取的虚拟机闲置策略,确定所述特定事件信息所关联的虚拟机的当前状态,向管理服务器输出对应的虚拟机状态信息,以及接收所述管理服务器发送的待机命令,并向所述硬件层发送对应的待机指令,其中,所述虚拟机状态信息表示该虚拟机处于闲置状态或非闲置状态;The virtual machine monitoring unit VMM is configured to: determine the current state of the virtual machine associated with the specific event information according to the specific event information of the virtual machine collected by the probe and the acquired idle policy of the virtual machine, and report to the management server Outputting corresponding virtual machine state information, receiving a standby command sent by the management server, and sending a corresponding standby instruction to the hardware layer, wherein the virtual machine state information indicates that the virtual machine is in an idle state or a non-idle state ;
所述硬件层用于:响应所述待机指令,控制并使该物理主机进入挂起到内存的待机状态。The hardware layer is used for: responding to the standby instruction, controlling and causing the physical host to enter the standby state of suspending to memory.
另一方面,本发明实施例提供一种管理服务器,包括:On the other hand, an embodiment of the present invention provides a management server, including:
策略管理单元,用于管理虚拟机闲置策略,以及向物理主机下发所述虚拟机闲置策略,所述虚拟机闲置策略供所述物理主机用以确定该物理主机上宿主的虚拟机的状态;A policy management unit, configured to manage a virtual machine idle policy, and deliver the virtual machine idle policy to a physical host, where the virtual machine idle policy is used by the physical host to determine the status of a virtual machine hosted on the physical host;
云管理单元,用于在获得的虚拟机状态信息表示被宿主的物理主机上所宿主的所有虚拟机的状态均为闲置状态时,向所述被宿主的物理主机发送待机命令,所述待机命令用于控制并使该物理主机进入挂起到内存的待机状态。The cloud management unit is configured to send a standby command to the hosted physical host when the obtained virtual machine status information indicates that all virtual machines hosted on the hosted physical host are idle, and the standby command Used to control and put the physical host into a suspend-to-ram standby state.
另一方面,本发明实施例提供一种桌面虚拟化环境下的节能方法,该方法包括:On the other hand, an embodiment of the present invention provides a method for energy saving in a desktop virtualization environment, the method comprising:
通过探针收集对应虚拟机的特定事件信息;Collect specific event information corresponding to the virtual machine through the probe;
根据收集到的虚拟机的特定事件信息及获取的虚拟机闲置策略,确定该特定事件信息所关联的虚拟机的当前状态,向管理服务器输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示该虚拟机处于闲置状态或非闲置状态;According to the collected specific event information of the virtual machine and the acquired virtual machine idle policy, determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine state information to the management server, wherein the virtual machine state The information indicates that the virtual machine is idle or not idle;
接收所述管理服务器发送的待机命令,并向硬件层发送对应的待机指令,以控制并使该虚拟机宿主的物理主机进入挂起到内存的待机状态。Receive the standby command sent by the management server, and send a corresponding standby command to the hardware layer, so as to control and make the physical host hosting the virtual machine enter the standby state of suspending memory.
可见,本发明实施例提供一种桌面虚拟化环境下的节能方案,在每个虚拟机中部署探针,通过探针收集对应虚拟机的特定事件信息;虚拟机监控单元VMM根据所述探针收集的虚拟机的特定事件信息及管理服务器提供的虚拟机闲置策略,确定所述特定事件信息所关联的虚拟机的当前状态,并向所述管理服务器输出对应的虚拟机状态信息;当管理服务器感知到被宿主的物理主机上所宿主的所有虚拟机均为闲置状态时,向该被宿主的物理主机发送待机命令;VMM收到所述管理服务器下发的待机命令,向硬件层发送对应的待机指令,以控制并使该物理主机进入挂起到内存的待机状态;可见,通过本发明实施例的方案,能够对虚拟机的使用情况进行识别,从而例如,在企业下班后,可以使自身上所宿主的所有虚拟机均为闲置状态的物理主机待机节能,同时,由于处于挂起到内存的待机状态的物理主机,其内存供电,内存状态信息完整;物理主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。It can be seen that the embodiment of the present invention provides an energy-saving solution in a desktop virtualization environment. A probe is deployed in each virtual machine, and the specific event information of the corresponding virtual machine is collected through the probe; the virtual machine monitoring unit VMM according to the probe The collected specific event information of the virtual machine and the idle policy of the virtual machine provided by the management server determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine state information to the management server; when the management server When sensing that all the virtual machines hosted on the hosted physical host are in an idle state, send a standby command to the hosted physical host; VMM receives the standby command issued by the management server, and sends the corresponding to the hardware layer Standby command, to control and make the physical host enter the standby state of suspending memory; it can be seen that through the solution of the embodiment of the present invention, the usage of the virtual machine can be identified, so that for example, after the enterprise is off work, it can make itself All the virtual machines hosted above are idle physical hosts to save energy. At the same time, because the physical hosts are in the standby state from suspend to memory, their memory supplies power and the memory status information is complete; Therefore, while achieving the energy-saving effect, it also avoids network traffic congestion caused by a large number of virtual machines "hot migration" or a large number of virtual machine loading when the enterprise is at work, thus ensuring the virtual machine Stable, reliable and high performance, which improves end-user experience satisfaction.
附图说明 Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without any creative work.
图1a为本发明实施例的一种桌面虚拟化系统的逻辑结构示意图;FIG. 1a is a schematic diagram of a logical structure of a desktop virtualization system according to an embodiment of the present invention;
图1b为本发明实施例的一种桌面虚拟化系统的物理部署示意图;FIG. 1b is a schematic diagram of physical deployment of a desktop virtualization system according to an embodiment of the present invention;
图2为本发明实施例的一种物理主机的结构示意图;FIG. 2 is a schematic structural diagram of a physical host according to an embodiment of the present invention;
图3为本发明实施例的一种虚拟机中嵌入探针的结构示意图;3 is a schematic structural diagram of a probe embedded in a virtual machine according to an embodiment of the present invention;
图4为本发明实施例的一种管理服务器的结构示意图;FIG. 4 is a schematic structural diagram of a management server according to an embodiment of the present invention;
图5为本发明实施例的一种桌面虚拟化环境下的节能方法的流程示意图;FIG. 5 is a schematic flowchart of an energy saving method in a desktop virtualization environment according to an embodiment of the present invention;
图6为本发明实施例的另一种桌面虚拟化环境下的节能方法的流程示意图;FIG. 6 is a schematic flowchart of another energy saving method in a desktop virtualization environment according to an embodiment of the present invention;
图7为本发明实施例的再一种桌面虚拟化环境下的节能方法的流程示意图。FIG. 7 is a schematic flowchart of another energy saving method in a desktop virtualization environment according to an embodiment of the present invention.
具体实施方式 Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
请参阅图1a,为本发明实施例的一种桌面虚拟化系统的逻辑结构示意图,如图1a所示,本发明实施例的桌面虚拟化系统包括:多台物理主机10,20,30(亦可称作业务主机,图中以三台物理主机示意,但不限于此)和管理服务器40,其中,每台物理主机包括硬件层(图中以11,21,31示意),运行在所述硬件层之上的虚拟机监控单元VMM(图中以12,22,32示意),运行在所述虚拟机监控单元VMM之上的至少一个虚拟机(图中以VM1,VM2,VM3示意,但不限于此),以及至少一个探针(图中以13,23,33示意,需要说明的是,探针的部署方式不限于此),其中:Please refer to FIG. 1a, which is a schematic diagram of a logical structure of a desktop virtualization system according to an embodiment of the present invention. As shown in FIG. It can be referred to as a service host, shown as three physical hosts in the figure, but not limited thereto) and a management server 40, wherein each physical host includes a hardware layer (shown as 11, 21, 31 in the figure), running on the The virtual machine monitoring unit VMM on the hardware layer (indicated by 12, 22, 32 in the figure), at least one virtual machine running on the virtual machine monitoring unit VMM (indicated by VM1, VM2, VM3 in the figure, but is not limited to this), and at least one probe (shown as 13, 23, 33 in the figure, it should be noted that the deployment method of the probe is not limited to this), wherein:
所述探针用于:收集对应虚拟机的特定事件信息;The probe is used to: collect specific event information corresponding to the virtual machine;
这里的特定事件信息可以包括硬件使用信息和/或虚拟机用户操作信息;The specific event information here may include hardware usage information and/or virtual machine user operation information;
虚拟机监控单元VMM 12,22,32用于:根据探针收集的虚拟机的特定事件信息,及管理服务器40提供的虚拟机闲置策略,确定该特定事件信息所关联的虚拟机的当前状态,并向管理服务器40输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态;The virtual machine monitoring unit VMM 12, 22, 32 is used for: according to the specific event information of the virtual machine collected by the probe, and the virtual machine idle policy provided by the management server 40, determine the current state of the virtual machine associated with the specific event information, And output corresponding virtual machine status information to the management server 40, wherein the virtual machine status information indicates that the virtual machine is in an idle state or a non-idle state;
以及,管理服务器40用于:当获得的虚拟机状态信息表示被宿主的物理主机(比如物理主机10)上所宿主的所有虚拟机均为闲置状态时,向该被宿主的物理主机(比如物理主机10)发送待机命令;And, the management server 40 is used for: when the obtained virtual machine status information indicates that all the virtual machines hosted on the hosted physical host (such as the physical host 10) are in an idle state, send a message to the hosted physical host (such as the physical host 10). Host 10) sends a standby command;
相应的,虚拟机监控单元VMM 12进一步用于:接收管理服务器40下发的待机命令,并向硬件层11发送对应的待机指令,以控制并使该物理主机10进入挂起到内存的待机状态即ACPI-S3状态。Correspondingly, the virtual machine monitoring unit VMM 12 is further used to: receive the standby command issued by the management server 40, and send a corresponding standby command to the hardware layer 11, so as to control and make the physical host 10 enter the standby state of suspending memory That is, the ACPI-S3 state.
这里的ACPI-S3状态指的是ACPI的S3状态,即Suspend to RAM(挂起到内存)状态,简称STR;即将系统进入STR前的工作状态数据都存放到内存中去。在STR状态下,电源仍然继续为内存等最必要的设备供电,以确保数据不丢失,而其他设备均处于关闭状态,系统的耗电量极低。一旦Power按钮(主机电源开关)被触发,或通过鼠标键盘事件,网卡事件等,系统就被唤醒,立即从内存中读取数据并恢复到STR之前的工作状态。其中,ACPI指的是Advanced Configuration and Power Interface,高级配置与电源接口;这是英特尔、微软和东芝共同开发的一种电源管理标准;ACPI根据节能程度的高低,一共有S0~S5六种状态。ACPI-S3是待机状态中的一种,其内存供电,CPU等不供电,能耗节省达80%以上;The ACPI-S3 state here refers to the S3 state of ACPI, that is, the Suspend to RAM (suspend to memory) state, referred to as STR; the working state data before the system enters STR is stored in the memory. In the STR state, the power supply continues to supply power to the most necessary devices such as memory to ensure that data is not lost, while other devices are turned off, and the power consumption of the system is extremely low. Once the Power button (host power switch) is triggered, or through mouse and keyboard events, network card events, etc., the system will wake up, read data from the memory immediately and restore to the working state before STR. Among them, ACPI refers to Advanced Configuration and Power Interface, advanced configuration and power interface; this is a power management standard jointly developed by Intel, Microsoft and Toshiba; ACPI has a total of six states from S0 to S5 according to the degree of energy saving. ACPI-S3 is one of the standby states, the memory is powered, the CPU is not powered, and the energy consumption can be saved by more than 80%;
在一种实现方式下,如图1a所示,探针13,23,33具体嵌入于对应虚拟机中,具体用于收集对应虚拟机的硬件使用信息和/或对应虚拟机的用户操作信息;In one implementation, as shown in FIG. 1a, the probes 13, 23, and 33 are embedded in the corresponding virtual machine, and are specifically used to collect hardware usage information of the corresponding virtual machine and/or user operation information of the corresponding virtual machine;
相应的,虚拟机监控单元VMM 12,22,32具体用于:根据探针13,23,33收集的硬件使用信息和/或用户操作信息,及管理服务器40提供的虚拟机闲置策略,确定所述硬件使用信息和/或用户操作信息所关联的虚拟机的当前状态,向管理服务器40输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态。Correspondingly, the virtual machine
在另一种实现方式下,所述探针包括嵌入于对应虚拟机中的前端探针(图1a中以13,23,33示意)和部署于所述虚拟机监控单元VMM中的后端探针(图中未示出),其中,所述前端探针用于收集对应虚拟机的用户操作信息;所述后端探针用于收集对应虚拟机的硬件使用信息;In another implementation, the probes include front-end probes embedded in corresponding virtual machines (indicated by 13, 23, and 33 in FIG. 1a ) and back-end probes deployed in the virtual machine monitoring unit VMM. A needle (not shown in the figure), wherein, the front-end probe is used to collect user operation information of the corresponding virtual machine; the back-end probe is used to collect hardware usage information of the corresponding virtual machine;
相应的,虚拟机监控单元VMM 12,22,32具体用于:根据前端探针收集的对应虚拟机的用户操作信息和后端探针收集的对应虚拟机的硬件使用信息,及管理服务器40提供的虚拟机闲置策略,确定所述硬件使用信息和用户操作信息所关联的虚拟机的当前状态,向管理服务器40输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态。Correspondingly, the virtual machine
需要说明的是,这里的虚拟机的硬件使用信息表示所述虚拟机上发生的硬件事件,所述硬件事件包括但不限于:鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件等等,这里的虚拟机的用户操作信息表示所述虚拟机上发生的操作事件,所述操作事件包括但不限于:用户对虚拟机执行的“闲置”操作、“待机”操作、“休眠”操作和“断开”操作等等;It should be noted that the hardware usage information of the virtual machine here represents hardware events that occur on the virtual machine, and the hardware events include but are not limited to: mouse events, keyboard events, network I/O events, and disk I/O events Etc., the user operation information of the virtual machine here represents the operation event that occurs on the virtual machine, and the operation event includes but not limited to: "idle" operation, "standby" operation, "sleep" operation performed by the user on the virtual machine operation and "disconnect" operation, etc.;
本发明实施例的虚拟机闲置策略包括:虚拟机闲置时间区段、虚拟机闲置类别、虚拟机硬件使用信息闲置判定条件和虚拟机用户操作信息闲置判定条件这四种条件中的一种或任意组合;具体可以根据实际应用灵活确定。The virtual machine idle policy in the embodiment of the present invention includes: virtual machine idle time section, virtual machine idle category, virtual machine hardware usage information idle judgment condition, and virtual machine user operation information idle judgment condition. One or any of the four conditions Combination; the details can be flexibly determined according to the actual application.
举例说明:虚拟机闲置策略为:“虚拟机闲置类别为可闲置”+“闲置时间区段18:00-23:00”+“鼠标+键盘30分钟无事件”||“用户待机操作”;若虚拟机A属于可闲置类别,且当前时间段处于18:00-23:00,且虚拟机A已30分钟无鼠标键标事件,或者虚拟机A被用户持行待机操作,则虚拟机A处于闲置状态,否则虚拟机A处于非闲置状态;需要说明的是,这里的“+”表示“和”的关系,“||”表示“或”的关系。For example: The virtual machine idle policy is: "The virtual machine idle category is idle" + "Idle time range 18:00-23:00" + "Mouse + keyboard without events for 30 minutes"||"User standby operation"; If virtual machine A belongs to the idle category, and the current time period is between 18:00-23:00, and virtual machine A has no mouse button event for 30 minutes, or virtual machine A is held by the user for standby operation, then virtual machine A Otherwise, virtual machine A is in a non-idle state; it should be noted that "+" here means "and" relationship, and "||" means "or" relationship.
其中,虚拟机闲置时间区段指的是虚拟机可闲置的时间区段,如20:00-06:00;虚拟机闲置类别指的是虚拟机是否可闲置;如虚拟机A为不可闲置类别,那么不管其它条件是否满足,该虚拟机A不会被闲置;Among them, the virtual machine idle time period refers to the time period during which the virtual machine can be idle, such as 20:00-06:00; the virtual machine idle category refers to whether the virtual machine can be idle; for example, virtual machine A is a non-idleable category , then no matter whether other conditions are satisfied, the virtual machine A will not be idle;
虚拟机硬件使用信息闲置判定条件指的是根据上报的虚拟机硬件使用信息所表示的硬件事件的发生频率来判定虚拟机是否可以闲置,各种虚拟机硬件事件可以任意组合使用,所述硬件事件包括但不限于鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件等等;The virtual machine hardware usage information idle judgment condition refers to judging whether the virtual machine can be idle according to the occurrence frequency of hardware events represented by the reported virtual machine hardware usage information. Various virtual machine hardware events can be used in any combination. The hardware event Including but not limited to mouse events, keyboard events, network I/O events and disk I/O events, etc.;
虚拟机用户操作信息闲置判定条件指的是判定被执行所述虚拟机用户操作信息所表示的操作的虚拟机是否可以闲置;具体的,如果上报的虚拟机用户操作信息所表示的操作为闲置操作,则该虚拟机可闲置;如果上报的虚拟机用户操作信息所表示的操作为预定操作范围内的操作,则根据设定的操作替代规则确定该虚拟机是否可闲置;具体的,如果设定虚拟机“待机”、“休眠”或“断开”操作能以“闲置”操作替代,则被执行待机”、“休眠”或“断开”操作的虚拟机可闲置;如果设定虚拟机“待机”、“休眠”或“断开”操作不能以“闲置”操作替代,则被执行待机”、“休眠”或“断开”操作的虚拟机虚拟机不可闲置;这里的预定操作范围包括“待机”操作、“休眠”操作或“断开”操作。The virtual machine user operation information idle judgment condition refers to determining whether the virtual machine that is executed with the operation represented by the virtual machine user operation information can be idle; specifically, if the operation represented by the reported virtual machine user operation information is an idle operation , then the virtual machine can be idle; if the operation indicated by the reported virtual machine user operation information is an operation within the predetermined operation range, then it is determined whether the virtual machine can be idle according to the set operation substitution rules; specifically, if the The "standby", "hibernation" or "disconnect" operation of the virtual machine can be replaced by the "idle" operation, and the virtual machine that has been executed with the "standby", "hibernation" or "disconnect" operation can be idle; if the virtual machine " "Standby", "Hibernation" or "Disconnect" operations cannot be replaced by "Idle" operations, and the virtual machines that are executed by "Standby", "Hibernation" or "Disconnect" operations cannot be idle; the scope of predetermined operations here includes " Standby operation, Hibernation operation or Disconnect operation.
需要说明的是,为了增强虚拟机闲置策略的灵活性,针对不同的虚拟机闲置时间区段和/或虚拟机闲置类别,对应的虚拟机硬件使用信息闲置判定条件和/或虚拟机用户操作信息闲置判定条件可以是不同的。It should be noted that, in order to enhance the flexibility of the virtual machine idle policy, for different virtual machine idle time periods and/or virtual machine idle categories, the corresponding virtual machine hardware usage information idle judgment conditions and/or virtual machine user operation information The idle determination conditions may be different.
在一种实现方式下,虚拟机监控单元VMM 12,22,32具体用于:当上报信息所关联的虚拟机属于可闲置类别,且当前时间段处于第一闲置时间区段内,且该虚拟机在第一阈值时间内未发生硬件事件,或者,硬件事件发生频率小于第一阈值频率,或者,该虚拟机被执行闲置操作,或者该虚拟机被执行预定操作范围内的操作且该操作能以“闲置”操作替代,则确定该虚拟机当前处于可闲置状态,并向管理服务器40输出表示闲置状态的虚拟机状态信息;这里的硬件事件包括鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件中的一种或多种;In one implementation, the virtual machine
在另一种实现方式下,虚拟机监控单元VMM 12,22,32具体用于:当上报信息所关联的虚拟机属于可闲置类别,且当前时间段处于第二闲置时间区段内,且该虚拟机在第二阈值时间内未发生硬件事件,或者,硬件事件发生频率小于第二阈值频率,或者,该虚拟机被执行闲置操作,或者该虚拟机被执行预定操作范围内的操作且该操作能以“闲置”操作替代,则确定该虚拟机当前处于可闲置状态,并向管理服务器40输出表示闲置状态的虚拟机状态信息;In another implementation, the virtual machine
在另一种实现方式下,虚拟机监控单元VMM 12,22,32具体用于:当上报信息所关联的虚拟机属于可闲置类别,且该虚拟机被执行预定操作范围内的操作且该操作不能以“闲置”操作替代,则确定该虚拟机当前处于不可闲置状态,并向管理服务器40输出表示不可闲置状态的虚拟机状态信息;In another implementation, the virtual machine
在另一种实现方式下,虚拟机监控单元VMM 12,22,32具体用于:当上报信息所关联的虚拟机属于不可闲置类别,则确定该虚拟机当前处于不可闲置状态,并向管理服务器40输出表示不可闲置状态的虚拟机状态信息;In another implementation, the virtual machine
应当理解的是,虚拟机的类别划分的粒度不限于:可闲置类别和不可闲置类别。在更精细化管理的情况下,可闲置类别可进一步划分为不同的子类别,例如A,B,C。It should be understood that, the granularity of classifying virtual machines is not limited to: a class that can be idled and a class that cannot be idled. In the case of more fine-grained management, the idle category can be further divided into different subcategories, such as A, B, C.
进一步的,如图1a所示,本发明实施例的桌面虚拟化系统中,管理服务器40进一步用于:根据所述虚拟机状态信息及虚拟机迁移策略,确定需要迁移的处于不可闲置状态的虚拟机和迁移目的物理主机,并向需要迁移的虚拟机宿主的物理主机发送迁移命令;其中,所述迁移命令包括需要迁移的虚拟机标识ID和迁移的目的主机信息。这里的虚拟机标识ID是VMM为每一个虚拟机分配的唯一的字符串序列,用于唯一标识虚拟机;在Xen架构下称为uuid;迁移的目的主机信息,具体可以是目的业务主机的IP地址。Further, as shown in FIG. 1a, in the desktop virtualization system of the embodiment of the present invention, the management server 40 is further used to: determine the virtual machine that needs to be migrated and is in an unidleable state according to the virtual machine status information and the virtual machine migration policy. machine and the migration destination physical host, and send a migration command to the physical host hosting the virtual machine to be migrated; wherein, the migration command includes the ID of the virtual machine to be migrated and the information of the migration destination host. The virtual machine identification ID here is a unique string sequence assigned by VMM to each virtual machine, which is used to uniquely identify the virtual machine; it is called uuid under the Xen architecture; the destination host information of the migration can be the IP of the destination business host address.
相应的,虚拟机监控单元VMM 12,22,32进一步用于:根据管理服务器40发送的迁移命令,将所述虚拟机标识ID对应的虚拟机迁移到所述目的业务主机信息对应的目的业务主机上。Correspondingly, the virtual machine
下面来介绍下虚拟机迁移策略:Let's introduce the virtual machine migration strategy:
所述虚拟机迁移策略包括:虚拟机迁移时间区段、虚拟机迁移判定条件和迁移目标业务主机选定条件;举例说明:如在虚拟机迁移时间区段内,将“非闲置状态”虚拟机数小于2且总虚拟机数大于物理主机宿主的平均虚拟机数的业务主机上“非闲置状态”的虚拟机迁移到“非闲置状态”虚拟机比重最高及资源利用率最低的业务主机上。The virtual machine migration strategy includes: a virtual machine migration time zone, a virtual machine migration judgment condition, and a migration target business host selection condition; The virtual machines in the "non-idle state" on the service hosts whose number is less than 2 and the total number of virtual machines is greater than the average number of virtual machines hosted by the physical host are migrated to the service host with the highest proportion of "non-idle state" virtual machines and the lowest resource utilization.
其中,虚拟机迁移判定条件指的是根据当前虚拟机状态和当前虚拟机所宿主的物理主机状态信息来判定当前虚拟机是否需要迁移,当前虚拟机所宿主的物理主机状态信息包括当前虚拟机所宿主的物理主机上所宿主的总虚拟机数、“闲置状态”虚拟机数、平均虚拟机数中的一种或任意组合;Wherein, the virtual machine migration judging condition refers to judging whether the current virtual machine needs to be migrated according to the state of the current virtual machine and the state information of the physical host hosting the current virtual machine. The state information of the physical host hosting the current virtual machine includes One or any combination of the total number of virtual machines hosted on the hosting physical host, the number of "idle" virtual machines, the average number of virtual machines;
目标业务主机选定条件指的是根据桌面虚拟化环境中物理主机状态信息选择迁移的目标物理主机,该物理主机状态信息包括物理主机上所宿主的总虚拟机数、“非闲置状态”虚拟机数/比重、业务主机资源利用率中的一种或任意组合;具体的,选择满足如下条件中的一项或多项的物理主机作为迁移的目标物理主机;The selection condition of the target business host refers to the selection of the target physical host for migration based on the status information of the physical host in the desktop virtualization environment. One or any combination of the number/proportion and resource utilization of business hosts; specifically, select a physical host that meets one or more of the following conditions as the target physical host for migration;
a.在桌面虚拟化环境中本物理主机上所宿主的总虚拟机数最大,或者本物理主机上所宿主的总虚拟机数大于第一阈值数;a. In the desktop virtualization environment, the total number of virtual machines hosted on the physical host is the largest, or the total number of virtual machines hosted on the physical host is greater than the first threshold number;
b.在桌面虚拟化环境中本物理主机上所宿主的“非闲置状态”虚拟机比重最大,或者本物理主机上所宿主的“非闲置状态”虚拟机比重大于第一阈值百分比;b. In the desktop virtualization environment, the proportion of "non-idle state" virtual machines hosted on the physical host is the largest, or the proportion of "non-idle state" virtual machines hosted on the physical host is greater than the first threshold percentage;
c.在桌面虚拟化环境中本物理主机资源利用率最低,或者本物理主机资源利用率低于第二阈值百分比。c. The resource utilization rate of the physical host is the lowest in the desktop virtualization environment, or the resource utilization rate of the physical host is lower than the second threshold percentage.
应当理解的是,本发明实施例中,为了增强迁移的灵活性,针对不同的虚拟机迁移时间区段,对应的虚拟机迁移判定条件和/或迁移目标业务主机选定条件可以是不同的。It should be understood that, in the embodiments of the present invention, in order to enhance the flexibility of migration, the corresponding virtual machine migration judgment conditions and/or migration target service host selection conditions may be different for different virtual machine migration time periods.
进一步的,请参阅图1b,为本发明实施例的一种桌面虚拟化系统的物理部署示意图,如图1b所示,本发明实施例的桌面虚拟化系统中,管理服务器40进一步用于:响应用户登录虚拟机的操作,向该虚拟机宿主的物理主机(如物理主机10)下发唤醒指令;Further, please refer to FIG. 1b, which is a schematic diagram of physical deployment of a desktop virtualization system according to an embodiment of the present invention. As shown in FIG. 1b, in the desktop virtualization system according to this embodiment of the present invention, the management server 40 is further used to: respond The user logs in to the operation of the virtual machine, and sends a wake-up instruction to the physical host (such as the physical host 10) where the virtual machine hosts;
相应的,该该物理主机10的硬件层11用于:响应管理服务器40发送的唤醒指令,运行挂起的内存,激活对应的虚拟机,使得该虚拟机进入可操纵状态。Correspondingly, the hardware layer 11 of the physical host 10 is used for: responding to the wake-up command sent by the management server 40, running the suspended memory, and activating the corresponding virtual machine, so that the virtual machine enters a manipulable state.
需要说明的是,唤醒指令是管理服务器40直接向物理主机硬件层发送的指令;由硬件层(具体可以是网卡)接收,并触发CPU上电、加载运行。It should be noted that the wake-up instruction is an instruction sent directly by the management server 40 to the hardware layer of the physical host; it is received by the hardware layer (specifically, a network card), and triggers the CPU to be powered on, loaded and running.
综上所述,本发明实施例提供一种桌面虚拟化系统,在每个虚拟机中部署探针,通过探针收集对应虚拟机的特定事件信息;虚拟机监控单元VMM根据所述探针收集的虚拟机的特定事件信息及管理服务器提供的虚拟机闲置策略,确定所述特定事件信息所关联的虚拟机的当前状态,并向所述管理服务器输出对应的虚拟机状态信息;当管理服务器感知到被宿主的物理主机上所宿主的所有虚拟机均为闲置状态时,向该被宿主的物理主机发送待机命令;VMM收到所述管理服务器下发的待机命令,向硬件层发送对应的待机指令,以控制并使该物理主机进入挂起到内存的待机状态;可见,通过本发明实施例的方案,能够对虚拟机的使用情况进行识别,从而例如,在企业下班后,可以使自身上所宿主的所有虚拟机均为闲置状态的物理主机待机节能,同时,由于处于挂起到内存的待机状态的物理主机,其内存供电,内存状态信息完整;业务主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。进一步的,通过本发明实施例方案,例如针对那些夜间仍然需要工作,被标记为“非闲置状态”的虚拟机,可“热迁移”至其它业务主机;由于本发明实施例的桌面虚拟化系统中此类虚拟机数量较少,“热迁移”不会产生网络流量拥塞现象。In summary, the embodiment of the present invention provides a desktop virtualization system, deploying a probe in each virtual machine, and collecting specific event information of the corresponding virtual machine through the probe; the virtual machine monitoring unit VMM collects The specific event information of the virtual machine and the virtual machine idle policy provided by the management server, determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine status information to the management server; when the management server perceives When all the virtual machines hosted on the hosted physical host are idle, send a standby command to the hosted physical host; VMM receives the standby command issued by the management server, and sends the corresponding standby command to the hardware layer. Instructions to control and make the physical host enter the standby state of suspending memory; it can be seen that through the solution of the embodiment of the present invention, the usage of the virtual machine can be identified, so that, for example, after the enterprise is off work, it can make itself go online All the host virtual machines are idle physical hosts to save energy. At the same time, because the physical hosts are in the standby state of suspend to memory, their memory supplies power and the memory status information is complete; the business host is woken up, directly from the suspended The memory runs and quickly returns to the state before standby, so while achieving energy saving effects, it avoids network traffic congestion caused by "hot migration" of a large number of virtual machines or loading of a large number of virtual machines when the enterprise goes to work, thereby ensuring the virtual machine. Stable, reliable and high-performance, improving end-user experience satisfaction. Further, through the solution of the embodiment of the present invention, for example, for those virtual machines that still need to work at night, the virtual machines marked as "non-idle state" can be "hot migrated" to other business hosts; because the desktop virtualization system of the embodiment of the present invention The number of such virtual machines is small, and "hot migration" will not cause network traffic congestion.
请参阅图2,为本发明实施例的一种物理主机的结构示意图,该物理主机可应用于桌面虚拟化系统中,如图2所示,该物理主机包括:硬件层11,运行在硬件层11上的虚拟机监控单元VMM 12和运行在虚拟机监控单元VMM 12上的至少一个虚拟机(图中以VM1,VM2示意,包括但不限于此),以及至少一个探针(图中以探针13示意,但需要说明的是,探针的部署方式不限于此),其中:Please refer to FIG. 2 , which is a schematic structural diagram of a physical host according to an embodiment of the present invention. The physical host can be applied to a desktop virtualization system. As shown in FIG. 2 , the physical host includes: a hardware layer 11 running on the hardware layer The virtual machine
探针13用于:收集对应虚拟机的特定事件信息;The probe 13 is used to: collect specific event information corresponding to the virtual machine;
虚拟机监控单元VMM 12用于:根据探针13收集的虚拟机的特定事件信息,及获取的虚拟机闲置策略,确定该特定事件信息所关联的虚拟机的当前状态,并向管理服务器40输出对应的虚拟机状态信息,以及用于接收管理服务器40发送的待机命令,并向硬件层发送对应的待机指令。其中,所述虚拟机状态信息表示该虚拟机处于闲置状态或非闲置状态;这里的虚拟机闲置策略的获取方式,可以是管理服务器40应物理主机的请求所下发的虚拟机闲置策略,也可以是管理服务器40主动推送给物理主机的,也可以是预先确定的虚拟机闲置策略,等等。The virtual machine
硬件层11,用于响应所述待机指令,控制并使该物理主机进入挂起到内存的待机状态即ACPI-S3状态。The hardware layer 11 is configured to respond to the standby command, control and make the physical host enter into the standby state of suspending to memory, ie the ACPI-S3 state.
需要说明的是,在一种实现方式下,探针13嵌入于对应虚拟机中,具体是嵌入于对应虚拟机的用户操作系统Guest OS中,有两种层次:a、与驱动Drive同一层次;b、与应用Application同一层次;探针13具体用于收集对应虚拟机的硬件使用信息和/或对应虚拟机的用户操作信息;It should be noted that, in one implementation mode, the probe 13 is embedded in the corresponding virtual machine, specifically embedded in the guest operating system Guest OS of the corresponding virtual machine, and has two levels: a, the same level as the driver Drive; b. It is at the same level as Application; the probe 13 is specifically used to collect hardware usage information of the corresponding virtual machine and/or user operation information of the corresponding virtual machine;
相应的,虚拟机监控单元VMM 12具体用于:根据探针13收集的对应虚拟机的硬件使用信息和/或用户操作信息,及管理服务器40提供的虚拟机闲置策略,确定该硬件使用信息和/或用户操作信息所关联的虚拟机的当前状态,向管理服务器40输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态。具体的,通过消息通讯或共享文件访问方式向管理服务器40输出各虚拟机状态信息;Correspondingly, the virtual machine
需要说明的是,这里的虚拟机的硬件使用信息表示所述虚拟机上发生的硬件事件,所述硬件事件包括但不限于:鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件等等,这里的虚拟机的用户操作信息表示所述虚拟机上发生的操作事件,所述操作事件包括但不限于:用户对虚拟机执行的“闲置”操作、“待机”操作、“休眠”操作和“断开”操作等等;作为对本装置的补充,所述虚拟机可提供“闲置”操作选项或菜单,供用户主动执行虚拟机“闲置”操作;It should be noted that the hardware usage information of the virtual machine here represents hardware events that occur on the virtual machine, and the hardware events include but are not limited to: mouse events, keyboard events, network I/O events, and disk I/O events Etc., the user operation information of the virtual machine here represents the operation event that occurs on the virtual machine, and the operation event includes but not limited to: "idle" operation, "standby" operation, "sleep" operation performed by the user on the virtual machine operation and "disconnect" operation, etc.; as a supplement to this device, the virtual machine can provide an "idle" operation option or menu for the user to actively perform the "idle" operation of the virtual machine;
在又一种实现方式下,如图3所示,虚拟机VM1,VM2中分别部署有前端探针13aa,物理主机的虚拟机监控单元VMM12中部署有后端探针13b,前端探针13aa和后端探针13b可以通过事件通道方式通讯,换言之,探针包括嵌入于对应虚拟机中的前端探针13aa和部署于虚拟机监控单元VMM中的后端探针13b,其中,前端探针13aa具体用于收集对应虚拟机的用户操作信息;后端探针13b具体用于收集对应虚拟机的硬件使用信息;应当理解的是,探针不一定要分为“前端探针”和“后端探针”。In yet another implementation, as shown in FIG. 3, front-end probes 13aa are respectively deployed in virtual machines VM1 and VM2, and back-end probes 13b, front-end probes 13aa and The back-end probe 13b can communicate through an event channel. In other words, the probe includes a front-end probe 13aa embedded in the corresponding virtual machine and a back-end probe 13b deployed in the virtual machine monitoring unit VMM, wherein the front-end probe 13aa It is specifically used to collect user operation information of the corresponding virtual machine; the back-end probe 13b is specifically used to collect the hardware usage information of the corresponding virtual machine; it should be understood that the probes are not necessarily divided into "front-end probe" and "back-end probe" probe".
相应的,虚拟机监控单元VMM12具体用于:根据前端探针13a收集的对应虚拟机的用户操作信息和后端探针13b收集的对应虚拟机的硬件使用信息,及管理服务器40提供的虚拟机闲置策略,确定该硬件使用信息和用户操作信息所关联的虚拟机的当前状态,向管理服务器40输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态。Correspondingly, the virtual machine monitoring unit VMM12 is specifically used for: according to the user operation information of the corresponding virtual machine collected by the front-end probe 13a and the hardware usage information of the corresponding virtual machine collected by the back-end probe 13b, and the virtual machine provided by the management server 40 The idle policy is to determine the current state of the virtual machine associated with the hardware usage information and user operation information, and output the corresponding virtual machine state information to the management server 40, wherein the virtual machine state information indicates that the virtual machine is in an idle state or not idle state.
较优的,虚拟机监控单元12进一步用于接收管理服务器40发送的迁移命令,将所述迁移命令中包含的虚拟机标识ID对应的虚拟机迁移到所述迁移命令中包含的目的业务主机信息对应的目的业务主机上。以及,硬件层11进一步用于:接收管理服务器40发送的唤醒指令,响应所述唤醒指令,运行挂起的内存,激活对应的虚拟机,使得该虚拟机进入可操纵状态。具体的,唤醒指令是管理服务器直接向物理主机的硬件层发送的指令;由硬件层(具体可以是网卡)接收,并触发CPU上电、加载运行。Preferably, the virtual
下面介绍探针是通过如下方法来收集虚拟机硬件使用信息和/或虚拟机用户操作信息:The following describes how the probe collects virtual machine hardware usage information and/or virtual machine user operation information through the following methods:
1、对应虚拟机的用户操作信息:是探针通过向Guest OS注册相应操作的事件处理函数,截获对应的用户操作事件;1. User operation information corresponding to the virtual machine: the probe intercepts the corresponding user operation event by registering the corresponding operation event processing function with the Guest OS;
2、对应虚拟机的硬件使用信息中的鼠标和键盘信息:探针通过向Guest OS注册鼠标和键盘的事件处理函数,截获相应事件;网络I/O信息:是探针通过向Guest OS注册相应的驱动接口,截获网络I/O事件;磁盘I/O信息:是探针通过向Guest OS注册相应的驱动接口,截获磁盘I/O事件;2. Corresponding to the mouse and keyboard information in the hardware usage information of the virtual machine: the probe intercepts the corresponding events by registering the event processing functions of the mouse and keyboard with the Guest OS; network I/O information: the probe registers the corresponding events with the Guest OS The driver interface intercepts network I/O events; disk I/O information: the probe registers the corresponding driver interface with the Guest OS to intercept disk I/O events;
在虚拟机硬件使用信息和/或虚拟机用户操作信息收集到后,可通过事件通道或消息通讯等方式传递至虚拟机监控单元VMM 12,22,32;After the virtual machine hardware usage information and/or virtual machine user operation information is collected, it can be transmitted to the virtual machine
下面介绍虚拟机闲置策略:The virtual machine idle policy is described below:
这里的虚拟机闲置策略包括:虚拟机闲置时间区段、虚拟机闲置类别、虚拟机硬件使用信息闲置判定条件和虚拟机用户操作信息闲置判定条件这四种条件中的一种或任意组合;具体可以根据实际应用灵活确定。The virtual machine idle policy here includes: one or any combination of four conditions: virtual machine idle time period, virtual machine idle category, virtual machine hardware usage information idle judgment condition and virtual machine user operation information idle judgment condition; It can be flexibly determined according to actual applications.
举例说明:虚拟机闲置策略为:“虚拟机闲置类别为可闲置”+“闲置时间区段18:00-23:00”+“鼠标+键盘30分钟无事件”||“用户待机操作”;若虚拟机A属于可闲置类别,且当前时间段处于18:00-23:00,且虚拟机A已30分钟无鼠标键标事件,或者虚拟机A被用户持行待机操作,则虚拟机A处于闲置状态,否则虚拟机A处于非闲置状态;需要说明的是,这里的“+”表示“和”的关系,“||”表示“或”的关系。For example: The virtual machine idle policy is: "The virtual machine idle category is idle" + "Idle time range 18:00-23:00" + "Mouse + keyboard without events for 30 minutes"||"User standby operation"; If virtual machine A belongs to the idle category, and the current time period is between 18:00-23:00, and virtual machine A has no mouse button event for 30 minutes, or virtual machine A is held by the user for standby operation, then virtual machine A Otherwise, virtual machine A is in a non-idle state; it should be noted that "+" here means "and" relationship, and "||" means "or" relationship.
其中,虚拟机闲置时间区段指的是虚拟机可闲置的时间区段,如20:00-06:00;虚拟机闲置类别指的是虚拟机是否可闲置;如虚拟机A为不可闲置类别,那么不管其它条件是否满足,该虚拟机A不会被闲置;Among them, the virtual machine idle time period refers to the time period during which the virtual machine can be idle, such as 20:00-06:00; the virtual machine idle category refers to whether the virtual machine can be idle; for example, virtual machine A is a non-idleable category , then no matter whether other conditions are satisfied, the virtual machine A will not be idle;
虚拟机硬件使用信息闲置判定条件指的是根据上报的虚拟机硬件使用信息所表示的硬件事件的发生频率来判定虚拟机是否可以闲置,各种虚拟机硬件事件可以任意组合使用,所述硬件事件包括但不限于鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件等等;The virtual machine hardware usage information idle judgment condition refers to judging whether the virtual machine can be idle according to the occurrence frequency of hardware events represented by the reported virtual machine hardware usage information. Various virtual machine hardware events can be used in any combination. The hardware event Including but not limited to mouse events, keyboard events, network I/O events and disk I/O events, etc.;
虚拟机用户操作信息闲置判定条件指的是判定被执行所述虚拟机用户操作信息所表示的操作的虚拟机是否可以闲置;具体的,如果上报的虚拟机用户操作信息所表示的操作为闲置操作,则该虚拟机可闲置;如果上报的虚拟机用户操作信息所表示的操作为预定操作范围内的操作,则根据设定的操作替代规则确定该虚拟机是否可闲置;具体的,如果设定虚拟机“待机”、“休眠”或“断开”操作能以“闲置”操作替代,则被执行待机”、“休眠”或“断开”操作的虚拟机可闲置;如果设定虚拟机“待机”、“休眠”或“断开”操作不能以“闲置”操作替代,则被执行待机”、“休眠”或“断开”操作的虚拟机虚拟机不可闲置;这里的预定操作范围包括“待机”操作、“休眠”操作或“断开”操作。The virtual machine user operation information idle judgment condition refers to determining whether the virtual machine that is executed with the operation represented by the virtual machine user operation information can be idle; specifically, if the operation represented by the reported virtual machine user operation information is an idle operation , then the virtual machine can be idle; if the operation indicated by the reported virtual machine user operation information is an operation within the predetermined operation range, then it is determined whether the virtual machine can be idle according to the set operation substitution rules; specifically, if the The "standby", "hibernation" or "disconnect" operation of the virtual machine can be replaced by the "idle" operation, and the virtual machine that has been executed with the "standby", "hibernation" or "disconnect" operation can be idle; if the virtual machine " "Standby", "Hibernation" or "Disconnect" operations cannot be replaced by "Idle" operations, and the virtual machines that are executed by "Standby", "Hibernation" or "Disconnect" operations cannot be idle; the scope of predetermined operations here includes " Standby operation, Hibernation operation or Disconnect operation.
需要说明的是,为了增强虚拟机闲置策略的灵活性,针对不同的虚拟机闲置时间区段和/或虚拟机闲置类别,对应的虚拟机硬件使用信息闲置判定条件和/或虚拟机用户操作信息闲置判定条件可以是不同的。It should be noted that, in order to enhance the flexibility of the virtual machine idle policy, for different virtual machine idle time periods and/or virtual machine idle categories, the corresponding virtual machine hardware usage information idle judgment conditions and/or virtual machine user operation information The idle determination conditions may be different.
在一种实现方式下,虚拟机监控单元VMM 12具体用于:当上报信息所关联的虚拟机属于可闲置类别,且当前时间段处于第一闲置时间区段内,且该虚拟机在第一阈值时间内未发生硬件事件,或者,硬件事件发生频率小于第一阈值频率,或者,该虚拟机被执行闲置操作,或者该虚拟机被执行预定操作范围内的操作且该操作能以“闲置”操作替代,则确定该虚拟机当前处于可闲置状态,并向管理服务器40输出表示闲置状态的虚拟机状态信息,以及用于接收管理服务器40下发的待机命令,并向硬件层发送对应的待机指令,以控制并使该物理主机进入ACPI-S3状态;这里的硬件事件包括鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件中的一种或多种;In one implementation, the virtual machine
在另一种实现方式下,虚拟机监控单元VMM 12具体用于:当上报信息所关联的虚拟机属于可闲置类别,且当前时间段处于第二闲置时间区段内,且该虚拟机在第二阈值时间内未发生硬件事件,或者,硬件事件发生频率小于第二阈值频率,或者,该虚拟机被执行闲置操作,或者该虚拟机被执行预定操作范围内的操作且该操作能以“闲置”操作替代,则确定该虚拟机当前处于可闲置状态,并向管理服务器40输出表示闲置状态的虚拟机状态信息,以及用于接收管理服务器40下发的待机命令,并向硬件层发送对应的待机指令,以控制并使该物理主机进入ACPI-S3状态,以及用于接收管理服务器40下发的待机命令,并向硬件层发送对应的待机指令,以控制并使该物理主机进入ACPI-S3状态;In another implementation, the virtual machine
在另一种实现方式下,虚拟机监控单元VMM 12具体用于:当上报信息所关联的虚拟机属于可闲置类别,且该虚拟机被执行预定操作范围内的操作且该操作不能以“闲置”操作替代,则确定该虚拟机当前处于不可闲置状态,并向管理服务器40输出表示不可闲置状态的虚拟机状态信息,以及用于接收管理服务器40下发的待机命令,并向硬件层发送对应的待机指令,以控制并使该物理主机进入ACPI-S3状态;In another implementation, the virtual machine
在另一种实现方式下,虚拟机监控单元VMM 12具体用于:当上报信息所关联的虚拟机属于不可闲置类别,则确定该虚拟机当前处于不可闲置状态,并向管理服务器40输出表示不可闲置状态的虚拟机状态信息,以及用于接收管理服务器40下发的待机命令,并向硬件层发送对应的待机指令,以控制并使该物理主机进入ACPI-S3状态;In another implementation, the virtual machine
应当理解的是,虚拟机的类别划分的粒度不限于:可闲置类别和不可闲置类别。在更精细化管理的情况下,可闲置类别可进一步划分为不同的子类别,例如A,B,C。It should be understood that, the granularity of classifying virtual machines is not limited to: a class that can be idled and a class that cannot be idled. In the case of more fine-grained management, the idle category can be further divided into different subcategories, such as A, B, C.
关于如上功能单元的具体实现可参考方法实施例的描述。Regarding the specific implementation of the above functional units, reference may be made to the description of the method embodiments.
本发明实施例装置的各个单元可以集成于一体,也可以分离部署。上述单元可以合并为一个单元,也可以进一步拆分成多个子单元。Each unit of the device in the embodiment of the present invention can be integrated into one body, or can be deployed separately. The above units can be combined into one unit, and can also be further divided into multiple sub-units.
综上所述,本发明实施例提供一种物理主机,在每个虚拟机中部署探针,通过探针收集对应虚拟机的特定事件信息;虚拟机监控单元VMM根据所述探针收集的虚拟机的特定事件信息及获取的虚拟机闲置策略,确定所述特定事件信息所关联的虚拟机的当前状态,并向所述管理服务器输出对应的虚拟机状态信息;当管理服务器感知到被宿主的物理主机上所宿主的所有虚拟机均为闲置状态时,向该被宿主的物理主机发送待机命令;VMM收到所述管理服务器下发的待机命令,向硬件层发送对应的待机指令,以控制并使该物理主机进入挂起到内存的待机状态;可见,通过本发明实施例的方案,能够对虚拟机的使用情况进行识别,从而例如,在企业下班后,可以使自身上所宿主的所有虚拟机均为闲置状态的物理主机待机节能,同时,由于处于挂起到内存的待机状态的物理主机,其内存供电,内存状态信息完整;业务主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。进一步的,通过本发明实施例方案,例如针对那些夜间仍然需要工作,被标记为“非闲置状态”的虚拟机,可“热迁移”至其它业务主机;由于本发明实施例的桌面虚拟化系统中此类虚拟机数量较少,“热迁移”不会产生网络流量拥塞现象。In summary, the embodiment of the present invention provides a physical host, deploying probes in each virtual machine, and collecting specific event information of the corresponding virtual machine through the probes; the virtual machine monitoring unit VMM collects virtual machine specific event information and the acquired virtual machine idle policy, determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine state information to the management server; when the management server perceives that the hosted When all virtual machines hosted on the physical host are in an idle state, a standby command is sent to the hosted physical host; VMM receives the standby command issued by the management server, and sends a corresponding standby command to the hardware layer to control And make the physical host enter the standby state of suspending to the memory; it can be seen that through the scheme of the embodiment of the present invention, the usage of the virtual machine can be identified, so that for example, after the enterprise is off work, all the hosts on itself can be The virtual machines are all idle physical hosts to save energy. At the same time, because the physical hosts are in the standby state of suspend to memory, their memory is powered and the memory status information is complete; the business host is awakened and runs directly from the suspended memory, quickly Restore to the state before standby, so while achieving the energy-saving effect, avoid the network traffic congestion caused by the "hot migration" of a large number of virtual machines or the loading of a large number of virtual machines when the enterprise goes to work, thereby ensuring the stability and reliability of the virtual machine. performance, improving end-user experience satisfaction. Further, through the solution of the embodiment of the present invention, for example, for those virtual machines that still need to work at night, the virtual machines marked as "non-idle state" can be "hot migrated" to other business hosts; because the desktop virtualization system of the embodiment of the present invention The number of such virtual machines is small, and "hot migration" will not cause network traffic congestion.
请参阅图4,为本发明实施例的一种管理服务器的结构示意图,如图4所示,管理服务器40包括策略管理单元41和云管理单元42,其中:Please refer to FIG. 4, which is a schematic structural diagram of a management server according to an embodiment of the present invention. As shown in FIG. 4, the management server 40 includes a policy management unit 41 and a cloud management unit 42, wherein:
策略管理单元41,用于管理虚拟机闲置策略,以及向物理主机下发该虚拟机闲置策略,该虚拟机闲置策略供所述物理主机用以确定该物理主机上宿主的虚拟机的状态;需要说明的是,一般是系统初始化时,由策略管理单元41下发虚拟机闲置策略。这里的虚拟机闲置策略的具体内容,请参见前述实施例,这里不再赘述。The policy management unit 41 is used to manage the idle policy of the virtual machine, and deliver the idle policy of the virtual machine to the physical host, and the idle policy of the virtual machine is used by the physical host to determine the status of the virtual machine hosted on the physical host; It should be noted that, generally, when the system is initialized, the policy management unit 41 issues the virtual machine idle policy. For the specific content of the virtual machine idle policy here, please refer to the foregoing embodiments, and details are not repeated here.
云管理单元42,用于在获得的虚拟机状态信息表示被宿主的物理主机上所宿主的所有虚拟机的状态均为闲置状态时,向该被宿主的物理主机发送待机命令,所述待机命令用于控制并使该物理主机进入挂起到内存的待机状态。其中,所述虚拟机状态信息表示虚拟机处于“闲置状态”或“非闲置状态”;The cloud management unit 42 is configured to send a standby command to the hosted physical host when the obtained virtual machine state information indicates that all the virtual machines hosted on the hosted physical host are idle, and the standby command Used to control and put the physical host into a suspend-to-ram standby state. Wherein, the virtual machine state information indicates that the virtual machine is in an "idle state" or a "non-idle state";
在一种实现方式下,策略管理单元41进一步用于管理虚拟机迁移策略;这里的虚拟机迁移策略的具体内容,请参见前述实施例,这里不再赘述。In one implementation manner, the policy management unit 41 is further configured to manage the virtual machine migration policy; for the specific content of the virtual machine migration policy here, please refer to the foregoing embodiments, which will not be repeated here.
云管理单元42进一步用于:根据获得的虚拟机状态信息及虚拟机迁移策略,确定需要迁移的处于不可闲置状态的虚拟机和迁移目的业务主机,并向需要迁移的虚拟机宿主的物理主机发送迁移命令;其中,所述迁移命令包括需要迁移的虚拟机标识ID和迁移的目的主机信息。这里的虚拟机标识ID是VMM为每一个虚拟机分配的唯一的字符串序列,用于唯一标识虚拟机;例如,在Xen架构下称为uuid;这里的迁移的目的主机信息,具体可以是目的业务主机的IP地址。The cloud management unit 42 is further used for: according to the acquired virtual machine state information and virtual machine migration strategy, determine the virtual machine that needs to be migrated and is in the non-idle state and the migration destination service host, and send the host to the physical host that hosts the virtual machine that needs to be migrated. A migration command; wherein, the migration command includes the ID of the virtual machine to be migrated and the information of the destination host for migration. The virtual machine identification ID here is a unique string sequence assigned by VMM to each virtual machine, which is used to uniquely identify the virtual machine; for example, it is called uuid under the Xen architecture; the destination host information of the migration here can specifically be the destination IP address of the service host.
在一种实现方式下,云管理单元42进一步用于:响应用户登录虚拟机的操作命令,向该虚拟机宿主的物理主机下发唤醒指令,所述唤醒指令用于使得该虚拟机进入可操纵状态;需要说明的是,参见图1b所示,用户通过SC或TC登录对应虚拟机,相应的操作命令传递到管理服务器40(具体是云管理单元42),管理服务器40(具体是云管理单元42)响应该操作命令,向该虚拟机宿主的物理主机10,20,30下发唤醒指令,具体是通过网络消息向该虚拟机宿主的物理主机的硬件层下发唤醒指令,所述唤醒指令为网卡唤醒指令。In one implementation, the cloud management unit 42 is further configured to: respond to the operation command of the user to log in to the virtual machine, and issue a wake-up instruction to the physical host hosting the virtual machine, and the wake-up instruction is used to make the virtual machine enter a controllable state; it should be noted that, as shown in FIG. 1b, the user logs in to the corresponding virtual machine through SC or TC, and the corresponding operation command is delivered to the management server 40 (specifically, the cloud management unit 42), and the management server 40 (specifically, the cloud management unit 42) 42) In response to the operation command, send a wake-up instruction to the physical host 10, 20, 30 of the virtual machine host, specifically send a wake-up instruction to the hardware layer of the physical host of the virtual machine host through a network message, and the wake-up instruction A wake-up command for the network card.
在实际应用中,本发明实施例的管理服务器可以为物理服务器或虚拟机。In practical applications, the management server in this embodiment of the present invention may be a physical server or a virtual machine.
关于如上功能单元的具体实现可参考方法实施例的描述。Regarding the specific implementation of the above functional units, reference may be made to the description of the method embodiments.
本发明实施例装置的各个单元可以集成于一体,也可以分离部署。上述单元可以合并为一个单元,也可以进一步拆分成多个子单元。Each unit of the device in the embodiment of the present invention can be integrated into one body, or can be deployed separately. The above units can be combined into one unit, and can also be further divided into multiple sub-units.
综上所述,本发明实施例提供一种管理服务器,在获得的虚拟机状态信息表示被宿主的物理主机上所宿主的所有虚拟机的状态均为“闲置状态”状态时,向该被宿主的物理主机发送待机命令,使得物理主机响应该待机命令进入挂起到内存的待机状态即ACPI-S3状态;可见,通过本发明实施例的方案,能够使部分业务主机待机节能,同时,由于处于ACPI-S3状态的业务主机,其内存供电,内存状态信息完整;业务主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。To sum up, the embodiment of the present invention provides a management server that, when the obtained virtual machine state information indicates that all the virtual machines hosted on the hosted physical host are in the "idle state" state, sends The physical host sends a standby command, so that the physical host responds to the standby command and enters the standby state that is suspended to the memory, that is, the ACPI-S3 state; it can be seen that through the solution of the embodiment of the present invention, it is possible to make some business hosts standby and save energy. The ACPI-S3 state of the business host, its memory power supply, the memory status information is complete; the business host is woken up, directly runs from the suspended memory, and quickly restores to the state before standby, so while achieving the energy saving effect, it is avoided. When a large number of virtual machines are "hot migrated" or the network traffic congestion caused by a large number of virtual machine loading, the stability, reliability and high performance of the virtual machines are ensured, and the end user experience satisfaction is improved.
进一步的,通过本发明实施例方案,例如针对那些夜间仍然需要工作,被标记为“非闲置状态”的虚拟机,可“热迁移”至其它业务主机;由于本发明实施例的桌面虚拟化系统中此类虚拟机数量较少,“热迁移”不会产生网络流量拥塞现象。Further, through the solution of the embodiment of the present invention, for example, for those virtual machines that still need to work at night, the virtual machines marked as "non-idle state" can be "hot migrated" to other business hosts; because the desktop virtualization system of the embodiment of the present invention The number of such virtual machines is small, and "hot migration" will not cause network traffic congestion.
请参阅图5,为本发明实施例提供一种桌面虚拟化环境下的节能方法的流程示意图,该方法可以应用于如图1a和1b所示桌面虚拟化系统中的物理主机,该物理主机包括:硬件层,运行在硬件层上的虚拟机监控单元VMM和运行在虚拟机监控单元VMM上的至少一个虚拟机,以及至少一个探针,如图5所示,该方法可以包括如下步骤:Please refer to FIG. 5 , which provides a schematic flowchart of an energy-saving method in a desktop virtualization environment according to an embodiment of the present invention. The method can be applied to a physical host in a desktop virtualization system as shown in FIGS. 1a and 1b. The physical host includes : a hardware layer, a virtual machine monitoring unit VMM running on the hardware layer and at least one virtual machine running on the virtual machine monitoring unit VMM, and at least one probe, as shown in Figure 5, the method may include the following steps:
S501、通过探针收集对应虚拟机的特定事件信息;S501. Collect specific event information corresponding to the virtual machine through a probe;
S502、根据收集到的虚拟机的特定事件信息,及获得的虚拟机闲置策略,确定该特定事件信息所关联的虚拟机的当前状态,向管理服务器输出对应的虚拟机状态信息,其中,所述虚拟机状态信息表示虚拟机处于闲置状态或非闲置状态;S502. According to the collected specific event information of the virtual machine and the obtained idle policy of the virtual machine, determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine state information to the management server, wherein the The virtual machine state information indicates that the virtual machine is in an idle state or a non-idle state;
这里虚拟机闲置策略的获得方式,可以是管理服务器主动下发的虚拟机闲置策略,也可以是管理服务器应物理主机的请求所下发的虚拟机闲置策略,也可以是预先确定的虚拟机闲置策略,等等。Here, the way to obtain the virtual machine idle policy can be the virtual machine idle policy issued actively by the management server, the virtual machine idle policy issued by the management server in response to the request of the physical host, or the predetermined virtual machine idle policy. strategy, etc.
这里的虚拟机闲置策略包括:虚拟机闲置时间区段、虚拟机闲置类别、虚拟机硬件使用信息闲置判定条件和虚拟机用户操作信息闲置判定条件这四种条件中的一种或任意组合;具体可以根据实际应用灵活确定。对于虚拟机闲置策略的详细描述请参考前述实施例,这里不再赘述。The virtual machine idle policy here includes: one or any combination of four conditions: virtual machine idle time period, virtual machine idle category, virtual machine hardware usage information idle judgment condition and virtual machine user operation information idle judgment condition; It can be flexibly determined according to actual applications. For a detailed description of the virtual machine idle policy, please refer to the foregoing embodiments, and details are not repeated here.
S503、接收管理服务器发送的待机命令,并向硬件层发送对应的待机指令,以控制并使该虚拟机宿主的物理主机进入挂起到内存的待机状态即ACPI-S3状态。S503. Receive a standby command sent by the management server, and send a corresponding standby command to the hardware layer, so as to control and make the physical host hosting the virtual machine enter the standby state of suspending memory, that is, the ACPI-S3 state.
在一种实现方式下,S501具体包括:通过嵌入于对应虚拟机中的探针收集所述虚拟机的硬件使用信息和/或用户操作信息;相应的,S502具体包括:根据收集到的对应虚拟机的硬件使用信息和/或对应虚拟机的用户操作信息及管理服务器提供的虚拟机闲置策略,确定所述硬件使用信息和/或用户操作信息所关联的虚拟机的当前状态,向所述管理服务器输出对应的虚拟机状态信息。In one implementation manner, S501 specifically includes: collecting hardware usage information and/or user operation information of the virtual machine through a probe embedded in the corresponding virtual machine; correspondingly, S502 specifically includes: according to the collected corresponding virtual machine The hardware usage information of the machine and/or the user operation information of the corresponding virtual machine and the idle policy of the virtual machine provided by the management server determine the current status of the virtual machine associated with the hardware usage information and/or user operation information, and report to the management The server outputs corresponding virtual machine state information.
在另一种实现方式下,S501具体包括:由部署于对应虚拟机中的前端探针收集对应虚拟机的用户操作信息,由部署于虚拟机监控单元VMM中的后端探针收集对应虚拟机的硬件使用信息;相应的,S502具体包括:根据所述前端探针收集的对应虚拟机的用户操作信息和所述后端探针收集的对应虚拟机的硬件使用信息及管理服务器提供的虚拟机闲置策略,确定所述硬件使用信息和用户操作信息所关联的虚拟机的当前状态,向所述管理服务器输出对应的虚拟机状态信息。In another implementation, S501 specifically includes: collecting the user operation information of the corresponding virtual machine by the front-end probe deployed in the corresponding virtual machine, and collecting the corresponding virtual machine by the back-end probe deployed in the virtual machine monitoring unit VMM Correspondingly, S502 specifically includes: according to the user operation information of the corresponding virtual machine collected by the front-end probe, the hardware usage information of the corresponding virtual machine collected by the back-end probe, and the virtual machine provided by the management server The idle policy determines the current state of the virtual machine associated with the hardware usage information and the user operation information, and outputs the corresponding virtual machine state information to the management server.
较佳的,本发明实施例的方法中,进一步包括:接收管理服务器发送的迁移命令,将所述迁移命令中包含的虚拟机标识ID对应的虚拟机迁移到所述迁移命令中包含的目的业务主机信息对应的目的业务主机上。其中,所述迁移命令包括需要迁移的虚拟机标识ID和迁移的目的主机信息。这里的虚拟机标识ID是VMM为每一个虚拟机分配的唯一的字符串序列,用于唯一标识虚拟机;如,在Xen架构下称为uuid;迁移的目的主机信息,具体可以是目的业务主机的IP地址。Preferably, the method in the embodiment of the present invention further includes: receiving a migration command sent by the management server, and migrating the virtual machine corresponding to the virtual machine ID contained in the migration command to the target service contained in the migration command On the destination service host corresponding to the host information. Wherein, the migration command includes the ID of the virtual machine to be migrated and the information of the destination host of the migration. The virtual machine identification ID here is a unique string sequence assigned by VMM to each virtual machine, which is used to uniquely identify the virtual machine; for example, it is called uuid under the Xen architecture; the destination host information for migration can be specifically the destination business host IP address.
进一步的,本发明实施例的方法进一步包括:接收管理服务器发送的唤醒指令,响应该唤醒指令,运行挂起的内存,激活对应的虚拟机,使得该虚拟机进入可操纵状态,这里的唤醒指令为管理服务器响应用户登录虚拟机的操作所下发的。Further, the method in the embodiment of the present invention further includes: receiving a wake-up command sent by the management server, responding to the wake-up command, running the suspended memory, activating the corresponding virtual machine, and making the virtual machine enter a manipulable state, where the wake-up command Issued by the management server in response to the operation of the user logging in to the virtual machine.
所述虚拟机的硬件使用信息表示所述虚拟机上发生的硬件事件,所述硬件事件包括:鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件中的一种或多种;所述虚拟机的用户操作信息表示所述虚拟机上发生的操作事件,所述操作事件包括:用户对虚拟机执行的闲置操作、待机操作、休眠操作和断开操作中的一种或多种;The hardware usage information of the virtual machine represents a hardware event occurring on the virtual machine, and the hardware event includes: one or more of a mouse event, a keyboard event, a network I/O event, and a disk I/O event; The user operation information of the virtual machine indicates an operation event that occurs on the virtual machine, and the operation event includes: one or more of an idle operation, a standby operation, a hibernation operation, and a disconnection operation performed by the user on the virtual machine ;
所述虚拟机闲置策略包括:虚拟机闲置时间区段、虚拟机闲置类别、虚拟机硬件使用信息闲置判定条件和虚拟机用户操作信息闲置判定条件中的一种或任意组合;The virtual machine idle policy includes: one or any combination of virtual machine idle time period, virtual machine idle category, virtual machine hardware use information idle judgment condition and virtual machine user operation information idle judgment condition;
其中,所述虚拟机闲置时间区段指的是虚拟机可闲置的时间区段;所述虚拟机闲置类别指的是虚拟机是否可闲置;所述虚拟机硬件使用信息闲置判定条件指的是根据所述虚拟机硬件使用信息所表示的硬件事件的发生频率来判定虚拟机是否可以闲置;所述虚拟机用户操作信息闲置判定条件指的是判定被执行所述虚拟机用户操作信息所表示的操作的虚拟机是否可以闲置。具体的内容和实现可以参考前述实施例的描述,这里不再赘述。Wherein, the virtual machine idle time section refers to the time section during which the virtual machine can be idle; the virtual machine idle category refers to whether the virtual machine can be idle; the virtual machine hardware usage information idle judgment condition refers to Determine whether the virtual machine can be idle according to the frequency of occurrence of hardware events represented by the virtual machine hardware usage information; Whether the operating virtual machine can be idled. For specific content and implementation, reference may be made to the description of the foregoing embodiments, and details are not repeated here.
在一种实现方式下,根据收集到的硬件使用信息和/或用户操作信息及获取的虚拟机闲置策略,确定该硬件使用信息和/或用户操作信息所关联的虚拟机的当前状态,向管理服务器输出对应的虚拟机状态信息,具体包括:In one implementation, according to the collected hardware usage information and/or user operation information and the acquired virtual machine idle policy, determine the current status of the virtual machine associated with the hardware usage information and/or user operation information, and send the information to the management The server outputs the corresponding virtual machine status information, including:
当收集到的硬件使用信息和/或用户操作信息所关联的虚拟机属于可闲置类别,且当前时间段处于第一闲置时间区段内,且该虚拟机在第一阈值时间内未发生硬件事件,或者,硬件事件发生频率小于第一阈值频率,或者,该虚拟机被执行闲置操作,或者该虚拟机被执行预定操作范围内的操作且该操作能以“闲置”操作替代,则确定该虚拟机当前处于可闲置状态,并向管理服务器输出表示闲置状态的虚拟机状态信息;这里的硬件事件包括鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件中的一种或多种;When the virtual machine associated with the collected hardware usage information and/or user operation information belongs to the idle category, and the current time period is within the first idle time period, and no hardware event occurs on the virtual machine within the first threshold time , or, the frequency of occurrence of hardware events is less than the first threshold frequency, or, the virtual machine is executed an idle operation, or the virtual machine is executed an operation within a predetermined operating range and the operation can be replaced by an "idle" operation, then it is determined that the virtual machine The machine is currently in an idle state, and outputs virtual machine status information indicating the idle state to the management server; the hardware events here include one or more of mouse events, keyboard events, network I/O events, and disk I/O events ;
或者,当收集到的硬件使用信息和/或用户操作信息所关联的虚拟机属于可闲置类别,且当前时间段处于第二闲置时间区段内,且该虚拟机在第二阈值时间内未发生硬件事件,或者,硬件事件发生频率小于第二阈值频率,或者,该虚拟机被执行闲置操作,或者该虚拟机被执行预定操作范围内的操作且该操作能以“闲置”操作替代,则确定该虚拟机当前处于可闲置状态,并向管理服务器输出表示闲置状态的虚拟机状态信息;其中,所述预定操作范围包括待机操作、休眠操作或断开操作。Or, when the virtual machine associated with the collected hardware usage information and/or user operation information belongs to the idle category, and the current time period is within the second idle time period, and the virtual machine does not occur within the second threshold time A hardware event, or, the hardware event occurrence frequency is less than the second threshold frequency, or, the virtual machine is performed an idle operation, or the virtual machine is performed an operation within a predetermined operation range and the operation can be replaced by an "idle" operation, then it is determined The virtual machine is currently in an idle state, and outputs virtual machine state information indicating the idle state to the management server; wherein, the predetermined operation range includes standby operation, hibernation operation or disconnection operation.
或者,当收集到的硬件使用信息和/或用户操作信息所关联的虚拟机属于可闲置类别,且该虚拟机被执行预定操作范围内的操作且该操作不能以“闲置”操作替代,则确定该虚拟机当前处于不可闲置状态,并向管理服务器输出表示不可闲置状态的虚拟机状态信息;Or, when the virtual machine associated with the collected hardware usage information and/or user operation information belongs to the idle category, and the virtual machine is executed within the predetermined operation range and the operation cannot be replaced by the "idle" operation, then determine The virtual machine is currently in a non-idle state, and outputs virtual machine status information indicating the non-idle state to the management server;
或者,当收集到的硬件使用信息和/或用户操作信息所关联的虚拟机属于不可闲置类别,则确定该虚拟机当前处于不可闲置状态,并向管理服务器输出表示不可闲置状态的虚拟机状态信息。Or, when the virtual machine associated with the collected hardware usage information and/or user operation information belongs to the non-idleable category, it is determined that the virtual machine is currently in a non-idleable state, and the virtual machine status information indicating the non-idleable state is output to the management server .
综上所述,本发明实施例提供一种桌面虚拟化环境下的节能方法,在每个虚拟机中部署探针,通过探针收集对应虚拟机的特定事件信息;根据所述探针收集的虚拟机的特定事件信息及管理服务器提供的虚拟机闲置策略,确定所述特定事件信息所关联的虚拟机的当前状态,并向管理服务器输出对应的虚拟机状态信息;当收到管理服务器下发的待机命令,向硬件层发送对应的待机指令,以控制并使该物理主机进入挂起到内存的待机状态;可见,通过本发明实施例的方案,能够对虚拟机的使用情况进行识别,从而例如,在企业下班后,可以使自身上所宿主的所有虚拟机均为闲置状态的物理主机待机节能,同时,由于处于挂起到内存的待机状态的物理主机,其内存供电,内存状态信息完整;业务主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。To sum up, the embodiment of the present invention provides an energy-saving method in a desktop virtualization environment, in which a probe is deployed in each virtual machine, and the specific event information of the corresponding virtual machine is collected through the probe; The specific event information of the virtual machine and the virtual machine idle policy provided by the management server determine the current state of the virtual machine associated with the specific event information, and output the corresponding virtual machine status information to the management server; The standby command sends the corresponding standby command to the hardware layer to control and make the physical host enter the standby state of suspend-to-memory; it can be seen that through the solution of the embodiment of the present invention, the usage of the virtual machine can be identified, thereby For example, after the enterprise is off work, all the virtual machines hosted by itself can be idled to save energy. At the same time, because the physical host is in the standby state of suspending to memory, its memory is powered and its memory status information is complete. ;The business host is woken up, runs directly from the suspended memory, and quickly restores to the state before standby, so while achieving energy saving effects, it avoids the "hot migration" of a large number of virtual machines or the loading of a large number of virtual machines when the enterprise goes to work, for example. Network traffic congestion, thereby ensuring the stability, reliability and high performance of virtual machines, and improving end-user experience satisfaction.
进一步的,通过本发明实施例方案,例如针对那些夜间仍然需要工作,被标记为“非闲置状态”的虚拟机,可“热迁移”至其它业务主机;由于本发明实施例的桌面虚拟化系统中此类虚拟机数量较少,“热迁移”不会产生网络流量拥塞现象。Further, through the solution of the embodiment of the present invention, for example, for those virtual machines that still need to work at night, the virtual machines marked as "non-idle state" can be "hot migrated" to other business hosts; because the desktop virtualization system of the embodiment of the present invention The number of such virtual machines is small, and "hot migration" will not cause network traffic congestion.
下面结合实际应用来详细介绍下本发明实施例的方法:The method of the embodiment of the present invention will be introduced in detail below in combination with practical applications:
请参阅图6,为本发明实施例的又一种桌面虚拟化环境下的节能方法的流程示意图,可以应用于在桌面虚拟化系统办公环境中,在用户下班时间区段内触发虚拟机待机流程的场景,如图6所示,该方法包括:Please refer to FIG. 6 , which is a schematic flow diagram of another energy-saving method in a desktop virtualization environment according to an embodiment of the present invention, which can be applied in an office environment of a desktop virtualization system to trigger a virtual machine standby process during the user's off-duty time period scenario, as shown in Figure 6, the method includes:
S601、流程开始;S601, the process starts;
在初始状态,业务主机上的虚拟机运行正常。In the initial state, the virtual machine on the service host runs normally.
S602、用户通过TC(Thin Client,瘦客户机)或者SC(Software Client,软件终端)访问虚拟机桌面,手工执行虚拟机闲置操作;S602, the user accesses the desktop of the virtual machine through TC (Thin Client, thin client) or SC (Software Client, software terminal), and manually executes the idle operation of the virtual machine;
需要说明的是,所述虚拟机可提供“闲置”操作选项或菜单,供用户主动执行虚拟机“闲置”操作;It should be noted that the virtual machine may provide an "idle" operation option or menu for the user to actively perform the "idle" operation of the virtual machine;
S603、业务主机的虚拟机中嵌入的探针收集该虚拟机的硬件使用信息和该虚拟机的用户操作信息,并将该虚拟机的硬件使用信息和用户操作信息传递给业务主机的VMM;S603. The probe embedded in the virtual machine of the service host collects the hardware usage information of the virtual machine and the user operation information of the virtual machine, and transmits the hardware usage information and user operation information of the virtual machine to the VMM of the service host;
在本实施例中,该虚拟机的硬件使用信息表示该虚拟机上发生的硬件事件,所述硬件事件包括鼠标事件、键盘事件、网络I/O事件和磁盘I/O事件等等,该虚拟机的用户操作信息表示所述虚拟机上发生的操作事件,该操作事件为用户对虚拟机执行的“闲置”操作事件。In this embodiment, the hardware usage information of the virtual machine represents hardware events occurring on the virtual machine, and the hardware events include mouse events, keyboard events, network I/O events and disk I/O events, etc., the virtual machine The user operation information of the machine represents an operation event occurring on the virtual machine, and the operation event is an "idle" operation event performed by the user on the virtual machine.
需要说明的是,这里的S602与S603之间不存在明确的先后关系,应当理解的是,在虚拟机启动后,收集动作一直进行;It should be noted that there is no clear sequence relationship between S602 and S603 here. It should be understood that after the virtual machine is started, the collection action continues;
S604、业务主机的VMM根据虚拟机硬件使用信息和虚拟机用户操作信息并结合管理服务器下发的虚拟机闲置策略,确定该VMM层上虚拟机的状态,并通知管理服务器虚拟机状态信息;其中,虚拟机状态信息表示对应的虚拟机处于“闲置状态”,或者“非闲置状态”;S604. The VMM of the service host determines the status of the virtual machine on the VMM layer according to the virtual machine hardware usage information and virtual machine user operation information combined with the virtual machine idle policy delivered by the management server, and notifies the management server of the status information of the virtual machine; , the virtual machine status information indicates that the corresponding virtual machine is in the "idle state" or "non-idle state";
S605、管理服务器监测该业务主机上宿主的所有虚拟机是否均处于闲置状态,当获得的虚拟机状态信息表示该业务主机上宿主的少数虚拟机处于“非闲置状态”时,转步骤S606;反之,当获得的虚拟机状态信息表示该业务主机上宿主的所有虚拟机都处于“闲置状态”时,转步骤S609;S605. The management server monitors whether all virtual machines hosted on the service host are in an idle state, and when the obtained virtual machine status information indicates that a few virtual machines hosted on the service host are in a "non-idle state", go to step S606; otherwise , when the obtained virtual machine status information indicates that all virtual machines hosted on the service host are in the "idle state", go to step S609;
需要说明的是,这里的监测可以是定时监测,也可以是周期监测,也可以是实时监测。It should be noted that the monitoring here may be regular monitoring, periodic monitoring, or real-time monitoring.
S607、判断该物理主机上宿主的处于“非闲置状态”的虚拟机是否满足虚拟机迁移策略,当不满足时,转步骤S605;反之,转步骤S607;S607. Determine whether the virtual machine hosted on the physical host in the "non-idle state" satisfies the virtual machine migration policy, and if not, go to step S605; otherwise, go to step S607;
所述虚拟机迁移策略包括:虚拟机迁移时间区段、虚拟机迁移判定条件和迁移目标业务主机选定条件;关于虚拟机迁移策略的具体内容的介绍,请参阅前述实施例,这里不再赘述:The virtual machine migration strategy includes: virtual machine migration time zone, virtual machine migration judgment conditions, and migration target business host selection conditions; for the introduction of the specific content of the virtual machine migration strategy, please refer to the foregoing embodiments, and will not be repeated here :
举例说明:如果当前时间段处于虚拟机迁移时间区段内,该物理主机上宿主的处于“非闲置状态”虚拟机数小于2且该物理主机上宿主的总虚拟机数大于预设平均虚拟机数,且桌面虚拟化系统中存在非闲置状态”虚拟机比重最高及资源利用率最低的另一物理主机,则该物理主机上宿主的处于“非闲置状态”虚拟机满足虚拟机迁移策略;反之,则该物理主机上宿主的处于“非闲置状态”虚拟机不满足虚拟机迁移策略。For example: if the current time period is within the virtual machine migration time period, the number of virtual machines in the "non-idle state" hosted on the physical host is less than 2 and the total number of virtual machines hosted on the physical host is greater than the preset average virtual machine number, and there is another physical host in the desktop virtualization system that has the highest proportion of virtual machines in the non-idle state and the lowest resource utilization, then the virtual machine in the "non-idle state" hosted on the physical host meets the virtual machine migration strategy; otherwise , the virtual machine in the "non-idle state" hosted on the physical host does not meet the virtual machine migration policy.
S607、管理服务器向该物理主机的VMM发送迁移命令;S607. The management server sends a migration command to the VMM of the physical host;
其中,所述迁移命令包括需要迁移的虚拟机标识ID和迁移的目的主机信息。这里的虚拟机标识ID是VMM为每一个虚拟机分配的唯一的字符串序列,用于唯一标识虚拟机;如在Xen架构下称为uuid;迁移的目的主机信息,具体可以是目的业务主机的IP地址。Wherein, the migration command includes the ID of the virtual machine to be migrated and the information of the destination host of the migration. The virtual machine identification ID here is a unique string sequence assigned by VMM to each virtual machine, which is used to uniquely identify the virtual machine; for example, it is called uuid under the Xen architecture; the destination host information for migration can be specifically the destination business host IP address.
S608、该物理主机的VMM响应该迁移命令,将该物理主机上宿主的处于“非闲置状态”虚拟机(即所述虚拟机标识ID对应的虚拟机)迁移到“非闲置状态”虚拟机比重最高及资源利用率最低的目的业务主机(即所述目的业务主机信息对应的目的业务主机)上。S608, the VMM of the physical host responds to the migration command, and migrates the virtual machine in the "non-idle state" hosted on the physical host (that is, the virtual machine corresponding to the virtual machine ID) to the proportion of the virtual machine in the "non-idle state" on the destination service host with the highest and lowest resource utilization (that is, the destination service host corresponding to the destination service host information).
S609、管理服务器向该业务主机的VMM下发待机命令;S609. The management server issues a standby command to the VMM of the service host;
S610、该业务主机的VMM接收到待机命令后,向该业务主机的硬件层的处理器下发对应的待机指令,以控制并使该物理主机进入挂起到内存的待机状态;S610. After receiving the standby command, the VMM of the service host sends a corresponding standby command to the processor of the hardware layer of the service host, so as to control and make the physical host enter the standby state of suspending memory;
S611、该物理主机进入挂起到内存的待机状态;S611. The physical host enters a standby state of suspend-to-memory;
这里的待机状态指的是业务主机的处理器运行在ACPI-S3模式,除了内存保持激活外,处理器、硬盘、网卡等其余设备都下电,或以微弱电量运行;The standby state here means that the processor of the business host is running in ACPI-S3 mode. Except for the memory that remains active, other devices such as the processor, hard disk, and network card are powered off or run on weak power;
S612、流程结束。S612, the process ends.
综上所述,本发明实施例提供一种桌面虚拟化环境下的节能方法,在虚拟机中设置一个“探针”,通过“探针”收集虚拟机硬件使用信息和/或虚拟机用户操作信息,根据所述硬件使用信息和/或用户操作信息及虚拟机闲置策略,确定虚拟机的当前状态,并输出虚拟机状态信息,其中,所述状态包括“闲置状态”或“非闲置状态”;并在收到下发的待机命令,向硬件层发送待机指令,以控制并使该物理主机进入ACPI-S3状态;可见,通过本发明实施例的方案,能够对虚拟机的使用情况进行识别,从而例如,在企业下班后,可以使部分业务主机待机节能,同时,由于处于ACPI-S3状态的业务主机,其内存供电,内存状态信息完整;业务主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。To sum up, the embodiment of the present invention provides an energy-saving method in a desktop virtualization environment. A "probe" is set in the virtual machine, and the virtual machine hardware usage information and/or virtual machine user operations are collected through the "probe". Information, according to the hardware usage information and/or user operation information and virtual machine idle policy, determine the current state of the virtual machine, and output virtual machine state information, wherein the state includes "idle state" or "non-idle state" and after receiving the standby command issued, send the standby command to the hardware layer to control and make the physical host enter the ACPI-S3 state; it can be seen that by the scheme of the embodiment of the present invention, the usage of the virtual machine can be identified , so that, for example, after the enterprise is off work, some business hosts can be kept on standby to save energy. At the same time, because the business hosts in the ACPI-S3 state are powered by memory, the memory status information is complete; the business hosts are woken up and run directly from the suspended memory. , and quickly return to the state before standby, so while achieving energy saving effects, avoid network traffic congestion caused by "hot migration" of a large number of virtual machines or loading of a large number of virtual machines when the enterprise is at work, thereby ensuring the stability and reliability of virtual machines and high performance, improving end-user experience satisfaction.
进一步的,通过本发明实施例方案,对业务主机上只有少量“未闲置状态”的虚拟机执行迁移操作,使得这些“未闲置状态”的虚拟机聚集在少数的业务主机上,从而可以让更多的业务主机待机节能;由于本发明实施例的桌面虚拟化系统中此类虚拟机数量较少,“迁移”不会产生网络流量拥塞现象。Further, through the solution of the embodiment of the present invention, the migration operation is performed on only a small number of virtual machines in the "not idle state" on the service hosts, so that these "not idle state" virtual machines are gathered on a small number of service hosts, so that more A large number of service hosts are on standby to save energy; since the number of such virtual machines in the desktop virtualization system of the embodiment of the present invention is small, "migration" will not cause network traffic congestion.
请参阅图7,为本发明实施例的再一种桌面虚拟化环境下的节能方法的流程示意图,可以应用于在桌面虚拟化系统办公环境中,在用户上班时间区段内触发虚拟机唤醒流程的场景,如图7所示,该方法包括:Please refer to FIG. 7 , which is a schematic flow chart of another energy-saving method in a desktop virtualization environment according to an embodiment of the present invention, which can be applied in an office environment of a desktop virtualization system to trigger a virtual machine wake-up process during the user's working hours. scenario, as shown in Figure 7, the method includes:
S701、流程开始;S701, the process starts;
S702、在上班时段,当用户需要使用虚拟机,首先登入终端,该终端链接到管理服务器上。S702. During working hours, when the user needs to use the virtual machine, he first logs in to the terminal, and the terminal is connected to the management server.
终端形式可以是web页面,也可以使客户端程序。The terminal form can be a web page or a client program.
S703、管理服务器检查该虚拟机的状态;当该虚拟机处于闲置状态时,转步骤S704;反之,转步骤S707;S703. The management server checks the status of the virtual machine; when the virtual machine is in an idle state, go to step S704; otherwise, go to step S707;
S704、管理服务器检查该虚拟机所宿主的业务主机的状态,当该虚拟机所宿主的业务主机已待机,转步骤S705;反之,转步骤S706;S704. The management server checks the status of the service host hosting the virtual machine. When the service host hosting the virtual machine is on standby, go to step S705; otherwise, go to step S706;
S705、管理服务器向该业务主机的硬件层发送唤醒指令,以唤醒该业务主机;所述唤醒指令为网卡唤醒指令;S705. The management server sends a wake-up command to the hardware layer of the service host to wake up the service host; the wake-up command is a network card wake-up command;
发起者向待唤醒主机发送一个特定格式的数据包,待唤醒主机的网卡有特殊的电路处理逻辑来处理这个数据包,然后通过专用连线发出开机信号,通知主板开机启动。这个技术,要求发起者和被唤醒者处于同一个子网,且发起者需要知道被唤醒者的MAC地址。The initiator sends a data packet of a specific format to the host to be awakened, and the network card of the host to be awakened has special circuit processing logic to process the data packet, and then sends a power-on signal through a dedicated connection to notify the motherboard to start up. This technology requires the initiator and the awakened to be in the same subnet, and the initiator needs to know the MAC address of the awakened.
S706、业务主机唤醒后直接运行挂起的内存,激活自身上宿主的对应的虚拟机,使得该虚拟机进入可操纵状态。S706. After waking up, the service host directly runs the suspended memory, and activates a corresponding virtual machine of the host on itself, so that the virtual machine enters a manipulable state.
S707、登入虚拟机。S707. Log in to the virtual machine.
S708、流程结束。S708, the process ends.
综上所述,本发明实施例提供一种桌面虚拟化环境下的节能方法,由于处于ACPI-S3状态的业务主机,其内存供电,内存状态信息完整;业务主机被唤醒,直接从挂起的内存运行,迅速恢复至待机前的状态,故在达到节能效果的同时,避免例如企业上班时,大量虚拟机“热迁移”或大量虚拟机加载导致的网络流量拥塞现象,进而保证了虚拟机的稳定可靠和高性能,提高了终端用户体验满意度。In summary, the embodiment of the present invention provides an energy-saving method in a desktop virtualization environment. Since the service host in the ACPI-S3 state is powered by its memory, the memory status information is complete; The memory runs and quickly returns to the state before standby, so while achieving energy saving effects, it avoids network traffic congestion caused by "hot migration" of a large number of virtual machines or loading of a large number of virtual machines when the enterprise goes to work, thereby ensuring the virtual machine. Stable, reliable and high-performance, improving end-user experience satisfaction.
需要说明的是,前述实施例描述中所采用的第一、第二的说法,没有限定顺序的意思,仅为方便区分而已。It should be noted that the terms first and second used in the description of the foregoing embodiments do not mean to limit the sequence, but are only for convenience of distinction.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件(如处理器)来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be realized by instructing related hardware (such as a processor) through a computer program, and the program can be stored in a computer-readable memory In the medium, when the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.
以上所述仅是本发明的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The foregoing is only a specific embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, some improvements and modifications can also be made without departing from the principle of the present invention. It should be regarded as the protection scope of the present invention.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010102653818A CN101916207B (en) | 2010-08-28 | 2010-08-28 | Energy saving method, device and system under desktop virtual environment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010102653818A CN101916207B (en) | 2010-08-28 | 2010-08-28 | Energy saving method, device and system under desktop virtual environment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101916207A CN101916207A (en) | 2010-12-15 |
| CN101916207B true CN101916207B (en) | 2013-10-09 |
Family
ID=43323724
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2010102653818A Active CN101916207B (en) | 2010-08-28 | 2010-08-28 | Energy saving method, device and system under desktop virtual environment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101916207B (en) |
Families Citing this family (35)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8578006B2 (en) * | 2011-03-29 | 2013-11-05 | Symantec Corporation | Enabling selective policy driven propagation of configuration elements between and among a host and a plurality of guests |
| WO2011144037A2 (en) * | 2011-05-19 | 2011-11-24 | 华为技术有限公司 | Energy saving method, apparatus and system |
| CN102222014B (en) * | 2011-06-16 | 2013-05-22 | 华中科技大学 | Dynamic memory management method based on memory hot plug for virtual machine |
| CN102882698B (en) * | 2011-07-14 | 2016-08-03 | 鸿富锦精密工业(深圳)有限公司 | virtual machine management method and system |
| CN102890554A (en) * | 2011-07-22 | 2013-01-23 | 鸿富锦精密工业(深圳)有限公司 | Power supply management system and method |
| WO2013019185A1 (en) | 2011-07-29 | 2013-02-07 | Hewlett-Packard Development Company, L.P. | Migrating virtual machines |
| CN102445980A (en) * | 2011-09-19 | 2012-05-09 | 浪潮电子信息产业股份有限公司 | Energy-saving control system based on back-propagation (BP) neural network |
| CN102999372A (en) * | 2011-09-19 | 2013-03-27 | 中兴通讯股份有限公司 | Virtual machine operation method and system |
| CN102333088B (en) * | 2011-09-26 | 2014-08-27 | 华中科技大学 | Server resource management system |
| TWM432075U (en) * | 2011-10-25 | 2012-06-21 | Chunghwa Telecom Co Ltd | Monitoring device and monitoring system applicable to cloud algorithm |
| CN103179102B (en) * | 2011-12-26 | 2016-05-25 | 中国移动通信集团公司 | A kind of desktop virtual method, equipment and system |
| CN102520785B (en) * | 2011-12-27 | 2015-04-15 | 东软集团股份有限公司 | Energy consumption management method and system for cloud data center |
| CN102437938B (en) * | 2012-01-09 | 2013-11-13 | 北京邮电大学 | Large-scale network monitoring oriented virtual deployment system and method |
| CN103543813A (en) * | 2012-07-13 | 2014-01-29 | 云联(北京)信息技术有限公司 | Timer interruption and remote wakening implementation method based on cloud office business handling |
| CN102915270B (en) * | 2012-09-14 | 2015-04-15 | 福建升腾资讯有限公司 | Method for recording storage I/O (input/output) requirement and verifying pressure simulation |
| CN103853592A (en) * | 2012-11-30 | 2014-06-11 | 英业达科技有限公司 | Management system and management method of virtual machine |
| CN103888420A (en) * | 2012-12-20 | 2014-06-25 | 中国农业银行股份有限公司广东省分行 | Virtual server system |
| CN103229489B (en) * | 2012-12-21 | 2016-05-25 | 华为技术有限公司 | The collocation method of virtual machine control strategy and switch |
| CN103279703B (en) * | 2013-06-07 | 2018-02-02 | 国网江西省电力公司信息通信分公司 | A kind of method for building desktop cloud virtual trust safety wall |
| CN103561089B (en) * | 2013-10-30 | 2017-01-04 | 华为技术有限公司 | Virtual machine desktop log-in, Apparatus and system |
| CN103701870A (en) * | 2013-12-12 | 2014-04-02 | 上海兆民云计算科技有限公司 | Method for reducing power consumption generated in connection of desktop cloud terminal and server |
| CN103810020B (en) * | 2014-02-14 | 2017-08-29 | 华为技术有限公司 | Virtual machine elastic telescopic method and device |
| CN105022659B (en) * | 2014-04-30 | 2018-05-11 | 中国电信股份有限公司 | virtual machine state control method and system |
| CN104598297B (en) * | 2015-01-30 | 2018-05-11 | 新华三技术有限公司 | virtual machine management method and device |
| CN106201703A (en) * | 2016-07-20 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | A kind of homomorphism based on virtual ACPI polymerization energy-saving scheduling method and system |
| CN108958903B (en) * | 2017-05-25 | 2024-04-05 | 北京忆恒创源科技股份有限公司 | Embedded multi-core central processor task scheduling method and device |
| CN109992350B (en) * | 2017-12-29 | 2023-12-01 | 北京华胜天成科技股份有限公司 | Migration method and device for virtual machines in resource pool of cloud computing system |
| CN112965782A (en) * | 2019-12-13 | 2021-06-15 | 天翼电子商务有限公司 | Intelligent monitoring method and device for Docker container, storage medium and electronic equipment |
| CN113742009B (en) * | 2020-05-28 | 2024-04-09 | 深信服科技股份有限公司 | Desktop cloud environment resource scheduling method, device, equipment and storage medium |
| CN114647481A (en) * | 2020-12-17 | 2022-06-21 | 中兴通讯股份有限公司 | Configuration method, device and equipment of virtualized resources and storage medium |
| CN113110730B (en) * | 2021-04-09 | 2022-02-01 | 北京润尼尔网络科技有限公司 | Energy-saving method and device for operating equipment and electronic equipment |
| CN113342621A (en) * | 2021-07-14 | 2021-09-03 | 芯河半导体科技(无锡)有限公司 | System for monitoring and testing idle time of machine host and giving alarm |
| CN113626143B (en) * | 2021-07-15 | 2024-05-28 | 麒麟软件有限公司 | Virtual machine tuning method based on user behavior monitoring |
| CN116680058A (en) * | 2023-06-29 | 2023-09-01 | 南京维拓科技股份有限公司 | Method for automatically scheduling cloud desktop and computing child node hardware resources |
| CN116627240B (en) * | 2023-07-25 | 2024-01-26 | 腾讯科技(深圳)有限公司 | Power consumption adjustment method, device, electronic equipment, storage medium and program product |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1726470A (en) * | 2002-12-19 | 2006-01-25 | 英特尔公司 | Method and system for managing machine state in virtual machine operations |
| CN101154167A (en) * | 2006-09-28 | 2008-04-02 | 联想(北京)有限公司 | Virtual machine system and its CPU scheduling method |
| CN101419558A (en) * | 2008-11-13 | 2009-04-29 | 湖南大学 | CUDA graphic subsystem virtualization method |
| CN101719081A (en) * | 2009-12-01 | 2010-06-02 | 北京大学 | Method for scheduling virtual machines |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9405347B2 (en) * | 2009-02-26 | 2016-08-02 | Microsoft Technology Licensing, Llc | Power-saving operating system for virtual environment |
-
2010
- 2010-08-28 CN CN2010102653818A patent/CN101916207B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1726470A (en) * | 2002-12-19 | 2006-01-25 | 英特尔公司 | Method and system for managing machine state in virtual machine operations |
| CN101154167A (en) * | 2006-09-28 | 2008-04-02 | 联想(北京)有限公司 | Virtual machine system and its CPU scheduling method |
| CN101419558A (en) * | 2008-11-13 | 2009-04-29 | 湖南大学 | CUDA graphic subsystem virtualization method |
| CN101719081A (en) * | 2009-12-01 | 2010-06-02 | 北京大学 | Method for scheduling virtual machines |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101916207A (en) | 2010-12-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101916207B (en) | Energy saving method, device and system under desktop virtual environment | |
| US8271814B2 (en) | Migrating a client computer to a virtual machine server when the client computer is deemed to be idle | |
| CN102156532B (en) | Computer and method that reduces power consumption while maintaining a specific function | |
| US11181970B2 (en) | System and method for performing distributed power management without power cycling hosts | |
| US8924534B2 (en) | Resource optimization and monitoring in virtualized infrastructure | |
| CN102326132B (en) | Power management to maximize reduced power state for virtual machine platforms | |
| Agarwal et al. | {SleepServer}: A {Software-Only} Approach for Reducing the Energy Consumption of {PCs} within Enterprise Environments | |
| US20110106935A1 (en) | Power management for idle system in clusters | |
| US9229516B2 (en) | Methods, devices, and computer program products for maintaining network presence while conserving power consumption | |
| EP3428801B1 (en) | Scheduling method and electronic device | |
| US9811346B2 (en) | Dynamic reconfiguration of queue pairs | |
| EP2672381A1 (en) | Virtual resource management method, system and device | |
| US9672055B2 (en) | Information processing system having two sub-systems with different hardware configurations which enable switching therebetween | |
| CN103810015A (en) | Virtual machine establishing method and equipment | |
| CN101770273A (en) | Method for realizing energy saving of system with a plurality of central processing units of server and device therefor | |
| US20140282587A1 (en) | Multi-core binary translation task processing | |
| WO2015180111A1 (en) | Method, apparatus and device for managing system resource | |
| US7636861B2 (en) | Bus technique for controlling power states of blades in a blade enclosure | |
| CN108701033A (en) | Client operating system awakening method, device, electronic equipment and readable medium | |
| CN117240637A (en) | A core hibernation method, virtual network system, and storage medium | |
| KR101438461B1 (en) | Cloud stroage system having electric power control switching module | |
| CN103036711A (en) | State inspection method and system and management node device | |
| Li et al. | An efficient approach for reducing power consumption in a production-run cluster | |
| CN120687153A (en) | State processing method, device, electronic device and computer-readable storage medium | |
| WO2025196541A1 (en) | State processing methods and apparatus, electronic device, and computer program product |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20201105 Address after: 215500 No.13, Caotang Road, Changshu, Suzhou, Jiangsu Province Patentee after: Changshu intellectual property operation center Co.,Ltd. Address before: Unit 2414-2416, main building, no.371, Wushan Road, Tianhe District, Guangzhou City, Guangdong Province Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd. Effective date of registration: 20201105 Address after: Unit 2414-2416, main building, no.371, Wushan Road, Tianhe District, Guangzhou City, Guangdong Province Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
| CP02 | Change in the address of a patent holder | ||
| CP02 | Change in the address of a patent holder |
Address after: 215500 5th floor, building 4, 68 Lianfeng Road, Changfu street, Changshu City, Suzhou City, Jiangsu Province Patentee after: Changshu intellectual property operation center Co.,Ltd. Address before: No.13 caodang Road, Changshu City, Suzhou City, Jiangsu Province Patentee before: Changshu intellectual property operation center Co.,Ltd. |
