A virtual machine management system, method and medium

By deploying a virtual machine manager on each worker node of the Kubernetes cluster to replace the libvirtd process, unified virtual machine management of multiple Pods is achieved, solving the problems of system resource waste and redundancy, and improving the integrity and ease of use of virtualization functions.

CN115080187BActive Publication Date: 2026-02-27LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210762433.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2026-02-27
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

In existing technologies, Kubernetes clusters need to start a libvirtd process for each Pod when managing virtual machines, which leads to waste and redundancy of system resources and is not convenient for cluster management of virtual machines.

Method used

Deploy a virtual machine manager on each worker node to replace the libvirtd process that starts automatically in multiple Pods. This provides a unified management portal for managing virtual machines in multiple Pods, reducing redundant components and improving system resource utilization and ease of use.

Benefits of technology

By unifying the management of virtual machines, system resource waste is reduced, the integrity and ease of use of virtualization functions are improved, and the management inconvenience caused by redundant components is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080187B_ABST
    Figure CN115080187B_ABST
Patent Text Reader

Abstract

The application provides a virtual machine management system, method and medium. For a container orchestration cluster including a control node and multiple working nodes, a virtual machine manager can be deployed in each working node to replace a libvirtd process originally started by each Pod component in the working node, and the virtual machine manager is connected with each Pod in the working node and the control node to respond to a virtual machine management instruction, so that the virtual machine in multiple Pods is managed through the unified management entrance. Compared with starting a libvirtd process in each Pod to manage the virtual machine in the Pod, the system resource waste caused by starting a large number of repeated libvirtd processes in multiple working nodes is avoided, and the integrity and usability of the virtualization function are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application mainly relates to the technical field of cloud computing, and more particularly to a virtual machine management system, method and medium. BACKGROUND

[0002] With the development of cloud computing technology, the demand for virtualization of cloud platforms is increasing, and the application demand is no longer a single scenario of virtual machines or containers. Taking a kubernetes (k8s for short) cluster as an example, the cluster can use a Pod containing multiple application containers related to business as a basic application load, and is required to create a virtual machine as a certain complex business load to exert the advantages of virtualization and meet the demand of extensive application.

[0003] To this end, the kubevirt plug-in is usually deployed in the cluster to run the virtual machine, so that the k8s cluster can support the simultaneous running of application containers and virtual machines. In the implementation process, a Pod (container set) can be allocated for each virtual machine, and virt-launcher (virtual machine life cycle management), libvirtd (virtual machine management service) and qemu (user mode simulator and virtual machine monitor, referred to as virtual machine management component) are started in the Pod to realize independent management of the virtual machine, but it is not convenient for the virtual machine to be managed based on the node cluster, and the core functional components are redundant, causing a large waste of system resources. SUMMARY

[0004] Therefore, the present application provides a virtual machine management system, which comprises:

[0005] a container orchestration cluster composed of a control node and a plurality of worker nodes, and a virtual machine manager is deployed in each worker node;

[0006] The virtual machine manager is configured to respond to a virtual machine management instruction, and is connected in communication with the control node and each Pod created by the worker node, so as to manage the virtual machine in the Pod.

[0007] Optionally, the system further comprises:

[0008] a cloud management platform configured to be connected in communication with the virtual machine manager of each of the control node and the plurality of worker nodes, so as to uniformly manage all virtual machines of the plurality of worker nodes.

[0009] Optionally, the virtual machine manager comprises an application communication interface, a core manager and a data converter, wherein:

[0010] The application communication interface is configured to be connected with the cloud management platform to support the cloud management platform to manage the working node;

[0011] The data converter is configured to listen to the Pod update state of the corresponding working node in the database deployed by the control node, obtain the corresponding virtual machine configuration file, and convert the virtual machine configuration file into a control command of the virtualization simulation component in the corresponding Pod.

[0012] The core manager is configured to respond to the virtual machine management instruction, be connected with the virtualization simulation component in each Pod created by the working node, obtain the IP address of the each Pod, respond to the control command according to the IP address, start the virtual machine management of the corresponding virtualization simulation component, and update the virtual machine state in the database.

[0013] Optionally, the virtual machine manager further comprises:

[0014] The communication expansion interface is configured to connect external devices to realize the business function expansion of each Pod created by the working node; and / or,

[0015] The cloud management platform is connected with the virtual machine manager deployed by each of the plurality of working nodes through a rest communication mechanism; and the application communication interface of the virtual machine manager comprises an application program interface conforming to the rest communication mechanism.

[0016] The core manager adopts a uniform resource identifier (URI) network to connect the virtualization simulation component of each Pod created by the working node.

[0017] The application further provides a virtual machine management method, which comprises:

[0018] Deploying a virtual machine manager in each of the plurality of working nodes of the container orchestration cluster;

[0019] The virtual machine manager is connected with each Pod created by the working node and a control node of the container orchestration cluster in response to a virtual machine management instruction;

[0020] The virtual machine management of each Pod in the working node is realized by the virtual machine manager.

[0021] Optionally, the virtual machine management of each Pod in the working node by the virtual machine manager comprises:

[0022] The virtual machine manager listens to the Pod update state of the corresponding working node in the database deployed by the control node, and obtains the corresponding virtual machine configuration file.

[0023] convert the virtual machine configuration file into a control command for the virtualization simulation component in the corresponding Pod;

[0024] start the virtual machine management of the corresponding virtualization simulation component according to the IP address of the Pod and the control command, and update the virtual machine state in the database.

[0025] Optionally, the obtaining of the corresponding virtual machine configuration file comprises:

[0026] obtain a Pod creation success event, trigger a virtual machine creation process for the created Pod, and obtain the corresponding Pod configuration file in the first language configured by the control node;

[0027] convert the Pod configuration file into a virtual machine configuration file in the second language.

[0028] Optionally, the starting of the virtual machine management of the corresponding virtualization simulation component according to the control command and the updating of the virtual machine state in the database comprise:

[0029] start the virtualization simulation component of the application container of the corresponding Pod, and create a virtual machine according to the control command;

[0030] determine that the virtual machine is successfully started, feed back the state information of the created virtual machine to the control node, and update the virtual machine state in the database of the control node.

[0031] Optionally, the method further comprises:

[0032] the cloud management platform obtains an application control instruction for a virtual machine created in at least one Pod of different worker nodes;

[0033] send the application control instruction to a virtual machine manager deployed on the corresponding worker node;

[0034] trigger a preset operation on the virtual machine created in the corresponding Pod by the virtual machine manager according to the application control instruction.

[0035] The application further provides a computer readable storage medium, which stores a plurality of computer instructions, the computer instructions are loaded and executed by a processor, and the computer instructions realize the method for realizing virtual machine management.

[0036] It can be seen that the application provides a virtual machine management system, method and medium. For a container orchestration cluster including a control node and multiple working nodes, a virtual machine manager can be deployed in each working node to replace a libvirtd process originally started by each Pod component in the working node, to respond to a virtual machine management instruction, so that the virtual machine manager is connected with each Pod in the working node and the control node, and the management of virtual machines in multiple Pods is realized through the unified management portal. Compared with starting a libvirtd process in each Pod to manage the virtual machine in the Pod, the system resource waste caused by starting a large number of repeated libvirtd processes in multiple working nodes is avoided, and the integrity and ease of use of the virtualization function are improved. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.

[0038] Figure 1 Structure schematic diagram of an optional example of the virtual machine management system proposed in the present application;

[0039] Figure 2 Structure schematic diagram of another optional example of the virtual machine management system proposed in the present application;

[0040] Figure 3 Structure schematic diagram of another optional example of the virtual machine management system proposed in the present application;

[0041] Figure 4 Structure schematic diagram of an optional example of the virtual machine manager of any working node of the container orchestration cluster in the virtual machine management system proposed in the present application;

[0042] Figure 5 Virtual machine configuration process schematic diagram of the virtual machine management system proposed in the present application;

[0043] Figure 6 Flow schematic diagram of an optional example of the virtual machine management method proposed in the present application;

[0044] Figure 7 Flow schematic diagram of another optional example of the virtual machine management method proposed in the present application;

[0045] Figure 8a Flow schematic diagram of another optional example of the virtual machine management method proposed in the present application;

[0046] Figure 8b A flowchart of another optional example of the virtual machine management method proposed in the present application;

[0047] Figure 9 A flowchart of another optional example of the virtual machine management method proposed in the present application;

[0048] Figure 10 A structural diagram of an optional example of the virtual machine management device proposed in the present application;

[0049] Figure 11 A structural diagram of another optional example of the virtual machine management device proposed in the present application. DETAILED DESCRIPTION

[0050] For the description in the background section, in order to save system resources such as a kubernetes (k8s for short) cluster and improve the convenience of virtual machine (vm for short) management, the present application proposes to deploy a virtual machine manager (vm-virt) in any worker node in the cluster, replace the libvirtd (virtual machine management service) process / component started by each Pod created by the worker node, realize the management of virtual machines in all Pods created in the worker node, reduce the number of components running inside the Pod, and avoid a large number of repeated libvirtd processes on the worker node and the waste of resources of a libvirtd process managing a virtual machine of a Pod.

[0051] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0052] Reference Figure 1 A structural diagram of an optional example of the virtual machine management system proposed in the present application, which can include a container orchestration cluster composed of a control node (Master node) 100 and multiple worker nodes (Worker node) 200, and a virtual machine manager 210 deployed in each worker node 200. In actual application, the virtual machine manager 200 can be used to respond to virtual machine management instructions, communicate with the control node 100 and each Pod (container set) 220 created by the worker node 200, and realize the management of virtual machines in each Pod 220.

[0053] The container orchestration cluster can include a kubernetes cluster. The application embodiments do not make a detailed description of how to determine the control node 100 from the multiple nodes included in the cluster management system and the basic structures of the control node 100 and the other worker nodes 200, which can be determined as appropriate. In actual applications, the nodes included in the container orchestration cluster can be computer devices such as servers or terminals. The server can include one or more physical servers or cloud servers. The terminal can be an electronic device with certain computing power. The device type of each node can be determined according to the scene requirements.

[0054] For example, as shown in the structural schematic diagram of the virtual machine management system, Figure 2 The control node 100 of the kubernetes cluster can include an interface server (API server) 110, a scheduler 120, a database (such as an etcd distributed key-value storage system) 130, and a virtual machine controller (vm-controller) 140. In order to implement the virtual machine management method proposed in the application, an application interface for implementing virtual machine management is deployed in the API server, denoted as vm-api, etc. It should be noted that the structural components of the control node 100 include but are not limited to the components listed in the embodiments, which can be flexibly adjusted and configured according to application requirements. The application embodiments do not make a detailed description here.

[0055] In the actual application of the control node 100, the API server is used to process API operations. The component can be connected with other components in the kubernetes cluster, and message transmission between different components is realized through the API server. The scheduler can be used to complete the container scheduling in the worker node, such as placing the user-submitted container on a suitable worker node according to the CPU, memory request size, and other information of the container. The etcd distributed storage system can be used to store the required information in the API server, and the high availability of the entire control node 100 component is ensured by using the characteristics of the high-availability system. The distributed storage structure and working principle of etcd are not described in the application. The virtual machine controller can be used to implement the management of the cluster state and the virtual machine. The management implementation method is not described in the application and can be determined as appropriate.

[0056] For any worker node 200 in the kubernetes cluster, in addition to deploying the virtual machine manager 210 and at least one Pod 220, according to the application processing requirements, a kubelet component 230 is usually started / deployed, which is a service process running on the worker node 200, acts as a proxy for the worker node 200, monitors the Pods allocated to the worker node 200, and implements the process, which is not detailed herein. The Pod component 220 is the smallest scheduling and resource unit in the kubernetes cluster, which is composed of one or more containers, and can be created by an API server to run on a certain worker node and be scheduled and managed according to application requirements. The creation of the Pod and its working principle are not detailed herein.

[0057] It should be noted that in each Pod of the worker node, a virtualization simulation component (i.e., qemu component / process) and other basic components can be started to implement the life cycle management of the virtual machine, but the libvirtd component does not need to be started / deployed, thereby avoiding the waste of system resources.

[0058] In combination with the above description, referring to the virtual machine management system as shown in Figure 2 In the actual application of the system, the management of the life cycle of the virtual machine can be realized on the control node 100 of the kubernetes cluster through the vm-ctl (virtual machine management) tool, and the distribution of the virtual machine management instruction and the operation of the etcd data can be processed through the vm-api plug-in. The virtual machine controller (vm-controller component) can be a custom CRD (Custom Resource Definition, custom resource definition) resource controller, which is used to convert the configuration file of the CRD of the virtual machine to the Pod configuration, update the state of the CRD virtual machine, and realize the life cycle triggering of the Pod. Then, the scheduler 120 of the control node 100 can be used to select the worker node for the deployment of the Pod resource. The implementation method of the Pod resource configuration and deployment of the control node 100 of the kubernetes cluster is not detailed herein.

[0059] In addition, in the actual application of the virtual machine management system proposed in the present application, for each working node 200, the kubelet component 230 deployed in the working node 200 can manage the life cycle of each Pod in the working node 200, and a virtual machine manager (vm-virt) 210 deployed in the working node 200 can manage multiple virtual machines based on the multiple Pod components 220 managed by the kubelet component 230, including but not limited to virtual machine creation, configuration file change, etc. The implementation process can refer to but is not limited to the description of the corresponding part of the following embodiment.

[0060] In summary, the virtual machine management system proposed in the present application is constructed on the basis of a container orchestration cluster containing a control node and multiple working nodes. Specifically, a virtual machine manager can be deployed in each working node to replace the libvirtd process originally started by each Pod component in the working node to respond to virtual machine management instructions. The virtual machine manager is connected in communication with each Pod in the working node and the control node, and manages the virtual machines in multiple Pods through the unified management portal. Compared with starting a libvirtd process in each Pod to manage the virtual machines in the Pod, the virtual machine management system avoids the waste of system resources caused by starting a large number of repeated libvirtd processes in multiple working nodes, and improves the completeness and ease of use of virtualization functions.

[0061] Reference Figure 3 For another optional example of the virtual machine management system proposed in the present application, based on the composition structure of the virtual machine management system described in the above embodiment, the virtual machine management system can further include a virtualization service management platform, i.e., a cloud management platform vm-CMP (Cloud Management Platforms) 300, which can be used to communicate with the virtual machine manager 210 of each of the control node 100 and the multiple working nodes 200 to uniformly manage all virtual machines of the multiple working nodes 200, thereby realizing the management of virtual machines according to working nodes and the unified management portal to improve the ease of use of virtualization functions.

[0062] To implement virtualization management, the cloud management platform 300 can be built by one or more computer devices, which can include servers and / or electronic devices. The servers can include a physical server, a service cluster composed of multiple physical servers, a cloud server supporting cloud computing services, etc. The electronic devices can include user terminals such as computers, smart phones, smart devices, virtual reality devices, etc., by which operation instructions are obtained to implement unified management of working nodes and virtual machines in the virtualized data center resource pool (such as life cycle management, configuration, deployment, snapshot, etc. of virtual machines), monitoring and scheduling, etc. The deployment and building process of the cloud management platform 300 is not described in detail in the present application.

[0063] In some other embodiments of the present application, as shown in Figure 4 The virtual machine manager 210 deployed in any of the working nodes 200 can include but is not limited to an application communication interface 211, a data converter 212 and a core manager 213, wherein:

[0064] The application communication interface 211 can be used for communication connection with the cloud management platform 300 to support management of the working node 200 by the cloud management platform 300. Optionally, in actual applications, the cloud management platform 300 can interface with the virtual machine manager 210 on each working node 200 through a REST (Representational State Transfer, or Representational State Transfer) mode to implement unified management of all virtual machines on multiple working nodes 200 in the container orchestration cluster.

[0065] Therefore, in the virtual machine management system proposed in the present application, the cloud management platform 300 can realize communication connection with the virtual machine managers 210 deployed in multiple working nodes 200 through a rest communication mechanism. The application communication interface 211 deployed in the virtual machine manager 210 can include an application program interface conforming to the REST communication mechanism, denoted as REST API, but is not limited to the interface type under this communication mode. The interface can be configured according to the communication mechanism configured by the system, which is not described in detail in the present application.

[0066] In the application of the virtual machine management system, the business is usually split into independent services, and the communication between different services is implemented in the REST manner. The REST is a design and development method for network applications, which is usually based on the API calling method provided by the protocols such as HTTP (Hyper Text Transfer Protocol), URI (Uniform Resource Identifier), XML (Extensible Markup Language), HTML (Hyper Text Markup Language), and realizes the interaction between services. The working principle of the REST communication mechanism is not described in detail.

[0067] For the data converter 212 in the virtual machine manager 210, denoted as vm-convert, it can be used to listen to the Pod update state of the corresponding working node in the database deployed by the control node 100, obtain the corresponding virtual machine configuration file, convert the virtual machine configuration file into the control command of the virtualization simulation component in the corresponding Pod, and the implementation process can refer to but is not limited to the working process of the libvirtd process of the Pod startup of the working node of the kubernetes cluster.

[0068] Optionally, in a container orchestration cluster such as a kubernetes cluster, the cooperation of each component is usually carried out through the List-Watch listening mechanism to keep the data synchronized. The working principle of the Watch listening mechanism is not described in detail. Therefore, as shown in Figure 4 The vm-convert converter can listen to the changes of the Pods in the database etcd and process the virtual machine configuration file through the List-Watch mechanism, so as to ensure that the related information of each Pod stored in the database etcd is consistent with the actual state information of the corresponding Pod in the working node.

[0069] For the core manager 213 in the virtual machine manager 210, denoted as vm-virtd, it can be used to respond to the virtual machine management instruction, communicate with the virtualization simulation component qemu in each Pod created by the working node, obtain the IP address of the each Pod, and then respond to the control command according to the IP address, start the virtual machine management of the virtualization simulation component qemu in the corresponding Pod, and update the virtual machine state in the database etcd.

[0070] As shown in Figure 4As shown, the vm-virtd component can use a uniform resource identifier (URI) network to implement virtualization simulation component qemu (i.e., a service process) created by all pods of the working node 200, such as through the qemu+tcp: / / $pod_ip / system instruction code, to implement the URL connection mode of qemu. The data interaction implementation process of the URI connection mode of the qemu component is not described in detail.

[0071] To implement the configuration file change of the virtual machine, refer to Figure 5 The processing process diagram is shown in Figure 2 and Figure 3 The configuration file change implementation process of the virtual machine vm1 and the virtual machine vm3 is described as an example. The configuration file change process of other virtual machines is similar, and will not be described one by one. As shown in Figure 5 As shown, the basic virtual machine configuration can be defined by the CRD resource configuration of the kubernetes cluster, and the configuration implementation process will not be described in detail in the embodiments of the present application. Usually, a configuration file in the yaml (YAML Ain't Markup Language, another markup language) format, such as the virtual machine configuration file CRD.yaml, is obtained.

[0072] Then, the obtained virtual machine configuration file can be written into the etcd database through the API server to create a data table of the virtual machine vm1 to save the CRD.yaml file. The CRD.yaml file is converted into a standard resource configuration POD.yaml suitable for the kubernetes cluster by the virtual machine controller vm-controller, that is, a Pod configuration file. The scheduler in the control node 100 can implement the scheduling of multiple working nodes 200 through the election scoring decision to determine the node identifier lable of each working node 200, such as the node identifier of the working node where the virtual machine vm1 is located can be node1, the node identifier of the working node where the virtual machine vm3 is located can be node3, and the like. The content of the node identifier is not limited in the present application, as long as the accurate scheduling management of different working nodes 200 can be implemented based on the node identifier lable. The detailed description will not be described one by one.

[0073] vm-convert responds to virtual machine management commands, obtains the Pod configuration file (POD.yaml) for any virtual machine, and converts it into an XML configuration file (vm.xml) for the virtual machine. Then, it converts this vm.xml file into the standard command line of the corresponding virtual machine's QEMU component, i.e., the control commands of the virtualization emulation component described above, and sends them to vm-virtd. The core manager executes these control commands to start the QEMU component of the corresponding Pod, thus implementing virtual machine management for that Pod. Based on the aforementioned monitoring mechanism, the monitored virtual machine status information is updated in the ectd database, thereby updating the virtual machine status recorded in the ectd database to ensure data synchronization. The implementation process is not detailed in this embodiment.

[0074] In some further embodiments of this application, in conjunction with the above description of the composition of the virtual machine manager 210, the virtual machine manager 210 may further include: a communication extension interface for connecting to external devices to implement the extension of business functions for each Pod created on the working node. Therefore, in scenarios where one or more working nodes need to execute new services, the user can use external devices to call the communication extension interface in the virtual machine manager of the corresponding working node to complete the new service configuration for that working node. The configuration implementation process can refer to, but is not limited to, the process described above for changing the virtual machine configuration file. This application does not limit the communication extension interface or the method for extending the business functions of the Pod; it can be determined as appropriate.

[0075] Based on the virtual machine management system proposed in this application as described in the above embodiments, the virtual machine management method proposed in this application will be described below with examples, but is not limited to the virtual machine management method described in the following embodiments.

[0076] like Figure 6 The above is a flowchart illustrating an optional example of the virtual machine management method proposed in this application. This method can be applied to the virtual machine management system described in the above embodiments. The composition and structure of this system can be referred to the description of the above system embodiments; further details are not provided here. Figure 6 As shown, the virtual machine management method proposed in this embodiment may include:

[0077] Step S61: Deploy the respective virtual machine manager on each of the multiple worker nodes of the container orchestration cluster;

[0078] In combination with the foregoing description of the virtual machine management system, the present application proposes introducing a virtual machine manager in each worker node of a container orchestration cluster (such as the kubernetes cluster described above) to manage the virtual machines of each Pod in the worker node, avoiding starting a libvirtd process for each Pod in the worker node, i.e., the cluster starts a large number of repeated libvirtd processes to manage the virtual machines of the Pod in which the process is located, resulting in a large waste of system resources, thereby improving the utilization of system resources, and at the same time, reducing the number of components running in each Pod, improving the convenience of virtual machine management.

[0079] Step S62, in response to the virtual machine management instruction, the virtual machine manager controls the virtual machine manager to be communicatively connected with each Pod created by the worker node and the control node of the container orchestration cluster;

[0080] In the scenario where the virtual machines of one or more worker nodes of the container orchestration cluster need to be managed, the cloud management platform or the user terminal can generate a corresponding virtual machine management instruction, send the virtual machine management instruction to the virtual machine manager in the corresponding worker node through a corresponding communication mode, and the virtual machine manager responds to the virtual machine management instruction, and is communicatively connected with the control node of the container orchestration cluster and each Pod (specifically, the qemu component started by each Pod) in the worker node where the virtual machine manager is located. For example, the URI method is used to realize the communication connection between the virtual machine manager and the qemu component started by each Pod, and the process of communication connection is not described in detail in the present application.

[0081] Step S63, through the virtual machine manager, the virtual machines of each Pod in the worker node are managed.

[0082] As described above, only one virtual machine manager needs to be deployed in a worker node of the container orchestration cluster to replace the libvirtd component started by each Pod in the worker node, and the original virtual machine management function of the libvirtd component is realized. That is, through the virtual machine manager introduced in each worker node, the present application can realize unified management of the virtual machines of all Pods in the worker node, improve the integrity and ease of use of the virtualization function, and solve the technical problem caused by the serious redundancy of the core functional components (i.e., the libvirtd component) of each Pod of the container orchestration cluster.

[0083] Reference Figure 7 The flowchart of another optional example of the virtual machine management method proposed in the present application can be an optional detailed implementation method of the virtual machine management method described above, but is not limited to the detailed implementation method described in the present embodiment, such as Figure 7As shown, the refinement implementation method can include:

[0084] Step S71, deploying respective virtual machine managers in a plurality of worker nodes of the container orchestration cluster;

[0085] Step S72, in response to a virtual machine management instruction, the virtual machine manager controls the virtual machine manager to be communicatively connected with respective Pods created by the worker node and a control node of the container orchestration cluster;

[0086] For the implementation process of step S71 and step S72, refer to the description of the corresponding part of the above embodiment, and this embodiment will not be described here.

[0087] Step S73, the virtual machine manager listens to the Pod update state of the corresponding worker node in the database deployed by the control node, and obtains the corresponding virtual machine configuration file;

[0088] Step S74, converting the virtual machine configuration file into a control command of the virtualization simulation component in the corresponding Pod;

[0089] Step S75, according to the IP address of each Pod in the worker node where the virtual machine manager is located, responding to the control command, starting the corresponding virtualization simulation component to manage the virtual machine, and updating the virtual machine state in the database.

[0090] In combination with the related description of the composition structure of the virtual machine manager above, refer to the description of the corresponding part of the above Figure 4 and Figure 5 The vm-convert in the virtual machine manager listens to the changes of each Pod in the etcd database and processes the virtual machine configuration file through the list-watch mechanism, to ensure the synchronization of the virtual machine state. During the change of the virtual machine configuration file, the self-defined CDR.yaml file can be converted into a vm.xml configuration file, and then into a standard command line of the virtual machine qemu component, i.e., into a control instruction of qemu. The conversion process will not be described in detail.

[0091] For the above virtual machine manager, a REST API is provided, which can be used for unified connection management with the cloud manager vm-CMP, to realize the transmission of virtual machine management instructions, application control instructions and other messages. As the core component of the virtual machine manager, vm-virtd can obtain the IP address of each Pod in the worker node, simultaneously connect the qemu processes inside these multiple Pods through a network URI, and realize the unified management of the virtual machines of these multiple Pods.

[0092] Refer to Figure 8aAs shown in the flowchart of another optional example of the virtual machine management method proposed in the present application, the embodiment can be another optional refinement of the virtual machine management method described above, which can include Figure 8a

[0093] Step S81, deploying a respective virtual machine manager in each of the plurality of worker nodes of the container orchestration cluster;

[0094] Step S82, in response to a virtual machine management instruction, the virtual machine manager controls the communication connection between the virtual machine manager, the respective Pod created by the worker node, and the control node of the container orchestration cluster;

[0095] Step S83, the virtual machine manager listens to the Pod update state of the corresponding worker node in the database deployed by the control node;

[0096] For the implementation process of steps S81-S83, please refer to the corresponding description of the above embodiment, which will not be repeated here.

[0097] Step S84, obtaining a Pod creation success event, triggering a virtual machine creation process for the created Pod, and obtaining a corresponding Pod configuration file with a first language configured by the control node;

[0098] Step S85, converting the Pod configuration file into a virtual machine configuration file with a second language;

[0099] Step S86, converting the virtual machine configuration file into a control command for the virtualization simulation component in the corresponding Pod;

[0100] As described above in the embodiment related to the configuration file change scenario of the virtual machine, the first language can refer to the yaml language, and the second language can refer to the xml language. In the management scenario of virtual machine creation, referring to the flowchart shown in Figure 8b The kubelet component of the corresponding worker node is responsible for deploying the resource creation of the Pod where the virtual machine is located. Referring to the related description of the virtual machine configuration file change process above, after the POD resource deployment is completed, the corresponding resource state in the database etcd is updated. When the virtual machine manager in the worker node where the virtual machine is created obtains the Pod creation success event (such as the user terminal sends a virtual machine creation instruction, which generates a corresponding Pod creation success event), the process of creating a qemu virtual machine is triggered.

[0101] Then, as shown in Figure 8b ​As shown, the vm-api in the API server of the control node obtains the yaml format configuration file (i.e. CRD.yaml) of the virtual machine, writes it into the etcd database, and the virtual machine controller listens to the new virtual machine CRD resource (i.e. vm-CRD) and needs to convert it into a Pod configuration file (POD.yaml). For this, the vm-api can read the CRD.yaml file stored in the etcd database, send it to the virtual machine controller for resource conversion, and send the obtained POD.yaml to the vm-api for writing into the etcd database for storage. After the scheduler in the control node listens to the new POD.yaml file, it can bind the Pod, and the corresponding vm-api writes the determined node identifier of the corresponding worker node into the etcd database for storage.

[0102] After the kubelet of the worker node listens to the Pod resource update event, it can trigger the corresponding container to run, and after the POD resource is deployed, the corresponding resource state in the database etcd is updated. After the virtual machine converter of the worker node listens to the Pod resource update event, it needs to perform configuration file conversion processing. For this, the vm-api can send the POD.yaml file read from the etcd database to the virtual machine manager, and the virtual machine manager converts the Pod.yaml file into a virtual machine xml format configuration file (vm.xml), and writes the vm.xml file into the etcd database through the vm-api for storage. In addition, the virtual machine manager can convert the xml format configuration file into a qemu control command to start the virtual machine.

[0103] Step S87, according to the IP address of each Pod in the worker node where the virtual machine manager is located, responding to the control command, starting the virtualization simulation component of the application container of the corresponding Pod, creating a virtual machine;

[0104] Step S88, determining that the virtual machine is successfully started, feeding back the state information of the created virtual machine to the control node to update the virtual machine state in the database of the control node.

[0105] After the above description of the virtual machine creation process, the qemu control command is obtained, and the qemu process in the container of the corresponding Pod can be started according to the configuration, the communication connection between the qemu process and the virtual machine manager of the worker node is established, the virtual machine is created and started, and after determining that the virtual machine is successfully started, the latest virtual machine state information is written into the etcd database through the vm-api to update the corresponding virtual machine state of the etcd database.

[0106] Referring to Figure 9This is a flowchart illustrating another optional example of the virtual machine management method proposed in this application. This method can be applied to the virtual machine management system described in the above embodiments, such as... Figure 9 As shown, the method may include, but is not limited to:

[0107] Step S91: Deploy the respective virtual machine manager on each of the multiple worker nodes of the container orchestration cluster;

[0108] In step S92, the virtual machine manager responds to the virtual machine management instructions and controls the virtual machine manager to establish communication connections with each Pod created by the worker node and the control node of the container orchestration cluster.

[0109] Step S93: Through the virtual machine manager, manage the virtual machines of each Pod in the working node;

[0110] The implementation process of steps S91-S93 can be referred to the description of the corresponding parts of the above embodiment, and will not be repeated here.

[0111] Step S94: The cloud management platform obtains application control instructions for virtual machines created in at least one Pod on different worker nodes.

[0112] In step S95, the cloud management platform sends the application control command to the virtual machine manager deployed on the corresponding worker node.

[0113] In step S96, the virtual machine manager responds to the application's control command and triggers the virtual machine created by the corresponding Pod to perform a preset operation.

[0114] In this embodiment, the proposed virtual machine manager system introduces a cloud management platform as a virtual machine management component into the container orchestration cluster, enabling unified management of virtual machines on each worker node within the cluster. Thus, when a virtual machine on a worker node in the container orchestration cluster needs to perform a certain application operation, the user can input the corresponding application control command through the cloud management platform and send the application control command to the virtual machine manager deployed on the corresponding worker node via REST communication, thereby controlling the corresponding virtual machine to perform the preset operation.

[0115] As can be seen, the unified virtual machine management method proposed in this application enables the management of virtual machines based on worker nodes and a unified management entry point, namely the virtual machine manager of the worker node, which improves the ease of use of virtualization functions and meets a wide range of application needs.

[0116] Reference Figure 10 This is a schematic diagram of an optional example of the virtual machine management device proposed in this application. This device can be applied to the aforementioned virtual machine management system, such as... Figure 10 As shown, the device may include:

[0117] The virtual machine manager deployment module 101 is configured to deploy a respective virtual machine manager in each of the plurality of worker nodes of the container orchestration cluster;

[0118] The communication module 102 is configured to control the virtual machine manager to communicate with each Pod created in the worker node and a control node of the container orchestration cluster in response to a virtual machine management instruction.

[0119] The virtual machine management module 103 is configured to implement virtual machine management of each Pod in the worker node by the virtual machine manager.

[0120] Optionally, as shown in Figure 11 The virtual machine management module 103 can include:

[0121] The listening unit 1031 is configured to listen to a Pod update state of a corresponding worker node in a database deployed by the control node, and obtain a corresponding virtual machine configuration file.

[0122] The conversion processing unit 1032 is configured to convert the virtual machine configuration file into a control command of a virtualization simulation component in a corresponding Pod.

[0123] The virtual machine management unit 1033 is configured to start virtual machine management of the virtualization simulation component in response to the control command according to an IP address of the corresponding Pod.

[0124] The virtual machine state update unit 1034 is configured to update a virtual machine state in the database.

[0125] In some embodiments, the listening unit 1031 can include:

[0126] The Pod configuration file obtaining unit is configured to obtain a Pod creation success event, trigger a virtual machine creation process for the created Pod, and obtain a corresponding Pod configuration file configured by the control node in a first language.

[0127] The virtual machine configuration file obtaining unit is configured to convert the Pod configuration file into a virtual machine configuration file in a second language.

[0128] In yet some embodiments, the virtual machine management unit 1033 can include:

[0129] The virtual machine creation unit is configured to start a virtualization simulation component of an application container of a corresponding Pod in response to the control command, and create a virtual machine.

[0130] The virtual machine state information feedback unit is configured to determine that the virtual machine is successfully started, feed back state information of the created virtual machine to the control node, and update the virtual machine state in the database of the control node.

[0131] The virtual machine management apparatus described in the above embodiments can further include:

[0132] The application control instruction obtaining module is configured to be deployed in a cloud management platform, and obtain application control instructions for virtual machines created in at least one Pod of different worker nodes.

[0133] The application control instruction sending module is configured to send the application control instructions to a virtual machine manager deployed in the worker node.

[0134] The application execution module is configured to be deployed in the virtual machine manager, and trigger the virtual machines created in the Pod to perform a preset operation in response to the application control instructions.

[0135] It should be noted that the various modules, units, etc. in the above-described apparatus embodiments can be stored in the memory as program modules, and the processor executes the above-described program modules stored in the memory to achieve the corresponding functions. For the functions and technical effects achieved by the various program modules and their combinations, reference can be made to the descriptions of the corresponding parts of the above method embodiments, and the present embodiment will not be described again.

[0136] The present application also provides a computer readable storage medium, which can store a plurality of computer instructions, the computer instructions can be loaded and executed by a processor to implement the various steps of the virtual machine management method described in the above embodiments. The implementation process can refer to the descriptions of the corresponding parts of the above embodiments, and the present application will not be described again.

[0137] Finally, it should be noted that, in the above embodiments, unless the context clearly indicates otherwise, the words "one", "a", "an", and / or "the" do not necessarily refer to the singular, but can also include the plural. Generally, the terms "comprise" and "include" only indicate the inclusion of the steps and elements explicitly identified, and these steps and elements do not constitute an exclusive list. The process or device can also include other steps or elements. The element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, product or device comprising the element.

[0138] In the description of the embodiments of the present application, unless otherwise specified, " / " means the meaning of or, for example, A / B can mean A or B; "and / or" in this document is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0139] The terms such as "first", "second" and the like involved in the present application are only for the purpose of description, used to distinguish one operation, unit or module from another operation, unit or module, and do not necessarily require or imply any such actual relationship or order between the units, operations or modules. And it cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features, so the features with "first", "second" can explicitly or implicitly include one or more features.

[0140] In addition, each embodiment in the specification is described in a progressive or parallel manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between each embodiment can be referred to each other. For the method, device and medium disclosed by the embodiments, since it corresponds to the system disclosed by the embodiments, the description is relatively simple, and the related parts can be referred to the system part.

[0141] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1.A virtual machine management system, comprising: a container orchestration cluster composed of a control node and a plurality of worker nodes, each of the worker nodes having a virtual machine manager deployed therein; the virtual machine manager comprising an application communication interface, a core manager and a data converter, wherein: the application communication interface is configured to communicate with a cloud management platform to support the cloud management platform to manage the worker node; the data converter is configured to listen to a Pod update state of a corresponding worker node in a database deployed by the control node, obtain a corresponding virtual machine configuration file, and convert the virtual machine configuration file into a control command for a virtualization simulation component in the corresponding Pod; the core manager is configured to, in response to a virtual machine management instruction, communicate with the virtualization simulation component in each Pod created by the worker node, obtain an IP address of the each Pod, and in response to the control command, start virtual machine management on the corresponding virtualization simulation component according to the IP address, and update a virtual machine state in the database. 2.The system of claim 1, further comprising: a cloud management platform configured to communicate with the virtual machine manager of each of the control node and the plurality of worker nodes to implement unified management of all virtual machines of the plurality of worker nodes. 3.The system of claim 1, wherein the virtual machine manager further comprises: a communication extension interface configured to connect an external device to implement business function extension of each Pod created by the worker node; and / or the cloud management platform is configured to implement communication connection with the virtual machine manager of each of the plurality of worker nodes through a rest communication mechanism; and the application communication interface of the virtual machine manager comprises an application program interface conforming to the rest communication mechanism; the core manager is configured to connect the virtualization simulation component of each Pod created by the worker node using a uniform resource identifier (URI) network. 4.A virtual machine management method, comprising: deploying a virtual machine manager in each of a plurality of worker nodes of a container orchestration cluster; listening to a Pod update state of a corresponding worker node in a database deployed by a control node by the virtual machine manager to obtain a corresponding virtual machine configuration file; converting the virtual machine configuration file into a control command for a virtualization simulation component in the corresponding Pod; in response to the control command, starting virtual machine management on the corresponding virtualization simulation component according to an IP address of each Pod to update a virtual machine state in the database. 5.The method of claim 4, wherein the obtaining of the corresponding virtual machine configuration file comprises: obtaining a Pod creation success event to trigger a virtual machine creation process for the created Pod, and obtaining a corresponding Pod configuration file in a first language configured by the control node; converting the Pod configuration file into a virtual machine configuration file in a second language. ​ 6.The method of claim 4, wherein the starting, in response to the control command, the virtual machine management of the corresponding virtualization simulation component and updating the virtual machine state in the database comprises: starting, in response to the control command, a virtualization simulation component of an application container of a corresponding Pod to create a virtual machine; determining that the virtual machine is successfully started, and feeding back state information of the created virtual machine to the control node to update the virtual machine state in the database of the control node. 7.The method of claim 4, further comprising: obtaining, by a cloud management platform, an application control instruction for a virtual machine created in at least one Pod of a different worker node; sending, by the cloud management platform, the application control instruction to a virtual machine manager deployed on the corresponding worker node; triggering, by the virtual machine manager in response to the application control instruction, the virtual machine created by the corresponding Pod to perform a preset operation. 8.A computer readable storage medium having stored thereon a plurality of computer instructions, the computer instructions being loaded and executed by a processor to implement the method for implementing virtual machine management according to any one of claims 4-7. ​ ​ ​ ​ ​

Citation Information

Patent Citations

  • Method for realizing management of virtual machine by cloud native application

    CN112000439A