WO2014121485A1 - Method and system for managing virtual machines - Google Patents

Method and system for managing virtual machines Download PDF

Info

Publication number
WO2014121485A1
WO2014121485A1 PCT/CN2013/071506 CN2013071506W WO2014121485A1 WO 2014121485 A1 WO2014121485 A1 WO 2014121485A1 CN 2013071506 W CN2013071506 W CN 2013071506W WO 2014121485 A1 WO2014121485 A1 WO 2014121485A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
virtual machine
cloud server
running
information
Prior art date
Application number
PCT/CN2013/071506
Other languages
French (fr)
Chinese (zh)
Inventor
余祥
成淑敏
李宁
宋哲炫
朱星
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201380000525.9A priority Critical patent/CN103502939B/en
Priority to PCT/CN2013/071506 priority patent/WO2014121485A1/en
Publication of WO2014121485A1 publication Critical patent/WO2014121485A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/102Entity profiles

Definitions

  • a virtual machine is a complete computer system that runs through a software and functions as a complete hardware system running in a completely isolated environment.
  • operating systems widely supported by virtual machines include: Red Hat and Ubuntu Linux.
  • Software that can run on virtual machines includes: Apache, MySQL, Hadoop, Condor, Open MPI, WebSphere and Oracle's WebLogic. Since so many applications can run on virtual machines, and one physical computer device can run multiple virtual machines, developers of network applications are more inclined to configure various network applications on virtual machines.
  • the cloud server can improve the operating efficiency of the computer device by managing and deploying the operation of the application in the physical computer device (for example, load balancing of the application, automatic expansion of the application, etc.) Reduce the configuration requirements of computer equipment.
  • these technologies cannot directly manage and provision applications on virtual machines, mainly because the various applications running on the virtual machines are managed and provisioned by the operating system on the virtual machines.
  • the remote cloud servers can only be virtualized. The physical computer equipment where the machine is located is managed and deployed, or the physical computer equipment is used to roughly manage and deploy the running information of the virtual machine.
  • Embodiments of the present invention provide a method and system for managing a virtual machine to perform policy control on a virtual machine running in one or more physical devices based on an application running on the virtual machine.
  • a first aspect of the embodiments of the present invention provides a method for managing a virtual machine, where the system is configured by a cloud server and a computer device including at least one virtual machine that is communicatively connected to the cloud server, and includes at least : the cloud server is based on the acquired deployment instructions, and uses presets Using the description information, deploying a corresponding application and a first obtaining module for obtaining running information of the corresponding application to at least one of the virtual machines; the cloud server acquiring the running on each of the virtual machines The running information of the application; the cloud server analyzes each of the obtained running information, and performs policy control on the virtual machine running the corresponding application based on the analysis result.
  • the cloud server deploying the application and the first obtaining module includes: the cloud server deploying at least one of the application and the first to at least one of the virtual machines based on preset description information of each application Get the module.
  • the acquiring, by the cloud server, the running information of the application running on each of the virtual machines comprises: sending, by the virtual machine, running information for acquiring an application to each first acquiring module according to a polling mechanism.
  • the instructions are obtained, so that each of the first obtaining modules acquires running information of the corresponding application, and then sends all the obtained running information to the cloud server.
  • the acquiring, by the cloud server, the running information of the application running on each of the virtual machines further includes: each of the first obtaining modules registering with a virtual machine that is located before the running, so that the virtual server The machine uses the registration information of the first acquisition module to poll the first acquisition modules that have been registered, and then obtains the operation information of the corresponding application.
  • the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including: the cloud server identifies, from the obtained multiple running information, operation information of the same application from different virtual machines; and the cloud The server analyzes the running information of the same application from the plurality of virtual machines, and performs policy control on the at least one virtual machine based on the analysis result.
  • the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, and the cloud server sends, according to the analysis result, a virtual machine that runs the corresponding application, to change the application and the corresponding first acquisition.
  • the instruction that the module is running is running.
  • the instruction for changing the operation of the application and the corresponding first obtaining module comprises at least one of the following: a start instruction, a pause instruction, and a stop instruction.
  • the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, where the cloud server generates a deployment instruction based on the analysis result, so as to re-execute the deployment step, to the virtual machine that is not running the application. Deploying the application and a corresponding first acquisition module.
  • the method further includes: the virtual machine monitoring the operation information acquired by the first acquisition module, and determining whether the application corresponding to the operation information is adjacent to or exceeds a preset normal operation range of the corresponding application, if adjacent Or the running information is exceeded if the preset corresponding normal application is out of range.
  • the cloud server Provided to the cloud server; if it is not near or exceeds the preset range of the normal operation of the corresponding application, the monitoring is continued.
  • a second aspect of the embodiments of the present invention provides a system for managing a virtual machine, including: a cloud server and a computer device including at least one virtual machine communicatively coupled to the cloud server;
  • the cloud server includes: a deployment module, configured to deploy, according to the obtained deployment instruction, a corresponding application and a first acquiring module for acquiring running information of the corresponding application to at least one a second acquiring module, configured to acquire operation information of the application deployed by each of the virtual machines by the deployment module, and a policy control module, configured to be used by the second acquiring module
  • a deployment module configured to deploy, according to the obtained deployment instruction, a corresponding application and a first acquiring module for acquiring running information of the corresponding application to at least one
  • a second acquiring module configured to acquire operation information of the application deployed by each of the virtual machines by the deployment module
  • a policy control module configured to be used by the second acquiring module
  • the deployment module is further configured to deploy at least one of the application and the first obtaining module to at least one of the virtual machines based on preset description information of each application.
  • the policy control module includes: an identification submodule, configured to identify operation information of the same application from different virtual machines from the plurality of operation information acquired by the second acquisition module.
  • the policy control module is specifically configured to send, according to the analysis result, an instruction for changing the operation of the application and the corresponding first acquiring module to a virtual machine running the corresponding application.
  • the instruction for changing the operation of the application and the corresponding first obtaining module comprises at least one of the following: a start instruction, a pause instruction, and a stop instruction.
  • the policy control module is specifically configured to send the deployment instruction to the deployment module based on the analysis result, so that the deployment module deploys the application on a virtual machine that does not run the corresponding application based on the deployment instruction.
  • Corresponding first acquisition module the cloud server acquires operation information of each application running in the virtual machine by using a first acquiring module deployed on the virtual machine, and The analysis of the running information controls the virtual machine running the corresponding application. In this way, the problem that the existing cloud server cannot manage the virtual machine based on the application running on the virtual machine can be solved. At the same time, the strategy can be performed on each virtual machine in real time.
  • FIG. 1 is a flowchart of a method for managing a virtual machine according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a preferred method in a method for managing a virtual machine according to an embodiment of the present invention.
  • FIG. 3 is a structural diagram of a system for managing a virtual machine according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a system for managing a virtual machine according to an embodiment of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments.
  • an embodiment of the present invention provides a method for managing a virtual machine.
  • the management method is applied to a system composed of a cloud server and a computer device including at least one virtual machine communicatively coupled to the cloud server.
  • the virtual machine can communicate with the cloud server by using a communication protocol.
  • the cloud server deploys the corresponding application and the first obtaining module for acquiring the running information of the corresponding application to the at least one virtual machine by using the preset description information of the respective applications, so that the cloud server The application and the first acquisition module run on the virtual machine.
  • the deployment instruction includes information such as the name and address of the virtual machine to be deployed, the name of the application, and the version of the application.
  • the application includes any software that can run on a virtual machine, including but not limited to: a WEB-based application or the like.
  • the description information of the application includes any information that can describe the application, including but not limited to: version information of the application, configuration information of the application running normally, and the application and the first acquiring module The configuration relationship, the configuration relationship between the applications, the storage address of the application or the first acquiring module, and the like.
  • the description information includes: a port of the virtual machine occupied by the application running, interface information of the application connected to the first acquiring module, and the like.
  • the running information of the application includes any information that can reflect the running status of the application, including but not limited to: the current number of sessions of the application, an abnormal situation generated by the application at runtime, and the application occupying the virtual Resource information of the machine, etc.
  • the first obtaining module may obtain one running information of the application, and may also obtain all running information of the application.
  • the cloud server deploys at least one of the application and the first acquiring module to at least one of the virtual machines based on the preset description information of each application, so that the application and the first The acquisition module runs on the virtual machine.
  • the description information of the WEB application a3 a4 includes: WEB application a3
  • the configuration file connected with the database a1 b1, the configuration file b2 between the WEB application a3 and the first acquisition module a2.
  • the cloud server installs the WEB application a3, the first obtaining module a2, and the database a1 in the virtual machine A remotely based on the description information a4, and respectively applies the WEB application a3 and the database a1 according to the configuration file b1 and the configuration file b2.
  • the WEB application a3 is connected to the first acquisition module a2, so that the WEB application a3 can operate normally, and the first acquisition module a2 can acquire the operation information of the WEB application a3.
  • the manner in which the first obtaining module acquires the running information of the application includes, but is not limited to: 1) acquiring running information of the application from a task manager of the virtual machine; 2) providing the application through the application The interface acquires running information of the application, and the like.
  • step S2 the cloud server acquires running information of the application running on each of the virtual machines.
  • the application running on the virtual machine may be one or more.
  • the cloud server acquires running information of each of the applications running on the virtual machine.
  • the manner in which the cloud server obtains running information of an application running on each of the virtual machines includes, but is not limited to:
  • the running information of the obtained corresponding application is directly sent to the cloud server by each of the first acquiring modules in the virtual machine.
  • the virtual machine runs: an application c1, a first obtaining module d1 for acquiring running information of the application c1, an application c2, and a first obtaining module d2 for acquiring running information of the application c2.
  • the first obtaining modules d1 and d2 respectively send the running information of the respective acquired applications to the cloud server according to the preset address of the cloud server based on the preset time interval.
  • the virtual machine sends an instruction for acquiring the running information of the application to each first acquiring module based on the polling mechanism, so that each first acquiring module acquires running information of the corresponding application, and then acquires the obtained information. All operational information is sent to the cloud server.
  • the virtual machine records the name, version number, installation address, and running address of each application and the first acquiring module when the application and the first acquiring module are installed and run under the deployment instruction of the cloud server. And other information, and based on the polling mechanism, an instruction for obtaining the running information of the application is issued through the recorded information to obtain all the running information.
  • each of the first obtaining modules registers with the virtual machine in which the first acquiring module is located, so that the virtual machine uses the registration information of the first acquiring module to poll the registered first acquiring modules, and then obtains corresponding Application running information.
  • the registration information includes, but is not limited to, a version number of the first obtaining module, a name of the first acquiring module, a running address of the first acquiring module, and the like.
  • Adding to the maintained dynamic linked list for issuing an instruction for acquiring the running information to the first acquiring module based on a polling mechanism.
  • step S3 the cloud server analyzes each acquired operation information, and performs policy control on the virtual machine running the corresponding application based on the analysis result.
  • the analysis result includes, but is not limited to, the application is in normal operation, the application is in abnormal operation, the application is adjacent to the abnormal operation, and one or all of the running information of the application cannot be acquired.
  • the manner of policy control includes any manner in which the operating environment or operation of the application can be changed based on the acquired operational information of the application.
  • the types of policy control include, but are not limited to, at least one of the following: load balancing control, automatic expansion/decrement control, and dynamic migration control.
  • the manner in which the cloud server analyzes each of the obtained running information includes but is not limited to:
  • the cloud server compares the acquired running information with the pre-stored running information of the corresponding application to obtain an analysis result.
  • the running information obtained by the cloud server includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the maximum number of sessions of the preset application m2 is 200, and the cloud server analyzes and obtains the acquired application m2. The current number of sessions is approaching the maximum number of sessions.
  • the cloud server analyzes the acquired running information based on the preset analysis rules of each application to obtain an analysis result.
  • an evaluation formula is preset for the art tlt x weight value 1 + face-to-face dragon weight value 2 , wherein the maximum number of sessions is 300, the weight value is 2, and the weight 2 is 3, when the evaluation value is Normal operation between 1 and 3 Row.
  • the running information obtained by the cloud server includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the proportion of the resources of the application m2 occupying the virtual machine M2 is 30%, and the cloud server follows the preset application m2.
  • the above analysis rule obtains an evaluation value of the operation status of the application m2 from the virtual machine M2 of 1.9, and concludes that the operation result of the application m2 in the virtual machine M2 is normal operation.
  • the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including but not limited to:
  • the cloud server sends an instruction for changing the operation of the application and the corresponding first obtaining module to the virtual machine running the corresponding application based on the analysis result.
  • the instructions include but are not limited to: a start command, a pause command, or a stop command.
  • the analysis result obtained by the cloud server is that the running information of an application cannot be obtained or the running state of an application needs to be changed, sending, to the virtual machine running the corresponding application, the application or the corresponding The first acquisition module executes the instructions.
  • the cloud server generates a deployment instruction based on the analysis result, so as to re-execute step S1 to deploy the application and the corresponding first acquiring module to the virtual machine that is not running the application.
  • the analysis result obtained by the cloud server is that an application is running at a full load, generating a deployment instruction, so that the cloud server deploys the application to a virtual machine that is not running the application specified by the deployment instruction. And the first acquisition module.
  • the step S3 comprises a step S31 and a step S32.
  • step S31 the cloud server identifies running information of the same application from different virtual machines from the obtained plurality of running information.
  • the cloud server extracts identification information that can identify the application and the virtual machine from the obtained multiple running information, and then identifies the same application running in different virtual machines according to the identification information.
  • the identifier information includes but is not limited to: an application name, an application version number, a virtual machine name, a virtual machine address, and the like.
  • the multiple running information obtained by the cloud server includes: an application from the virtual machine N 1
  • the cloud server extracts the application name and the name of the virtual machine in each running information, and compares each application name and the virtual machine name in a loop, and identifies that the application name in the running information c1 and the running information c3 is the same, and the virtual The cloud server determines that the running information c1 and the running information c3 are the same from different virtual machines based on the identification result.
  • step S32 the cloud server analyzes the operation information of the same application from the plurality of virtual machines, and performs policy control on the at least one virtual machine based on the analysis result.
  • the manner in which the cloud server performs policy control on at least one virtual machine includes, but is not limited to: 1) performing policy control on at least one virtual machine running the application based on the analysis result.
  • the obtained running information of the application in each virtual machine includes: the current session number 300 of the application A in the virtual machine M1, the current session number 400 of the application A in the virtual machine M2, and the current application A of the virtual machine M3.
  • the cloud server determines that the virtual machine M1, the virtual machine M2, and the virtual machine M3 run the same application A based on the identification information of the application in each running information, and is based on the application A in the virtual machine M1, the virtual machine M2, and the virtual machine respectively.
  • the operation information in M3 manages the operation of the application A in the virtual machines M1, M2, M3.
  • the cloud server compares the current session number 400 of the application A in the virtual machine M2 with the maximum number of sessions 450 of the preset application A, and determines that the new user access request is no longer allocated to the application A in the virtual machine M2. Instead, the new user access request is assigned to application A in virtual machine M1 or virtual machine M3, thereby balancing the load of virtual machines M1, M2, and M3.
  • step S1, S2, and S3 are not necessarily performed in sequence.
  • the cloud server may acquire the running information of each application by using the multi-threading technology.
  • the policy control is performed on each application based on the acquired running information of each application.
  • step S1 may be performed to deploy a new application, and obtain running information of the new application.
  • step S2 in the embodiment further includes: the virtual machine monitoring the operation information acquired by the first acquisition module, and determining whether the application corresponding to the operation information is adjacent or exceeds a preset corresponding If the range of the normal operation is applied, if the range of the normal operation of the corresponding application is indeed approached or exceeded, the operation information is provided to the cloud server; if it is not adjacent to or exceeds the preset normal operation range of the corresponding application, Then continue to monitor.
  • the cloud server deploys the corresponding application and the first acquiring module for acquiring the running information of the corresponding application to the at least one virtual entity by using the preset description information of each application. Onboard, so that the application and the first acquisition module run on the virtual machine.
  • step S20 the virtual machine registers each of the deployed first acquisition modules based on the registration request from the first acquisition module.
  • step S30 the virtual machine sends an instruction for acquiring the operation information to each of the first acquisition modules that have been registered, so that each first acquisition module acquires the operation information of the corresponding application, in step S40.
  • the virtual machine monitors the operation information acquired by the first acquisition module, and determines whether the application corresponding to the operation information is adjacent to or exceeds a preset normal operation range of the corresponding application, and if the application is indeed adjacent to or exceeds the preset, the corresponding application is normal. If the range of the operation is not completed, the step S50 is performed if the range of the normal operation of the corresponding application is not approached or exceeded.
  • step S50 the virtual machine continues to monitor the operation information acquired by the first acquiring module.
  • step S60 the virtual machine provides the operation information to the cloud server.
  • step S70 the cloud server analyzes each of the acquired operation information, and performs policy control on the virtual machine running the corresponding application based on the analysis result.
  • the virtual machine may send the operation information acquired by the first acquiring module to the cloud according to other manners described in the first embodiment.
  • the cloud server analyzes each application by using the solution described in the first embodiment, and performs corresponding policy control based on the analysis result.
  • each first acquiring module notifies the virtual machine of the respective information by means of registration, so that the virtual machine sends a polling instruction to the registered first acquiring module by using a polling mechanism, thereby being able to target
  • a polling mechanism thereby being able to target
  • the virtual machine obtains the running information of each application, it is based on Each of the running information distinguishes whether the corresponding application is adjacent to or exceeds a preset range in which the application is in normal operation, and can share the burden of the cloud server.
  • the manner in which the virtual machine maintains communication with the cloud server includes, but is not limited to: maintaining communication between the virtual machine and the cloud server based on a heartbeat mechanism.
  • the virtual machine communicates with the cloud server once every 15 minutes based on a heartbeat mechanism.
  • the cloud server does not receive heartbeat information from the virtual machine within 20 minutes, the virtual machine is determined to be the virtual machine. Abnormally, and displaying the abnormality information through a display connected to the cloud server, so that the technician processes the virtual machine.
  • the present invention also provides a system for managing a virtual machine.
  • the system includes a cloud server 1 and a computer device including at least one virtual machine 2 communicatively coupled to the cloud server 1, as shown in FIG.
  • the virtual machine 2 can communicate with the cloud server 1 by using a communication protocol.
  • the cloud server 1 includes at least: a deployment module 1 1 , a second acquisition module 12 , and a policy control module 13 . As shown in Figure 4.
  • the application includes any software that can run on a virtual machine, including but not limited to: a WEB-based application or the like.
  • the description information of the application includes any information that can describe the application, including but not limited to: version information of the application, configuration information of the application running normally, and the application and the first acquiring module The configuration relationship, the configuration relationship between the applications, the storage address of the application or the first acquiring module, and the like.
  • the description information includes: a port of the virtual machine 2 occupied by the application, interface information of the application connected to the first acquiring module, and the like.
  • the running information of the application includes any information that can reflect the situation when the application is running, including but not limited to: the current number of sessions of the application, the abnormal situation generated by the application during operation, and the application occupation
  • the resource information of the virtual machine 2 and the like are described.
  • the first obtaining module may obtain one type of running information of the application, and may also obtain all running information of the application.
  • the deployment module 1 1 deploys at least one of the application and the first acquiring module to at least one of the virtual machines 2 based on the preset description information of each application, so that the application and the The first acquisition module runs on the virtual machine 2.
  • the description information of the WEB application a3 a4 includes: WEB application a3
  • the configuration file connected with the database a1 b1, the configuration file b2 between the WEB application a3 and the first acquisition module a2.
  • the deployment module 1 1 remotely installs the WEB application a3, the first obtaining module a2, and the database a1 in the virtual machine A based on the description information a4, and then applies the WEB application a3 and the database according to the configuration file b1 and the configuration file b2 respectively.
  • A1 the WEB application a3 is connected to the first obtaining module a2, so that the WEB application a3 can operate normally, and the first obtaining module a2 can obtain the running of the WEB application a3.
  • the manner in which the first obtaining module acquires the running information of the application includes, but is not limited to: 1) acquiring running information of the application from a task manager of the virtual machine 2; 2) providing by using the application The interface obtains the running information of the application, and the like.
  • the second obtaining module 12 is configured to acquire, by the deployment module 1 1 , each of the virtual Operational information of the application on machine 2.
  • the application running on the virtual machine 2 may be one or more.
  • the second obtaining module 12 acquires running information of each of the applications running on the virtual machine 2.
  • the first acquisition module of the virtual machine 2 directly sends the acquired operation information of the corresponding application to the second acquisition module 12.
  • the virtual machine 2 runs: an application c1, a first obtaining module d1 for acquiring running information of the application c1, an application c2, and a first acquiring module for acquiring running information of the application C2. D2.
  • the first obtaining modules d1 and d2 respectively send the running information of the respective acquired applications to the second acquiring module 12 according to the preset address of the second acquiring module based on the preset time interval.
  • the virtual machine 2 sends an instruction for acquiring the running information to each of the first acquiring modules based on the polling mechanism, so that each first acquiring module acquires the running information of the corresponding application, and then sends all the acquired running information to The second obtaining module 12 is provided.
  • the virtual machine 2 records the name, version number, and installation address of each application and the first acquiring module when the application and the first acquiring module are installed and run under the deployment instruction of the deployment module 11. And running the address and the like, and based on the polling mechanism, issuing an instruction for acquiring the running information of the application through the recorded information, so as to obtain all the running information.
  • each of the first obtaining modules registers with the virtual machine 2 in which it is located before running, so that the virtual machine 2 polls the registered first acquiring modules by using the registration information of the first acquiring module, and further Get the running information of the corresponding application.
  • the registration information includes, but is not limited to, a version number of the first acquiring module, a name of the first acquiring module, an operating address of the first acquiring module, and the like.
  • the first obtaining module deployed on the virtual machine 2 starts the running, first sends a registration request including the registration information to the virtual machine 2 according to the pre-stored virtual machine registration port, where the virtual machine 2
  • the registration information is added to the maintained dynamic linked list for issuing an instruction for acquiring the running information to the first obtaining module based on the polling mechanism.
  • the manner in which the policy control module 13 analyzes each of the acquired operation information includes but is not limited to:
  • the policy control module 13 compares and analyzes the acquired operation information with the pre-stored operation information of the corresponding application to obtain an analysis result.
  • the operation information acquired by the policy control module 13 includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the maximum number of sessions of the preset application m2 is 200, and the policy control module 13 analyzes and obtains The number of current sessions of the obtained application m2 is approaching the maximum number of sessions.
  • the policy control module 13 analyzes the acquired running information based on the preset analysis rules of each application to obtain an analysis result.
  • an evaluation formula is set to Sil x weight 1 + when the Li war source proportional weight 2 , wherein the maximum number of sessions is 300, the weight 1 is 2, the weight 2 is 3, and the evaluation value is 1 Normal operation between -3.
  • the running information obtained by the policy control module 13 includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the proportion of the resources of the virtual machine M2 is 30%, and the policy control module 13 follows the preset.
  • the above analysis rule of the application m2 the evaluation value of the operation of the application m2 from the virtual machine M2 is 1.9, and the operation result of the application m2 in the virtual machine M2 is normal operation.
  • the policy control module 13 performs policy control on the virtual machine 2 running the corresponding application based on the analysis result, including but not limited to:
  • the policy control module 13 sends an instruction for changing the operation of the application and the corresponding first acquisition module to the virtual machine 2 running the corresponding application based on the analysis result.
  • the instructions include, but are not limited to, a start command, a pause command, or a stop command.
  • the policy control module 13 issues the deployment instruction to the deployment module 1 1 based on the analysis result, so that the deployment module 11 deploys the virtual machine 2 on the virtual machine 2 that is not running the corresponding application based on the deployment instruction.
  • Application and corresponding first acquisition module Specifically, if the analysis result obtained by the policy control module 13 is that an application is running at a full load, the deployment instruction is issued to the deployment module 11 and is not run by the deployment module 1 1 .
  • the virtual machine 2 of the application deploys the application and the first obtaining module.
  • the policy control module 13 further includes an identification sub-module 131.
  • the identification sub-module 131 is configured to identify operation information of the same application from different virtual machines 2 from the plurality of operation information acquired by the second acquisition module 12.
  • the identification sub-module 131 extracts identification information that can identify the application and the virtual machine from the plurality of operation information acquired by the second acquisition module 12, and identifies the same operation running in different virtual machines according to the identification information.
  • application includes but is not limited to: an application name, an application version number, a virtual machine name, a virtual machine address, and the like.
  • the plurality of operation information acquired by the identification submodule 131 includes: operation information c1 of the application C1 from the virtual machine N1, operation information c2 of the application C2 from the virtual machine N2, and operation of the application C1 from the virtual machine N3.
  • Information c3 The identification sub-module 131 extracts the application name and the name of the virtual machine in each operation information, and cyclically compares each application name and the virtual machine name, and identifies that the application name in the operation information c1 and the operation information c3 are the same.
  • the name of the virtual machine is different, and based on the identification result, the operation information c1 and the operation information c3 are determined to be operation information of the same application from different virtual machines.
  • the policy control module 13 is configured to analyze the running information of the same application from multiple virtual machines, and perform policy control on the at least one virtual machine based on the analysis result.
  • the manner in which the policy control module 13 performs policy control on at least one virtual machine includes but is not limited to:
  • the obtained running information of the application in each virtual machine includes: the current session number 300 of the application A in the virtual machine M1, the current session number 400 of the application A in the virtual machine M2, and the current application A of the virtual machine M3.
  • the policy control module 13 determines that the virtual machine M1, the virtual machine M2, and the virtual machine M3 run the same application A based on the identification information of the application in each operation information, and based on the application A, respectively, in the virtual machine M1, the virtual machine M2, and
  • the operation information in the virtual machine M3 manages the operation of the application A in the virtual machines M1, M2, M3.
  • the policy control module 13 compares the current session number 400 of the application A in the virtual machine M2 with the maximum number of sessions 450 of the preset application A, and determines that the virtual machine is no longer used.
  • Application A in M2 allocates a new user access request, and in turn assigns a new user access request to application A in virtual machine M1 or virtual machine M3, thereby balancing the load of virtual machines M1, M2, and M3.
  • the deployment module 1 1 is deployed to deploy the application and the corresponding first acquisition module to the virtual machine that is not running the application.
  • the The deployment module 11 can also deploy a new application to the specified virtual machine based on the deployment instruction output by the policy control module 13, and acquire the running information of the new application.
  • the cloud server obtains operation information of each application running in the virtual machine by using the first acquiring module deployed in the virtual machine, And performing the policy control on the virtual machine running the corresponding application by analyzing the running information, so that the problem that the existing cloud server cannot manage the virtual machine based on the application running on the virtual machine can be solved;
  • Each virtual machine performs policy control for the virtual machine to change the running state or running environment of the application.
  • the cloud server further determines the running status of the same application running on different virtual machines by identifying the obtained running information, and then performs policy control on each virtual machine, so that the same application can be performed on each virtual machine. normal operation.
  • each of the first obtaining modules informs the virtual machine of the respective information by means of registration, so that the virtual machine sends a polling instruction to the registered first acquiring module by using a polling mechanism, thereby being targeted.
  • the virtual machine and the cloud server ensure communication connection with each other through regular communication, which is beneficial to timely processing the cloud server in time according to an emergency plan when the physical device of the virtual machine is abnormal or the network is abnormal. To ensure that each application can run stably.
  • the foregoing storage medium when the program is executed, the steps including the foregoing method embodiments are performed; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

Provided are a method and system for managing virtual machines in the present invention. The method comprises: on the basis of the obtained deployment commands and by using the preset description information of each application, a cloud server deploys into at least one virtual machine the corresponding applications and a first obtainment module for obtaining the operation information of the corresponding applications; the cloud server obtains the operation information of the applications operating on each virtual machine; the cloud server analyzes each operation information obtained and then on the basis of the analyzed result, performs policy control for virtual machines on which the corresponding applications operate. The method and system provided in the present invention can solve the prior problem that a cloud server cannot manage virtual machines, and meanwhile can perform policy control for each virtual machine so that the virtual machines can change the operation conditions or operation environments of applications.

Description

对虚拟机进行管理的方法及***  Method and system for managing virtual machine
技术领域 本发明涉及云计算技术,特别是涉及一种对虚拟机进行管理的方法及***。 背景技术 虚拟机是指通过软件模拟的具有完整硬件***功能的、 运行在一个完全隔 离环境中的完整计算机***。 目前, 虚拟机广泛支持的操作***包括: Red Hat 和 Ubuntu Linux 等。 能够运行在虚拟机上的软件包括: Apache、 MySQL, Hadoop、 Condor, Open MPI、 WebSphere禾口 Oracle的 WebLogic等。 鉴于 如此多的应用均可在虚拟机上运行, 同时一个物理的计算机设备能够运行多个 虚拟机, 使得网络应用的开发者更倾向于在虚拟机上配置各种网络应用。 TECHNICAL FIELD The present invention relates to cloud computing technologies, and in particular, to a method and system for managing a virtual machine. BACKGROUND OF THE INVENTION A virtual machine is a complete computer system that runs through a software and functions as a complete hardware system running in a completely isolated environment. Currently, operating systems widely supported by virtual machines include: Red Hat and Ubuntu Linux. Software that can run on virtual machines includes: Apache, MySQL, Hadoop, Condor, Open MPI, WebSphere and Oracle's WebLogic. Since so many applications can run on virtual machines, and one physical computer device can run multiple virtual machines, developers of network applications are more inclined to configure various network applications on virtual machines.
与此同时, 随着云技术的发展, 云服务器通过管理和调配物理的计算机设 备中的应用的运行 (如, 使应用的负载均衡、 为应用自动扩容等) , 能够提高 计算机设备的运行效率, 降低计算机设备的配置要求。 然而, 这些技术无法直 接管理和调配在虚拟机上的应用, 主要是因为虚拟机上所运行的各种应用由该 虚拟机上的操作***来负责管理和调配, 远程的云服务器只能对虚拟机所在的 物理计算机设备进行管理和调配, 或者通过物理计算机设备对虚拟机的运行信 息进行粗略的管理和调配。  At the same time, with the development of cloud technology, the cloud server can improve the operating efficiency of the computer device by managing and deploying the operation of the application in the physical computer device (for example, load balancing of the application, automatic expansion of the application, etc.) Reduce the configuration requirements of computer equipment. However, these technologies cannot directly manage and provision applications on virtual machines, mainly because the various applications running on the virtual machines are managed and provisioned by the operating system on the virtual machines. The remote cloud servers can only be virtualized. The physical computer equipment where the machine is located is managed and deployed, or the physical computer equipment is used to roughly manage and deploy the running information of the virtual machine.
这样的缺点在于,云服务器由于无法得到虚拟机中运行的应用的运行信息, 而不能基于虚拟机上运行的应用对虚拟机进行策略控制。 发明内容 本发明实施例提供一种对虚拟机进行管理的方法及***, 以便基于虚拟机 上运行的应用对运行在一个或多个物理设备中的虚拟机进行策略控制。  The disadvantage is that the cloud server cannot control the virtual machine based on the running information of the application running on the virtual machine because it cannot obtain the running information of the application running in the virtual machine. SUMMARY OF THE INVENTION Embodiments of the present invention provide a method and system for managing a virtual machine to perform policy control on a virtual machine running in one or more physical devices based on an application running on the virtual machine.
本发明实施例的第一方面提供一种对虚拟机进行管理的方法, 应用于由云 服务器及与所述云服务器通信连接的包含至少一个虚拟机的计算机设备所构成 的***中, 其至少包括: 所述云服务器基于获取的部署指令, 利用预设的各应 用的描述信息, 将相应的应用及用于获取相应应用的运行信息的第一获取模块 部署到至少一个所述虚拟机上; 所述云服务器获取在每一个所述虚拟机上运行 的所述应用的运行信息;所述云服务器对获取的每一个所述运行信息进行分析, 并基于分析结果对运行相应应用的虚拟机进行策略控制。 A first aspect of the embodiments of the present invention provides a method for managing a virtual machine, where the system is configured by a cloud server and a computer device including at least one virtual machine that is communicatively connected to the cloud server, and includes at least : the cloud server is based on the acquired deployment instructions, and uses presets Using the description information, deploying a corresponding application and a first obtaining module for obtaining running information of the corresponding application to at least one of the virtual machines; the cloud server acquiring the running on each of the virtual machines The running information of the application; the cloud server analyzes each of the obtained running information, and performs policy control on the virtual machine running the corresponding application based on the analysis result.
优选地, 所述云服务器部署所述应用和第一获取模块包括: 所述云服务器 基于预设的各应用的描述信息, 向至少一个所述虚拟机部署至少一个所述应用 及所述第一获取模块。  Preferably, the cloud server deploying the application and the first obtaining module includes: the cloud server deploying at least one of the application and the first to at least one of the virtual machines based on preset description information of each application Get the module.
优选地, 所述云服务器获取在每一个所述虚拟机上运行的所述应用的运行 信息包括: 由所述虚拟机基于轮询机制向每一个第一获取模块发出用于获取应 用的运行信息的指令, 以便各第一获取模块获取相应应用的运行信息, 再将获 取的所有运行信息发送至所述云服务器。  Preferably, the acquiring, by the cloud server, the running information of the application running on each of the virtual machines comprises: sending, by the virtual machine, running information for acquiring an application to each first acquiring module according to a polling mechanism. The instructions are obtained, so that each of the first obtaining modules acquires running information of the corresponding application, and then sends all the obtained running information to the cloud server.
优选地, 所述云服务器获取在每一个所述虚拟机上运行的所述应用的运行 信息还包括: 各所述第一获取模块在运行之前向其所在的虚拟机进行注册, 以 便所述虚拟机利用第一获取模块的注册信息, 轮询已注册的各第一获取模块, 进而取得相应应用的运行信息。  Preferably, the acquiring, by the cloud server, the running information of the application running on each of the virtual machines further includes: each of the first obtaining modules registering with a virtual machine that is located before the running, so that the virtual server The machine uses the registration information of the first acquisition module to poll the first acquisition modules that have been registered, and then obtains the operation information of the corresponding application.
优选地, 所述云服务器基于分析结果对运行相应应用的虚拟机进行策略控 制包括: 所述云服务器从获取的多个运行信息中识别来自不同虚拟机的同一应 用的运行信息; 以及所述云服务器分析来自多个虚拟机的同一应用的所述运行 信息, 并基于分析结果对至少一个虚拟机进行策略控制。  Preferably, the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including: the cloud server identifies, from the obtained multiple running information, operation information of the same application from different virtual machines; and the cloud The server analyzes the running information of the same application from the plurality of virtual machines, and performs policy control on the at least one virtual machine based on the analysis result.
优选地, 所述云服务器基于分析结果对运行相应应用的虚拟机进行策略控 制包括: 所述云服务器基于分析结果, 向运行相应应用的虚拟机发送用于改变 所述应用及相应的第一获取模块运行的指令。  Preferably, the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, and the cloud server sends, according to the analysis result, a virtual machine that runs the corresponding application, to change the application and the corresponding first acquisition. The instruction that the module is running.
优选地, 所述用于改变所述应用及相应的第一获取模块运行的指令至少包 括以下一种: 启动指令、 暂停指令和停止指令。  Preferably, the instruction for changing the operation of the application and the corresponding first obtaining module comprises at least one of the following: a start instruction, a pause instruction, and a stop instruction.
优选地, 所述云服务器基于分析结果对运行相应应用的虚拟机进行策略控 制包括: 所述云服务器基于分析结果, 生成部署指令, 以便通过重新执行部署 的步骤, 向未运行该应用的虚拟机部署所述应用及相应的第一获取模块。  Preferably, the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, where the cloud server generates a deployment instruction based on the analysis result, so as to re-execute the deployment step, to the virtual machine that is not running the application. Deploying the application and a corresponding first acquisition module.
优选地, 所述方法还包括: 所述虚拟机监控所述第一获取模块获取的运行 信息, 并判断所述运行信息对应的应用是否临近或超出预设的相应应用正常运 行的范围, 若临近或超出预设的相应应用正常运行的范围, 则将所述运行信息 提供给所述云服务器; 若未临近或超出预设的相应应用正常运行的范围, 则继 续监控。 Preferably, the method further includes: the virtual machine monitoring the operation information acquired by the first acquisition module, and determining whether the application corresponding to the operation information is adjacent to or exceeds a preset normal operation range of the corresponding application, if adjacent Or the running information is exceeded if the preset corresponding normal application is out of range. Provided to the cloud server; if it is not near or exceeds the preset range of the normal operation of the corresponding application, the monitoring is continued.
本发明实施例的第二方面提供一种对虚拟机进行管理的***, 包括: 云服 务器及与所述云服务器通信连接的包含至少一个虚拟机的计算机设备;  A second aspect of the embodiments of the present invention provides a system for managing a virtual machine, including: a cloud server and a computer device including at least one virtual machine communicatively coupled to the cloud server;
所述云服务器中包括: 部署模块, 用于基于获取的部署指令, 利用预设的 各应用的描述信息, 将相应的应用及用于获取相应应用的运行信息的第一获取 模块部署到至少一个所述虚拟机上; 第二获取模块, 用于获取由所述部署模块 部署在每一个所述虚拟机上的所述应用的运行信息; 策略控制模块, 用于对所 述第二获取模块所获取的每一个所述运行信息进行分析, 并基于分析结果对运 行相应应用的虚拟机进行策略控制。  The cloud server includes: a deployment module, configured to deploy, according to the obtained deployment instruction, a corresponding application and a first acquiring module for acquiring running information of the corresponding application to at least one a second acquiring module, configured to acquire operation information of the application deployed by each of the virtual machines by the deployment module, and a policy control module, configured to be used by the second acquiring module Each of the obtained running information is analyzed, and based on the analysis result, policy control is performed on the virtual machine running the corresponding application.
优选地, 所述部署模块进一步用于基于预设的各应用的描述信息, 向至少 一个所述虚拟机部署至少一个所述应用及所述第一获取模块。  Preferably, the deployment module is further configured to deploy at least one of the application and the first obtaining module to at least one of the virtual machines based on preset description information of each application.
优选地, 所述策略控制模块包括: 识别子模块, 用于从所述第二获取模块 获取的多个运行信息中识别来自不同虚拟机的同一应用的运行信息。  Preferably, the policy control module includes: an identification submodule, configured to identify operation information of the same application from different virtual machines from the plurality of operation information acquired by the second acquisition module.
优选地, 所述策略控制模块具体用于基于分析结果, 向运行相应应用的虚 拟机发送用于改变所述应用及相应的第一获取模块运行的指令。  Preferably, the policy control module is specifically configured to send, according to the analysis result, an instruction for changing the operation of the application and the corresponding first acquiring module to a virtual machine running the corresponding application.
优选地, 所述用于改变所述应用及相应的第一获取模块运行的指令至少包 括以下一种: 启动指令、 暂停指令和停止指令。  Preferably, the instruction for changing the operation of the application and the corresponding first obtaining module comprises at least one of the following: a start instruction, a pause instruction, and a stop instruction.
优选地, 所述策略控制模块具体用于基于分析结果, 向所述部署模块发出 所述部署指令, 以便所述部署模块基于所述部署指令在未运行相应应用的虚拟 机上部署所述应用及相应的第一获取模块。 根据本发明实施例提供的对虚拟机进行管理的方法及***, 所述云服务器 通过部署在虚拟机上的第一获取模块获取在虚拟机中运行的各应用的运行信 息, 并通过对所述运行信息的分析对运行相应应用的虚拟机进行策略控制, 如 此, 能够解决现有的云服务器无法基于虚拟机上运行的应用对虚拟机进行管理 的问题; 同时, 能够实时对各虚拟机进行策略控制, 以便虚拟机改变应用的运 行情况或运行环境。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描 述中的附图是本发明的一些实施例。 Preferably, the policy control module is specifically configured to send the deployment instruction to the deployment module based on the analysis result, so that the deployment module deploys the application on a virtual machine that does not run the corresponding application based on the deployment instruction. Corresponding first acquisition module. According to the method and system for managing a virtual machine according to an embodiment of the present invention, the cloud server acquires operation information of each application running in the virtual machine by using a first acquiring module deployed on the virtual machine, and The analysis of the running information controls the virtual machine running the corresponding application. In this way, the problem that the existing cloud server cannot manage the virtual machine based on the application running on the virtual machine can be solved. At the same time, the strategy can be performed on each virtual machine in real time. Control, so that the virtual machine changes the running or running environment of the application. DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is some embodiments of the invention.
图 1为本发明实施例提供的一种对虚拟机进行管理的方法的流程图。  FIG. 1 is a flowchart of a method for managing a virtual machine according to an embodiment of the present invention.
图 2为本发明实施例提供的一种对虚拟机进行管理的方法中的一种优选方 案的流程图。  FIG. 2 is a flowchart of a preferred method in a method for managing a virtual machine according to an embodiment of the present invention.
图 3为本发明实施例提供的一种对虚拟机进行管理的***的架构图。  FIG. 3 is a structural diagram of a system for managing a virtual machine according to an embodiment of the present invention.
图 4为本发明实施例提供的一种对虚拟机进行管理的***的结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明 实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。  FIG. 4 is a schematic structural diagram of a system for managing a virtual machine according to an embodiment of the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. The embodiments are a part of the embodiments of the invention, and not all of the embodiments.
实施例一  Embodiment 1
如图 1 所示, 本发明实施例提供一种对虚拟机进行管理的方法。 其中, 所 述管理方法应用于由云服务器以及与所述云服务器通信连接的包含至少一个虚 拟机的计算机设备所构成的***。 其中, 所述虚拟机可利用通信协议与所述云 服务器进行通信。  As shown in FIG. 1 , an embodiment of the present invention provides a method for managing a virtual machine. Wherein the management method is applied to a system composed of a cloud server and a computer device including at least one virtual machine communicatively coupled to the cloud server. The virtual machine can communicate with the cloud server by using a communication protocol.
在步骤 S1 中, 云服务器基于获取的部署指令, 利用预设的各应用的描述 信息, 将相应的应用及用于获取相应应用的运行信息的第一获取模块部署到至 少一个虚拟机上, 以便所述应用及所述第一获取模块运行在所述虚拟机上。 其 中, 所述部署指令中包括要部署的虚拟机的名称及地址、 应用的名称、 应用的 版本等信息。  In the step S1, the cloud server deploys the corresponding application and the first obtaining module for acquiring the running information of the corresponding application to the at least one virtual machine by using the preset description information of the respective applications, so that the cloud server The application and the first acquisition module run on the virtual machine. The deployment instruction includes information such as the name and address of the virtual machine to be deployed, the name of the application, and the version of the application.
其中, 所述应用包括任何能够运行在虚拟机上的软件, 其包括但不限于: 基于 WEB的应用等。 所述应用的描述信息包括任何能够描述所述应用的信息, 其包括但不限于: 所述应用的版本信息、 所述应用正常运行的配置信息、 所述 应用与所述第一获取模块之间的配置关系、 所述各应用之间的配置关系、 所述 应用或所述第一获取模块的存放地址等。 例如, 所述描述信息包括: 所述应用 运行所占用的虚拟机的端口,所述应用与所述第一获取模块连接的接口信息等。 所述应用的运行信息包括任何能够反映所述应用运行情况的信息, 其包括但不 限于: 所述应用当前的会话数、 所述应用在运行时产生的异常情况、 所述应用 占用所述虚拟机的资源信息等。 所述第一获取模块可以获取所述应用的一种运 行信息, 也可以获取所述应用的全部运行信息。 The application includes any software that can run on a virtual machine, including but not limited to: a WEB-based application or the like. The description information of the application includes any information that can describe the application, including but not limited to: version information of the application, configuration information of the application running normally, and the application and the first acquiring module The configuration relationship, the configuration relationship between the applications, the storage address of the application or the first acquiring module, and the like. For example, the description information includes: a port of the virtual machine occupied by the application running, interface information of the application connected to the first acquiring module, and the like. The running information of the application includes any information that can reflect the running status of the application, including but not limited to: the current number of sessions of the application, an abnormal situation generated by the application at runtime, and the application occupying the virtual Resource information of the machine, etc. The first obtaining module may obtain one running information of the application, and may also obtain all running information of the application.
本实施例中, 所述云服务器基于预设的各应用的描述信息, 向至少一个所 述虚拟机部署至少一个所述应用及所述第一获取模块, 以使所述应用及所述第 一获取模块运行在所述虚拟机上。  In this embodiment, the cloud server deploys at least one of the application and the first acquiring module to at least one of the virtual machines based on the preset description information of each application, so that the application and the first The acquisition module runs on the virtual machine.
例如, WEB应用 a3的描述信息 a4包括: WEB应用 a3与数据库 a1连接 的配置文件 b1、 WEB应用 a3与第一获取模块 a2之间的配置文件 b2。 所述云 服务器基于所述描述信息 a4, 将 WEB应用 a3、 第一获取模块 a2和数据库 a1 远程安装在虚拟机 A中后, 按照配置文件 b1和配置文件 b2分别将 WEB应用 a3与数据库 a1、 WEB应用 a3与第一获取模块 a2进行连接, 以便 WEB应用 a3可以正常运行, 同时所述第一获取模块 a2能够获取 WEB应用 a3的运行信 息。  For example, the description information of the WEB application a3 a4 includes: WEB application a3 The configuration file connected with the database a1 b1, the configuration file b2 between the WEB application a3 and the first acquisition module a2. The cloud server installs the WEB application a3, the first obtaining module a2, and the database a1 in the virtual machine A remotely based on the description information a4, and respectively applies the WEB application a3 and the database a1 according to the configuration file b1 and the configuration file b2. The WEB application a3 is connected to the first acquisition module a2, so that the WEB application a3 can operate normally, and the first acquisition module a2 can acquire the operation information of the WEB application a3.
其中,所述第一获取模块获取所述应用的运行信息的方式包括但不限于:1 ) 从所述虚拟机的任务管理器中获取所述应用的运行信息; 2 )通过所述应用提供 的接口获取所述应用的运行信息等。  The manner in which the first obtaining module acquires the running information of the application includes, but is not limited to: 1) acquiring running information of the application from a task manager of the virtual machine; 2) providing the application through the application The interface acquires running information of the application, and the like.
在步骤 S2 中, 所述云服务器获取在每一个所述虚拟机上运行的所述应用 的运行信息。 其中, 运行在所述虚拟机上的应用可以是一个或多个, 优选地, 所述云服务器获取运行在虚拟机上的每一个所述应用的运行信息。  In step S2, the cloud server acquires running information of the application running on each of the virtual machines. The application running on the virtual machine may be one or more. Preferably, the cloud server acquires running information of each of the applications running on the virtual machine.
所述云服务器获取在每一个所述虚拟机上运行的应用的运行信息的方式包 括但不限于:  The manner in which the cloud server obtains running information of an application running on each of the virtual machines includes, but is not limited to:
1 )由所述虚拟机中的各所述第一获取模块直接将获取的相应应用的运行信 息发送至所述云服务器。 例如, 所述虚拟机上运行有: 应用 c1、 用于获取所述 应用 c1 的运行信息的第一获取模块 d1、 应用 c2及用于获取所述应用 c2的运 行信息的第一获取模块 d2。则第一获取模块 d1和 d2基于预设的时间间隔, 按 照预设的所述云服务器的地址, 分别将各自获取的应用的运行信息发送至所述 云服务器。  1) The running information of the obtained corresponding application is directly sent to the cloud server by each of the first acquiring modules in the virtual machine. For example, the virtual machine runs: an application c1, a first obtaining module d1 for acquiring running information of the application c1, an application c2, and a first obtaining module d2 for acquiring running information of the application c2. The first obtaining modules d1 and d2 respectively send the running information of the respective acquired applications to the cloud server according to the preset address of the cloud server based on the preset time interval.
2 )由所述虚拟机基于轮询机制向每一个第一获取模块发出用于获取应用的 运行信息的指令, 以便各第一获取模块获取相应应用的运行信息, 再将获取的 所有运行信息发送至所述云服务器。 2) The virtual machine sends an instruction for acquiring the running information of the application to each first acquiring module based on the polling mechanism, so that each first acquiring module acquires running information of the corresponding application, and then acquires the obtained information. All operational information is sent to the cloud server.
具体地, 所述虚拟机在所述云服务器的部署指令下, 安装、 运行各应用及 所述第一获取模块时, 记录各应用及第一获取模块的名称、 版本号、 安装地址、 运行地址等信息, 并基于轮询机制, 通过记录的信息发出用于获取应用的运行 信息的指令, 以便获取所有的运行信息。  Specifically, the virtual machine records the name, version number, installation address, and running address of each application and the first acquiring module when the application and the first acquiring module are installed and run under the deployment instruction of the cloud server. And other information, and based on the polling mechanism, an instruction for obtaining the running information of the application is issued through the recorded information to obtain all the running information.
优选地, 各所述第一获取模块在运行之前向其所在的虚拟机进行注册, 以 便所述虚拟机利用第一获取模块的注册信息, 轮询已注册的各第一获取模块, 进而取得相应应用的运行信息。 其中, 所述注册信息包括但不限于所述第一获 取模块的版本号、 所述第一获取模块的名称、 所述第一获取模块的运行地址等。 例如, 部署在虚拟机上的第一获取模块在启动运行时, 先按照预存储的虚拟机 的注册端口向所在虚拟机发出包含所述注册信息的注册请求, 所述虚拟机将所 述注册信息添加到所维护的动态链表中, 以供基于轮询机制向所述第一获取模 块发出用于获取运行信息的指令。  Preferably, each of the first obtaining modules registers with the virtual machine in which the first acquiring module is located, so that the virtual machine uses the registration information of the first acquiring module to poll the registered first acquiring modules, and then obtains corresponding Application running information. The registration information includes, but is not limited to, a version number of the first obtaining module, a name of the first acquiring module, a running address of the first acquiring module, and the like. For example, when the first obtaining module deployed on the virtual machine starts the running, first sends a registration request including the registration information to the virtual machine according to the pre-stored virtual machine registration port, and the virtual machine uses the registration information. Adding to the maintained dynamic linked list for issuing an instruction for acquiring the running information to the first acquiring module based on a polling mechanism.
在步骤 S3 中, 所述云服务器对获取的每一个所述运行信息进行分析, 并 基于分析结果对运行相应应用的虚拟机进行策略控制。 其中, 所述分析结果包 括但不限于: 应用处于正常运行、 应用处于异常运行、 应用临近异常运行、 无 法获取应用的一个或全部运行信息等。 所述策略控制的方式包括任何能够基于 所获取的应用的运行信息, 更改所述应用的运行环境或运行情况的方式。 所述 策略控制的类型包括但不限于以下至少一种: 负载均衡的控制, 自动扩 /减容的 控制, 及动态迁移的控制等。  In step S3, the cloud server analyzes each acquired operation information, and performs policy control on the virtual machine running the corresponding application based on the analysis result. The analysis result includes, but is not limited to, the application is in normal operation, the application is in abnormal operation, the application is adjacent to the abnormal operation, and one or all of the running information of the application cannot be acquired. The manner of policy control includes any manner in which the operating environment or operation of the application can be changed based on the acquired operational information of the application. The types of policy control include, but are not limited to, at least one of the following: load balancing control, automatic expansion/decrement control, and dynamic migration control.
其中, 所述云服务器对获取的每一个所述运行信息进行分析的方式包括但 不限于:  The manner in which the cloud server analyzes each of the obtained running information includes but is not limited to:
1 )所述云服务器将获取的运行信息与预存的相应应用的运行信息进行比较 分析, 以得到分析结果。 例如, 所述云服务器获取的运行信息包括: 来自虚拟 机 M2的应用 m2的当前会话数为 150, 预设的应用 m2的最大会话数为 200, 则所述云服务器分析得到所获取的应用 m2的当前会话数已临近最大会话数。  1) The cloud server compares the acquired running information with the pre-stored running information of the corresponding application to obtain an analysis result. For example, the running information obtained by the cloud server includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the maximum number of sessions of the preset application m2 is 200, and the cloud server analyzes and obtains the acquired application m2. The current number of sessions is approaching the maximum number of sessions.
2 ) 所述云服务器基于预设的各应用的分析规则对获取的运行信息进行分 析, 以得到分析结果。  2) The cloud server analyzes the acquired running information based on the preset analysis rules of each application to obtain an analysis result.
例如, 针对应用 m2 预设一个评价公式为藝 tltx权值 1 +当麵 资龍例 权值 2, 其中 最大会话数为 300, 权值 1为 2, 权值 2为 3, 当评价值在 1 -3之间时为正常运 行。 假设所述云服务器获取的运行信息包括: 来自虚拟机 M2 的应用 m2 的当 前会话数为 150, 应用 m2 占用虚拟机 M2的资源比例为 30%, 则所述云服务 器按照预设的应用 m2的上述分析规则,得到来自虚拟机 M2的应用 m2的运行 情况的评价值为 1 .9, 得出虚拟机 M2中的应用 m2的运行结果为正常运行。 For example, for the application m2, an evaluation formula is preset for the art tlt x weight value 1 + face-to-face dragon weight value 2 , wherein the maximum number of sessions is 300, the weight value is 2, and the weight 2 is 3, when the evaluation value is Normal operation between 1 and 3 Row. It is assumed that the running information obtained by the cloud server includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the proportion of the resources of the application m2 occupying the virtual machine M2 is 30%, and the cloud server follows the preset application m2. The above analysis rule obtains an evaluation value of the operation status of the application m2 from the virtual machine M2 of 1.9, and concludes that the operation result of the application m2 in the virtual machine M2 is normal operation.
其中,所述云服务器基于分析结果对运行相应应用的虚拟机进行策略控制, 其方式包括但不限于:  The cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including but not limited to:
1 )所述云服务器基于所述分析结果, 向运行相应应用的虚拟机发送用于改 变所述应用及相应的第一获取模块运行的指令。 其中, 所述指令包括但不限于: 启动指令、 暂停指令、 或停止指令等。  1) The cloud server sends an instruction for changing the operation of the application and the corresponding first obtaining module to the virtual machine running the corresponding application based on the analysis result. The instructions include but are not limited to: a start command, a pause command, or a stop command.
具体地, 如果所述云服务器得到的分析结果为无法获取某个应用的运行信 息或确定需要改变某个应用的运行状态, 则向运行相应应用的虚拟机发送用于 改变所述应用或相应的第一获取模块运行的指令。  Specifically, if the analysis result obtained by the cloud server is that the running information of an application cannot be obtained or the running state of an application needs to be changed, sending, to the virtual machine running the corresponding application, the application or the corresponding The first acquisition module executes the instructions.
2 ) 所述云服务器基于所述分析结果, 生成部署指令, 以便重新执行步骤 S1 向未运行该应用的虚拟机部署所述应用及相应的第一获取模块。  2) The cloud server generates a deployment instruction based on the analysis result, so as to re-execute step S1 to deploy the application and the corresponding first acquiring module to the virtual machine that is not running the application.
具体地, 如果所述云服务器得到的分析结果为某个应用已满负荷运行, 则 生成部署指令, 以便所述云服务器向所述部署指令指定的未运行所述应用的虚 拟机部署所述应用及第一获取模块。  Specifically, if the analysis result obtained by the cloud server is that an application is running at a full load, generating a deployment instruction, so that the cloud server deploys the application to a virtual machine that is not running the application specified by the deployment instruction. And the first acquisition module.
优选地, 所述步骤 S3包括步骤 S31和步骤 S32。  Preferably, the step S3 comprises a step S31 and a step S32.
在步骤 S31 中, 所述云服务器从获取的多个运行信息中识别来自不同虚拟 机的同一应用的运行信息。  In step S31, the cloud server identifies running information of the same application from different virtual machines from the obtained plurality of running information.
具体地, 所述云服务器从获取的多个运行信息中提取能够标识应用及虚拟 机的标识信息, 再根据所述标识信息识别运行在不同虚拟机中的同一应用。 其 中, 所述标识信息包括但不限于: 应用的名称、 应用的版本号、 虚拟机的名称、 虚拟机地址等。  Specifically, the cloud server extracts identification information that can identify the application and the virtual machine from the obtained multiple running information, and then identifies the same application running in different virtual machines according to the identification information. The identifier information includes but is not limited to: an application name, an application version number, a virtual machine name, a virtual machine address, and the like.
例如, 所述云服务器获取到的多个运行信息包括: 来自虚拟机 N 1 的应用 For example, the multiple running information obtained by the cloud server includes: an application from the virtual machine N 1
C1 的运行信息 c1、 来自虚拟机 N2的应用 C2的运行信息 c2、 来自虚拟机 N3 的应用 C1 的运行信息 c3。 所述云服务器提取每一个运行信息中的应用名称及 虚拟机的名称, 并将每一个应用名称及虚拟机名称进行循环比对, 识别出运行 信息 c1和运行信息 c3中的应用名称相同、 虚拟机的名称不同, 则所述云服务 器基于该识别结果确定运行信息 c1和运行信息 c3为来自不同虚拟机的同一应 用的运行信息。 The operation information c1 of C1, the operation information c2 of the application C2 from the virtual machine N2, and the operation information c3 of the application C1 from the virtual machine N3. The cloud server extracts the application name and the name of the virtual machine in each running information, and compares each application name and the virtual machine name in a loop, and identifies that the application name in the running information c1 and the running information c3 is the same, and the virtual The cloud server determines that the running information c1 and the running information c3 are the same from different virtual machines based on the identification result. The running information used.
在步骤 S32中, 所述云服务器分析来自多个虚拟机的同一应用的所述运行 信息, 并基于分析结果对至少一个虚拟机进行策略控制。  In step S32, the cloud server analyzes the operation information of the same application from the plurality of virtual machines, and performs policy control on the at least one virtual machine based on the analysis result.
其中,所述云服务器对至少一个虚拟机进行策略控制的方式包括但不限于: 1 ) 基于分析结果对运行该应用的至少一个虚拟机进行策略控制。  The manner in which the cloud server performs policy control on at least one virtual machine includes, but is not limited to: 1) performing policy control on at least one virtual machine running the application based on the analysis result.
例如, 获取的各虚拟机中的应用的运行信息包括: 虚拟机 M1 中的应用 A 当前的会话数 300、 虚拟机 M2中的应用 A当前的会话数 400、 虚拟机 M3中 的应用 A当前的会话数 200以及虚拟机 M3中的应用 B当前的会话数 250。 所 述云服务器基于各运行信息中的应用的标识信息确定虚拟机 M1、虚拟机 M2和 虚拟机 M3运行同一应用 A, 并基于所述应用 A分别在虚拟机 M 1、 虚拟机 M2 和虚拟机 M3中的运行信息来管理所述虚拟机 M1、 M2、 M3中所述应用 A的运 行。 比如, 所述云服务器将虚拟机 M2中的应用 A的当前会话数 400与预设的 应用 A的最大会话数 450进行比较, 确定不再向虚拟机 M2中的应用 A分配新 的用户访问请求, 转而将新的用户访问请求分配给虚拟机 M 1 或虚拟机 M3 中 的应用 A, 以此来均衡虚拟机 M1、 M2和 M3的负载。  For example, the obtained running information of the application in each virtual machine includes: the current session number 300 of the application A in the virtual machine M1, the current session number 400 of the application A in the virtual machine M2, and the current application A of the virtual machine M3. The number of sessions 200 and the current number of sessions B of application B in virtual machine M3. The cloud server determines that the virtual machine M1, the virtual machine M2, and the virtual machine M3 run the same application A based on the identification information of the application in each running information, and is based on the application A in the virtual machine M1, the virtual machine M2, and the virtual machine respectively. The operation information in M3 manages the operation of the application A in the virtual machines M1, M2, M3. For example, the cloud server compares the current session number 400 of the application A in the virtual machine M2 with the maximum number of sessions 450 of the preset application A, and determines that the new user access request is no longer allocated to the application A in the virtual machine M2. Instead, the new user access request is assigned to application A in virtual machine M1 or virtual machine M3, thereby balancing the load of virtual machines M1, M2, and M3.
2 ) 基于分析结果, 通过重新执行步骤 S1 向未运行该应用的虚拟机部署所 述应用及相应的第一获取模块。  2) Based on the analysis result, the application and the corresponding first acquiring module are deployed to the virtual machine not running the application by performing step S1 again.
需要说明的是, 本领域技术人员应该理解, 上述步骤 S1、 步骤 S2和步骤 S3之间并非一定按顺序的连续执行, 事实上, 所述云服务器可以利用多线程技 术一边获取各应用的运行信息, 一边基于所获取的各应用的运行信息对各应用 进行策略控制, 同时, 还可以执行步骤 S1 来部署新的应用, 并获取新的应用 的运行信息。  It should be noted that those skilled in the art should understand that the foregoing steps S1, S2, and S3 are not necessarily performed in sequence. In fact, the cloud server may acquire the running information of each application by using the multi-threading technology. The policy control is performed on each application based on the acquired running information of each application. At the same time, step S1 may be performed to deploy a new application, and obtain running information of the new application.
通过本实施例提供的对虚拟机进行管理的方法,所述云服务器通过在虚拟 机中部署的第一获取模块来获取在虚拟机中运行的各应用的运行信息, 并通过 对所述运行信息的分析对运行相应应用的虚拟机进行策略控制, 如此, 能够解 决现有的云服务器无法基于虚拟机上运行的应用对虚拟机进行管理的问题; 同 时, 能够实时对各虚拟机进行策略控制, 以供虚拟机改变应用的运行情况或运 行环境。 进一步, 所述云服务器还可以通过对获取的各运行信息进行识别, 来 确定不同虚拟机上运行的同一应用的运行情况,然后对各虚拟机进行策略控制, 使得同一应用在各虚拟机上的都能正常运行。 实施例二 With the method for managing a virtual machine provided by the embodiment, the cloud server acquires running information of each application running in the virtual machine by using a first acquiring module deployed in the virtual machine, and passes the running information The analysis of the virtual machine running the corresponding application is controlled. In this way, the problem that the existing cloud server cannot manage the virtual machine based on the application running on the virtual machine can be solved; at the same time, the policy control of each virtual machine can be performed in real time. In order for the virtual machine to change the running or running environment of the application. Further, the cloud server may further determine the running status of the same application running on different virtual machines by identifying the obtained running information, and then perform policy control on each virtual machine, so that the same application is on each virtual machine. Can run normally. Embodiment 2
与实施例一不同的是, 本实施例中步骤 S2 还包括: 所述虚拟机监控所述 第一获取模块获取的运行信息, 并判断所述运行信息对应的应用是否临近或超 出预设的相应应用正常运行的范围, 若确实临近或超出预设的相应应用正常运 行的范围, 则将所述运行信息提供给所述云服务器; 若并未临近或超出预设的 相应应用正常运行的范围, 则继续监控。  The difference from the first embodiment is that the step S2 in the embodiment further includes: the virtual machine monitoring the operation information acquired by the first acquisition module, and determining whether the application corresponding to the operation information is adjacent or exceeds a preset corresponding If the range of the normal operation is applied, if the range of the normal operation of the corresponding application is indeed approached or exceeded, the operation information is provided to the cloud server; if it is not adjacent to or exceeds the preset normal operation range of the corresponding application, Then continue to monitor.
例如, 所述第一获取模块获取的运行信息包括: 应用 d 1 的当前会话数为 30、 应用 d2的当前 CPU占用 70%。 所述虚拟机将预设的应用 d1 能够承受的 最大会话数 500与所获取的应用 d1 的会话数 30取差值, 并将所述差值与预设 的临界阈值 5进行比较,确定所述差值大于所述临界阈值, 即所述应用 d1运行 正常, 继续监控所述应用 d 1 的当前会话数; 同时, 基于预设的应用 d2能够占 用的 CPU的最大比例不得超过 50%, 确定所述应用 d2运行异常, 将所述应用 d2的运行信息提供给所述云服务器。  For example, the running information acquired by the first obtaining module includes: the current session number of the application d 1 is 30, and the current CPU usage of the application d2 is 70%. The virtual machine compares the maximum number of sessions 500 that the preset application d1 can withstand the number of sessions 30 of the obtained application d1, and compares the difference with a preset critical threshold 5 to determine the The difference is greater than the critical threshold, that is, the application d1 is running normally, and the current session number of the application d 1 is continuously monitored; meanwhile, the maximum proportion of the CPU that can be occupied based on the preset application d2 may not exceed 50%. The application d2 runs abnormally, and the running information of the application d2 is provided to the cloud server.
具体地, 本方案的工作过程如图 2所示。  Specifically, the working process of the solution is as shown in FIG. 2.
在步骤 S10中, 所述云服务器基于获取的部署指令, 利用预设的各应用的 描述信息, 将相应的应用及用于获取相应应用的运行信息的第一获取模块部署 到至少一个所述虚拟机上, 以便所述应用及所述第一获取模块运行在所述虚拟 机上。  In the step S10, the cloud server deploys the corresponding application and the first acquiring module for acquiring the running information of the corresponding application to the at least one virtual entity by using the preset description information of each application. Onboard, so that the application and the first acquisition module run on the virtual machine.
在步骤 S20中, 所述虚拟机基于来自所述第一获取模块的注册请求, 对所 部署的每一个第一获取模块进行注册;  In step S20, the virtual machine registers each of the deployed first acquisition modules based on the registration request from the first acquisition module.
在步骤 S30中, 所述虚拟机基于轮询机制向已注册的每一个第一获取模块 发出用于获取运行信息的指令, 以便各第一获取模块获取相应应用的运行信息; 在步骤 S40中, 所述虚拟机监控所述第一获取模块获取的运行信息, 并判 断所述运行信息对应的应用是否临近或超出预设的相应应用正常运行的范围, 若确实临近或超出预设的相应应用正常运行的范围, 则执行步骤 S60, 若并未 临近或超出预设的相应应用正常运行的范围, 则执行步骤 S50。  In step S30, the virtual machine sends an instruction for acquiring the operation information to each of the first acquisition modules that have been registered, so that each first acquisition module acquires the operation information of the corresponding application, in step S40. The virtual machine monitors the operation information acquired by the first acquisition module, and determines whether the application corresponding to the operation information is adjacent to or exceeds a preset normal operation range of the corresponding application, and if the application is indeed adjacent to or exceeds the preset, the corresponding application is normal. If the range of the operation is not completed, the step S50 is performed if the range of the normal operation of the corresponding application is not approached or exceeded.
在步骤 S50中, 所述虚拟机继续监控所述第一获取模块获取的运行信息。 在步骤 S60中, 所述虚拟机将所述运行信息提供给所述云服务器。  In step S50, the virtual machine continues to monitor the operation information acquired by the first acquiring module. In step S60, the virtual machine provides the operation information to the cloud server.
在步骤 S70中, 所述云服务器对获取的每一个所述运行信息进行分析, 并 基于分析结果对运行相应应用的虚拟机进行策略控制。 需要说明的是, 本实施例仅为本发明的一个实施例, 事实上, 所述虚拟机 可以按照实施例一中描述的其他方式将所述第一获取模块获取的运行信息发送 至所述云服务器, 所述云服务器在接收到各虚拟机所发送的各应用的运行信息 后, 利用实施例一中所描述的方案对各应用进行分析, 并基于分析结果进行相 应的策略控制。 In step S70, the cloud server analyzes each of the acquired operation information, and performs policy control on the virtual machine running the corresponding application based on the analysis result. It should be noted that the embodiment is only one embodiment of the present invention. In fact, the virtual machine may send the operation information acquired by the first acquiring module to the cloud according to other manners described in the first embodiment. After receiving the running information of each application sent by each virtual machine, the cloud server analyzes each application by using the solution described in the first embodiment, and performs corresponding policy control based on the analysis result.
本实施例中, 每一个第一获取模块通过注册的方式把各自的信息告知所在 的虚拟机, 以便虚拟机利用轮询机制向已注册的第一获取模块发出轮询指令, 由此能够有针对性的管理虚拟机上运行的应用, 而不必获取一些临时运行的应 用的运行信息, 以提高管理效率, 减少垃圾信息产生; 另外, 所述虚拟机在获 取到各应用的运行信息时, 先基于各所述运行信息甄别相应的应用是否临近或 超出预设的所述应用正常运行的范围, 能够分担云服务器的负担。  In this embodiment, each first acquiring module notifies the virtual machine of the respective information by means of registration, so that the virtual machine sends a polling instruction to the registered first acquiring module by using a polling mechanism, thereby being able to target To manage the running of the application on the virtual machine without having to obtain the running information of some temporarily running applications, so as to improve the management efficiency and reduce the generation of spam. In addition, when the virtual machine obtains the running information of each application, it is based on Each of the running information distinguishes whether the corresponding application is adjacent to or exceeds a preset range in which the application is in normal operation, and can share the burden of the cloud server.
实施例三  Embodiment 3
与实施例一、 二不同的是, 在所述虚拟机将获取的各应用的运行信息发送 给所述云服务器, 所述云服务器基于所获取的各应用的运行信息进行分析并执 行相应的策略控制的同时, 所述虚拟机和所述云服务器之间还保持通信, 以便 所述虚拟机和云服务器能够及时得知彼此是否处于通信状态。  Different from the first and second embodiments, the running information of each application that is obtained by the virtual machine is sent to the cloud server, and the cloud server analyzes and executes a corresponding policy based on the obtained running information of each application. While controlling, the virtual machine and the cloud server also maintain communication, so that the virtual machine and the cloud server can know in time whether they are in communication state.
具体地, 所述虚拟机与所述云服务器之间保持通信的方式包括但不限于: 基于心跳机制保持所述虚拟机与所述云服务器之间的通信。  Specifically, the manner in which the virtual machine maintains communication with the cloud server includes, but is not limited to: maintaining communication between the virtual machine and the cloud server based on a heartbeat mechanism.
例如, 所述虚拟机基于心跳机制每隔 15 分钟与所述云服务器进行一次通 信, 当所述云服务器在 20分钟时间内未收到来自所述虚拟机的心跳信息, 则确 定所述虚拟机异常, 并将所述异常信息通过与所述云服务器连接的显示器予以 显示, 以便技术人员对所述虚拟机进行处理。  For example, the virtual machine communicates with the cloud server once every 15 minutes based on a heartbeat mechanism. When the cloud server does not receive heartbeat information from the virtual machine within 20 minutes, the virtual machine is determined to be the virtual machine. Abnormally, and displaying the abnormality information through a display connected to the cloud server, so that the technician processes the virtual machine.
本实施例中, 所述虚拟机与所述云服务器通过定期通信来确保彼此的通信 连接, 有利于当所述虚拟机所在物理设备异常或网络异常时, 所述云服务器及 时报警或按照应急预案予以及时处理, 以确保各应用能够稳定运行。  In this embodiment, the virtual machine and the cloud server ensure communication connection with each other through regular communication, which is convenient for the cloud server to timely alarm or follow the emergency plan when the physical device of the virtual machine is abnormal or the network is abnormal. Handle it in time to ensure that applications are stable.
实施例四  Embodiment 4
本发明还提供一种对虚拟机进行管理的***。 其中, 所述***包括云服务 器 1 以及与所述云服务器 1通信连接的包含至少一个虚拟机 2的计算机设备, 如图 3所示。其中,所述虚拟机 2可利用通信协议与所述云服务器 1进行通信。 所述云服务器 1至少包括: 部署模块 1 1、 第二获取模块 12、 策略控制模块 13。 如图 4所示。 The present invention also provides a system for managing a virtual machine. The system includes a cloud server 1 and a computer device including at least one virtual machine 2 communicatively coupled to the cloud server 1, as shown in FIG. The virtual machine 2 can communicate with the cloud server 1 by using a communication protocol. The cloud server 1 includes at least: a deployment module 1 1 , a second acquisition module 12 , and a policy control module 13 . As shown in Figure 4.
所述部署模块 1 1 用于基于获取的部署指令, 利用预设的各应用的描述信 息, 将相应的应用及用于获取相应应用的运行信息的第一获取模块部署到至少 一个所述虚拟机 2上, 以便所述应用及所述第一获取模块运行在所述虚拟机 2 上。 其中, 所述部署指令中至少包括所要部署的虚拟机的名称及地址、 应用的 名称、 应用的版本等信息。  The deployment module 11 is configured to deploy, according to the obtained deployment instruction, the corresponding application and the first acquiring module for acquiring the running information of the corresponding application to the at least one virtual machine by using the preset description information of each application. 2, so that the application and the first acquisition module run on the virtual machine 2. The deployment instruction includes at least information such as a name and an address of the virtual machine to be deployed, a name of the application, and a version of the application.
其中, 所述应用包括任何能够运行在虚拟机上的软件, 其包括但不限于: 基于 WEB的应用等。 所述应用的描述信息包括任何能够描述所述应用的信息, 其包括但不限于: 所述应用的版本信息、 所述应用正常运行的配置信息、 所述 应用与所述第一获取模块之间的配置关系、 所述各应用之间的配置关系、 所述 应用或所述第一获取模块的存放地址等。 例如, 所述描述信息包括: 所述应用 运行所占用的虚拟机 2的端口, 所述应用与所述第一获取模块连接的接口信息 等。 所述应用的运行信息包括任何能够反映所述应用运行时的情况的信息, 其 包括但不限于: 所述应用当前的会话数、 所述应用在运行时产生的异常情况、 所述应用占用所述虚拟机 2的资源信息等。 所述第一获取模块可以获取所述应 用的一种运行信息, 也可以获取所述应用的全部运行信息。  The application includes any software that can run on a virtual machine, including but not limited to: a WEB-based application or the like. The description information of the application includes any information that can describe the application, including but not limited to: version information of the application, configuration information of the application running normally, and the application and the first acquiring module The configuration relationship, the configuration relationship between the applications, the storage address of the application or the first acquiring module, and the like. For example, the description information includes: a port of the virtual machine 2 occupied by the application, interface information of the application connected to the first acquiring module, and the like. The running information of the application includes any information that can reflect the situation when the application is running, including but not limited to: the current number of sessions of the application, the abnormal situation generated by the application during operation, and the application occupation The resource information of the virtual machine 2 and the like are described. The first obtaining module may obtain one type of running information of the application, and may also obtain all running information of the application.
本实施例中, 所述部署模块 1 1基于预设的各应用的描述信息, 向至少一个 所述虚拟机 2部署至少一个所述应用及所述第一获取模块, 以使所述应用及所 述第一获取模块运行在所述虚拟机 2上。  In this embodiment, the deployment module 1 1 deploys at least one of the application and the first acquiring module to at least one of the virtual machines 2 based on the preset description information of each application, so that the application and the The first acquisition module runs on the virtual machine 2.
例如, WEB应用 a3的描述信息 a4包括: WEB应用 a3与数据库 a1连接 的配置文件 b1、 WEB应用 a3与第一获取模块 a2之间的配置文件 b2。 所述部 署模块 1 1基于所述描述信息 a4,将 WEB应用 a3、第一获取模块 a2和数据库 a1远程安装在虚拟机 A中后,按照配置文件 b1和配置文件 b2分别将 WEB应 用 a3与数据库 a1、 WEB应用 a3与第一获取模块 a2进行连接, 以便 WEB应 用 a3可以正常运行,同时所述第一获取模块 a2能够获取 WEB应用 a3的运行 自  For example, the description information of the WEB application a3 a4 includes: WEB application a3 The configuration file connected with the database a1 b1, the configuration file b2 between the WEB application a3 and the first acquisition module a2. The deployment module 1 1 remotely installs the WEB application a3, the first obtaining module a2, and the database a1 in the virtual machine A based on the description information a4, and then applies the WEB application a3 and the database according to the configuration file b1 and the configuration file b2 respectively. A1, the WEB application a3 is connected to the first obtaining module a2, so that the WEB application a3 can operate normally, and the first obtaining module a2 can obtain the running of the WEB application a3.
其中,所述第一获取模块获取所述应用的运行信息的方式包括但不限于:1 ) 从所述虚拟机 2的任务管理器中获取所述应用的运行信息; 2 )通过所述应用提 供的接口获取所述应用的运行信息等。  The manner in which the first obtaining module acquires the running information of the application includes, but is not limited to: 1) acquiring running information of the application from a task manager of the virtual machine 2; 2) providing by using the application The interface obtains the running information of the application, and the like.
所述第二获取模块 12用于获取由所述部署模块 1 1部署在每一个所述虚拟 机 2上的所述应用的运行信息。 其中, 运行在所述虚拟机 2上的应用可以是一 个或多个,优选地,所述第二获取模块 12获取运行在虚拟机 2上的每一个所述 应用的运行信息。 The second obtaining module 12 is configured to acquire, by the deployment module 1 1 , each of the virtual Operational information of the application on machine 2. The application running on the virtual machine 2 may be one or more. Preferably, the second obtaining module 12 acquires running information of each of the applications running on the virtual machine 2.
所述第二获取模块 12获取在每一个所述虚拟机 2上运行的应用的运行信息 的方式包括但不限于:  The manner in which the second obtaining module 12 obtains the running information of the application running on each of the virtual machines 2 includes but is not limited to:
1 )由所述虚拟机 2中的各所述第一获取模块直接将获取的相应应用的运行 信息发送至所述第二获取模块 12。 例如, 所述虚拟机 2上运行有: 应用 c1、 用于获取所述应用 c1 的运行信息的第一获取模块 d 1、应用 c2及用于获取所述 应用 C2的运行信息的第一获取模块 d2。 则第一获取模块 d1和 d2基于预设的 时间间隔, 按照预设的所述第二获取模块的地址, 分别将各自所获取的应用的 运行信息发送至所述第二获取模块 12。  1) The first acquisition module of the virtual machine 2 directly sends the acquired operation information of the corresponding application to the second acquisition module 12. For example, the virtual machine 2 runs: an application c1, a first obtaining module d1 for acquiring running information of the application c1, an application c2, and a first acquiring module for acquiring running information of the application C2. D2. The first obtaining modules d1 and d2 respectively send the running information of the respective acquired applications to the second acquiring module 12 according to the preset address of the second acquiring module based on the preset time interval.
2 )由所述虚拟机 2基于轮询机制向每一个第一获取模块发出用于获取运行 信息的指令, 以便各第一获取模块获取相应应用的运行信息, 再将获取的所有 运行信息发送至所述第二获取模块 12。  2) The virtual machine 2 sends an instruction for acquiring the running information to each of the first acquiring modules based on the polling mechanism, so that each first acquiring module acquires the running information of the corresponding application, and then sends all the acquired running information to The second obtaining module 12 is provided.
具体地, 所述虚拟机 2在所述部署模块 1 1 的部署指令下, 安装、 运行各应 用及所述第一获取模块时, 记录各应用及第一获取模块的名称、 版本号、 安装 地址、 运行地址等信息, 并基于轮询机制, 通过所记录的信息发出用于获取应 用的运行信息的指令, 以便获取所有的运行信息。  Specifically, the virtual machine 2 records the name, version number, and installation address of each application and the first acquiring module when the application and the first acquiring module are installed and run under the deployment instruction of the deployment module 11. And running the address and the like, and based on the polling mechanism, issuing an instruction for acquiring the running information of the application through the recorded information, so as to obtain all the running information.
优选地, 各所述第一获取模块在运行之前向其所在的虚拟机 2进行注册, 以便所述虚拟机 2利用第一获取模块的注册信息, 轮询已注册的各第一获取模 块, 进而取得相应应用的运行信息。 其中, 所述注册信息包括但不限于所述第 一获取模块的版本号、 所述第一获取模块的名称、 所述第一获取模块的运行地 址等。 例如, 部署在虚拟机 2上的第一获取模块在启动运行时, 先按照预存储 的虚拟机的注册端口向所在虚拟机 2发出包含所述注册信息的注册请求, 所述 虚拟机 2将所述注册信息添加到所维护的动态链表中, 以供基于轮询机制向所 述第一获取模块发出用于获取运行信息的指令。  Preferably, each of the first obtaining modules registers with the virtual machine 2 in which it is located before running, so that the virtual machine 2 polls the registered first acquiring modules by using the registration information of the first acquiring module, and further Get the running information of the corresponding application. The registration information includes, but is not limited to, a version number of the first acquiring module, a name of the first acquiring module, an operating address of the first acquiring module, and the like. For example, when the first obtaining module deployed on the virtual machine 2 starts the running, first sends a registration request including the registration information to the virtual machine 2 according to the pre-stored virtual machine registration port, where the virtual machine 2 The registration information is added to the maintained dynamic linked list for issuing an instruction for acquiring the running information to the first obtaining module based on the polling mechanism.
所述策略控制模块 13用于对所述第二获取模块 12获取的每一个所述运行 信息进行分析, 并基于分析结果对运行相应应用的虚拟机 2进行策略控制。 其 中, 所述分析结果包括但不限于: 应用处于正常运行、 应用处于异常运行、 应 用临近异常运行、 无法获取应用的一个或全部运行信息等。 所述策略控制的方 式包括任何能够基于所获取的应用的运行信息, 更改所述应用的运行环境或运 行情况的策略。 所述策略控制的类型包括但不限于以下至少一种: 负载均衡的 控制, 自动扩 /减容的控制, 及动态迁移的控制等。 The policy control module 13 is configured to analyze each of the operation information acquired by the second obtaining module 12, and perform policy control on the virtual machine 2 running the corresponding application based on the analysis result. The analysis result includes, but is not limited to, the application is in normal operation, the application is in abnormal operation, the application is adjacent to the abnormal operation, and one or all of the running information of the application cannot be acquired. The party controlled by the policy The formula includes any policy that can change the running environment or operation of the application based on the running information of the acquired application. The types of policy control include, but are not limited to, at least one of the following: load balancing control, automatic expansion/decrement control, and dynamic migration control.
其中,所述策略控制模块 13对获取的每一个所述运行信息进行分析的方式 包括但不限于:  The manner in which the policy control module 13 analyzes each of the acquired operation information includes but is not limited to:
1 ) 所述策略控制模块 13将获取的运行信息与预存的相应应用的运行信息 进行比较分析, 以得到分析结果。 例如, 所述策略控制模块 13获取的运行信息 包括: 来自虚拟机 M2的应用 m2的当前会话数为 150, 预设的应用 m2的最大 会话数为 200, 则所述策略控制模块 13分析得到所获取的应用 m2的当前会话 数已临近最大会话数。  1) The policy control module 13 compares and analyzes the acquired operation information with the pre-stored operation information of the corresponding application to obtain an analysis result. For example, the operation information acquired by the policy control module 13 includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the maximum number of sessions of the preset application m2 is 200, and the policy control module 13 analyzes and obtains The number of current sessions of the obtained application m2 is approaching the maximum number of sessions.
2 ) 所述策略控制模块 13基于预设的各应用的分析规则对获取的运行信息 进行分析, 以得到分析结果。  2) The policy control module 13 analyzes the acquired running information based on the preset analysis rules of each application to obtain an analysis result.
例如, 针对应用 m2预设一个评价公式为 Silx权值 1 +当丽战源比例 权值 2, 其中 最大会话数为 300, 权值 1为 2, 权值 2为 3, 当评价值在 1 -3之间时为正常运 行。 假设所述策略控制模块 13 获取的运行信息包括: 来自虚拟机 M2 的应用 m2的当前会话数为 150, 应用 m2占用虚拟机 M2的资源比例为 30%, 则所述 策略控制模块 13按照预设的应用 m2的上述分析规则, 得到来自虚拟机 M2的 应用 m2的运行情况的评价值为 1 .9, 得出虚拟机 M2中的应用 m2的运行结果 为正常运行。 For example, for the application m2, an evaluation formula is set to Sil x weight 1 + when the Li war source proportional weight 2 , wherein the maximum number of sessions is 300, the weight 1 is 2, the weight 2 is 3, and the evaluation value is 1 Normal operation between -3. It is assumed that the running information obtained by the policy control module 13 includes: the current number of sessions of the application m2 from the virtual machine M2 is 150, and the proportion of the resources of the virtual machine M2 is 30%, and the policy control module 13 follows the preset. The above analysis rule of the application m2, the evaluation value of the operation of the application m2 from the virtual machine M2 is 1.9, and the operation result of the application m2 in the virtual machine M2 is normal operation.
其中,所述策略控制模块 13基于分析结果对运行相应应用的虚拟机 2进行 策略控制, 其方式包括但不限于:  The policy control module 13 performs policy control on the virtual machine 2 running the corresponding application based on the analysis result, including but not limited to:
1 ) 所述策略控制模块 13基于所述分析结果, 向运行相应应用的虚拟机 2 发送用于改变所述应用及相应的第一获取模块运行的指令。 其中, 所述指令包 括但不限于: 启动指令、 暂停指令、 或停止指令等。  1) The policy control module 13 sends an instruction for changing the operation of the application and the corresponding first acquisition module to the virtual machine 2 running the corresponding application based on the analysis result. The instructions include, but are not limited to, a start command, a pause command, or a stop command.
具体地,如果所述策略控制模块 13得到的分析结果为无法获取某个应用的 运行信息或确定需要改变某个应用的运行状态, 则向运行相应应用的虚拟机 2 发送用于改变所述应用或相应的第一获取模块运行的指令。  Specifically, if the analysis result obtained by the policy control module 13 is that the running information of an application cannot be obtained or the running state of an application needs to be changed, the virtual machine 2 running the corresponding application is sent to change the application. Or the corresponding first acquisition module runs instructions.
2 ) 所述策略控制模块 13基于分析结果, 向所述部署模块 1 1 发出所述部 署指令, 以便所述部署模块 1 1基于所述部署指令在未运行相应应用的虚拟机 2 上部署所述应用及相应的第一获取模块。 具体地,如果所述策略控制模块 13得到的分析结果为某个应用已满负荷运 行, 则向所述部署模块 1 1发出所述部署指令, 并由所述部署模块 1 1 向指定的 未运行所述应用的虚拟机 2部署所述应用及第一获取模块。 2) The policy control module 13 issues the deployment instruction to the deployment module 1 1 based on the analysis result, so that the deployment module 11 deploys the virtual machine 2 on the virtual machine 2 that is not running the corresponding application based on the deployment instruction. Application and corresponding first acquisition module. Specifically, if the analysis result obtained by the policy control module 13 is that an application is running at a full load, the deployment instruction is issued to the deployment module 11 and is not run by the deployment module 1 1 . The virtual machine 2 of the application deploys the application and the first obtaining module.
优选地, 所述策略控制模块 13还包括识别子模块 131。  Preferably, the policy control module 13 further includes an identification sub-module 131.
所述识别子模块 131 用于从所述第二获取模块 12获取的多个运行信息中 识别来自不同虚拟机 2的同一应用的运行信息。  The identification sub-module 131 is configured to identify operation information of the same application from different virtual machines 2 from the plurality of operation information acquired by the second acquisition module 12.
具体地, 所述识别子模块 131 从所述第二获取模块 12获取的多个运行信 息中提取能够标识应用及虚拟机的标识信息, 再根据所述标识信息识别运行在 不同虚拟机中的同一应用。 其中, 所述标识信息包括但不限于: 应用的名称、 应用的版本号、 虚拟机的名称、 虚拟机地址等。  Specifically, the identification sub-module 131 extracts identification information that can identify the application and the virtual machine from the plurality of operation information acquired by the second acquisition module 12, and identifies the same operation running in different virtual machines according to the identification information. application. The identifier information includes but is not limited to: an application name, an application version number, a virtual machine name, a virtual machine address, and the like.
例如, 所述识别子模块 131 获取到的多个运行信息包括: 来自虚拟机 N1 的应用 C1 的运行信息 c1、 来自虚拟机 N2的应用 C2的运行信息 c2、 来自虚 拟机 N3的应用 C1 的运行信息 c3。 所述识别子模块 131提取每一个运行信息 中的应用名称及虚拟机的名称, 并将每一个应用名称及虚拟机名称进行循环比 对, 识别出运行信息 c1和运行信息 c3中的应用名称相同、虚拟机的名称不同, 基于该识别结果确定运行信息 c1和运行信息 c3为来自不同虚拟机的同一应用 的运行信息。  For example, the plurality of operation information acquired by the identification submodule 131 includes: operation information c1 of the application C1 from the virtual machine N1, operation information c2 of the application C2 from the virtual machine N2, and operation of the application C1 from the virtual machine N3. Information c3. The identification sub-module 131 extracts the application name and the name of the virtual machine in each operation information, and cyclically compares each application name and the virtual machine name, and identifies that the application name in the operation information c1 and the operation information c3 are the same. The name of the virtual machine is different, and based on the identification result, the operation information c1 and the operation information c3 are determined to be operation information of the same application from different virtual machines.
相应的,所述策略控制模块 13用于分析来自多个虚拟机的同一应用的所述 运行信息, 并基于分析结果对至少一个虚拟机进行策略控制。  Correspondingly, the policy control module 13 is configured to analyze the running information of the same application from multiple virtual machines, and perform policy control on the at least one virtual machine based on the analysis result.
其中,所述策略控制模块 13对至少一个虚拟机进行策略控制的方式包括但 不限于:  The manner in which the policy control module 13 performs policy control on at least one virtual machine includes but is not limited to:
1 ) 基于分析结果对运行该应用的至少一个虚拟机进行策略控制。  1) Perform policy control on at least one virtual machine running the application based on the analysis result.
例如, 获取的各虚拟机中的应用的运行信息包括: 虚拟机 M1 中的应用 A 当前的会话数 300、 虚拟机 M2中的应用 A当前的会话数 400、 虚拟机 M3中 的应用 A当前的会话数 200以及虚拟机 M3中的应用 B当前的会话数 250。 所 述策略控制模块 13基于各运行信息中的应用的标识信息确定虚拟机 M 1、 虚拟 机 M2和虚拟机 M3运行同一应用 A, 并基于所述应用 A分别在虚拟机 M1、 虚 拟机 M2和虚拟机 M3中的运行信息来管理所述虚拟机 M 1、 M2、 M3中的所述 应用 A的运行。 比如, 所述策略控制模块 13根据虚拟机 M2中的应用 A的当 前会话数 400与预设的应用 A的最大会话数 450进行比较,确定不再向虚拟机 M2 中的应用 A分配新的用户访问请求, 转而将新的用户访问请求分配给虚拟 机 M 1或虚拟机 M3中的应用 A, 以此来均衡虚拟机 M1、 M2和 M3的负载。 For example, the obtained running information of the application in each virtual machine includes: the current session number 300 of the application A in the virtual machine M1, the current session number 400 of the application A in the virtual machine M2, and the current application A of the virtual machine M3. The number of sessions 200 and the current number of sessions B of application B in virtual machine M3. The policy control module 13 determines that the virtual machine M1, the virtual machine M2, and the virtual machine M3 run the same application A based on the identification information of the application in each operation information, and based on the application A, respectively, in the virtual machine M1, the virtual machine M2, and The operation information in the virtual machine M3 manages the operation of the application A in the virtual machines M1, M2, M3. For example, the policy control module 13 compares the current session number 400 of the application A in the virtual machine M2 with the maximum number of sessions 450 of the preset application A, and determines that the virtual machine is no longer used. Application A in M2 allocates a new user access request, and in turn assigns a new user access request to application A in virtual machine M1 or virtual machine M3, thereby balancing the load of virtual machines M1, M2, and M3.
2 ) 基于分析结果, 指示部署模块 1 1 向未运行该应用的虚拟机部署所述应 用及相应的第一获取模块。  2) Based on the analysis result, the deployment module 1 1 is deployed to deploy the application and the corresponding first acquisition module to the virtual machine that is not running the application.
需要说明的是,所述第二获取模块 12在获取当前各虚拟机所提供的运行信 息,并由所述策略控制模块 13对所获取的某一个应用的运行信息进行策略控制 的同时, 所述部署模块 1 1还可以基于所述策略控制模块 13输出的部署指令向 指定虚拟机部署新的应用, 并获取新的应用的运行信息。 综上所述, 本发明实施例提供的对虚拟机进行管理的方法及***, 所述云 服务器通过在虚拟机中部署的第一获取模块来获取在虚拟机中运行的各应用的 运行信息, 并通过对所述运行信息的分析对运行相应应用的虚拟机进行策略控 制, 如此, 能够解决现有的云服务器无法基于虚拟机上运行的应用对虚拟机进 行管理的问题; 同时, 能够实时对各虚拟机进行策略控制, 以供虚拟机改变应 用的运行情况或运行环境。  It should be noted that, when the second obtaining module 12 acquires the running information provided by each virtual machine, and the policy control module 13 performs policy control on the acquired running information of the certain application, the The deployment module 11 can also deploy a new application to the specified virtual machine based on the deployment instruction output by the policy control module 13, and acquire the running information of the new application. In summary, the method and system for managing a virtual machine provided by the embodiment of the present invention, the cloud server obtains operation information of each application running in the virtual machine by using the first acquiring module deployed in the virtual machine, And performing the policy control on the virtual machine running the corresponding application by analyzing the running information, so that the problem that the existing cloud server cannot manage the virtual machine based on the application running on the virtual machine can be solved; Each virtual machine performs policy control for the virtual machine to change the running state or running environment of the application.
另外, 所述虚拟机在获取到各应用的运行信息时, 先基于各所述运行信息 甄别相应的应用是否临近或超出预设的所述应用正常运行的范围, 能够分担云 服务器的负担。  In addition, when acquiring the running information of each application, the virtual machine firstly divides the corresponding application according to each of the running information to see whether the corresponding application is approaching or exceeds a preset range in which the application is in normal operation, and can share the burden of the cloud server.
所述云服务器还通过对所获取的各运行信息进行识别, 来确定不同虚拟机 上运行的同一应用的运行情况, 然后对各虚拟机进行策略控制, 使得同一应用 在各虚拟机上的都能正常运行。  The cloud server further determines the running status of the same application running on different virtual machines by identifying the obtained running information, and then performs policy control on each virtual machine, so that the same application can be performed on each virtual machine. normal operation.
再有, 每一个第一获取模块通过注册的方式把各自的信息告知所在的虚拟 机, 以便虚拟机利用轮询机制向已注册的第一获取模块发出轮询指令, 由此能 够有针对性的管理虚拟机上运行的应用, 而不必获取一些临时运行的应用的运 行信息, 以提高管理效率, 减少垃圾信息产生。  Further, each of the first obtaining modules informs the virtual machine of the respective information by means of registration, so that the virtual machine sends a polling instruction to the registered first acquiring module by using a polling mechanism, thereby being targeted. Manage applications running on virtual machines without having to get some running information about running applications to improve management efficiency and reduce spam.
此外, 所述虚拟机与所述云服务器通过定期通信来确保彼此的通信连接, 有利于当所述虚拟机所在物理设备异常或网络异常时, 所述云服务器及时报警 或按照应急预案予以及时处理, 以确保各应用能够稳定运行。  In addition, the virtual machine and the cloud server ensure communication connection with each other through regular communication, which is beneficial to timely processing the cloud server in time according to an emergency plan when the physical device of the virtual machine is abnormal or the network is abnormal. To ensure that each application can run stably.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤可 以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读取存 储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储 介质包括: ROM、 RAM , 磁碟或者光盘等各种可以存储程序代码的介质。 A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by using hardware related to the program instructions, and the foregoing program can be stored in a computer readable memory. In the storage medium, when the program is executed, the steps including the foregoing method embodiments are performed; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者 对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并不使相 应技术方案的本质脱离本发明各实施例技术方案的范围。  It should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.
上述实施例仅示例性说明本发明的原理及其功效, 而非用于限制本发明。 任何熟悉此技术的人士皆可在不违背本发明的精神及范畴下, 对上述实施例进 行修饰或改变。 因此, 举凡所属技术领域中具有通常知识者在未脱离本发明所 揭示的精神与技术思想下所完成的一切等效修饰或改变, 仍应由本发明的权利 要求所涵盖。  The above-described embodiments are merely illustrative of the principles of the invention and its effects, and are not intended to limit the invention. Modifications or variations of the above-described embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and scope of the invention will be covered by the appended claims.

Claims

权 利 要 求 书 、 一种对虚拟机进行管理的方法,应用于由云服务器及与所述云服务器通信连 接的包含至少一个虚拟机的计算机设备所构成的***中, 其特征在于, 至少 包括: A method for managing a virtual machine is applied to a system comprising a cloud server and a computer device including at least one virtual machine communicatively coupled to the cloud server, and the method includes at least:
所述云服务器基于获取的部署指令, 利用预设的各应用的描述信息, 将相应的应用及用于获取相应应用的运行信息的第一获取模块部署到至少 一个所述虚拟机上; 所述云服务器获取在每一个所述虚拟机上运行的所述应用的运行信 息; 所述云服务器对获取的每一个所述运行信息进行分析, 并基于分析结 果对运行相应应用的虚拟机进行策略控制。  The cloud server deploys, according to the obtained deployment instruction, the corresponding application and the first acquiring module for acquiring the running information of the corresponding application to the at least one virtual machine by using the preset description information of each application; The cloud server acquires running information of the application running on each of the virtual machines; the cloud server analyzes each of the obtained running information, and performs policy control on the virtual machine running the corresponding application based on the analysis result. .
、 根据权利要求 1所述的对虚拟机进行管理的方法, 其特征在于, 所述云服务 器部署所述应用和第一获取模块包括: 所述云服务器基于预设的各应用的描 述信息, 向至少一个所述虚拟机部署至少一个所述应用及所述第一获取模 块。 、 根据权利要求 1所述的对虚拟机进行管理的方法, 其特征在于, 所述云服务 器获取在每一个所述虚拟机上运行的所述应用的运行信息包括: 由所述虚拟 机基于轮询机制向每一个第一获取模块发出用于获取应用的运行信息的指 令, 以便各第一获取模块获取相应应用的运行信息, 再将获取的所有运行信 息发送至所述云服务器。 、 根据权利要求 3所述的对虚拟机进行管理的方法, 其特征在于, 所述云服务 器获取在每一个所述虚拟机上运行的所述应用的运行信息还包括: 各所述第 一获取模块在运行之前向其所在的虚拟机进行注册, 以便所述虚拟机利用第 一获取模块的注册信息, 轮询已注册的各第一获取模块, 进而取得相应应用 的运行信息。 The method for managing a virtual machine according to claim 1, wherein the cloud server deploying the application and the first obtaining module comprises: the cloud server based on a preset description information of each application, At least one of the virtual machines deploys at least one of the application and the first acquisition module. The method for managing a virtual machine according to claim 1, wherein the acquiring, by the cloud server, the running information of the application running on each of the virtual machines comprises: The inquiring mechanism sends an instruction for acquiring the running information of the application to each of the first obtaining modules, so that each first acquiring module acquires the running information of the corresponding application, and then sends all the acquired running information to the cloud server. The method for managing the virtual machine according to claim 3, wherein the obtaining, by the cloud server, the running information of the application running on each of the virtual machines further comprises: each of the first obtaining The module registers with the virtual machine it is in before the run, so that the virtual machine utilizes After acquiring the registration information of the module, the first acquisition modules that have been registered are polled, and the operation information of the corresponding application is obtained.
5、 根据权利要求 1所述的对虚拟机进行管理的方法, 其特征在于, 所述云服务 器基于分析结果对运行相应应用的虚拟机进行策略控制包括: The method for managing a virtual machine according to claim 1, wherein the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including:
所述云服务器从获取的多个运行信息中识别来自不同虚拟机的同一应 用的运行信息; 以及 所述云服务器分析来自多个虚拟机的同一应用的所述运行信息, 并基 于分析结果对至少一个虚拟机进行策略控制。  The cloud server identifies running information of the same application from different virtual machines from the obtained plurality of running information; and the cloud server analyzes the running information of the same application from the plurality of virtual machines, and based on the analysis result, at least A virtual machine performs policy control.
6、 根据权利要求 1或 5所述的对虚拟机进行管理的方法,其特征在于,所述云 服务器基于分析结果对运行相应应用的虚拟机进行策略控制包括: 所述云服 务器基于分析结果, 向运行相应应用的虚拟机发送用于改变所述应用及相应 的第一获取模块运行的指令。 The method for managing a virtual machine according to claim 1 or 5, wherein the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including: the cloud server is based on the analysis result, An instruction for changing the operation of the application and the corresponding first acquisition module is sent to the virtual machine running the corresponding application.
7、 根据权利要求 6所述的对虚拟机进行管理的方法, 其特征在于, 所述用于改 变所述应用及相应的第一获取模块运行的指令至少包括以下一种: 启动指 令、 暂停指令和停止指令。 8、 根据权利要求 1或 5所述的对虚拟机进行管理的方法,其特征在于,所述云 服务器基于分析结果对运行相应应用的虚拟机进行策略控制包括: 所述云服 务器基于分析结果, 生成部署指令, 以便通过重新执行部署的步骤, 向未运 行所述应用的虚拟机部署所述应用及相应的第一获取模块。 9、 根据权利要求 1所述的对虚拟机进行管理的方法, 其特征在于, 所述方法还 包括: 所述虚拟机监控所述第一获取模块获取的运行信息, 并判断所述运行 信息对应的应用是否临近或超出预设的相应应用正常运行的范围, 若临近或 超出预设的相应应用正常运行的范围, 则将所述运行信息提供给所述云服务 器; 若未临近或超出预设的相应应用正常运行的范围, 则继续监控。 、 根据权利要求 1所述的对虚拟机进行管理的方法, 其特征在于, 所述方 法还包括: 在所述虚拟机将获取的各应用的运行信息发送给所述云服务器, 所述云服务器基于获取的所述各应用的运行信息进行分析并执行相应的策 略控制的同时, 所述虚拟机和所述云服务器之间还保持通信。 、 根据权利要求 10 所述的对虚拟机进行管理的方法, 其特征在于, 所述 虚拟机和所述云服务器之间保持通信的方式包括: 基于心跳机制保持所述虚 拟机与所述云服务器之间的通信。 、 一种对虚拟机进行管理的***, 所述***包括云服务器及与所述云服务 器通信连接的包含至少一个虚拟机的计算机设备, 其特征在于, The method for managing a virtual machine according to claim 6, wherein the instruction for changing the operation of the application and the corresponding first obtaining module comprises at least one of the following: a start instruction, a pause instruction And stop instructions. The method for managing a virtual machine according to claim 1 or 5, wherein the cloud server performs policy control on the virtual machine running the corresponding application based on the analysis result, including: the cloud server is based on the analysis result, A deployment instruction is generated to deploy the application and the corresponding first acquisition module to a virtual machine that is not running the application by re-executing the step of deploying. The method for managing a virtual machine according to claim 1, wherein the method further comprises: the virtual machine monitoring operation information acquired by the first acquisition module, and determining that the operation information corresponds to Whether the application is approaching or beyond the default range of the corresponding application, if adjacent or If the range of the normal operation of the corresponding application exceeds the preset, the operation information is provided to the cloud server; if the range of the preset corresponding application normal operation is not approached or continues, the monitoring is continued. The method for managing a virtual machine according to claim 1, wherein the method further comprises: transmitting, to the cloud server, the running information of each application that is obtained by the virtual machine, the cloud server The communication between the virtual machine and the cloud server is maintained while analyzing the running information of the applications and performing corresponding policy control. The method for managing a virtual machine according to claim 10, wherein the manner of maintaining communication between the virtual machine and the cloud server comprises: maintaining the virtual machine and the cloud server based on a heartbeat mechanism Communication between. A system for managing a virtual machine, the system comprising a cloud server and a computer device including at least one virtual machine communicatively coupled to the cloud server, wherein
所述云服务器包括: 部署模块, 用于基于获取的部署指令, 利用预设的各应用的描述信息, 将相应的应用及用于获取相应应用的运行信息的第一获取模块部署到至少 一个所述虚拟机上; 第二获取模块, 用于获取由所述部署模块部署在每一个所述虚拟机上 的所述应用的运行信息; 策略控制模块, 用于对所述第二获取模块获取的每一个所述运行信息 进行分析, 并基于分析结果对运行相应应用的虚拟机进行策略控制。  The cloud server includes: a deployment module, configured to deploy, according to the obtained deployment instruction, a corresponding application and a first acquiring module for acquiring running information of the corresponding application to at least one office by using preset description information of each application a second acquiring module, configured to acquire running information of the application deployed by each of the virtual machines by the deployment module, and a policy control module, configured to acquire the second acquiring module Each of the running information is analyzed, and based on the analysis result, policy control is performed on the virtual machine running the corresponding application.
、 根据权利要求 12 所述的对虚拟机进行管理的***, 其特征在于, 所述 部署模块进一步用于基于预设的各应用的描述信息, 向至少一个所述虚拟机 部署至少一个所述应用及所述第一获取模块。 14、 根据权利要求 12 所述的对虚拟机进行管理的***, 其特征在于, 所述 策略控制模块包括: The system for managing a virtual machine according to claim 12, wherein the deployment module is further configured to deploy at least one of the applications to at least one of the virtual machines based on preset description information of each application. And the first acquisition module. The system for managing a virtual machine according to claim 12, wherein the policy control module comprises:
识别子模块, 用于从所述第二获取模块获取的多个运行信息中识别来自不 同虚拟机的同一应用的运行信息。  And an identification submodule, configured to identify operation information of the same application from different virtual machines from the plurality of operation information acquired by the second acquisition module.
15、 根据权利要求 12或 14所述的对虚拟机进行管理的***, 其特征在于, 所述策略控制模块具体用于基于分析结果, 向运行相应应用的虚拟机发送用 于改变所述应用及相应的第一获取模块运行的指令。 16、 根据权利要求 15 所述的对虚拟机进行管理的***, 其特征在于, 所述 用于改变所述应用及相应的第一获取模块运行的指令至少包括以下一种: 启 动指令、 暂停指令和停止指令。 The system for managing a virtual machine according to claim 12 or 14, wherein the policy control module is specifically configured to send, according to the analysis result, a virtual machine running the corresponding application, for changing the application and The corresponding first acquisition module runs an instruction. The system for managing a virtual machine according to claim 15, wherein the instruction for changing the operation of the application and the corresponding first obtaining module comprises at least one of the following: a start command, a pause command And stop instructions.
17、 根据权利要求 12或 14所述的对虚拟机进行管理的***, 其特征在于, 所述策略控制模块具体用于基于分析结果, 向所述部署模块发出所述部署指 令, 以便所述部署模块基于所述部署指令在未运行相应应用的虚拟机上部署 所述应用及相应的第一获取模块。 The system for managing a virtual machine according to claim 12 or 14, wherein the policy control module is specifically configured to send the deployment instruction to the deployment module based on the analysis result, so that the deployment is performed. The module deploys the application and the corresponding first acquisition module on the virtual machine that does not run the corresponding application based on the deployment instruction.
PCT/CN2013/071506 2013-02-07 2013-02-07 Method and system for managing virtual machines WO2014121485A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201380000525.9A CN103502939B (en) 2013-02-07 2013-02-07 The method and system that virtual machine is managed
PCT/CN2013/071506 WO2014121485A1 (en) 2013-02-07 2013-02-07 Method and system for managing virtual machines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/071506 WO2014121485A1 (en) 2013-02-07 2013-02-07 Method and system for managing virtual machines

Publications (1)

Publication Number Publication Date
WO2014121485A1 true WO2014121485A1 (en) 2014-08-14

Family

ID=49866741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/071506 WO2014121485A1 (en) 2013-02-07 2013-02-07 Method and system for managing virtual machines

Country Status (2)

Country Link
CN (1) CN103502939B (en)
WO (1) WO2014121485A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484155B (en) * 2014-11-24 2018-05-01 北京奇安信科技有限公司 A kind of method and apparatus to send instructions under under virtual platform
CN107104820B (en) * 2017-03-23 2020-02-07 国网江苏省电力公司信息通信分公司 Dynamic capacity-expansion daily operation and maintenance method based on F5 server node
CN107025123A (en) * 2017-05-17 2017-08-08 上海酷卓信息科技有限公司 The method for managing system and device of desktop virtualization
CN107592229B (en) * 2017-09-22 2021-07-27 银联商务股份有限公司 Service calling method, device and system
CN107807874A (en) * 2017-10-19 2018-03-16 国云科技股份有限公司 A kind of virtual machine behavior monitoring and locking means
CN108111351A (en) * 2017-12-25 2018-06-01 苏州乐麟无线信息科技有限公司 The method and server system of system update
CN114281398A (en) * 2021-12-10 2022-04-05 西安万像电子科技有限公司 Cloud mobile phone application management method, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593134A (en) * 2009-06-29 2009-12-02 北京航空航天大学 Virtual machine cpu resource distribution method and device
CN101719081A (en) * 2009-12-01 2010-06-02 北京大学 Method for scheduling virtual machines
CN102170474A (en) * 2011-04-22 2011-08-31 广州杰赛科技股份有限公司 Method and system for dynamic scheduling of virtual resources in cloud computing network

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8799902B2 (en) * 2007-04-09 2014-08-05 Intel Corporation Priority based throttling for power/performance quality of service
CN102880802B (en) * 2012-09-25 2016-06-29 浙江图讯科技股份有限公司 A kind of assay method for the major hazard source towards industrial and mining establishment's safety production cloud service platform system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593134A (en) * 2009-06-29 2009-12-02 北京航空航天大学 Virtual machine cpu resource distribution method and device
CN101719081A (en) * 2009-12-01 2010-06-02 北京大学 Method for scheduling virtual machines
CN102170474A (en) * 2011-04-22 2011-08-31 广州杰赛科技股份有限公司 Method and system for dynamic scheduling of virtual resources in cloud computing network

Also Published As

Publication number Publication date
CN103502939A (en) 2014-01-08
CN103502939B (en) 2016-11-02

Similar Documents

Publication Publication Date Title
WO2014121485A1 (en) Method and system for managing virtual machines
US10887247B2 (en) Dynamic resource allocation for sensor devices on a cellular network
US20230188421A1 (en) Autonomous distributed workload and infrastructure scheduling
US10503555B2 (en) Selecting type and quantity of application masters that need to be started in advance
US9201675B2 (en) DAAS manager and DAAS client for DAAS system
RU2712438C2 (en) Method of processing information on emergency signals, corresponding device and system
WO2021203862A1 (en) Distributed object recognition system and method, and edge computing apparatus
KR101408037B1 (en) Virtual Machine Integration Monitoring Apparatus and method for Cloud system
US11256544B2 (en) Redistributing update resources during update campaigns
US11102142B2 (en) Methods and apparatus to perform dynamic load balancing for a multi-fabric environment in network-based computing
CN114185637A (en) Intent-based telemetry gathering service
WO2016165242A1 (en) Method of adjusting number of nodes in system and device utilizing same
CN108700922B (en) Data center management
US20170111240A1 (en) Service Elastic Method and Apparatus in Cloud Computing
Cheng Automatic resource scaling for medical cyber-physical systems running in private cloud computing architecture
CN112751874A (en) Equipment policy control method and device, electronic equipment and storage medium
AU2018329492B2 (en) Fault tolerant services for integrated building automation systems
WO2013097176A1 (en) User experience index monitoring method and monitoring virtual machine
US11693703B2 (en) Monitoring resource utilization via intercepting bare metal communications between resources
KR20160003358A (en) System for managing server/storge system
EP3343835A1 (en) Network element management method and system
CN113986662A (en) Edge cluster monitoring method and system
Khoudali et al. EMMCS: An edge monitoring framework for multi-cloud environments using SNMP

Legal Events

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

Ref document number: 13874540

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13874540

Country of ref document: EP

Kind code of ref document: A1