Virtual machine monitoring method and device, electronic equipment and storage medium

By creating virtual machines in the cloud management platform and applying unified monitoring standards, the complexity and cumbersome monitoring solutions in heterogeneous hybrid cloud environments are solved, and efficient and accurate monitoring effects are achieved.

CN119883813APending Publication Date: 2025-04-25BEIJING TEAMSUN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411960271.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In a heterogeneous hybrid cloud environment, the design and implementation of unified monitoring solutions are complex and cumbersome, making it difficult to achieve efficient and accurate monitoring.

Method used

In the cloud management platform, by creating multiple virtual machines and applying predefined unified monitoring standards on them, monitoring indicator data is collected and preprocessed, and monitoring agents are automatically started to report the results.

Benefits of technology

It realizes efficient and accurate unified monitoring in heterogeneous hybrid cloud environments, reduces the complexity of monitoring solution design and implementation, and improves the optimization of resource allocation and service reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883813A_ABST
    Figure CN119883813A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a virtual machine monitoring method and device, electronic equipment and a storage medium, and relates to the technical field of cloud computing, the method is applied to a cloud management platform, and the method comprises the following steps: creating a plurality of virtual machines in various managed resource pools; the virtual machine is controlled to collect and preprocess monitoring index data according to a predefined unified monitoring standard, and a preprocessing result is reported to the monitoring platform; and accessing the monitoring platform, and obtaining a visual monitoring condition obtained based on a preprocessing result reported by the virtual machine. According to the technical scheme provided by the embodiment of the invention, the problem that efficient and accurate monitoring is difficult to realize due to complex design and implementation of a unified monitoring scheme in a heterogeneous hybrid cloud environment and tedious process can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a virtual machine monitoring method, device, electronic device and storage medium. Background Art

[0002] In today's wave of digital transformation, enterprises' demands for computing resources are becoming increasingly diverse, and heterogeneous hybrid cloud environments have become the first choice for many enterprises. It allows enterprises to integrate and leverage the advantages of internal private clouds and external public clouds, and flexibly allocate resources to adapt to changes in business needs. However, in order to ensure that these decentralized cloud resources can operate efficiently and stably and provide continuous service guarantees for enterprises, it is particularly important to implement comprehensive and effective monitoring. Through monitoring, you can grasp the usage of cloud resources in each cloud environment in real time, quickly respond to performance bottlenecks or potential failures, thereby optimizing resource allocation, improving service reliability, and reducing operating costs.

[0003] Although heterogeneous hybrid cloud environments bring flexibility and scalability to enterprise IT architectures, their complexity poses a severe challenge to monitoring technology. The environment integrates multiple cloud resources based on different CPU architectures (such as Power and x86) and operating systems (such as AIX, Linux, and Windows), resulting in a variety of monitoring indicators. This diversity not only increases the complexity of designing and implementing unified monitoring solutions in heterogeneous hybrid cloud environments, but also makes the process cumbersome. Therefore, how to achieve efficient and accurate unified monitoring in heterogeneous hybrid cloud environments has become a key problem that needs to be solved in the current cloud computing field. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a virtual machine monitoring method, device, electronic device and storage medium to solve the problem that the design and implementation of a unified monitoring solution in a heterogeneous hybrid cloud environment is complex, the process is cumbersome and it is difficult to achieve efficient and accurate monitoring.

[0005] In a first aspect, an embodiment of the present invention provides a virtual machine monitoring method, which is applied to a cloud management platform, and the method includes:

[0006] Create multiple virtual machines in various resource pools under management;

[0007] Controlling the virtual machine: collecting and preprocessing monitoring indicator data according to a predefined unified monitoring standard, and reporting the preprocessing results to the monitoring platform;

[0008] The monitoring platform is accessed to obtain a visual monitoring situation based on the preprocessing result reported by the virtual machine.

[0009] Furthermore, the method further comprises: creating a startup script for the virtual machine, the script comprising information required for starting the monitoring agent;

[0010] Controlling the virtual machine: collecting and preprocessing monitoring indicator data according to a predefined unified monitoring standard, and reporting the preprocessing results to the monitoring platform, including:

[0011] Control the virtual machine to automatically start the monitoring agent during the process of starting up through the startup script, so that the monitoring agent:

[0012] After successful startup, the monitoring indicator data is collected and preprocessed according to the predefined unified monitoring standards, and the preprocessing results are reported to the monitoring platform.

[0013] Furthermore, the startup script created for the virtual machine also includes a startup environment detection script and information required for the monitoring agent configuration;

[0014] Controlling the virtual machine to automatically start the monitoring agent during the process of starting up through the startup script includes:

[0015] Controlling the virtual machine: During the process of starting the virtual machine through the startup script, detecting whether the current startup environment meets the triggering condition of the monitoring agent configuration, and automatically configuring and starting the monitoring agent if so.

[0016] Furthermore, it is detected whether the current startup environment meets the triggering conditions configured by the monitoring agent, including:

[0017] Detecting whether the current startup environment meets any of the following conditions: the virtual machine is started for the first time; the network settings of the virtual machine are changed; the information required for the monitoring agent configuration is updated;

[0018] If yes, it is determined that the current startup environment satisfies the triggering condition configured by the monitoring agent.

[0019] Furthermore, the method further comprises:

[0020] After failing to obtain the visualized monitoring situation based on the preprocessing result reported by the virtual machine, controlling the virtual machine to restart.

[0021] Furthermore, a startup script is created for the virtual machine, the script containing information required for starting the monitoring agent, including:

[0022] Obtaining a native startup script of the virtual machine;

[0023] Determining a native startup script management method corresponding to the type of the virtual machine and the installed operating system;

[0024] According to the determined native startup script management method, the information required for starting the monitoring agent is embedded in the native startup script of the virtual machine.

[0025] Further, accessing the monitoring platform to obtain a visual monitoring situation based on the preprocessing result reported by the virtual machine includes:

[0026] The monitoring platform is accessed through a predefined unified application programming interface API via an API gateway to obtain a visual monitoring situation based on the preprocessing results reported by the virtual machine.

[0027] In a second aspect, an embodiment of the present invention provides a virtual machine monitoring device, which is applied to a cloud management platform, and the device includes:

[0028] A virtual machine creation unit, used to create multiple virtual machines in various resource pools under management;

[0029] A virtual machine monitoring unit, used to control the virtual machine: collect and pre-process monitoring indicator data according to a pre-defined unified monitoring standard, and report the pre-processing result to the monitoring platform;

[0030] The monitoring situation acquisition unit is used to access the monitoring platform and acquire the visual monitoring situation obtained based on the preprocessing result reported by the virtual machine.

[0031] Furthermore, the device further comprises a script creation unit, which is used to: create a startup script for the virtual machine, the script comprising information required for the monitoring agent to start;

[0032] The virtual machine monitoring unit is specifically used for:

[0033] Control the virtual machine to automatically start the monitoring agent during the process of starting up through the startup script, so that the monitoring agent:

[0034] After successful startup, the monitoring indicator data is collected and preprocessed according to the predefined unified monitoring standards, and the preprocessing results are reported to the monitoring platform.

[0035] Furthermore, the startup script created for the virtual machine also includes a startup environment detection script and information required for the monitoring agent configuration;

[0036] The virtual machine monitoring unit is specifically used to control the virtual machine to automatically start the monitoring agent during the process of starting by the startup script, including:

[0037] Controlling the virtual machine: During the process of starting the virtual machine through the startup script, detecting whether the current startup environment meets the triggering condition of the monitoring agent configuration, and automatically configuring and starting the monitoring agent if so.

[0038] Furthermore, the virtual machine monitoring unit is specifically used to control the virtual machine to detect whether the current startup environment meets the triggering condition configured by the monitoring agent during startup of the virtual machine through the startup script, including:

[0039] Controlling the virtual machine to detect whether the current startup environment meets any one of the following conditions during the startup process of the startup script: the first startup of the virtual machine; the change of the network setting of the virtual machine; the update of the information required for the monitoring agent configuration;

[0040] If yes, it is determined that the current startup environment satisfies the triggering condition configured by the monitoring agent.

[0041] Furthermore, the device also includes a virtual machine restart unit, which is used to:

[0042] After failing to obtain the visualized monitoring situation based on the preprocessing result reported by the virtual machine, controlling the virtual machine to restart.

[0043] Furthermore, the script creation unit is specifically used to:

[0044] Obtaining a native startup script of the virtual machine;

[0045] Determining a native startup script management method corresponding to the type of the virtual machine and the installed operating system;

[0046] According to the determined native startup script management method, the information required for starting the monitoring agent is embedded in the native startup script of the virtual machine.

[0047] Furthermore, the monitoring situation acquisition unit is specifically used to:

[0048] The monitoring platform is accessed through a predefined unified application programming interface API via an API gateway to obtain a visual monitoring situation based on the preprocessing results reported by the virtual machine.

[0049] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the virtual machine monitoring method described in the first aspect above.

[0050] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more central processing units to implement the virtual machine monitoring method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A flowchart of a virtual machine monitoring method provided in Embodiment 1 of the present invention;

[0053] Figure 2 A flowchart of a virtual machine monitoring method provided in Embodiment 2 of the present invention;

[0054] Figure 3 A schematic diagram of the structure of a virtual machine monitoring device provided in Embodiment 3 of the present invention;

[0055] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0057] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] Embodiment 1

[0059] This embodiment provides a virtual machine monitoring method, which can be applied to a cloud management platform and is specifically executed by a virtual machine monitoring device integrated on the platform. Figure 1 , the method includes the following steps 101-103.

[0060] Step 101: Create multiple virtual machines in various resource pools under management.

[0061] In this embodiment, the cloud management platform manages multiple types of resource pools, and creates multiple virtual machines in each type of resource pool. A resource pool refers to a group of computing resources (such as CPU, memory, storage, and network) with similar characteristics and configurations, which can be located on a physical server or in a virtualized environment. The purpose of designing a resource pool is to simplify resource allocation and management and improve resource utilization. According to different CPU architectures (such as x86, Power), operating systems (such as Linux, Windows, AIX), and other factors (such as geographical location, performance level, etc.), resource pools can be divided into multiple types. Of course, resource pools can also be divided according to other factors. For example, in a heterogeneous hybrid cloud environment, resource pool types include but are not limited to: openstack resource pools, PowerVC resource pools, VMware resource pools; or, resource pool types include public cloud resource pools and private cloud resource pools; or, resource pool types include but are not limited to: performance-oriented resource pools, general resource pools, economical resource pools, GPU-accelerated resource pools. This embodiment does not specifically limit this.

[0062] As the core management system of the entire heterogeneous hybrid cloud environment, the cloud management platform is responsible for managing and scheduling resources in all resource pools and creating multiple virtual machines in each resource pool. Specifically, the virtual machine creation process may include:

[0063] Prepare different types of virtual machine templates in advance and establish mapping relationships between them and different types of resource pools;

[0064] Obtain a virtual machine creation request and match the corresponding target resource pool according to the request;

[0065] The virtual machine under the virtual machine creation request is created according to the virtual machine template corresponding to the target resource pool.

[0066] In the above process, a person skilled in the art can define a series of virtual machine templates in the cloud management platform and specify a recommended resource pool type for each virtual machine template. For example, a virtual machine template for a high-performance computing task will be automatically mapped to a performance-oriented resource pool. Different types of virtual machine templates are used to create different types of virtual machines, and the operating systems may be the same or different. For example, virtual machine template types may include but are not limited to:

[0067] HPC template: contains the latest version of Linux distribution, with MPI library, math library and other scientific computing software installed;

[0068] Web application template: pre-installed LAMP / WAM stack (Linux / Windows+Apache / Nginx+MySQL / MariaDB+PHP / Python / Node.js), and configured with security update mechanism;

[0069] Development and testing template: A lightweight operating system equipped with an IDE, version control system, and common debugging tools, while maintaining flexibility for developers to customize the environment.

[0070] When a request to create a virtual machine is received, the setting parameters in the request (such as the department to which the requester belongs, the intended use of the virtual machine, the performance requirements of the virtual machine, etc.) are first parsed, and then the predefined mapping relationship between these setting parameters and different types of resource pools is applied to find the best matching target resource pool. Alternatively, based on the setting parameter values ​​in the parsed request, a built-in rule engine or policy set is used to match the target resource pool that best meets the request. For example, if the request specifies a high-performance computing task, a resource pool equipped with high-end processors and high-speed storage will be given priority. Once the virtual machine is online, it is immediately included in the monitoring scope of the monitoring platform. Among them, the intended use of the virtual machine can be development, testing, or production.

[0071] When a virtual machine creation request is received, the corresponding target resource pool can be quickly matched according to the request, and the virtual machine can be created according to the virtual machine template corresponding to the target resource pool, which can significantly improve the efficiency, resource utilization and scalability of virtual machine creation.

[0072] Step 102, control the virtual machine: collect and pre-process monitoring indicator data according to a pre-defined unified monitoring standard, and report the pre-processing results to the monitoring platform.

[0073] In this step, a set of monitoring indicators and data collection and preprocessing rules applicable to all types of virtual machines (regardless of their underlying architecture or operating system) can be predefined to ensure that all virtual machines follow the same monitoring standards so that the data collected by the monitoring platform is comparable and consistent. Among them, monitoring indicators may include but are not limited to: CPU utilization, memory usage, disk I / O, network traffic, etc. Specifically, the predefined unified monitoring standards can be reflected in the following two aspects:

[0074] Standardized definition of monitoring indicators: clarify the definition, unit, preprocessing method, sampling frequency, etc. of each monitoring indicator; for example, CPU usage can be defined as the ratio of current active CPU time to total CPU time, and memory occupancy can be defined as the ratio of used memory space to total memory space; these definitions should be consistent and comparable to ensure that monitoring indicator data between different resource pools can be compared with each other;

[0075] Standardization of preprocessing logic: Develop unified preprocessing logic for each monitoring indicator. For example, for CPU usage, the same calculation formula can be used to calculate the CPU usage of different resource pools. For memory occupancy, a similar calculation method can also be used. This ensures that the same monitoring indicator data between different resource pools has the same calculation basis and accuracy.

[0076] After the control virtual machine is started and enters the running state, it automatically starts to collect at least one related monitoring indicator data according to the predefined unified monitoring standard, and preprocesses the collected original monitoring indicator data to reduce the amount of data transmitted and improve readability. Among them, the preprocessing operation includes data cleaning, monitoring indicator value calculation, aggregation calculation or other calculations. For example, data cleaning includes removing abnormal data or invalid data, and aggregation calculation includes calculating statistical information such as average value, maximum value, minimum value, etc. Then, the preprocessed monitoring indicator data is securely sent to the centralized monitoring platform. This step usually involves an encrypted communication protocol (such as HTTPS) to protect sensitive information from man-in-the-middle attacks. Among them, the preprocessed monitoring indicator data can be submitted regularly at a predetermined time interval (such as every minute, every hour), or the preprocessed monitoring indicator data can be submitted when an abnormal situation is detected. Specifically, the virtual machine can use the built-in monitoring agent or directly use the operating system tool of the virtual machine to realize the collection, preprocessing and result reporting of monitoring indicator data.

[0077] Step 103: Access the monitoring platform to obtain a visual monitoring situation based on the preprocessing result reported by the virtual machine.

[0078] After receiving the pre-processed monitoring indicator data reported by each virtual machine, the monitoring platform will use the received data to generate corresponding visual monitoring conditions. Among them, the visual monitoring conditions may include various types of charts, such as line charts, bar charts, pie charts, etc., to help users intuitively understand the operating status of the virtual machine. Users can log in to the cloud management platform through a browser or other client tools and request to view the monitoring status of the virtual machine. The cloud management platform accesses the monitoring platform accordingly and obtains the visual monitoring conditions based on the pre-processing results reported by the virtual machine.

[0079] Preferably, in step 103, a monitoring platform is accessed through a predefined unified application programming interface API via an API gateway to obtain a visual monitoring situation based on a preprocessing result reported by the virtual machine.

[0080] To simplify development and maintenance, the cloud management platform provides a standardized API to handle all types of monitoring and viewing requests. This API can receive query requests for any virtual machine and its monitoring indicators, and return the corresponding monitoring status. Although this API is unified, it is flexible enough to support queries for different monitoring indicators of different virtual machines. For example, you can query the CPU utilization of a single virtual machine, or query the memory usage of multiple virtual machines at the same time.

[0081] Users can initiate monitoring and viewing requests through the graphical user interface (GUI), command line tool (CLI) or direct API calls provided by the cloud management platform. Each request contains necessary parameters, such as the virtual machine ID, monitoring indicator name (such as CPU utilization, memory usage, etc.), time range, etc. These parameters are used to accurately specify the specific monitoring information that the user wants to view.

[0082] After receiving the user's monitoring and viewing request, the cloud management platform will parse the parameters to determine the specific virtual machine and monitoring indicators to be queried. Based on the parsing results, the cloud management platform constructs a predefined unified API request and sends it to the API gateway. The API request contains all the necessary query conditions, such as virtual machine ID, indicator name, time range, etc.

[0083] As the single entry point for all external requests to enter the monitoring platform, the API gateway is responsible for verifying the legitimacy of the request and routing the request to the correct internal service of the monitoring platform based on the parameters in the request. The internal service of the monitoring platform searches for the corresponding monitoring status in its database based on the virtual machine ID and monitoring indicator name provided in the unified API request sent by the cloud management platform, and returns the search results to the cloud management platform through the API gateway, which then passes it to the user who originally issued the monitoring view request.

[0084] The technical solution provided in this embodiment has the following technical advantages:

[0085] By pre-defining unified monitoring standards, all virtual machines are ensured to follow the same monitoring indicators and data collection specifications regardless of which cloud resource pool they are running in, reducing the complexity of monitoring solution design and implementation caused by differences in technology stacks.

[0086] The collection and preliminary processing of monitoring data are delegated to the virtual machine level. On the one hand, this reduces the burden on the monitoring platform. On the other hand, since the virtual machine directly participates in data collection, its operating status can be reflected in real time, improving the accuracy of monitoring. On the other hand, the monitoring platform can more flexibly adapt to the differences between different cloud platforms and virtual machine technology stacks. When it is necessary to expand the monitoring scope or add new monitoring indicators, it is only necessary to perform corresponding configuration and updates at the virtual machine level without large-scale modification of the monitoring platform, which enhances the scalability and flexibility of the monitoring system.

[0087] The virtual machine reports the preprocessing results to the monitoring platform, which is responsible for receiving, integrating and storing this data. By accessing the monitoring platform, users can obtain visual monitoring information based on the data reported by the virtual machine. This centralized monitoring data processing and display method allows users to easily obtain comprehensive monitoring information in a heterogeneous hybrid cloud environment without switching between monitoring tools on different cloud management platforms or performing complex data integration.

[0088] Embodiment 2

[0089] Based on the above-mentioned embodiment 1, this embodiment optimizes the step of "controlling the virtual machine: collecting and preprocessing monitoring indicator data according to a predefined unified monitoring standard, and reporting the preprocessing result to the monitoring platform". Figure 2 , a virtual machine monitoring method includes the following steps 201-step.

[0090] Step 201: Create multiple virtual machines in various resource pools under management.

[0091] This step is the same as step 101 in the first embodiment and will not be described again.

[0092] Step 202: Create a startup script for the virtual machine, which contains information required for starting the monitoring agent.

[0093] In this step, each virtual machine created is installed with a monitoring agent software, which is responsible for collecting and preprocessing monitoring indicator data according to predefined unified monitoring standards, and reporting the preprocessing results to the monitoring platform. The information required for starting the monitoring agent is the information required to start the monitoring agent in the process of starting the virtual machine, for example, it can be a set of codes including startup parameters and environment variables of the monitoring agent. After the information required for starting the monitoring agent is written in a scripting language supported by various types of virtual machines, it can be embedded in the native startup script of the virtual machine to start the monitoring agent at the same time during the startup process of the virtual machine. Preferably, step 202 includes:

[0094] Get the native startup script of the virtual machine;

[0095] Determine the native startup script management method corresponding to the type of virtual machine and the installed operating system;

[0096] According to the determined native startup script management method, the information required for starting the monitoring agent is embedded in the native startup script of the virtual machine.

[0097] The native startup script of a virtual machine refers to the script that is automatically executed when the virtual machine starts. These scripts are usually used to initialize the virtual machine environment, configure network settings, start services, etc. The purpose of obtaining these scripts is to be able to automatically perform some additional tasks when the virtual machine starts, such as starting the monitoring agent.

[0098] Different virtual machine types and operating systems have different native startup script management methods. For example, Linux systems usually use shell scripts (such as bash scripts) to manage the native startup scripts of virtual machines, while Windows systems may use batch files (.bat or .cmd files) or PowerShell scripts. In addition, the type of virtual machine (such as VMware, Hyper-V, KVM, etc.) can also affect the placement and execution method of the native startup script. Therefore, before embedding the information required for the monitoring agent to start, it is necessary to determine the native startup script management method of the target virtual machine type and operating system.

[0099] Once you have determined how to manage the native startup scripts for your VMs, you can modify the native startup scripts for your VMs accordingly. This usually involves adding a set of code to the native startup scripts to start the monitoring agent. This set of code may include startup parameters, environment variables, etc. for the monitoring agent. For example, in Linux, this would require adding this set of code to the / etc / rc.local file or a systemd service unit file. In Windows, this might require modifying a batch file in the startup folder or creating a new PowerShell script.

[0100] Through the above process, it can be ensured that whenever the virtual machine is started, the monitoring agent will also be automatically started, so as to achieve continuous monitoring of the performance and status of the virtual machine. This is crucial for maintaining the stability and security of the virtual machine.

[0101] Step 203, control the virtual machine to automatically start the monitoring agent during the process of starting up through the startup script, so that the monitoring agent: after successful startup, collects and preprocesses monitoring indicator data according to a predefined unified monitoring standard, and reports the preprocessing result to the monitoring platform.

[0102] When the virtual machine is started by the startup script, the monitoring agent is automatically started according to the information required for starting the monitoring agent in the startup script, and the monitoring agent performs the collection, preprocessing and reporting of monitoring indicator data.

[0103] Step 204: Access the monitoring platform to obtain a visual monitoring situation based on the preprocessing result reported by the virtual machine.

[0104] This step is the same as step 103 in the first embodiment and will not be described again.

[0105] This embodiment starts the monitoring agent during the virtual machine startup process, which can achieve seamless monitoring of the entire process of the virtual machine from startup to operation, ensuring that any abnormal situation is captured in the first time, providing comprehensive historical data support, and improving deployment efficiency and system reliability through automated configuration. This method is crucial to ensuring the stability of virtual machines and optimizing resource management.

[0106] As a preferred implementation, in step 202, the startup script created for the virtual machine also includes a startup environment detection script and information required for the monitoring agent configuration. Accordingly, step 203 specifically includes:

[0107] Controlling the virtual machine: During the process of starting the virtual machine through the startup script, detecting whether the current startup environment meets the triggering condition of the monitoring agent configuration, and automatically configuring and starting the monitoring agent if yes. Optionally, directly starting the monitoring agent if no.

[0108] The monitoring agent startup required information is information required to configure the monitoring agent during the virtual machine startup process. The monitoring agent configuration required information can be written in a scripting language supported by various types of virtual machines and then embedded in the native startup script of the virtual machine to configure the monitoring agent during the virtual machine startup process.

[0109] In the above preferred methods, it is necessary to pre-determine in which cases the monitoring agent configuration needs to be performed during the virtual machine startup phase. Typically, the current startup environment is checked to see if it meets the triggering conditions for the monitoring agent configuration, including:

[0110] Check whether the current startup environment meets any of the following conditions: the first startup of the virtual machine; the network settings of the virtual machine are changed; the information required for the monitoring agent configuration is updated; if so, determine that the current startup environment meets the triggering conditions of the monitoring agent configuration.

[0111] Among them, to detect whether the virtual machine is started for the first time, the file marking method can be used, including: creating a specific file (such as / var / lib / cloud / instance / boot-finished) to mark the completion of the first startup; checking whether the file exists, if not, it is considered that the virtual machine is started for the first time. Detecting whether the network settings of the virtual machine have changed, including: comparing the network settings of the virtual machine saved last time (such as network configuration, IP address, etc.) with the network settings of the current virtual machine. If there is a difference, it is considered that the network settings of the virtual machine have changed. Similarly, detecting whether the information required for the monitoring agent configuration is updated includes: comparing the information required for the monitoring agent configuration saved last time with the information required for the current monitoring agent configuration. If there is a difference, it is considered that the information required for the monitoring agent configuration is updated.

[0112] The above preferred implementation method can ensure that the configuration of the monitoring agent is only executed when necessary during the virtual machine startup phase by defining clear monitoring agent configuration trigger conditions, creating an effective startup environment detection mechanism, and integrating it into the startup script. This method not only improves the flexibility and response speed of the system, but also reduces unnecessary configuration overhead and improves the overall operation and maintenance efficiency.

[0113] On the basis of the above scheme, the virtual machine monitoring method provided in this embodiment also includes: after failing to obtain the visual monitoring situation obtained based on the preprocessing results reported by the virtual machine, controlling the virtual machine to restart. As a measure to deal with the failure of obtaining the visual monitoring situation, the cloud management platform can send a restart instruction to the virtual machine, control the virtual machine to detect whether the current startup environment meets the triggering conditions of the monitoring agent configuration during the startup process through the native startup script, and automatically configure and start the monitoring agent if it does. This approach ensures that the monitoring agent can quickly resume normal operation, reduces monitoring blind spots, improves the stability and self-recovery ability of the system, simplifies management and maintenance work, and reduces the need for manual intervention, thereby providing more continuous and reliable monitoring coverage and ensuring the efficient operation and service quality of the virtual machine.

[0114] Embodiment 3

[0115] This embodiment provides a virtual machine monitoring device, which can be applied to a cloud management platform and implemented by software and / or hardware. Figure 3 , the device comprises:

[0116] A virtual machine creation unit 301 is used to create multiple virtual machines in various resource pools under management;

[0117] A virtual machine monitoring unit 302 is used to control the virtual machine: collect and pre-process monitoring indicator data according to a pre-defined unified monitoring standard, and report the pre-processing result to the monitoring platform;

[0118] The monitoring situation acquisition unit 303 is used to access the monitoring platform to obtain the visual monitoring situation obtained based on the preprocessing result reported by the virtual machine.

[0119] Exemplarily, the virtual machine monitoring device provided in this embodiment also includes a script creation unit 300, which is used to: create a startup script for the virtual machine, and the script contains the information required for the monitoring agent to start. Correspondingly, the virtual machine monitoring unit 302 is specifically used to: control the virtual machine to automatically start the monitoring agent during the startup process through the startup script, so that the monitoring agent: after successful startup, collects and preprocesses monitoring indicator data according to a predefined unified monitoring standard, and reports the preprocessing results to the monitoring platform.

[0120] Preferably, the startup script created for the virtual machine also includes a startup environment detection script and the monitoring agent configuration required information. Accordingly, the virtual machine monitoring unit 302 is specifically used to control the virtual machine to automatically start the monitoring agent during the startup process through the startup script, including:

[0121] Controlling the virtual machine: During the process of starting the virtual machine through the startup script, detecting whether the current startup environment meets the triggering condition of the monitoring agent configuration, and automatically configuring and starting the monitoring agent if so.

[0122] In specific implementation, the virtual machine monitoring unit 302 is specifically used to control the virtual machine to detect whether the current startup environment meets the triggering condition configured by the monitoring agent during the startup script, which may include:

[0123] Controlling the virtual machine to detect whether the current startup environment meets any one of the following conditions during the startup process of the startup script: the first startup of the virtual machine; the change of the network setting of the virtual machine; the update of the information required for the monitoring agent configuration;

[0124] If yes, it is determined that the current startup environment satisfies the triggering condition configured by the monitoring agent.

[0125] Preferably, the virtual machine monitoring device provided in this embodiment further includes a virtual machine restarting unit 304, which is used to: after failing to obtain the visualized monitoring situation obtained based on the preprocessing result reported by the virtual machine, control the virtual machine to restart.

[0126] Preferably, the script creation unit 300 is specifically used for:

[0127] Obtaining a native startup script of the virtual machine;

[0128] Determining a native startup script management method corresponding to the type of the virtual machine and the installed operating system;

[0129] According to the determined native startup script management method, the information required for starting the monitoring agent is embedded in the native startup script of the virtual machine.

[0130] Preferably, the monitoring situation acquisition unit 303 is specifically used to: access the monitoring platform via an API gateway through a predefined unified application programming interface API, and obtain a visual monitoring situation obtained based on a preprocessing result reported by the virtual machine.

[0131] The virtual machine monitoring device provided in this embodiment belongs to the same inventive concept as the aforementioned method embodiment. For technical details not described in this embodiment, reference can be made to the relevant description in the aforementioned method embodiment, which will not be repeated here.

[0132] Figure 4 FIG. 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present invention, which can implement the process of the first embodiment or the second embodiment of the present invention. Figure 4 As shown, the above-mentioned electronic device may include: a shell 41, a processor 42, a memory 43, a circuit board 44 and a power supply circuit 45, wherein the circuit board 44 is arranged inside the space enclosed by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power supply circuit 45 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 43 is used to store executable program codes; the processor 42 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 43, so as to execute the virtual machine monitoring method described in any of the above-mentioned embodiments.

[0133] The specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the executable program code can be found in the description of the method embodiment of the present invention, which will not be repeated here.

[0134] The electronic device can be an electronic device with data processing capabilities that exists in various forms, such as a server that provides computing services. Its structure is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.

[0135] Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more central processing units to implement the virtual machine monitoring method described in the aforementioned embodiment.

[0136] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0137] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0138] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0139] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0140] For the convenience of description, the above device is described by dividing the functions into various units / modules. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.

[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0142] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A virtual machine monitoring method, characterized in that: Applied to a cloud management platform, the method includes: Create multiple virtual machines in various resource pools under management; Controlling the virtual machine: collecting and preprocessing monitoring indicator data according to a predefined unified monitoring standard, and reporting the preprocessing results to the monitoring platform; The monitoring platform is accessed to obtain a visual monitoring situation based on the preprocessing result reported by the virtual machine.

2. The method according to claim 1, characterized in that The method further comprises: creating a startup script for the virtual machine, the script comprising information required for the monitoring agent to start; Controlling the virtual machine: collecting and preprocessing monitoring indicator data according to a predefined unified monitoring standard, and reporting the preprocessing results to the monitoring platform, including: The virtual machine is controlled to automatically start the monitoring agent during the process of being started by the startup script, so that the monitoring agent: after successful startup, collects and preprocesses monitoring indicator data according to a predefined unified monitoring standard, and reports the preprocessing results to the monitoring platform.

3. The method according to claim 2, characterized in that The startup script created for the virtual machine also includes a startup environment detection script and information required for the monitoring agent configuration; Controlling the virtual machine to automatically start the monitoring agent during the process of starting up through the startup script includes: Controlling the virtual machine: During the process of starting the virtual machine through the startup script, detecting whether the current startup environment meets the triggering condition of the monitoring agent configuration, and automatically configuring and starting the monitoring agent if so.

4. The method according to claim 3, characterized in that Check whether the current startup environment meets the trigger conditions configured by the monitoring agent, including: Detecting whether the current startup environment meets any of the following conditions: the virtual machine is started for the first time; the network settings of the virtual machine are changed; the information required for the monitoring agent configuration is updated; If yes, it is determined that the current startup environment satisfies the triggering condition configured by the monitoring agent.

5. The method according to claim 3, characterized in that: The method further comprises: After failing to obtain the visualized monitoring situation based on the preprocessing result reported by the virtual machine, controlling the virtual machine to restart.

6. The method according to claim 2, characterized in that Create a startup script for the virtual machine. The script contains the information required to start the monitoring agent, including: Obtaining a native startup script of the virtual machine; Determining a native startup script management method corresponding to the type of the virtual machine and the installed operating system; According to the determined native startup script management method, the information required for starting the monitoring agent is embedded in the native startup script of the virtual machine.

7. The method according to any one of claims 1 to 6, characterized in that Accessing the monitoring platform to obtain a visual monitoring situation based on the preprocessing result reported by the virtual machine includes: The monitoring platform is accessed through a predefined unified application programming interface API via an API gateway to obtain a visual monitoring situation based on the preprocessing results reported by the virtual machine.

8. A virtual machine monitoring device, characterized in that: Applied to a cloud management platform, the device comprises: A virtual machine creation unit, used to create multiple virtual machines in various resource pools under management; A virtual machine monitoring unit, used to control the virtual machine: collect and pre-process monitoring indicator data according to a pre-defined unified monitoring standard, and report the pre-processing result to the monitoring platform; The monitoring situation acquisition unit is used to access the monitoring platform and acquire the visual monitoring situation obtained based on the preprocessing result reported by the virtual machine.

9. An electronic device, characterized in that: The electronic device comprises: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the virtual machine monitoring method described in any one of the preceding claims 1-5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more central processing units to implement the virtual machine monitoring method described in any of the above claims 1-5.