CN116820686A - Physical machine deployment method, virtual machine and container unified monitoring method and device - Google Patents

Physical machine deployment method, virtual machine and container unified monitoring method and device Download PDF

Info

Publication number
CN116820686A
CN116820686A CN202311093064.6A CN202311093064A CN116820686A CN 116820686 A CN116820686 A CN 116820686A CN 202311093064 A CN202311093064 A CN 202311093064A CN 116820686 A CN116820686 A CN 116820686A
Authority
CN
China
Prior art keywords
virtual
monitoring
container
module
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311093064.6A
Other languages
Chinese (zh)
Other versions
CN116820686B (en
Inventor
闫冬冬
武警贺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202311093064.6A priority Critical patent/CN116820686B/en
Publication of CN116820686A publication Critical patent/CN116820686A/en
Application granted granted Critical
Publication of CN116820686B publication Critical patent/CN116820686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/301Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of cloud computing, and discloses a physical machine deployment method, a virtual machine and a container unified monitoring method and a device, wherein the physical machine deployment method comprises the following steps: obtaining a virtual machine and a container creation template, and arranging the virtual machine and at least one type of container in a physical machine through the virtual machine and the container creation template; the virtual machine and the container creation template are internally provided with a virtual network card or a virtual network bridge; respectively integrating and deploying an acquisition module, a transmission module and a virtual network card in a virtual machine and at least one type of container, and deploying a receiving module and a virtual switch in a physical machine to realize monitoring of cloud platform mixed resources; the sending module is connected with the acquisition module, and the receiving module is connected with the virtual switch. The invention reduces the consumption of the management end and the consumption of network resources.

Description

Physical machine deployment method, virtual machine and container unified monitoring method and device
Technical Field
The invention relates to the technical field of cloud computing, in particular to a physical machine deployment method, a virtual machine and a container unified monitoring method and device.
Background
In the cloud computing era, most cloud platforms adopt a strategy of a virtual machine management platform which is built firstly, and then with the rise of K8S (Kubernates open source platform for management and monitoring of container resources), in order to manage virtual machines and containers in one cloud platform, the purpose of hybrid management can be achieved, operation and maintenance of users are convenient, the K8S platform is simply integrated into the existing platform, and docking management is carried out through K8S API (Application Programming Interface ); thus, although the device is seemingly a platform, the rear end is provided with two platforms, the monitoring system is also split, and possibly the virtual machine and the container are also operated on different physical machines, so that the real mixed operation is not realized; with the appearance of containers, mixed operation is enabled, and a single physical machine can operate both a virtual machine and a container.
But presents challenges for upper layer monitoring systems; the original monitoring is integrated at the management end, and the two systems or platforms respectively manage the monitoring of the respective resources and only perform unified display through API call, if the monitoring data of different resources are to be sensed on the physical machine, the management end may need to be requested reversely to pull the data, which increases the IO (input/output) link and the request response time without doubt, and consumes valuable network bandwidth resources.
Disclosure of Invention
In view of the above, the invention provides a deployment method of a physical machine, a method and a device for uniformly monitoring a virtual machine and a container, so as to solve the problem that the physical machine reversely requests a management end to pull data to realize sensing of monitoring data of different resources, thereby causing more consumption of network bandwidth resources.
In a first aspect, the present invention provides a method for deploying a physical machine, where the method includes:
obtaining a virtual machine and a container creation template, and arranging the virtual machine and at least one type of container in a physical machine through the virtual machine and the container creation template; the virtual machine and the container creation template are internally provided with a virtual network card or a virtual network bridge;
respectively integrating a deployment acquisition module and a transmission module in a virtual machine and at least one type of container, and deploying a receiving module and a virtual switch in a physical machine to realize monitoring of cloud platform mixed resources; the acquisition module is connected with the sending module, and the receiving module is connected with the virtual switch.
According to the deployment method of the physical machine, the virtual machine and at least one type of container are deployed in the physical machine through the virtual machine and the container creation template, the characteristic that the K8S server is required to provide query for container monitoring is broken, the bottom query method is provided, and the monitoring data acquired by the external monitoring device cannot be monitored completely due to the fact that the safety attributes of the virtual machine and the container are insufficient, so that the internal monitoring device is adopted, namely the acquisition module, the detection module and the sending module are integrated in the virtual machine and the at least one type of container respectively, unified monitoring is conducted on a single physical machine layer, monitoring perceptibility is provided for agent programs at the tail end of a cloud platform, management control decision is made, loss of a management end and consumption of network resources are reduced, application scenes and applications are expanded, and expansion capability is enriched.
In an alternative embodiment, the method further comprises:
integrating a deployment detection module in a virtual machine and at least one type of container respectively, and deploying a fault reporting module in a physical machine; the fault reporting module is connected with the receiving module.
In an alternative embodiment, the method further comprises:
deploying a virtual machine and at least one type of container in a physical machine through container mirroring; wherein, the container mirror image is internally provided with a virtual network card or a virtual network bridge.
According to the deployment method of the physical machine, the virtual machine and at least one type of container are deployed in the physical machine through the container mirror image, so that accurate deployment of monitoring equipment in the physical machine is achieved.
In an alternative embodiment, the method further comprises:
utilizing a virtual switch to configure a virtual bridge for a virtual machine, at least one type of container and a receiving module respectively; the sending module is connected with the virtual switch through the virtual network card and/or the virtual network bridge, and the receiving module is connected with the virtual switch through the virtual network bridge.
According to the deployment method of the physical machine, the virtual network bridge is configured, so that the connection between the virtual switch and the virtual machine and the connection between the virtual switch and at least one type of container are realized, and a foundation is laid for subsequent data transmission.
In a second aspect, the present invention provides a method for uniformly monitoring a virtual machine and a container, which is applied to a device for uniformly monitoring a virtual machine and a container, where the device includes a management end and at least one physical machine, and the physical machine is deployed in the device for uniformly monitoring the virtual machine and the container by adopting a deployment method of the physical machine, and the method includes:
collecting cloud platform hybrid resource monitoring data through a virtual machine and at least one type of container, and transmitting the cloud platform hybrid resource monitoring data to a receiving module through a virtual network bridge and a virtual switch;
and receiving and storing the cloud platform hybrid resource monitoring data through the receiving module.
According to the method for uniformly monitoring the virtual machines and the containers, which is provided by the embodiment, monitoring constraint under the existing framework is broken, monitoring data aggregation is not needed at a management end, monitoring data summarization can be performed from a single physical machine layer, various monitoring indexes are calculated and collected, cloud platform mixed resource monitoring data are formed, so that the monitoring collection and summarization under a mixed resource operation scene can be completed by a single physical machine, loss of the management end and consumption of network resources are reduced, and more physical machines and management scales can be supported.
In an alternative embodiment, collecting cloud platform hybrid resource monitoring data through a virtual machine and at least one type of container, and transmitting the cloud platform hybrid resource monitoring data to a receiving module through a virtual bridge and a virtual switch, comprising:
the acquisition module acquires the custom script, acquires cloud platform mixed resource monitoring data according to a preset time interval based on the custom script, and transmits the cloud platform mixed resource monitoring data to the transmission module;
and the sending module transmits the cloud platform mixed resource monitoring data to the receiving module through the virtual network card and/or the virtual network bridge and the virtual switch according to a preset sending interval.
According to the method for uniformly monitoring the virtual machine and the container, the acquisition module acquires the cloud platform mixed resource monitoring data according to the preset time interval, so that the cloud platform mixed resource monitoring data can be optimized for different monitoring items, the occupation of the data of the virtual machine or the container is reduced, and the transmission module transmits the cloud platform mixed resource monitoring data according to the preset transmission interval, so that the transmission frequency is reduced, and the burden of the receiving module is reduced.
In an optional implementation manner, the transmitting module transmits the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card and/or the virtual bridge and the virtual switch according to a preset transmitting interval, and the method includes:
The sending module converts the cloud platform mixed resource monitoring data into a mixed resource monitoring message by using a preset message format;
the sending module utilizes a user datagram protocol to send the mixed resource monitoring message to the virtual switch through the virtual network card and/or the virtual network bridge group;
the virtual switch receives the mixed resource monitoring message, performs multicast suppression on the mixed resource monitoring message, and transmits the mixed resource monitoring message after multicast suppression to the receiving module.
According to the method for uniformly monitoring the virtual machines and the containers, the sending module performs multicast sending, so that other virtual machines or containers can also receive multicast messages, multicast inhibition is performed on the virtual switch layer by specifying the format of the multicast messages, only the receiving module allows release of the receiving, and other virtual bridges uniformly disable the messages in the format, so that multicast storms can be effectively prevented; and the user datagram protocol is utilized for data transmission, and the waiting for confirmation of the message is not needed, so that the successful triggering and dispatching of the message transmission can be ensured even when the service network and the monitoring network segment are repeated, and the problem of network segment conflict is further solved.
In an alternative embodiment, the transmitting module converts the cloud platform hybrid resource monitoring data into a hybrid resource monitoring message by using a preset message format, including:
The method comprises the steps that a sending module obtains a physical address, sending time and a monitoring message identifier, and a mixed resource monitoring message is generated based on cloud platform mixed resource monitoring data, the physical address, the sending time and the monitoring message identifier; the cloud platform mixed resource monitoring data comprises monitoring items and monitoring values.
According to the method for uniformly monitoring the virtual machine and the container, the cloud platform mixed resource monitoring data is converted into the mixed resource monitoring message by using the preset message format, and a foundation is laid for subsequent unique identification and multicast suppression.
In an optional implementation manner, the sending module converts the cloud platform hybrid resource monitoring data into the hybrid resource monitoring message by using a preset message format, and further includes:
the sending module calculates the resource difference amount based on a preset sending interval and a monitoring value, and generates a mixed resource monitoring message based on cloud platform mixed resource monitoring data, the resource difference amount, a physical address, sending time and a monitoring message identifier.
According to the method for uniformly monitoring the virtual machine and the container, the sending module is used for calculating the resource difference, so that the calculation pressure of the receiving module is further reduced, and the resource consumption is reduced.
In an alternative embodiment, before collecting the cloud platform hybrid resource monitoring data through the virtual machine and the at least one type of container, and transmitting the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card and/or the virtual bridge, and the virtual switch, the method further includes:
the virtual switch utilizes dynamic host configuration protocol to respectively allocate monitoring network addresses for the virtual network card and the virtual network bridge.
According to the method for uniformly monitoring the virtual machine and the container, the virtual switch utilizes the dynamic host configuration protocol to respectively allocate the monitoring network address to the virtual network card and the virtual bridge, and the monitoring network address can be utilized to carry out global scheduling, namely, in order to prevent the conflict between the service network segment in the virtual machine or the container and the built-in monitoring network segment, the monitoring network address can be utilized to dynamically schedule to other physical machines when the starting scheduling or the subsequent internal monitoring/detecting module senses that the network segment conflict exists, so that the difference of the monitoring network segments is ensured.
In an optional implementation manner, the sending module transmits the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card and/or the virtual bridge and the virtual switch according to a preset sending interval, and the method further includes:
The sending module obtains the monitoring network address, binds the monitoring network address with the mixed resource monitoring message after multicast inhibition to generate a monitoring broadcast message, and transmits the monitoring broadcast message to the receiving module through the virtual network card and/or the virtual network bridge and the virtual switch.
According to the method for uniformly monitoring the virtual machine and the container, the monitoring network address and the mixed resource monitoring message after multicast inhibition are bound, so that the difference of monitoring network segments is ensured, and a foundation is laid for the solution of the conflict of the subsequent network segments.
In an alternative embodiment, receiving and storing, by the receiving module, cloud platform hybrid resource monitoring data includes:
the receiving module receives the mixed resource monitoring message after multicast suppression, and determines a physical address and a monitoring item based on the mixed resource monitoring message after multicast suppression;
the receiving module generates a virtual machine identifier or a container identifier by utilizing external mapping comparison based on the physical address;
the receiving module generates a calling identifier based on the monitoring item and the virtual machine identifier or the container identifier;
the receiving module stores the calling identification and the monitoring broadcast message.
According to the method for uniformly monitoring the virtual machine and the container, the call identifier is generated based on the monitoring item and the virtual machine identifier or the container identifier, and other programs in the physical machine can be utilized to control access to the cloud platform hybrid resource monitoring data.
In an alternative embodiment, the receiving module stores the call identifier and the monitoring broadcast message, including:
the receiving module stores the calling identification and the monitoring broadcast message into a database.
According to the method for uniformly monitoring the virtual machine and the container, the calling identification and the monitoring broadcast message are stored in the database, so that the comprehensive storage of the cloud platform hybrid resource monitoring data is realized.
In an alternative embodiment, the receiving module stores the call identifier and monitors the broadcast message, and further includes:
the receiving module writes the calling identification and the monitoring broadcast message into the monitoring file, and broadcasts the monitoring file so that other physical machines call the monitoring broadcast message.
According to the method for uniformly monitoring the virtual machine and the container, the calling identification and the monitoring broadcast message are written into the monitoring file, and the monitoring file is broadcast, so that accurate calling of the cloud platform mixed resource monitoring data by other physical machines is realized.
In an alternative embodiment, the method further comprises:
the method comprises the steps of obtaining physical machine fault data through a fault reporting module, transmitting the physical machine fault data to a management end, and analyzing the physical machine fault data through the management end to generate a fault recovery strategy; the physical machine fault data comprise network segment conflict detection data and monitoring fault data.
According to the method for uniformly monitoring the virtual machine and the container, provided by the embodiment, the network segment conflict detection data and the monitoring fault data in the physical machine are timely processed through the fault reporting module, and the normal operation of the cloud platform is ensured.
In an optional implementation manner, the fault reporting module acquires fault data of the physical machine, transmits the fault data of the physical machine to the management end, and analyzes the fault data of the physical machine through the management end to generate a fault recovery strategy, which includes:
the detection module detects the network segment conflict, generates network segment conflict detection data, and transmits the network segment conflict detection data to the management end through the transmission module, the virtual network card and/or the virtual network bridge and the virtual switch through the receiving module and the fault reporting module;
when the receiving module does not acquire the cloud platform mixed resource monitoring data within a preset time period, generating monitoring fault data, and transmitting the monitoring fault data to the management end through the fault reporting module;
the management end receives the network segment conflict detection data and the monitoring fault data, and the virtual machine and at least one type of container are migrated to other physical machines based on the network segment conflict detection data or the monitoring fault data.
According to the method for uniformly monitoring the virtual machine and the container, the detection of network segment conflict is realized through the detection module, the physical machines of other monitoring network segments are searched through the management end to carry out scheduling migration, the network segment isolation of the service network and the monitoring network is ensured, and the management of monitoring faults is realized through the management end.
In an optional implementation manner, the fault reporting module obtains fault data of the physical machine, analyzes the fault data of the physical machine, generates a fault recovery strategy, and further includes:
after the management end migrates the virtual machine and at least one type of container to other physical machines, when the receiving module acquires the monitoring fault data, the management end controls the virtual machine and at least one type of container to restart.
According to the method for uniformly monitoring the virtual machine and the container, the monitoring faults are analyzed through the management end, so that the monitoring faults are timely and accurately processed, and the normal operation of the cloud platform is guaranteed.
In a third aspect, the present invention provides a deployment apparatus for a physical machine, including:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring a virtual machine and a container creation template, and the virtual machine and at least one type of container are deployed in a physical machine through the virtual machine and the container creation template; the virtual machine and the container creation template are internally provided with a virtual network card or a virtual network bridge;
The deployment module is used for integrating the deployment acquisition module, the transmission module and the virtual network card in the virtual machine and at least one type of container respectively, and deploying the receiving module and the virtual switch in the physical machine so as to realize monitoring of the cloud platform mixed resources; the sending module is connected with the acquisition module, and the receiving module is connected with the virtual switch.
In a fourth aspect, the present invention provides an apparatus for unified monitoring of a virtual machine and a container, including: the management terminal is connected with the at least one physical machine; the physical machine comprises a virtual machine, at least one type of container, a virtual switch and a receiving module; the virtual machine and the container are connected with a virtual switch through a virtual network bridge, and the virtual switch is connected with the receiving module through the virtual network bridge;
the virtual machine is used for collecting cloud platform mixed resource monitoring data and transmitting the cloud platform mixed resource monitoring data to the receiving module through the virtual network bridge and the virtual switch;
the container is used for collecting cloud platform mixed resource monitoring data and transmitting the cloud platform mixed resource monitoring data to the receiving module through the virtual network bridge and the virtual switch;
and the receiving module is used for receiving and storing the cloud platform hybrid resource monitoring data.
In a fifth aspect, the present invention provides a computer device comprising: the system comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions to execute the method for deploying the physical machine according to the first aspect or any corresponding embodiment of the first aspect or the method for uniformly monitoring the virtual machine and the container according to the second aspect or any corresponding embodiment of the second aspect.
In a sixth aspect, the present invention provides a computer readable storage medium, where computer instructions are stored on the computer readable storage medium, where the computer instructions are configured to cause a computer to perform the method for deploying physical machines according to the first aspect or any one of the embodiments corresponding thereto, or perform the method for uniformly monitoring the virtual machines and containers according to the second aspect or any one of the embodiments corresponding thereto.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method of deploying a physical machine according to an embodiment of the invention;
FIG. 2 is a block diagram of a virtual machine and container unified monitoring device according to an embodiment of the invention;
FIG. 3 is a flow diagram of a method for unified monitoring of virtual machines and containers according to an embodiment of the invention;
FIG. 4 is a flow diagram of another method for unified monitoring of virtual machines and containers according to an embodiment of the invention;
FIG. 5 is a flow diagram of a method for unified monitoring of virtual machines and containers in accordance with yet another embodiment of the invention;
FIG. 6 is a flow diagram of a method for unified monitoring of virtual machines and containers in accordance with yet another embodiment of the invention;
FIG. 7 is a block diagram of a deployment apparatus of a physical machine according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
According to an embodiment of the present invention, there is provided an embodiment of a method for deploying physical machines, it is noted that the steps shown in the flowchart of the drawing may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order different from that herein.
In this embodiment, a deployment method of a physical machine is provided, which may be used in the above mobile terminal, such as a mobile phone, a tablet computer, etc., fig. 1 is a flowchart of a deployment method of a physical machine according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
step S101, a virtual machine and a container creation template are obtained, and the virtual machine and at least one type of container are deployed in a physical machine through the virtual machine and the container creation template; wherein, the virtual machine and the container creation template are provided with a built-in virtual network card or virtual network bridge.
Specifically, as shown in FIG. 2, a virtual machine and at least one type of container are deployed in a physical machine through container mirroring; wherein, the container mirror image is internally provided with a virtual network card or a virtual network bridge.
Further, configuring virtual bridges for the virtual machine, the at least one type of container, and the receiving module, respectively, using the virtual switch; the sending module is connected with the virtual switch through the virtual network card and/or the virtual network bridge, and the receiving module is connected with the virtual switch through the virtual network bridge.
Further, a virtual switch special for monitoring data (i.e. cloud platform mixed resource monitoring data) collection is required to be built in each physical machine, all virtual network cards are connected to the virtual switch, a virtual network bridge is allocated to each virtual machine or container, and the virtual network bridge is connected with the virtual network card or directly connected with the container; the receiving module is also connected to the switch via a virtual bridge over which a receiving IP is assigned.
Further, as shown in fig. 2, virtual network cards are deployed on the virtual machine and KATA containers, and other types of containers are connected to the virtual switch through the virtual network cards.
Further, KATA containers (a lightweight security container) are only one of the containers, and can be spread over all types of containers, so that a monitoring model in a single physical machine is unified, and only other containers with different network manifestations can be connected and communicated with a virtual machine switch by only one virtual network bridge instead of a virtual network card.
Further, other containers may employ a run container (a lightweight container running tool), a docker container (an open source application container engine), etc.
Further, the virtual machine and the container create templates, and the container mirror image needs to additionally add a built-in virtual network card or virtual bridge, the virtual network card is made into a DHCP (Dynamic Host Configuration Protocol ) mode, the virtual machine or the container can automatically acquire built-in IP (Internet Protocol ), that is, monitor network address, the virtual network card is subsequently dedicated to data transmission, and the virtual bridge needs to create an external network bridge and configure IP and mac when the virtual machine or the container is started (Media Access Control protocol, medium access control protocol).
Further, when the virtual machine or the KATA container is inside, the virtual network card configuration needs to be protected, so that the change caused by misoperation of a user is prevented; the built-in acquisition module can check the network card configuration at regular time, and automatically restore to an initial state if the network card configuration is found to be modified.
Further, the mac of the virtual network card needs to be distinguished from the mac of the normally allocated network card, for example, the mac of the user service network card is 00:16:3e, and the mac of the built-in network card needs to be allocated as 00:34:32 for special identification.
Step S102, integrating a deployment acquisition module and a transmission module in a virtual machine and at least one type of container respectively, and deploying a receiving module and a virtual switch in a physical machine to realize monitoring of cloud platform mixed resources; the acquisition module is connected with the sending module, and the receiving module is connected with the virtual switch.
The cloud platform mixed resources comprise resources corresponding to the virtual machine and the container.
Specifically, the acquisition module is mainly used for acquiring data, and as to which data and what data can be acquired and developed in a self-defined way, the sending module is responsible for sending the acquired data to the receiving module at regular time, the receiving module can buffer or write in a file after receiving the data, and the monitoring data is published outwards in an API or file mode.
Further, integrating a deployment detection module in the virtual machine and at least one type of container respectively, and deploying a fault reporting module in the physical machine; the fault reporting module is connected with the receiving module.
Further, the acquisition module, the detection module and the sending module are manufactured to be a startup self-starting service, and the service corresponding to the acquisition module, the detection module and the sending module is required to be customized according to different operating systems, so that disablement is required, windows (which are operating systems developed by Microsoft corporation based on a graphical user interface and mainly applied to devices such as computers and smart phones) can be manufactured to be a system service, and only a super administrator can disable the service; the acquisition module, the detection module and the sending module have mutual supervision capability, and can automatically pull up other 2 services which are failed or are down, so that service suspension caused by antivirus programs or user operation is prevented.
According to the deployment method of the physical machine, the virtual machine and at least one type of container are deployed in the physical machine through the virtual machine and the container creation template, the characteristic that the K8S server is required to provide query for container monitoring is broken, the bottom query method is provided, and the monitoring data acquired by the external monitoring device cannot be monitored completely due to the fact that the safety attributes of the virtual machine and the container are insufficient, so that the internal monitoring device is adopted, namely the acquisition module, the detection module and the sending module are integrated in the virtual machine and the at least one type of container respectively, unified monitoring is carried out on a single physical machine layer, monitoring perceptibility is provided for an agent program at the tail end of a cloud platform, management control decision is made, and loss of a management end and network resources are reduced.
In this embodiment, a method for unified monitoring of a virtual machine and a container is provided, which may be used in a device for unified monitoring of a virtual machine and a container, where the device includes a management end and at least one physical machine, and the physical machine is deployed in the device for unified monitoring of a virtual machine and a container by using the deployment method of any physical machine of the foregoing, and fig. 3 is a flowchart of a method for unified monitoring of a virtual machine and a container according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
Step S301, cloud platform mixed resource monitoring data are collected through a virtual machine and at least one type of container, and the cloud platform mixed resource monitoring data are transmitted to a receiving module through a virtual network bridge and a virtual switch.
The cloud platform mixed resource monitoring data comprises virtual machine resource monitoring data and container resource monitoring data.
Specifically, the virtual switch utilizes a dynamic host configuration protocol to respectively allocate monitoring network addresses for the virtual network card and the virtual bridge.
Further, the virtual switch needs to provide DHCP functions, such as dnsmasq or other custom DHCP services, and allocates built-in IP to built-in virtual network cards, and since the service-related network cards of the virtual machine or the container are connected to the service network switch, they are not affected by DHCP; wherein dnsmasq is a tool for configuring DNS (Domain Name System ) and DHCP.
Further, since the virtual bridge of the non-KATA container needs to allocate IP and mac, the virtual switch simulates DHCP allocation and marks the IP as allocated in the DHCP service, so that the allocation to other virtual machines or KATA containers is prevented, and full-automatic allocation can be achieved; the method can also be used for segmentation, one section of IP is used for virtual machines and KATA containers and is configured to DHCP, and the other section of IP is used for IP allocation of non-KATA containers, so that the automatic allocation difficulty is reduced.
Further, the IP sections corresponding to the virtual switches in each physical machine are different, so that global scheduling is convenient; in order to prevent the conflict between the service network segment in the virtual machine or the container and the built-in monitoring network segment, the network segment can be dynamically scheduled to other physical machines when the starting-up scheduling or the subsequent internal acquisition module/detection module senses that the network segment conflict exists, so that the network segments are ensured to be different as much as possible.
For example, the physical machine a may create a virtual switch V1, allocate a set of monitoring segments 199.33.22.1-254, the physical machine b creates a virtual switch V2, allocate a set of monitoring segments 199.33.23.1-254, each physical machine has an internal virtual switch thereon, and the user is inoperable or configures, and the network IP segments of each switch are differentiated, so that when a conflict is found, it can be scheduled to other hosts to avoid the conflict.
Step S302, the cloud platform mixed resource monitoring data is received and stored through a receiving module.
According to the method for uniformly monitoring the virtual machines and the containers, which is provided by the embodiment, monitoring constraint under the existing framework is broken, monitoring data aggregation is not needed at a management end, monitoring data summarization can be performed from a single physical machine layer, various monitoring indexes are calculated and collected, cloud platform mixed resource monitoring data are formed, so that the monitoring collection and summarization under a mixed resource operation scene can be completed by a single physical machine, loss of the management end and consumption of network resources are reduced, and more physical machines and management scales can be supported.
In this embodiment, a method for unified monitoring of a virtual machine and a container is provided, which may be used in the device for unified monitoring of a virtual machine and a container, and fig. 4 is a flowchart of a method for unified monitoring of a virtual machine and a container according to an embodiment of the present invention, as shown in fig. 4, where the flowchart includes the following steps:
in step S401, cloud platform hybrid resource monitoring data is collected through the virtual machine and at least one type of container, and the cloud platform hybrid resource monitoring data is transmitted to the receiving module through the virtual bridge and the virtual switch.
Specifically, the step S401 includes:
step S4011, the acquisition module acquires a custom script, acquires cloud platform mixed resource monitoring data according to a preset time interval based on the custom script, and transmits the cloud platform mixed resource monitoring data to the sending module.
Specifically, the acquisition module can acquire data according to a custom script, and can configure different acquisition intervals for different monitoring items, wherein the custom script needs to configure an execution timeout interval to prevent the acquisition blockage of subsequent monitoring items due to overlong time.
The monitoring items comprise CPU (Central Processing Unit ) use rate, memory use rate, network packet loss rate and the like.
In step S4012, the sending module transmits the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card and/or the virtual bridge and the virtual switch according to the preset sending interval.
Specifically, the sending module may configure different preset sending intervals for different monitoring items.
According to the method for uniformly monitoring the virtual machine and the container, the acquisition module acquires the cloud platform mixed resource monitoring data according to the preset time interval, optimizes different monitoring items, reduces the occupation of a processor of the virtual machine or the container, and the transmission module transmits the cloud platform mixed resource monitoring data according to the preset transmission interval, so that the transmission frequency is reduced, and the burden of the receiving module is reduced.
In some optional embodiments, step S4012 described above comprises:
and a step a1, a sending module converts cloud platform mixed resource monitoring data into a mixed resource monitoring message by using a preset message format.
Specifically, a sending module obtains a physical address, sending time and a monitoring message identifier, and generates a mixed resource monitoring message based on cloud platform mixed resource monitoring data, the physical address, the sending time and the monitoring message identifier; the cloud platform mixed resource monitoring data comprises monitoring items and monitoring values; the monitoring message identification is used for multicast suppression identification, and the physical address is used for determining the uniqueness of the cloud platform mixed resource monitoring data.
Further, the sending module calculates the resource difference amount based on a preset sending interval and a monitoring value, and generates a mixed resource monitoring message based on cloud platform mixed resource monitoring data, the resource difference amount, a physical address, sending time and a monitoring message identifier.
Further, for some monitoring items, such as a network card bandwidth rate, the sending module may perform calculation, and calculate by (currently collected monitoring value-last collected monitoring value)/sending interval formula, so as to further reduce the calculation pressure of the receiving module, where the preset sending interval needs to be greater than the preset collection interval.
Further, the sending module obtains the monitoring network address, binds the monitoring network address and the mixed resource monitoring message after multicast suppression to generate a monitoring broadcast message, and transmits the monitoring broadcast message to the receiving module through the virtual network card and/or the virtual network bridge and the virtual switch.
Furthermore, the sending module needs to identify the monitoring network address according to the mac rule, and only binds the monitoring network address and the port to send the message, because the message is based on UDP (User Datagram Protocol ), and no waiting for confirmation of the message is needed, even if the service network and the monitoring network segment are repeated, the message sending can be ensured to trigger the scheduling successfully, and the problem of network segment conflict is further solved.
And a step a2, the sending module uses the user datagram protocol to send the mixed resource monitoring message to the virtual switch through the virtual network card and/or the virtual bridge group.
And a3, the virtual switch receives the mixed resource monitoring message, performs multicast suppression on the mixed resource monitoring message, and transmits the mixed resource monitoring message after multicast suppression to the receiving module.
Step S402, receiving and storing cloud platform hybrid resource monitoring data through a receiving module. Please refer to step S302 in the embodiment shown in fig. 3 in detail, which is not described herein.
According to the method for uniformly monitoring the virtual machine and the container, the problem of migration of the virtual machine or the problem of change of a physical address range caused by other factors of the DHCP is considered, the physical address change of a receiving module cannot be perceived in the virtual machine or the container, so that the sending module performs multicast sending, and further other virtual machines or containers can also receive multicast messages, so that the format of the multicast messages (namely, mixed resource monitoring messages) is required to be regulated, multicast suppression is performed on a virtual switch layer, only the receiving module is allowed to release the receiving, and other virtual bridges uniformly disable the messages in the format, and multicast storm can be effectively prevented.
In this embodiment, a method for unified monitoring of a virtual machine and a container is provided, which may be used in the foregoing apparatus for unified monitoring of a virtual machine and a container, and fig. 5 is a flowchart of a method for unified monitoring of a virtual machine and a container according to an embodiment of the present invention, as shown in fig. 5, where the flowchart includes the following steps:
in step S501, cloud platform hybrid resource monitoring data is collected through a virtual machine and at least one type of container, and the cloud platform hybrid resource monitoring data is transmitted to a receiving module through a virtual bridge and a virtual switch. Please refer to step S401 in the embodiment shown in fig. 4 in detail, which is not described herein.
Step S502, the cloud platform mixed resource monitoring data is received and stored through a receiving module.
Specifically, the step S502 includes:
step S5021, the receiving module receives the mixed resource monitoring message after the multicast suppression, and determines a physical address and a monitoring item based on the mixed resource monitoring message after the multicast suppression.
Specifically, if the sending time and the current time of the monitoring broadcast message received by the receiving module exceed a certain threshold, discarding the monitoring broadcast message.
In step S5022, the receiving module generates a virtual machine identifier or a container identifier based on the physical address by using external mapping comparison.
Specifically, with respect to mac information (i.e., physical address) carried by data sent by the message, the mac information is converted into a virtual machine ID (i.e., virtual machine identifier) or a container ID (i.e., container identifier) through external mapping comparison, so that an external program is convenient to call or query, and the virtual machine ID or the container ID and a monitoring item are used as unique keys (i.e., call identifiers) during storage.
In step S5023, the receiving module generates a call identifier based on the monitoring item and the virtual machine identifier or the container identifier.
Step S5024, the receiving module stores the calling identification and the monitoring broadcast message.
Specifically, the receiving module stores the calling identification and the monitoring broadcast message in a database.
Further, by adopting RRD (Round Robin Database, annular database) or other lightweight database record when the file is recorded, historical data can be recorded, more data can be saved, and 1 day of data is saved by default; and storing according to the configuration items when the record is cached, wherein the data is stored for only 5 minutes by default.
Further, the receiving module writes the calling identification and the monitoring broadcast message into the monitoring file, and broadcasts the monitoring file so that other physical machines call the monitoring broadcast message.
Further, the monitoring broadcast message received by the receiving module can be cached in the memory or written in the file, the monitoring data is exposed to the outside in an API or file mode, and other programs in the physical machine can access the monitoring data to perform other management control.
According to the method for uniformly monitoring the virtual machine and the container, the call identifier is generated based on the monitoring item and the virtual machine identifier or the container identifier, and other programs in the physical machine can be utilized to control access to the cloud platform hybrid resource monitoring data.
In this embodiment, a method for unified monitoring of a virtual machine and a container is provided, which may be used in the foregoing apparatus for unified monitoring of a virtual machine and a container, and fig. 6 is a flowchart of a method for unified monitoring of a virtual machine and a container according to an embodiment of the present invention, as shown in fig. 6, where the flowchart includes the following steps:
in step S601, cloud platform hybrid resource monitoring data is collected through a virtual machine and at least one type of container, and the cloud platform hybrid resource monitoring data is transmitted to a receiving module through a virtual bridge and a virtual switch. Please refer to step S501 in the embodiment shown in fig. 5 in detail, which is not described herein.
Step S602, the cloud platform mixed resource monitoring data is received and stored through a receiving module. Please refer to step S502 in the embodiment shown in fig. 5 in detail, which is not described herein.
Step S603, obtaining physical machine fault data through a fault reporting module, transmitting the physical machine fault data to a management end, and analyzing the physical machine fault data through the management end to generate a fault recovery strategy; the physical machine fault data comprise network segment conflict detection data and monitoring fault data.
Specifically, the step S603 includes:
in step S6031, the detection module detects the network segment conflict, generates network segment conflict detection data, and transmits the network segment conflict detection data to the management end through the sending module, the virtual network card and/or the virtual network bridge, and the virtual switch through the receiving module and the fault reporting module.
Specifically, the detection device is mainly used for two purposes: detecting whether the other two services are normal (i.e. whether module failure data exists); detecting whether there is a conflict (i.e., network segment conflict detection data) between the service network and the monitoring network.
Further, the judgment criteria of the detection module are: if the service network IP and the monitoring network IP are the same network segment, for example, the service network IP is 192.168.1.1, the monitoring network IP is 192.168.1.2, and the subnet masks are 255.255.255.0, the service network IP and the monitoring network IP belong to the 192.168.1.Xx network segment, that is, the network segment collision occurs.
The service network generally needs to bind a network card of the physical machine and needs to communicate with the outside, but the monitoring network is only an internal network of the physical machine, does not need to communicate with other physical machines, and only needs a physical machine network by the fault reporting module.
And step S6032, when the receiving module does not acquire the cloud platform mixed resource monitoring data within a preset time period, generating monitoring fault data, and transmitting the monitoring fault data to the management end through the fault reporting module.
In step S6033, the management end receives the network segment conflict detection data and the monitoring failure data, and migrates the virtual machine and at least one type of container to other physical machines based on the network segment conflict detection data or the monitoring failure data.
Specifically, if the detection module detects the network segment conflict, the sending module reports the network segment conflict, the receiving module reports the network segment conflict to the management end through the fault reporting module after receiving the network segment conflict, and the management end searches hosts of other monitoring network segments to conduct scheduling migration, so that isolation between a service network and the monitoring network segments is ensured.
Further, the detection module detects which IP is the monitoring network IP (i.e. the monitoring network address) according to the mac address rule, and configures a static route for the IP, so as to prevent the IP from becoming a default route and affecting the service.
Further, after the management end migrates the virtual machine and at least one type of container to other physical machines, when the receiving module obtains the monitoring fault data, the management end controls the virtual machine and at least one type of container to restart.
Further, the management end receives monitoring fault data, firstly migrates the virtual machine and at least one type of container to other physical machines, if the virtual machine or the container has a fault problem after execution, if the virtual machine or the container has multiple copies, the virtual machine or the container tries to restart under the condition of ensuring that the service is not influenced, and if the fault problem still exists after restarting, the virtual machine or the container generates an alarm to be manually intervened for solving.
According to the method for uniformly monitoring the virtual machine and the container, the detection of network segment conflict is realized through the detection module, the physical machines of other monitoring network segments are searched through the management end to carry out scheduling migration, the network segment isolation of the service network and the monitoring network is ensured, and the management of monitoring faults is realized through the management end.
A unified monitoring method of virtual machines and containers is described below by way of a specific embodiment.
Example 1:
the unified monitoring method for the virtual machine and the container comprises the following specific implementation processes:
1) In order to accelerate deployment efficiency, deployment is generally performed in a mode of creating templates or container images by a virtual machine and a container, and a service is quickly created for users to use; therefore, when a virtual machine and a container creation template or a container mirror image are provided, a detection, acquisition and transmission module is integrated and deployed in the virtual machine and the container creation template or the container mirror image, and the virtual machine is manufactured into a startup self-starting service:
a) The service needs to be customized aiming at different operating systems, the disablement is needed, windows can be made into system services, and only a super administrator can disable the system services;
b) The detection, collection and sending modules have mutual supervision capability, and can automatically pull up other 2 modules which are failed or are down, so that service suspension caused by disinfection programs or user operation is prevented.
2) The virtual machine and the container create template and the container mirror image need to additionally add a built-in virtual network card or virtual bridge, the virtual network card is made into a DHCP mode, the built-in IP can be automatically acquired in the virtual machine or the container, the network card is subsequently special for data transmission, the virtual bridge is special, an external network bridge needs to be created and the IP and mac are configured when the virtual machine or the container is started, the control layer carries out DHCP simulation, and the network DHCP mode is different from that of the virtual network card:
a) When the virtual machine or the KATA container is inside, the network card configuration needs to be protected, so that the change caused by misoperation of a user is prevented; the built-in acquisition module can check the network card configuration at regular time, and if the network card configuration is found to be modified, the network card configuration is automatically restored to an initial state;
b) The mac of the built-in network card needs to be distinguished from the normally allocated network card mac, for example, the mac of the user service network card is 00:16:3e, and the mac of the built-in network card needs to be allocated as 00:34:32 for special identification.
3) A virtual switch special for monitoring data acquisition is needed to be built in each physical machine of the cloud platform, all built-in network cards are connected to the virtual switch, a virtual bridge is distributed for each virtual machine or container, and the virtual network cards or the direct connected containers are connected; the receiving module is also connected to the exchange via a virtual bridge over which a receiving IP is assigned:
a) The virtual switch needs to provide a DHCP function, such as dnsmasq or other custom DHCP, and allocates built-in IP for built-in virtual network cards, and because the service-related network cards of the virtual machine or the container are connected with the service network switch, the virtual machine or the container cannot be influenced by the DHCP;
b) As in 2 above), virtual bridges other than KATA containers need to allocate IP and mac, and the control layer simulates DHCP allocation, marks the IP as allocated in the DHCP server, prevents allocation to other virtual machines or KATA containers, and can implement full-automatic allocation; the method can also be used for segmentation, wherein one section of IP is used for virtual machines and KATA containers and is configured to DHCP, and the other section of IP is used for IP allocation of non-KATA containers, so that the automatic allocation difficulty is reduced;
c) The IP sections corresponding to the virtual switches on each host are different, so that global scheduling is convenient; in order to prevent the conflict between the service network segment in the virtual machine or the container and the built-in monitoring network segment, the network segment can be dynamically scheduled to other hosts when the starting-up scheduling or the subsequent internal monitoring/detecting module senses that the network segment conflict exists, so that the network segments are ensured to be different as much as possible.
4) The detection module has two main uses: detecting whether the acquisition module and the sending module are normal; detecting whether a conflict exists between a service network and a monitoring network:
a) If the conflict exists, reporting is carried out through the sending module, after the receiving module receives the conflict, reporting is carried out to the management end through the fault reporting module, and the management end searches hosts of other monitoring network segments to carry out scheduling migration, so that isolation between a service network and the monitoring network segments is ensured;
b) According to mac address rule, detecting which IP is the IP of the monitoring network, configuring static route for the IP, preventing the IP from becoming default route and affecting service;
5) The acquisition module can acquire data according to a pre-defined script, and can configure different acquisition intervals for different monitoring items, so that optimization can be performed for different monitoring items, and CPU occupation of a virtual machine or a container is reduced:
a) Custom scripts require configuration of the execution timeout interval to prevent blocking of subsequent monitoring item acquisitions due to excessive time.
6) The sending module is responsible for sending the collected data, the module is responsible for monitoring the built-in IP of the virtual network card, and carrying out multicast sending in a UDP mode instead of sending through fixed Linux Socket communication:
a) The sending module needs to identify the IP of the monitoring network according to the mac rule, only binds the IP of the monitoring network and the port to send the message, and because the message is based on the UDP protocol, the message does not need to be confirmed, so that the successful triggering and dispatching of the message sending can be ensured even when the service network and the monitoring network segment are repeated, and the problem of network segment conflict is solved;
b) The module mainly considers the migration problem of the virtual machine or the IP range change problem caused by other factors of the DHCP through multicast, and the IP change of the receiving module cannot be perceived in the virtual machine or the container;
c) Because the multicast mechanism is adopted, other virtual machines or containers can also receive multicast messages, so that the format of the multicast messages needs to be regulated, multicast inhibition is carried out on the virtual switch layer, only a receiving module is allowed to pass the receiving, other virtual bridges uniformly disable the messages in the format, and the measure can effectively prevent multicast storm;
d) Different sending intervals can be configured for different monitoring items, so that message frequency is reduced, and the burden of a receiving module is reduced;
e) For a scene that some monitoring items need to calculate an average value, for example, the bandwidth rate of a network card, the sending module can calculate, and the calculation pressure of the receiving module is further reduced by calculating a (currently acquired monitoring value-last acquired monitoring value)/sending interval formula, wherein the sending interval needs to be larger than the acquisition interval under the scene;
f) The transmit message format needs to contain the following 5 elements: monitoring message identification, mac information, monitoring items, monitoring values and sending time, wherein the monitoring message identification is used for multicast suppression identification, and the mac information is used for determining the uniqueness of resources.
7) The receiving module is responsible for monitoring broadcast messages, the received messages are cached, the messages can be cached in the memory or written in the file, monitoring data are exposed to the outside in an API or file mode, and other programs in the host can access the monitoring data to perform other management control:
a) Aiming at mac information carried by data sent by a message, the mac information is converted into a virtual machine ID or a container ID through external mapping comparison, so that external program call or inquiry is facilitated;
b) When in storage, virtual machine ID or container ID and monitoring item are used as unique keys;
c) If the sending time and the current time of the received message exceed a certain threshold value, discarding the message;
d) Different preservation strategies may be configured: the history data can be recorded by adopting rrd or other lightweight database records when the file is recorded, more data can be saved, and the data is saved for 1 day by default; storing according to the configuration items when the cache records are cached, and only storing data within 5 minutes by default;
e) When new monitoring data cannot be acquired in a certain time, reporting a fault, and triggering a fault recovery strategy;
8) The fault reporting module is responsible for reporting faults to a management end through an external management network, and mainly reports two types of faults: network segment collision and monitoring failure:
9) After the management end receives the fault report, the management end analyzes the fault content, and can execute the following strategies: 1. migrating a virtual machine or container to other physical hosts; 2. if multiple copies exist in the virtual machine or the container, the restart is attempted under the condition of ensuring that the service is not affected:
a) For network segment conflict, only strategy 1 is selected, the network segment conflict is scheduled to other hosts, and the monitoring network segment is switched;
b) For the fault 2, the strategy 1 can be executed first, if the problem still exists after the execution, the strategy 2 is executed, and if the fault still exists after the execution, the alarm manual intervention is generated to solve the problem.
The present embodiment also provides a deployment device of a physical machine, which is used to implement the foregoing embodiments and preferred embodiments, and the description is omitted herein. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a deployment apparatus of a physical machine, as shown in fig. 7, including:
an obtaining module 701, configured to obtain a virtual machine and a container creation template, and deploy the virtual machine and at least one type of container in a physical machine through the virtual machine and the container creation template; the virtual machine and the container creation template are internally provided with a virtual network card or a virtual network bridge;
the deployment module 702 is configured to integrate the deployment acquisition module, the sending module, and the virtual network card in the virtual machine and at least one type of container, respectively, and deploy the receiving module and the virtual switch in the physical machine, so as to monitor the cloud platform hybrid resource; the sending module is connected with the acquisition module, and the receiving module is connected with the virtual switch.
The embodiment also provides a device for uniformly monitoring the virtual machine and the container, which is used for realizing the embodiment and the preferred implementation manner, and the description is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The embodiment provides a device for uniformly monitoring a virtual machine and a container, as shown in fig. 2, including: the management terminal 201 and the at least one physical machine 202, wherein the management terminal 201 is connected with the at least one physical machine 202; wherein physical machine 202 comprises virtual machine 203, at least one type of container 204, virtual switch 205, and receiving module 206; virtual machine 203 and at least one type of container 204 are connected to virtual switch 205 through virtual bridge 207, virtual switch 205 being connected to receiving module 206 through virtual bridge 207;
the virtual machine 203 is configured to collect cloud platform hybrid resource monitoring data, and transmit the cloud platform hybrid resource monitoring data to the receiving module 206 through the virtual bridge 207 and the virtual switch 205;
A container 204, configured to collect cloud platform hybrid resource monitoring data, and transmit the cloud platform hybrid resource monitoring data to a receiving module 206 through a virtual bridge 207 and a virtual switch 205;
and the receiving module 206 is configured to receive and store the cloud platform hybrid resource monitoring data.
In some alternative embodiments, both the virtual machine 203 and the container 204 are deployed with an acquisition module 208, a transmission module 209; the acquisition module 208 is connected with the transmission module 209, and the transmission module is connected with the virtual switch 205 through the virtual network card 210 and/or the virtual network bridge 207;
the acquisition module 208 is configured to acquire a custom script, acquire cloud platform hybrid resource monitoring data according to a preset time interval based on the custom script, and transmit the cloud platform hybrid resource monitoring data to the sending module 209;
the sending module 209 is configured to transmit the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card 210 and/or the virtual bridge 207, and the virtual switch 205 according to a preset sending interval.
In some alternative embodiments, virtual machine 203 and container 204 are also deployed with and detection module 211;
the detection module 211 is configured to detect a network segment collision, generate network segment collision detection data, and send the network segment collision detection data to the receiving module 206 through the sending module 209, the virtual network card 210 and/or the virtual network bridge 207, and the virtual switch 205.
In some alternative embodiments, further comprising: a fault reporting module 212;
the fault reporting module 212 is configured to obtain fault data of the physical machine, analyze the fault data of the physical machine, and generate a fault recovery policy; the physical machine fault data comprise network segment conflict detection data and monitoring fault data.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The deployment device of a physical machine and the device for unified monitoring of a virtual machine and a container in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit ) circuits, processors and memories that execute one or more software or firmware programs, and/or other devices that can provide the above functions.
The embodiment of the invention also provides computer equipment, which is provided with the device for uniformly monitoring the virtual machine and the container shown in the figure 2 or the deployment device of the physical machine shown in the figure 7.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 8, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 8.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device further comprises input means 30 and output means 40. The processor 10, memory 20, input device 30, and output device 40 may be connected by a bus or other means, for example in fig. 8.
The input device 30 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointer stick, one or more mouse buttons, a trackball, a joystick, and the like. The output means 40 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, displays and plasma displays. In some alternative implementations, the display device may be a touch screen.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (21)

1. A method for deploying a physical machine, the method comprising:
obtaining a virtual machine and a container creation template, and arranging the virtual machine and at least one type of container in a physical machine through the virtual machine and the container creation template; wherein, the virtual machine and the container creation template are internally provided with a virtual network card or a virtual network bridge;
integrating a deployment acquisition module and a transmission module in the virtual machine and the at least one type of container respectively, and deploying a receiving module and a virtual switch in the physical machine to realize monitoring of cloud platform mixed resources; the acquisition module is connected with the sending module, and the receiving module is connected with the virtual switch.
2. The method as recited in claim 1, further comprising:
integrating a deployment detection module in the virtual machine and the at least one type of container respectively, and deploying a fault reporting module in the physical machine; the detection module is connected with the sending module, and the fault reporting module is connected with the receiving module.
3. The method as recited in claim 1, further comprising:
deploying the virtual machine and the at least one type of container in the physical machine by container mirroring; wherein the container mirror image is internally provided with the virtual network card or the virtual network bridge.
4. The method as recited in claim 1, further comprising:
configuring virtual bridges for the virtual machine, the at least one type of container, and the receiving module, respectively, using a virtual switch; the sending module is connected with the virtual switch through the virtual network card and/or the virtual network bridge, and the receiving module is connected with the virtual switch through the virtual network bridge.
5. A method for unified monitoring of a virtual machine and a container, which is applied to a device for unified monitoring of a virtual machine and a container, the device comprising a management end and at least one physical machine, the physical machine being deployed in the device for unified monitoring of a virtual machine and a container by adopting the deployment method of the physical machine according to any one of claims 1 to 4, the method comprising:
collecting cloud platform hybrid resource monitoring data through a virtual machine and at least one type of container, and transmitting the cloud platform hybrid resource monitoring data to a receiving module through a virtual network bridge and a virtual switch;
and receiving and storing the cloud platform hybrid resource monitoring data through the receiving module.
6. The method of claim 5, wherein collecting cloud platform hybrid resource monitoring data via a virtual machine and at least one type of container and transmitting the cloud platform hybrid resource monitoring data to a receiving module via a virtual bridge and a virtual switch, comprises:
The acquisition module acquires a custom script, acquires the cloud platform mixed resource monitoring data according to a preset time interval based on the custom script, and transmits the cloud platform mixed resource monitoring data to the transmission module;
and the sending module transmits the cloud platform mixed resource monitoring data to the receiving module through the virtual network card and/or the virtual network bridge and the virtual switch according to a preset sending interval.
7. The method according to claim 6, wherein the transmitting module transmits the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card and/or the virtual bridge at a preset transmission interval, and the virtual switch includes:
the sending module converts the cloud platform mixed resource monitoring data into a mixed resource monitoring message by using a preset message format;
the sending module utilizes a user datagram protocol to send the mixed resource monitoring message to the virtual switch through the virtual network card and/or the virtual bridge group;
and the virtual switch receives the mixed resource monitoring message, performs multicast suppression on the mixed resource monitoring message, and transmits the mixed resource monitoring message after multicast suppression to the receiving module.
8. The method of claim 7, wherein the transmitting module converts the cloud platform hybrid resource monitoring data into a hybrid resource monitoring message using a preset message format, comprising:
the sending module obtains a physical address, sending time and a monitoring message identifier, and generates the mixed resource monitoring message based on the cloud platform mixed resource monitoring data, the physical address, the sending time and the monitoring message identifier; the cloud platform mixed resource monitoring data comprises monitoring items and monitoring values.
9. The method of claim 8, wherein the transmitting module converts the cloud platform hybrid resource monitoring data into a hybrid resource monitoring message using a preset message format, further comprising:
and the sending module calculates the resource difference amount based on the preset sending interval and the monitoring value, and generates the mixed resource monitoring message based on the cloud platform mixed resource monitoring data, the resource difference amount, the physical address, the sending time and the monitoring message identifier.
10. The method of claim 8, further comprising, prior to said collecting cloud platform hybrid resource monitoring data by the virtual machine and the at least one type of container and transmitting the cloud platform hybrid resource monitoring data to the receiving module via the virtual network card and/or the virtual bridge, and the virtual switch:
And the virtual switch utilizes a dynamic host configuration protocol to respectively allocate monitoring network addresses for the virtual network card and the virtual network bridge.
11. The method according to claim 10, wherein the transmitting module transmits the cloud platform hybrid resource monitoring data to the receiving module through the virtual network card and/or the virtual bridge at a preset transmission interval, and the virtual switch further comprises:
the sending module obtains the monitoring network address, binds the monitoring network address and the mixed resource monitoring message after multicast inhibition to generate a monitoring broadcast message, and transmits the monitoring broadcast message to the receiving module through the virtual network card and/or the virtual network bridge and the virtual switch.
12. The method of claim 11, wherein the receiving and storing, by the receiving module, the cloud platform hybrid resource monitoring data comprises:
the receiving module receives the mixed resource monitoring message after the multicast suppression, and determines the physical address and the monitoring item based on the mixed resource monitoring message after the multicast suppression;
The receiving module generates a virtual machine identifier or a container identifier by utilizing external mapping comparison based on the physical address;
the receiving module generates a calling identifier based on the monitoring item and the virtual machine identifier or the container identifier;
and the receiving module stores the calling identification and the monitoring broadcast message.
13. The method of claim 12, wherein the receiving module storing the call identifier and the monitoring broadcast message comprises:
and the receiving module stores the calling identification and the monitoring broadcast message into a database.
14. The method of claim 12, wherein the receiving module stores the call identifier and the monitoring broadcast message, further comprising:
and the receiving module writes the calling identifier and the monitoring broadcast message into a monitoring file, and broadcasts the monitoring file so that other physical machines call the monitoring broadcast message.
15. The method as recited in claim 6, further comprising:
the method comprises the steps of obtaining physical machine fault data through a fault reporting module, transmitting the physical machine fault data to a management end, analyzing the physical machine fault data through the management end, and generating a fault recovery strategy; the physical machine fault data comprise network segment conflict detection data and monitoring fault data.
16. The method of claim 15, wherein the obtaining physical machine fault data by the fault reporting module, transmitting the physical machine fault data to the management end, and analyzing the physical machine fault data by the management end, generating a fault recovery policy, includes:
the detection module detects network segment conflict, generates network segment conflict detection data, and transmits the network segment conflict detection data to the management end through the transmission module, the virtual network card and/or the virtual network bridge and the virtual switch through the receiving module and the fault reporting module;
when the receiving module does not acquire the cloud platform mixed resource monitoring data within a preset time period, generating monitoring fault data, and transmitting the monitoring fault data to the management end through the fault reporting module;
and the management end receives the network segment conflict detection data and the monitoring fault data, and migrates the virtual machine and the at least one type of container to other physical machines based on the network segment conflict detection data or the monitoring fault data.
17. The method of claim 16, wherein the obtaining physical machine fault data by the fault reporting module and analyzing the physical machine fault data to generate a fault recovery policy further comprises:
When the management end migrates the virtual machine and the at least one type of container to other physical machines and the receiving module obtains the monitoring fault data, the management end controls the virtual machine and the at least one type of container to restart.
18. A deployment apparatus for a physical machine, comprising:
an acquisition module for acquiring a virtual machine and a container creation template by which the virtual machine and at least one type of container are deployed in a physical machine; wherein, the virtual machine and the container creation template are internally provided with a virtual network card or a virtual network bridge;
the deployment module is used for integrating and deploying the acquisition module, the sending module and the virtual network card in the virtual machine and the at least one type of container respectively, and deploying the receiving module and the virtual switch in the physical machine so as to realize monitoring of cloud platform mixed resources; the sending module is connected with the collecting module, and the receiving module is connected with the virtual switch.
19. The utility model provides a device of virtual machine and container unified control which characterized in that includes: the system comprises a management end and at least one physical machine, wherein the management end is connected with the at least one physical machine; wherein the physical machine comprises a virtual machine, at least one type of container, a virtual switch and a receiving module; the virtual machine and the container are connected with the virtual switch through a virtual network bridge, and the virtual switch is connected with the receiving module through the virtual network bridge;
The virtual machine is used for collecting cloud platform mixed resource monitoring data and transmitting the cloud platform mixed resource monitoring data to the receiving module through the virtual network bridge and the virtual switch;
the container is used for collecting the cloud platform mixed resource monitoring data and transmitting the cloud platform mixed resource monitoring data to the receiving module through the virtual network bridge and the virtual switch;
and the receiving module is used for receiving and storing the cloud platform hybrid resource monitoring data.
20. A computer device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions stored therein, the processor executing the computer instructions to perform the method of deploying a physical machine according to any one of claims 1 to 4 or to perform the method of unified monitoring of a virtual machine and a container according to any one of claims 5 to 17.
21. A computer-readable storage medium, wherein computer instructions for causing a computer to perform the deployment method of the physical machine of any one of claims 1 to 4 or the method of unified monitoring of the virtual machine and container of any one of claims 5 to 17 are stored on the computer-readable storage medium.
CN202311093064.6A 2023-08-29 2023-08-29 Physical machine deployment method, virtual machine and container unified monitoring method and device Active CN116820686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311093064.6A CN116820686B (en) 2023-08-29 2023-08-29 Physical machine deployment method, virtual machine and container unified monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311093064.6A CN116820686B (en) 2023-08-29 2023-08-29 Physical machine deployment method, virtual machine and container unified monitoring method and device

Publications (2)

Publication Number Publication Date
CN116820686A true CN116820686A (en) 2023-09-29
CN116820686B CN116820686B (en) 2024-01-09

Family

ID=88118775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311093064.6A Active CN116820686B (en) 2023-08-29 2023-08-29 Physical machine deployment method, virtual machine and container unified monitoring method and device

Country Status (1)

Country Link
CN (1) CN116820686B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329799A (en) * 2017-05-22 2017-11-07 国网安徽省电力公司信息通信分公司 A kind of fusion Docker containers and the system of KVM virtualization technology
CN108418705A (en) * 2018-01-29 2018-08-17 山东汇贸电子口岸有限公司 Virtual machine mixes the virtual network management method and system of nested framework with container
CN108694068A (en) * 2017-03-29 2018-10-23 丛林网络公司 For the method and system in virtual environment
CN109324876A (en) * 2018-10-12 2019-02-12 西安交通大学 A kind of Docker of High Availabitity and virtual machine initial placement method
CN111970151A (en) * 2020-08-21 2020-11-20 中国建设银行股份有限公司 Flow fault positioning method and system for virtual and container network
CN112398687A (en) * 2020-11-13 2021-02-23 广东省华南技术转移中心有限公司 Configuration method of cloud computing network, cloud computing network system and storage medium
WO2021136311A1 (en) * 2019-12-30 2021-07-08 华为技术有限公司 Method and device for communication between vpcs
CN115617456A (en) * 2022-10-17 2023-01-17 北京知道未来信息技术有限公司 Method and device for hybrid operation of virtual machine and container, electronic equipment and readable storage medium
CN116225618A (en) * 2023-03-02 2023-06-06 统信软件技术有限公司 Method for starting virtual machine based on container mirror image and virtual machine starting device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108694068A (en) * 2017-03-29 2018-10-23 丛林网络公司 For the method and system in virtual environment
CN107329799A (en) * 2017-05-22 2017-11-07 国网安徽省电力公司信息通信分公司 A kind of fusion Docker containers and the system of KVM virtualization technology
CN108418705A (en) * 2018-01-29 2018-08-17 山东汇贸电子口岸有限公司 Virtual machine mixes the virtual network management method and system of nested framework with container
CN109324876A (en) * 2018-10-12 2019-02-12 西安交通大学 A kind of Docker of High Availabitity and virtual machine initial placement method
WO2021136311A1 (en) * 2019-12-30 2021-07-08 华为技术有限公司 Method and device for communication between vpcs
CN111970151A (en) * 2020-08-21 2020-11-20 中国建设银行股份有限公司 Flow fault positioning method and system for virtual and container network
CN112398687A (en) * 2020-11-13 2021-02-23 广东省华南技术转移中心有限公司 Configuration method of cloud computing network, cloud computing network system and storage medium
CN115617456A (en) * 2022-10-17 2023-01-17 北京知道未来信息技术有限公司 Method and device for hybrid operation of virtual machine and container, electronic equipment and readable storage medium
CN116225618A (en) * 2023-03-02 2023-06-06 统信软件技术有限公司 Method for starting virtual machine based on container mirror image and virtual machine starting device

Also Published As

Publication number Publication date
CN116820686B (en) 2024-01-09

Similar Documents

Publication Publication Date Title
US11687422B2 (en) Server clustering in a computing-on-demand system
CN108206847B (en) CDN management system, method and device
US8910172B2 (en) Application resource switchover systems and methods
CN106302565B (en) Scheduling method and system of service server
US8015275B2 (en) Computer product, method, and apparatus for managing operations of servers
US8387013B2 (en) Method, apparatus, and computer product for managing operation
US20080263390A1 (en) Cluster system and failover method for cluster system
US9223606B1 (en) Automatically configuring and maintaining cluster level high availability of a virtual machine running an application according to an application level specified service level agreement
US20140032753A1 (en) Computer system and node search method
WO2016037479A1 (en) Method, device and system for optimizing virtualized network function (vnf)
CN110365762B (en) Service processing method, device, equipment and storage medium
US11706080B2 (en) Providing dynamic serviceability for software-defined data centers
US20120233305A1 (en) Method, apparatus, and computer product for managing operation
CN103677858A (en) Method, system and device for managing virtual machine software in cloud environment
US20070237162A1 (en) Method, apparatus, and computer product for processing resource change
CN111343219B (en) Computing service cloud platform
KR20160136489A (en) Method for Resource Management base of Virtualization for cloud service
WO2018137520A1 (en) Service recovery method and apparatus
WO2019153532A1 (en) Deployment method and apparatus for monitoring system, and computer device and storage medium
US20170033980A1 (en) Agent manager for distributed transaction monitoring system
US9317355B2 (en) Dynamically determining an external systems management application to report system errors
CN112948008A (en) Ironic based physical bare computer management method
CN116820686B (en) Physical machine deployment method, virtual machine and container unified monitoring method and device
CN109495298B (en) Method and device for managing nodes in OpenStack system
WO2019241199A1 (en) System and method for predictive maintenance of networked devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant