Virtual machine management method, device and system
By using automated management methods for Kubernetes clusters, the high costs and low efficiency caused by manual operations in virtual machine management are solved, achieving efficient, stable, and intelligent management of virtual machines.
Patent Information
- Application Number
- CN202211639582.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-12-20
AI Technical Summary
Existing virtual machine management methods rely on manual operation, resulting in high time costs, low efficiency, and poor stability.
An automated management method based on a Kubernetes cluster is adopted. By mapping the control nodes and compute nodes of the Kubernetes cluster to the physical machine management system, the automated management of virtual machines is achieved. This includes processing Pods in the compute nodes and sending requests to the physical machine management system to automatically complete operations such as virtual machine creation and deletion.
It reduces the time cost of virtual machine management, improves management efficiency, stability and reliability, and realizes intelligent management without human intervention.
Smart Images

Figure CN116126464B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a virtual machine management method, device and system. BACKGROUND
[0002] With the continuous development of cloud computing technology, the application demand of virtual machines is higher and higher, and how to effectively manage the virtual machines has also become a problem concerned by many enterprises. The current virtual machine management mode is mainly based on a work order application and human participation. Taking the application of creating a virtual machine as an example, a request user operates a work order system to submit virtual machine application information, and the work order is approved layer by layer and given to a virtual machine management user in the form of an email or a task. The virtual machine management user manually selects a suitable target physical machine cabinet from a physical machine cluster according to the application information in the work order, selects a suitable target physical machine under the target machine cabinet, and then manually creates a virtual machine on the target physical machine. After the virtual machine management user completes the creation of the virtual machine, the virtual machine management user manually replies the relevant information of the virtual machine to the request user.
[0003] The above-mentioned virtual machine management mode based on a work order application and human participation not only consumes a long time and has a high time cost of virtual machine management, but also inevitably has errors in the manual operation of the virtual machine management user, so that the efficiency and stability of the virtual machine management are relatively low and poor. SUMMARY
[0004] The present application provides a virtual machine management method, device and system to reduce the time cost of virtual machine management and improve the management efficiency and stability of virtual machine management.
[0005] In a first aspect, an embodiment of the present application provides a virtual machine management method applied to a control node of a k8s cluster, and the method comprises the following steps:
[0006] receiving a first virtual machine processing request sent by a client; the first virtual machine processing request comprising processing information of a target virtual machine to be processed;
[0007] determining a first target computing node from a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes correspond one by one to a plurality of physical machines included in a physical machine management system, and at least one virtual machine is installed on each of the physical machines;
[0008] sending a control instruction to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0009] It can be seen that, in the embodiment of the application, when the control node of the k8s cluster receives the first virtual machine management request sent by the client, the first target computing node is determined in the multiple computing nodes included in the k8s cluster, and a control instruction is sent to the first target computing node according to the processing information of the target virtual machine to be processed, so that the first target computing node performs corresponding processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and a second virtual machine processing request is sent to the physical machine management system according to the processing information, so as to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are one-to-one corresponding, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are one-to-one corresponding, therefore, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is needed in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency, stability, reliability and intelligence of the virtual machine management.
[0010] In a second aspect, the embodiment of the application provides a virtual machine management method applied to a computing node of a k8s cluster, the computing node and a physical machine included in a physical machine management system are one-to-one corresponding, at least one virtual machine is installed on each physical machine, and the method comprises:
[0011] receiving a control instruction sent by a control node of the k8s cluster; the control instruction is sent by a client to the control node, and the control instruction comprises processing information of a target virtual machine to be processed;
[0012] performing corresponding processing on a first Pod corresponding to the target virtual machine in the computing node according to the processing information;
[0013] sending a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the computing node.
[0014] It can be seen that, in the embodiments of the present application, when the computing node receives the control instruction sent by the control node of the k8s cluster, the first Pod corresponding to the target virtual machine is processed according to the processing information of the target virtual machine included in the control instruction in the computing node, and a second virtual machine processing request is sent to the physical machine management system according to the processing information to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are one-to-one corresponding, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are one-to-one corresponding, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is required in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management.
[0015] In a third aspect, the embodiments of the present application provide a virtual machine management apparatus applied to a control node of a k8s cluster, the apparatus comprising:
[0016] a receiving module configured to receive a first virtual machine processing request sent by a client; the first virtual machine processing request comprising processing information of a target virtual machine to be processed;
[0017] a determining module configured to determine a first target computing node from a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes and a plurality of physical machines included in a physical machine management system are one-to-one corresponding, and each of the physical machines has at least one virtual machine installed thereon;
[0018] a sending module configured to send a control instruction to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and to send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0019] In a fourth aspect, the embodiments of the present application provide a virtual machine management apparatus applied to a computing node of a k8s cluster; the computing node and a physical machine included in a physical machine management system are one-to-one corresponding, and each of the physical machines has at least one virtual machine installed thereon; the apparatus comprising:
[0020] receive a control instruction sent by a control node of the k8s cluster; the control instruction comprises processing information of a target virtual machine to be processed;
[0021] a processing module, configured to perform corresponding processing on a first Pod corresponding to the target virtual machine in the computing node according to the processing information;
[0022] a sending module, configured to send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0023] In a fifth aspect, an embodiment of the present application provides a virtual machine management system, which comprises a client, a k8s cluster and a physical machine management system; the k8s cluster comprises a control node and a plurality of computing nodes, the plurality of computing nodes correspond one by one to a plurality of physical machines comprised by the physical machine management system, and at least one virtual machine is installed on each of the physical machines;
[0024] The client is configured to send a first virtual machine processing request to the control node in response to a user operation; the first virtual machine processing request comprises processing information of a target virtual machine to be processed.
[0025] The control node is configured to receive the first virtual machine processing request, determine a first target computing node in the plurality of computing nodes according to the processing information, and send a control instruction to the first target computing node according to the processing information.
[0026] The first target computing node is configured to receive the control instruction, perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information.
[0027] The physical machine management system is configured to receive the second virtual machine processing request, determine a target physical machine corresponding to the first target computing node according to the processing information, and perform corresponding processing on the target virtual machine in the target physical machine.
[0028] In a sixth aspect, an embodiment of the present application provides an electronic device, which comprises:
[0029] a processor; and a memory arranged to store computer executable instructions configured to be executed by the processor, the executable instructions comprising instructions for performing the steps in the virtual machine management method provided in the first aspect, or the executable instructions comprising instructions for performing the steps in the virtual machine management method provided in the second aspect.
[0030] In a seventh aspect, an embodiment of the present application provides a storage medium, the storage medium being configured to store computer executable instructions, the executable instructions causing a computer to perform the steps in the virtual machine management method provided in the first aspect, or the executable instructions causing a computer to perform the steps in the virtual machine management method provided in the second aspect. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of one or more embodiments of the present application or the prior art, the drawings needed to be used in the embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0032] Figure 1 A first scenario diagram of a virtual machine management method provided by an embodiment of the present application;
[0033] Figure 2 A second scenario diagram of a virtual machine management method provided by an embodiment of the present application;
[0034] Figure 3 A first flow diagram of a virtual machine management method provided by an embodiment of the present application;
[0035] Figure 4 A second flow diagram of a virtual machine management method provided by an embodiment of the present application;
[0036] Figure 5 A third flow diagram of a virtual machine management method provided by an embodiment of the present application;
[0037] Figure 6 A fourth flow diagram of a virtual machine management method provided by an embodiment of the present application
[0038] Figure 7 A first module composition diagram of a virtual machine management apparatus provided by an embodiment of the present application;
[0039] Figure 8 A second module composition diagram of a virtual machine management apparatus provided by an embodiment of the present application;
[0040] Figure 9 A structural schematic diagram of an electronic device is provided for one or more embodiments of the present application. DETAILED DESCRIPTION
[0041] In order for those skilled in the art to better understand the technical solutions in the one or more embodiments of the present application, the technical solutions in the one or more embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the one or more embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all embodiments. Based on the one or more embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present document.
[0042] The embodiments of the present application provide a virtual machine management method, device and system. Considering that the existing virtual machine management mode mainly relies on manual operation, not only the time cost is high, but also errors are inevitable, therefore the efficiency of virtual machine management is low, and the stability and reliability are poor. Based on this, the embodiments of the present application propose to realize the automatic management of virtual machines based on k8s cluster. Specifically, the k8s cluster includes a control node and a plurality of computing nodes, wherein the computing nodes are one-to-one corresponding to the physical machines included in the physical machine management system, and the Pods in the computing nodes are one-to-one corresponding to the virtual machines installed on the corresponding physical machines. When the control node receives a first virtual machine management request sent by a client, a first target computing node is determined, and a control instruction is sent to the first target computing node according to the processing information of the target virtual machine to be processed, so that the first target computing node processes the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and sends a second virtual machine processing request to the physical machine management system according to the processing information, to request the physical machine management system to process the target virtual machine in the target physical machine corresponding to the first target computing node. It can be seen that managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, there is no need for human intervention in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of the virtual machine management, and improving the management efficiency, stability, reliability and intelligence of the virtual machine management.
[0043] Specifically, Figure 1 An application scenario diagram of a virtual machine management method is provided for one or more embodiments of the present application, as shown in Figure 1As shown, the scenario includes a client, a k8s cluster, and a physical machine management system. The client can be a terminal device or a server. The terminal device can be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, etc. The server can be a standalone server or a server cluster composed of multiple servers. Figure 1 A mobile phone and a desktop computer are only exemplarily shown. The k8s cluster includes a control node (Master node) and multiple computing nodes (Node nodes). The computing node can also be referred to as a worker node (Worker node). The computing node can be a physical machine, a virtual machine, or a process. At least one Pod is created in the computing node. The physical machine management system includes multiple physical machines, which are in one-to-one correspondence with the computing nodes of the k8s cluster. At least one virtual machine is installed on each physical machine, and the virtual machine on the physical machine is in one-to-one correspondence with the Pod in the corresponding computing node. The virtual machine management system can also include multiple racks (not shown in the figure), and each rack includes at least one physical machine. Figure 1
[0044] When a user wants to process a target virtual machine (for example, create the target virtual machine, etc.), the user can operate the client to edit processing information of the target virtual machine and submit the processing information. The client, in response to the submission operation of the user, sends a first virtual machine processing request to the control node of the k8s cluster according to the obtained processing information. The control node receives the first virtual machine processing request, determines a first target computing node from the multiple computing nodes included in the k8s cluster according to the processing information included in the first virtual machine processing request, and sends a control instruction to the first target computing node according to the processing information. The first target computing node receives the control instruction, processes a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information included in the control instruction, and sends a second virtual machine processing request to the physical machine management system according to the processing information. The physical machine management system processes the target virtual machine in a target physical machine corresponding to the first target computing node according to the second virtual machine processing request.
[0045] As shown in one or more embodiments of the present application, Figure 2 The above application scenario can also include a virtual machine management system. The client sends a virtual machine processing request to the k8s cluster through the virtual machine management system. That is, the client, in response to the submission operation of the user, sends a first virtual machine processing request to the virtual machine management system according to the obtained processing information. The virtual machine management system sends the received first virtual machine processing request to the control node of the k8s cluster, and the control node performs subsequent processing according to the received first virtual machine processing request.
[0046] It should be noted that, Figure 1 and Figure 2 n, m, N in the above are positive integers, the Pods in different computing nodes can be the same or different, Figure 1 and Figure 2 The numbers 1, 2… in the above are only used for numbering the Pods in the same computing node and numbering the virtual machines in the same physical machine, and do not mean that Pod1 in the computing node 1 is the same as Pod1 in the computing node 2, and the virtual machines are the same.
[0047] Since the computing nodes included by the k8s cluster are in one-to-one correspondence with the physical machines included by the physical machine management system, and the Pods in the computing nodes are in one-to-one correspondence with the virtual machines installed on the corresponding physical machines, the management of the Pods based on the k8s cluster is equivalent to the management of the virtual machines, that is, no human intervention is needed in the management process of the virtual machines, the automatic management of the virtual machines is realized, the time cost of the virtual machine management is reduced, and the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management are improved.
[0048] In combination with the above application scenarios, one or more embodiments of the present application provide a virtual machine management method. Figure 3 A flowchart of a virtual machine management method provided by one or more embodiments of the present application is shown in Figure 3 The method in the above can be executed by a control node of a k8s cluster. As Figure 3 shown, the method includes the following steps:
[0049] Step S102, receiving a first virtual machine processing request sent by a client; the first virtual machine processing request includes processing information of a target virtual machine to be processed;
[0050] The first virtual machine processing request can include a first virtual machine creation request, and correspondingly, the processing information can include creation information of the target virtual machine. The creation information can include a specification identifier corresponding to specification information of the target virtual machine, a template identifier of a virtual machine template used by the target virtual machine, user identifier information of a user to which the client belongs, etc. The specification information includes CPU core number, memory size, disk size, etc.; the virtual machine template includes software, instructions, etc. required to be installed by the target virtual machine. The first virtual machine processing request can also include a first virtual machine deletion request, and correspondingly, the processing information can include deletion information of the target virtual machine. The deletion information can include first identification information of the target virtual machine, and the first identification information can be one or more of a name, an IP address, a unique identifier allocated to the target virtual machine, etc. of the target virtual machine.
[0051] Step S104, determining a first target computing node from a plurality of computing nodes included by the k8s cluster according to the processing information; the plurality of computing nodes are in one-to-one correspondence with a plurality of physical machines included by a physical machine management system, and at least one virtual machine is installed on each physical machine;
[0052] In the embodiments of the present application, the computing nodes correspond to the physical machines one by one, and the Pods in the computing nodes correspond to the virtual machines in the physical machines one by one, so that the management of the virtual machines can be realized by managing the Pods through the computing nodes. Correspondingly, when the target virtual machine is managed, the first target computing node needs to be determined first.
[0053] In step S106, a control instruction is sent to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and to send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node.
[0054] When the first virtual machine processing request includes a first virtual machine creation request, the control instruction is used to instruct the first target computing node to perform creation processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information; the second virtual machine processing request can include a second virtual machine creation request, which is used to request the physical machine management system to perform creation processing on the target virtual machine in the target physical machine corresponding to the first target computing node. When the first virtual machine processing request includes a first virtual machine deletion request, the control instruction is used to instruct the first target computing node to perform deletion processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information; the second virtual machine processing request can include a second virtual machine deletion request, which is used to request the physical machine management system to perform deletion processing on the target virtual machine in the target physical machine corresponding to the first target computing node.
[0055] It should be noted that when the first target computing node receives the control instruction, the first Pod corresponding to the target virtual machine is processed according to the processing information included in the control instruction, and the second virtual machine processing request is sent to the physical machine management system according to the processing information, so that the physical machine management system performs corresponding processing on the target virtual machine. In the virtual machine management method provided in the embodiments of the present application, it can be ensured that the processing of the Pods by the computing nodes and the processing of the virtual machines by the physical machine management system are ended at the same time. For example, the first virtual machine processing request includes a first virtual machine creation request, and the first target computing node creates the first Pod, and the physical machine management system creates the target virtual machine in the target physical machine at the same time.
[0056] In one or more embodiments of the present application, when the control node of the k8s cluster receives the first virtual machine management request sent by the client, the first target computing node is determined from the plurality of computing nodes included in the k8s cluster, and a control instruction is sent to the first target computing node according to the processing information of the target virtual machine to be processed, so that the first target computing node performs corresponding processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and sends a second virtual machine processing request to the physical machine management system to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are one-to-one corresponding, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are one-to-one corresponding, therefore, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is required in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management.
[0057] The first virtual machine processing request includes a first virtual machine creation request and a first virtual machine deletion request, which will be described in detail below. When the first virtual machine processing request includes the first virtual machine creation request, as shown in Figure 4 S102-2, step S104 can include the following steps S104-2 to S104-6; step S106 can include the following steps S106-2:
[0058] Step S102-2, receiving the first virtual machine creation request sent by the client; the first virtual machine creation request includes the creation information of the target virtual machine to be created;
[0059] Step S104-2, determining whether the creation information includes the scheduling strategy of the first target computing node, if yes, executing step S104-4; if no, executing step S104-6;
[0060] Specifically, when the user edits the creation information, the client can display a plurality of preset scheduling strategies for the user to select, and the user selects a scheduling strategy of the first target virtual machine from the plurality of scheduling strategies displayed by the client according to needs. Alternatively, the client includes an editing module of the scheduling strategy, and the user operates the editing module to formulate the scheduling strategy of the first target virtual machine by himself / herself. In an implementation, the scheduling strategy can include a maximum residual resource strategy, a mutual exclusion strategy, an affinity strategy, etc. The residual resource in the maximum residual resource strategy can be a combination of one or more of residual memory, residual disk, and residual CPU. The mutual exclusion strategy can be that when one or more pods meeting condition Y are running in a computing node with label X, the computing node is not the first target computing node. The affinity strategy is opposite to the mutual exclusion strategy, that is, when one or more pods meeting condition Y are running in a computing node with label X, the computing node is determined as the first target computing node. The generation process of the label X can refer to the existing generation process of the label of the computing node, which is not limited in the present application.
[0061] Step S104-4, determining the first target computing node from a plurality of computing nodes included in the k8s cluster according to the scheduling strategy included in the creation information;
[0062] Specifically, the target information of each computing node matched with the scheduling strategy is obtained, and the first target computing node is determined according to the target information. For example, the scheduling strategy included in the creation information is the maximum residual memory, and correspondingly, the control node obtains the residual memory size of each computing node, sorts the residual memory size to obtain the maximum residual memory, and determines the computing node corresponding to the maximum residual memory as the first target computing node.
[0063] Step S104-6, determining the first target computing node from a plurality of computing nodes included in the k8s cluster according to the default scheduling strategy.
[0064] The implementation of step S104-6 is the same as that of step S104-4, and the default scheduling strategy can be set by itself according to needs in actual application. In an implementation, the default scheduling strategy is the maximum residual resource strategy, and correspondingly, step S104-6 can include: the control node obtains the residual resource information (including residual memory, residual disk, and residual CPU) of each computing node, performs weighted summation calculation on the residual resources of each computing node according to the preset weights of the residual memory, the residual disk, and the residual CPU, and determines the calculation result as the scheduling score of the corresponding computing node; sorts the scheduling scores of the computing nodes to obtain the maximum scheduling score; and determines the computing node corresponding to the maximum scheduling score as the first target computing node.
[0065] Step S106-2, sending a control instruction to the first target computing node according to the creation information; the control instruction is used to instruct the first target computing node to create the first Pod corresponding to the target virtual machine in the first target computing node according to the creation information, and send a second virtual machine processing request to the physical machine management system according to the creation information; the second virtual machine processing request is used to request the physical machine management system to create the target virtual machine in the target physical machine corresponding to the first target computing node.
[0066] In the embodiments of the present application, the Pod is created, that is, the virtual machine corresponding to the Pod is created. Therefore, when the target virtual machine is created, the creation management of the target virtual machine is realized by creating the Pod corresponding to the target virtual machine in the first target computing node. In this process, the first target computing node is determined based on the scheduling strategy, which ensures that the first target computing node can meet the creation requirements of the target virtual machine.
[0067] Further, when the first virtual machine processing request includes a first virtual machine deletion request, as shown in FIG. 1, step S102 can include the following step S102-4, and step S104 can include the following steps S104-8 to S104-12; and step S106 can include the following step S106-4: Figure 5
[0068] Step S102-4, receiving a first virtual machine deletion request sent by a client; the first virtual machine deletion request includes deletion information of a target virtual machine to be deleted;
[0069] Specifically, when a user wants to delete a target virtual machine, the user can directly operate the client to edit the first identification information of the target virtual machine and submit. The client determines the obtained first identification information as deletion information in response to the submission operation of the user, and sends a first virtual machine deletion request to the control node according to the deletion information. Alternatively, when a user wants to delete a target virtual machine, the user operates the client to send a virtual machine query request to the control node; the control node performs query processing according to the received virtual machine query request, and sends a query result to the client, the query result including at least one virtual machine information; the client displays the received query result, and when the operation identification representing the deletion operation submitted by the user and the selection information generated by the selection operation of the user on the query result are obtained, determines the virtual machine corresponding to the virtual machine information selected by the user as the target virtual machine, and determines the first identification information in the virtual machine information selected by the user as the deletion information, and sends a first virtual machine deletion request to the control node according to the deletion information. The process of query processing can be referred to the related description in the following.
[0070] Step S104-8, obtaining the first identification information of the target virtual machine from the deletion information;
[0071] Step S104-10, querying the associated creation record information from the storage system according to the first identification information; wherein the creation record information is generated after the first target computing node creates the first Pod corresponding to the target virtual machine;
[0072] In order to effectively manage the Pod, that is, to manage the virtual machine, in the embodiment of the application, after the first target computing node creates the first Pod, the creation record information of the first Pod is generated according to the first identification information of the target virtual machine, the second identification information of the first target computing node, etc., and the creation record information is saved to the storage system. In an implementation manner, the storage system can be ETCD. Correspondingly, in step S104-10, the control node queries the associated creation record information from the storage system according to the obtained first identification information.
[0073] Step S104-12, obtaining the second identification information from the creation record information, and determining the computing node corresponding to the second identification information as the first target computing node.
[0074] Step S106-4, sending a control instruction to the first target computing node according to the deletion information; the control instruction is used to instruct the first target computing node to perform deletion processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the deletion information, and to send a second virtual machine processing request to the physical machine management system according to the creation information; the second virtual machine processing request is used to request the physical machine management system to perform deletion processing on the target virtual machine in the target physical machine corresponding to the first target computing node.
[0075] In the embodiment of the application, deleting the Pod means deleting the virtual machine corresponding to the Pod. Therefore, when deleting the target virtual machine, the first target computing node is determined, and a control instruction is sent to the first target computing node to delete the first Pod corresponding to the target virtual machine in the first target computing node, so that the deletion management of the target virtual machine is realized.
[0076] Considering that the user not only has the query demand of the virtual machine when deleting the target virtual machine, but also has the query demand of the virtual machine when daily wants to know the related information of the virtual machine. Based on this, on the basis of any of the above embodiments, the method can further include the following steps A2 to step A6:
[0077] Step A2, receiving a virtual machine query request sent by a client; wherein the virtual machine query request includes query information of a virtual machine to be queried;
[0078] In order to guarantee the information security of each virtual machine, in one or more embodiments of the present application, a user can query each virtual machine created by the user, and the user can also query a certain virtual machine created by the user. When the user wants to query each virtual machine created by the user, the query information can include user identification information; when the user wants to query a certain virtual machine created by the user, the query information can include first identification information of the virtual machine to be queried, and the query information can also include the first identification information of the virtual machine to be queried and the user identification information.
[0079] Step A4, querying target creation record information matching the query information from the storage system; wherein the target creation record information is generated after the first target computing node creates the first Pod corresponding to the virtual machine to be queried;
[0080] Specifically, when the user wants to query each virtual machine created by the user, the control node queries the associated creation record information from the storage system according to the user identification information in the query information, and determines the queried creation record information as the target creation record information matching the query information. When the user wants to query a certain virtual machine created by the user, the control node queries the associated creation record information from the storage system according to the first identification information in the query information, and determines the queried creation record information as the target creation record information matching the query information.
[0081] Step A6, generating a query result according to the target creation record information, and sending the query result to the client.
[0082] The specific content and form of the query result can be set as needed in actual application, and this application does not make specific limitations.
[0083] Therefore, the control node performs query processing based on the virtual machine query request sent by the client, and sends the query result to the client, thereby realizing the query management of the virtual machine.
[0084] Further, in order to standardize the specifications of each virtual machine, and facilitate the creation and unified management of the virtual machine, in one or more embodiments of the present application, the virtual machine specifications and virtual machine templates mentioned in the foregoing can also be managed. Specifically, the method further includes the following steps B2 and B4:
[0085] Step B2, receiving a virtual machine specification processing request sent by a client; the virtual machine specification processing request is used to request any processing of target specification information, such as creation, query, deletion, and update;
[0086] Step B4, performing corresponding processing on the target specification information according to the virtual machine specification processing request.
[0087] Specifically, if it is determined that the virtual machine specification processing request is used to request creation of the target specification information, the target specification information to be created is obtained from the virtual machine specification processing request, a specification identifier of the target specification information is generated, the target specification information is saved in the storage system in association with the specification identifier, and creation success information of the target specification information is sent to the client. The generation manner of the specification identifier can be set as needed in actual application, and is not specifically limited in the present application. As an example, the specification identifier can be sequentially numbered according to the order of creation of the specification information, and the number is determined as the specification identifier of the specification information. For example, the number (i.e., the specification identifier) of the last created specification information currently stored in the storage system is 10, and the specification identifier of the target specification information is determined as 11.
[0088] If it is determined that the virtual machine specification processing request is used to request query processing of the target specification information, the target specification information is queried from the storage system, a specification information query result is generated according to the queried target specification information, and the specification information query result is sent to the client. The specification information query result includes the target specification information and the specification identifier of the target specification information. It should be noted that the target specification information to be queried can be one specification information or multiple specification information. When the target specification information to be queried is one specification information, the virtual machine specification processing request includes the specification identifier of the specification information, and the control node queries the target specification information from the storage system according to the specification identifier.
[0089] If it is determined that the virtual machine specification processing request is used to request deletion processing of the target specification information, the target specification information to be deleted is queried from the storage system according to the specification identifier of the target specification information included in the virtual machine specification processing request, the target specification identifier information and the specification identifier of the target specification identifier information are deleted from the storage system, and deletion success information of the target specification information is sent to the client.
[0090] If it is determined that the virtual machine specification processing request is used to request update processing of the target specification information, the target specification information to be updated is obtained from the storage system according to the specification identifier of the target specification information included in the virtual machine specification processing request, the target specification information is updated according to the update information included in the virtual machine specification processing request, and update success information is sent to the client. For example, the specification identifier of the target specification information to be updated included in the virtual machine specification processing request is 10, and the update information is “10G of memory”. The target specification information associated with the specification identifier 10 is obtained from the storage system as “8-core CPU, 5G of memory, 20G of disk”, and the target specification information is updated to “8-core CPU, 10G of memory, 20G of disk” according to the update information.
[0091] Therefore, the control node processes the target specification information according to the request based on the specification information sent by the client, realizes effective and intelligent management of the specification information, and further improves the convenience of virtual machine creation and management.
[0092] Further, in one or more embodiments of the present application, the method can further include the following steps C2 and C4:
[0093] Step C2, receiving a virtual machine template processing request sent by a client; the virtual machine template processing request is used to request any processing of a target virtual machine template, such as creation, query, or deletion;
[0094] The virtual machine template includes information such as software and instructions required for installation of a target virtual machine. The virtual machine template can be in a file format such as Word, XML, Excel, etc., which is not limited in the present application.
[0095] Step C4, processing the target virtual machine template according to the virtual machine template processing request.
[0096] Specifically, if it is determined that the virtual machine template processing request is used to request creation processing of the target virtual machine template, the target virtual machine template to be created is obtained from the virtual machine template processing request, a template identifier of the target virtual machine template is generated, the target virtual machine template and the generated template identifier are associated and saved to a storage system, and creation success information of the target virtual machine template is sent to the client. The generation method of the template identifier can be set as needed in actual application, which is not limited in the present application.
[0097] If it is determined that the virtual machine template processing request is used to request query processing of the target virtual machine template, the target virtual machine template is queried from the storage system, a virtual machine template query result is generated according to the queried target virtual machine template, and the virtual machine template is sent to the client; wherein the virtual machine template query result includes the target virtual machine template and a template identifier of the target virtual machine template. It should be noted that the target virtual machine template to be queried can be one virtual machine template or multiple virtual machine templates. When the target virtual machine template to be queried is one, the virtual machine template processing request includes a template identifier of the target virtual machine template, and the control node queries the target virtual machine template from the storage system according to the template identifier.
[0098] If it is determined that the virtual machine template processing request is used to request deletion processing of the target virtual machine template, the target virtual machine template to be deleted is obtained according to the template identifier of the target virtual machine template included in the virtual machine template processing request, the associated target virtual machine template is obtained from the storage system, the target virtual machine template and the template identifier of the target virtual machine template are deleted from the storage system, and deletion success information of the target virtual machine template is sent to the client.
[0099] Therefore, the control node processes the target virtual machine based on the virtual machine template processing request sent by the client, realizes effective and intelligent management of the virtual machine template, and further improves the convenience of virtual machine creation and management.
[0100] It should be noted that each processing request sent by the aforementioned client to the control node can be that the client calls a corresponding Api interface to send a processing request to the virtual machine management system, and the virtual machine management system sends the received processing request sent by the client to the control node; the control node processes according to the received processing request sent by the virtual machine management system. For example, the client sends a first virtual machine creation request to the virtual machine management system, the virtual machine management system sends the received first virtual machine creation request to the control node, and the control node creates the target virtual machine according to the received first virtual machine creation request. For another example, the client sends a virtual machine specification processing request to the virtual machine management system, the virtual machine management system sends the received virtual machine specification processing request to the control node, and the control node processes the target specification information according to the received virtual machine specification processing request. This application will not be described one by one.
[0101] Considering that in actual application, with the continuous change of business, the current specification of the created virtual machine can not meet the business requirements, such as small memory capacity, small disk capacity, etc. Based on this, on the basis of any of the foregoing embodiments, the control node can also perform capacity change processing on the virtual machine to be changed in capacity according to the received first virtual machine capacity change request. Specifically, the method can further include the following steps D2 to D12:
[0102] Step D2, receiving a first virtual machine capacity change request sent by the virtual machine management system; wherein the first virtual machine capacity change request is sent based on a second virtual machine capacity change request sent by the client; the first virtual machine capacity change request includes a first annotation and first identification information of the virtual machine to be changed in capacity; the first annotation is a system attribute of the second Pod corresponding to the virtual machine to be changed in capacity, and is used to indicate that the virtual machine to be changed in capacity is processed, and the first annotation includes a target specification identifier;
[0103] Specifically, when a user wants to resize a virtual machine to be resized (which can be to expand or reduce the memory capacity, expand or reduce the disk capacity, etc.), the operation client edits the target specification identifier of the first identification information and the target specification information of the virtual machine to be resized and submits the edited information. The client, in response to the user's submission operation, sends a second virtual machine resizing request to the virtual machine management system according to the obtained first identification information, target specification identifier, and operation identifier representing the resizing operation. The virtual machine management system receives the second virtual machine resizing request, determines that the operation type is a resizing operation according to the operation identifier included in the second virtual machine resizing request, generates a first annotation of the second Pod corresponding to the virtual machine to be resized according to the target specification identifier included in the second virtual machine resizing request, and sends a first virtual machine resizing request to the control node according to the first annotation and the first identification information included in the second virtual machine resizing request. The form of the first annotation can be set as needed in actual application. In a feasible implementation, the form of the first annotation is "resizing identifier (operation identifier): target specification identifier of target specification information".
[0104] Step D4, if it is determined that the first annotation conforms to the preset format, the associated target specification information is obtained from the association between the specification identifier and the specification information saved by the storage system according to the target specification identifier;
[0105] Specifically, before step D4, it can also include verifying whether the form of the first annotation is the preset form, and verifying whether the operation identifier in the first annotation is the resizing identifier. In step D4, if it is determined that the verification results are all yes, it is determined that the first annotation conforms to the preset format, the target specification information is obtained from the first annotation, and the associated target specification information is obtained from the association between the specification identifier and the specification information saved by the storage system according to the target specification identifier.
[0106] Step D6, according to the first identification information, the creation record information of the second Pod is queried from the creation record information of the Pod saved by the storage system;
[0107] Step D8, the specification information in the creation record information of the second Pod is updated to the target specification information;
[0108] Step D10, the second target computing node corresponding to the virtual machine to be resized is determined as the second target computing node corresponding to the second Pod according to the second identification information in the creation record information of the second Pod;
[0109] Step D12, according to the target specification information and the first identification information, sending virtual machine capacity change indication information to the second target computing node; wherein the virtual machine capacity change indication information is used to instruct the second target computing node to send a third virtual machine capacity change request to the physical machine management system; the third virtual machine capacity change request is used to request the physical machine management system to perform capacity change processing on the virtual machine to be changed in the physical machine corresponding to the second target computing node.
[0110] When the second target computing node receives the virtual machine capacity change indication information sent by the control node, according to the target specification information and the first identification information included in the virtual machine capacity change indication information, and the second identification information of the second target computing node, etc., a third virtual machine capacity change request is sent to the physical machine management system. The physical machine management system receives the third virtual machine capacity change request sent by the second target computing node, and according to the second identification information included in the third virtual machine capacity change request, obtains the associated third identification information from the association relationship between the second identification information of the computing node and the third identification information of the physical machine; the physical machine corresponding to the obtained third identification information is determined as the physical machine corresponding to the second target computing node, and the target specification information included in the third virtual machine capacity change request is used to perform capacity change processing on the virtual machine to be changed corresponding to the first identification information in the physical machine.
[0111] Further, in one or more embodiments of the present application, the control node can include Api-server and Web-hook, and correspondingly, the above steps D2 to D12 can be executed by the Api-server, and after step D2, the Api-server sends the first annotation to the Web-hook, the Web-hook verifies whether the received first annotation conforms to the preset format, and sends the verification result to the Api-server; in step D4, if the Api-server determines that the first annotation conforms to the preset format according to the received verification result, the associated target specification information is obtained from the association relationship between the specification identifier and the specification information saved by the storage system according to the target specification identifier.
[0112] Therefore, based on the first virtual machine capacity change request sent by the virtual machine management system, the control node updates the creation record information of the second Pod corresponding to the virtual machine to be changed, and realizes the capacity change processing of the virtual machine to be changed, that is, realizes the capacity change management of the virtual machine.
[0113] Further, considering that in actual application, the user may also have a virtual machine migration request, based on this, in one or more embodiments of the present application, the control node can also perform virtual machine migration processing on the virtual machine to be migrated based on the received first virtual machine migration request. Specifically, the method can further include the following steps E2 to E10:
[0114] Step E2, receiving a first virtual machine migration request sent by the virtual machine management system; the first virtual machine migration request is sent based on a second virtual machine migration request sent by the client; the first virtual machine migration request comprises the second annotation and first identification information of the virtual machine to be migrated; the second annotation is a system attribute of the third Pod corresponding to the virtual machine to be migrated, and is used to represent that the virtual machine to be migrated is subjected to migration processing, and the second annotation comprises a first migration identifier and third identification information of the target physical machine;
[0115] Specifically, when the user wants to migrate the virtual machine to be migrated from the current physical machine to the target physical machine, the client edits the first identification information of the virtual machine to be migrated and the third identification information of the target physical machine and submits the edited information. The client, in response to the user's submission operation, sends a second virtual machine migration request to the virtual machine management system according to the obtained first identification information, third identification information, operation identifier representing the migration operation, etc. The virtual machine management system receives the second virtual machine migration request, determines that the operation type is a migration operation according to the operation identifier included in the second virtual machine migration request, generates a second annotation of the third Pod corresponding to the virtual machine to be migrated according to the third identification information included in the second virtual machine migration request, and sends a first virtual machine migration request to the control node according to the second annotation and the first identification information included in the second virtual machine migration request. The form of the second annotation can be set as needed in actual application. In a feasible implementation, the form of the second annotation is "first migration identifier (operation identifier): third identification information of the target physical machine".
[0116] Step E4, if it is determined that the second annotation conforms to the second preset format, determining a third target computing node where the third Pod is located according to the first identification information;
[0117] Specifically, step E4 can further comprise: verifying whether the form of the second annotation is a preset form, and verifying whether the operation identifier in the second annotation is the first migration identifier; if it is determined that the verification results are both yes in step E4, it is determined that the second annotation conforms to the preset format, the first identification information is obtained from the first virtual machine migration request, the creation record information of the associated third Pod is queried from the storage system according to the first identification information, the second identification information is obtained from the queried creation record information, and the computing node corresponding to the second identification information is determined as the third target computing node.
[0118] Step E6, sending first virtual machine migration instruction information to the third target computing node according to the first identification information and the second annotation; the first virtual machine migration instruction information is used to instruct the third target computing node to delete the third Pod and update the first migration identifier to a second migration identifier;
[0119] When the third target computing node receives the first virtual machine migration indication information, the third Pod corresponding to the virtual machine to be migrated is determined according to the first identification information, the third Pod is deleted from the third target computing node, and the first migration identifier in the second annotation is updated to the second migration identifier.
[0120] It can be understood that the third Pod is migrated, that is, the virtual machine to be migrated corresponding to the third Pod is migrated. The migration is that the third Pod is deleted in the third target computing node, and the third Pod is re-created in the fourth target computing node corresponding to the target physical machine; the process of deleting the third Pod from the third target computing node is implemented in step E6.
[0121] In step E8, if the second annotation containing the second migration identifier is obtained, the fourth target computing node corresponding to the target physical machine is determined according to the third identification information.
[0122] Specifically, if the second annotation containing the second migration identifier is obtained, the associated second identification information is obtained from the association between the second identification information of the computing node and the third identification information of the physical machine saved by the storage system according to the third identification, and the computing node corresponding to the obtained second identification information is determined as the fourth target computing node.
[0123] In step E10, the second virtual machine migration indication information is sent to the fourth target computing node according to the first identification information and the second annotation containing the second migration identifier; the second virtual machine migration indication information is used to instruct the fourth target computing node to create the third Pod in the fourth target computing node, update the creation record information of the third Pod in the storage system, and send a third virtual machine migration request to the physical machine management system; the third virtual machine migration request is used to request the physical machine management system to migrate the virtual machine to be migrated from the physical machine corresponding to the third target computing node to the target physical machine.
[0124] When the fourth target computing node receives the second virtual machine migration indication information, the fourth target computing node queries, from the storage system, creation record information of a third Pod corresponding to the virtual machine to be migrated according to first identification information included in the second virtual machine migration indication information, obtains specification information of the third Pod from the queried creation record information, creates the third Pod in the fourth target computing node according to the obtained specification information, updates second identification information of the fourth target computing node included in the creation record information of the third Pod in the storage system to second identification information of the fourth target computing node, and sends a third virtual machine migration request to the physical machine management system according to the first identification information of the virtual machine to be migrated and the third identification information of the target physical machine. The physical machine management system determines a physical machine (that is, a physical machine corresponding to the third target computing node) currently where the virtual machine to be migrated is located according to the first identification information in the received third virtual machine migration request, and migrates the virtual machine to be migrated corresponding to the first identification information from the current physical machine to the target physical machine.
[0125] Further, in one or more embodiments of the present application, the control node can include an Api-server and a Web-hook, wherein the Web-hook can intercept data including an annotation of a Pod and send the data to the Api-server. Correspondingly, the above steps E2 to E10 can be executed by the Api-server, and after step E2, the Api-server sends the second annotation to the Web-hook, the Web-hook verifies whether the received second annotation conforms to a preset format, and sends a verification result to the Api-server; in step E4, if the Api-server determines that the second annotation conforms to the preset format according to the received verification result, the Api-server determines the third target computing node where the third Pod is located according to the first identification information. Before step E8, the Web-hook can intercept the second annotation including the second migration identification and send the second annotation to the Api-server; in step E8, the Api-server determines that the second annotation including the second migration identification is obtained, and performs subsequent processing.
[0126] Therefore, based on the first virtual machine migration request sent by the virtual machine management system, the control node first determines the third target computing node where the third Pod corresponding to the virtual machine to be migrated is located, controls the third target computing node to delete the third Pod, then determines the fourth target computing node where the target physical machine is located, and controls the fourth target computing node to re-create the third Pod, thereby realizing migration of the third Pod, that is, migration of the virtual machine to be migrated, that is, realizing migration management of the virtual machine.
[0127] Through the creation, query, deletion, and update (expansion and migration) of the Pod, the effective management of the life cycle of the Pod is achieved, that is, the effective management of the life cycle of the virtual machine is achieved.
[0128] Considering that error running data may occur in the running process of the virtual machine due to various reasons, in order to enable the virtual machine to return to the previous correct state as soon as possible, in one or more embodiments of the present application, the virtual machine can also be subjected to snapshot processing to obtain a virtual machine snapshot, which records the current state of the virtual machine, including the currently stored data, the current resource remaining condition, and the like. Specifically, the k8s cluster further includes a CRD (Custom Resource Definition, custom resource) controller, and the method can further include the following step F2.
[0129] In step F2, if it is determined that the snapshot processing condition is met, snapshot processing indication information is sent to the CRD controller; wherein the snapshot processing indication information is used to instruct the CRD controller to perform any processing of creating, querying, deleting, or rolling back the target virtual machine snapshot.
[0130] Specifically, if the snapshot processing request sent by the client is received, it is determined that the snapshot processing condition is met, and the snapshot processing indication information is sent to the CRD controller according to the snapshot processing request. The first snapshot processing request is used to request any processing of creating, querying, deleting, or rolling back the target virtual machine snapshot.
[0131] More specifically, if the snapshot processing request is used to request the creation processing of the target virtual machine snapshot, the snapshot creation indication information is sent to the CRD controller according to the snapshot creation information included in the snapshot processing request, wherein the snapshot creation information includes the first identification information of the virtual machine to be snapped. The CRD controller sends a snapshot creation request to the physical machine management system according to the snapshot creation information included in the snapshot creation indication information. The physical machine management system performs snapshot creation processing on the virtual machine to be snapped according to the received snapshot creation request to obtain the target virtual machine snapshot, and sends snapshot creation success information to the CRD controller according to the related information of the target virtual machine snapshot. The CRD controller takes the snapshot name, snapshot time, snapshot version, and the like included in the snapshot creation success information as snapshot creation record information, saves the snapshot creation record information to the storage system, and sends the snapshot creation success information to the client. In one or more embodiments of the present application, the control node can also set the snapshot creation time of the virtual machine to be snapped according to the first identification information of the virtual machine to be snapped and the snapshot frequency information (for example, a snapshot is created every five minutes) included in the snapshot creation information, and when the snapshot creation time is reached, it is determined that the snapshot processing condition is met, the snapshot creation indication information is sent to the CRD controller according to the first identification information of the virtual machine to be snapped, and the subsequent processing is performed in the foregoing manner.
[0132] If the snapshot processing request is used to request query processing of the target virtual machine snapshot, the snapshot query indication information is sent to the CRD controller according to the snapshot query information included in the snapshot processing request. The CRD controller queries the snapshot creation record information of the target virtual machine snapshot from the storage system according to the snapshot query information included in the received snapshot query indication information, generates a snapshot query result according to the queried snapshot creation record information, and sends the snapshot query result to the client to enable the client to display the snapshot query result.
[0133] If the snapshot processing request is used to request deletion processing of the target virtual machine snapshot, the snapshot deletion indication information is sent to the CRD controller according to the snapshot deletion information included in the snapshot processing request; wherein the snapshot deletion information includes the snapshot name of the target virtual machine snapshot and the like. The CRD controller queries the associated snapshot creation record information from the storage system according to the snapshot name included in the received snapshot deletion indication information, deletes the queried snapshot creation record information from the storage system; and sends a snapshot deletion request to the physical machine management system according to the snapshot deletion information. The physical machine management system performs deletion processing of the target virtual machine snapshot according to the received snapshot deletion request.
[0134] If the snapshot processing request is used to request rollback processing of the target virtual machine snapshot, the snapshot rollback indication information is sent to the CRD controller according to the snapshot rollback information included in the snapshot processing request; wherein the snapshot rollback information includes the snapshot name of the target virtual machine snapshot, the first identification information of the virtual machine to which the target virtual machine snapshot belongs and the like. The CRD controller sends a snapshot rollback request to the physical machine management system according to the snapshot rollback information included in the received snapshot rollback indication information. The physical machine management system performs rollback processing of the virtual machine to which the target virtual machine snapshot belongs according to the received snapshot rollback request, so as to make the virtual machine rollback to the state corresponding to the target virtual machine snapshot.
[0135] Thus, the control node and the CRD perform data interaction, and the snapshot processing of the virtual machine is realized, that is, the automatic management of the virtual machine snapshot is realized.
[0136] In one or more embodiments of the present application, when the control node of the k8s cluster receives the first virtual machine management request sent by the client, a first target computing node is determined from the plurality of computing nodes included in the k8s cluster, and a control instruction is sent to the first target computing node according to the processing information of the target virtual machine to be processed, so that the first target computing node performs corresponding processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and sends a second virtual machine processing request to the physical machine management system according to the processing information to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are one-to-one corresponding, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are one-to-one corresponding, therefore, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is required in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency, stability, reliability and intelligence of the virtual machine management.
[0137] Corresponding to the above-described physical machine management method, based on the same technical concept, one or more embodiments of the present application also provide another physical machine management method, Figure 6 The flowchart of another physical machine management method provided for one or more embodiments of the present application, Figure 6 The method in the above embodiment can be executed by a computing node of the k8s cluster, which can be any computing node of the plurality of computing nodes included in the k8s cluster, and the plurality of computing nodes correspond one-to-one to the plurality of physical machines included in the physical machine management system, and each physical machine has at least one virtual machine installed thereon. As shown in Figure 6 The method includes the following steps:
[0138] In step S202, a control instruction sent by a control node of the k8s cluster is received; the control instruction includes processing information of a target virtual machine to be processed;
[0139] Specifically, when a user wants to process a target virtual machine (for example, create a target virtual machine, etc.), he can operate his client to edit the processing information of the target virtual machine and submit it. The client responds to the user's submission operation and sends a first virtual machine processing request to the control node of the k8s cluster according to the obtained processing information. The control node receives the first virtual machine processing request and determines a first target computing node from the plurality of computing nodes included in the k8s cluster according to the processing information included in the first virtual machine processing request, and sends a control instruction to the first target computing node according to the processing information. The computing node determined as the first target computing node receives the control instruction sent by the control node.
[0140] At step S204, according to the processing information, the first Pod corresponding to the target virtual machine is processed in the computing node.
[0141] Specifically, when the computing node receives the control instruction, according to the processing information included in the control instruction, the first Pod corresponding to the target virtual machine is processed in the computing node.
[0142] At step S206, a second virtual machine processing request is sent to the physical machine management system according to the processing information, and the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the computing node.
[0143] In this embodiment of the present application, when the physical machine management system receives the second virtual machine processing request sent by the computing node, the target physical machine corresponding to the computing node is determined, and corresponding processing is performed on the target virtual machine in the target physical machine.
[0144] In this embodiment of the present application, when the computing node receives the control instruction sent by the control node of the k8s cluster, according to the processing information of the target virtual machine included in the control instruction, the first Pod corresponding to the target virtual machine is processed in the computing node, and a second virtual machine processing request is sent to the physical machine management system according to the processing information, to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are one-to-one corresponding, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are one-to-one corresponding, therefore, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, in the management process of the virtual machines, no human intervention is needed, realizing the automatic management of the virtual machines, reducing the time cost of the virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management.
[0145] In one or more embodiments of the present application, the first virtual machine processing request includes a first virtual machine creation request, and the processing information includes creation information. Correspondingly, the second virtual machine processing request includes a second virtual machine creation request, and the second virtual machine creation request is used to request the physical machine management system to perform creation processing on the target virtual machine in the target physical machine corresponding to the computing node. Further corresponding, the processing of the first Pod corresponding to the target virtual machine at step S204 includes: performing creation processing on the first Pod corresponding to the target virtual machine.
[0146] In order to facilitate the creation of the Pod, that is, to facilitate the creation of the virtual machine, in this embodiment of the present application, the specification information of the virtual machine and the virtual machine template are also managed. Correspondingly, the creation processing of the first Pod corresponding to the target virtual machine can include:
[0147] obtaining the specification identifier and the template identifier from the creation information;
[0148] obtaining specification information of the associated virtual machine in the storage system according to the specification identifier;
[0149] obtaining the virtual machine template associated with the template identifier in the storage system;
[0150] performing creation processing on the first Pod corresponding to the target virtual machine according to the specification information and the virtual machine template.
[0151] Further, when the first virtual machine processing request includes a first virtual machine creation request, in order to facilitate management of the Pod, i.e., management of the virtual machine, after the corresponding processing on the first Pod corresponding to the target virtual machine in step S204, the method further includes: generating creation record information of the first Pod according to the creation information, and saving the creation record information to the storage system.
[0152] The creation record information includes first identification information of the target virtual machine, second identification information of the computing node where the Pod is located, specification information, virtual machine template identifier, etc. The specific content of the creation record information is not limited in the present application, and can be set as needed in actual application.
[0153] Thus, by performing creation processing on the Pod, creation management of the virtual machine is realized.
[0154] In one or more embodiments of the present application, the first virtual machine processing request includes a first virtual machine deletion request, and the processing information includes deletion information. Correspondingly, the second virtual machine processing request is used to request the physical machine management system to perform deletion processing on the target virtual machine in the target physical machine corresponding to the target computing node. Further correspondingly, the corresponding processing on the first Pod corresponding to the target virtual machine in step S204 includes: performing deletion processing on the first Pod corresponding to the target virtual machine. Specifically, according to the first identification information of the target virtual machine included in the deletion information, the associated creation record information is queried from the storage system, the fourth identification information is obtained from the queried creation record information, the Pod corresponding to the fourth identification information is determined as the first Pod to be deleted, and the first Pod is deleted.
[0155] Further, when the first virtual machine processing request includes a first virtual machine deletion request, after the corresponding processing on the first Pod corresponding to the target virtual machine in step S204, the method includes: deleting the creation record information of the first Pod from the storage system.
[0156] Thus, by performing deletion processing on the Pod, deletion management of the virtual machine is realized.
[0157] In actual applications, as the business changes, the current specifications of the created virtual machines can not meet the business requirements, such as insufficient memory capacity, insufficient disk capacity, and the like. Based on any of the foregoing embodiments, the method can further include the following steps F2 and F4:
[0158] Step F2, receiving virtual machine capacity change indication information sent by the control node, the virtual machine capacity change indication information including first identification information of a virtual machine to be changed in capacity and target specification information;
[0159] Step F4, sending, to a physical machine management system, a third virtual machine capacity change request according to the first identification information, the target specification information, and second identification information of the second computing node; the third virtual machine capacity change request being used to request the physical machine management system to perform capacity change processing on the virtual machine to be changed in capacity in a physical machine corresponding to the computing node.
[0160] Specifically, when a user needs to perform capacity change processing on a virtual machine to be changed in capacity, a second virtual machine capacity change request is sent to the virtual machine management system through a client; the virtual machine management system sends a first virtual machine capacity change request to the control node according to the second virtual machine capacity change request, the control node performs capacity change processing on a second Pod corresponding to the virtual machine to be changed in capacity according to the first virtual machine capacity change request, and sends virtual machine capacity change indication information to a second target computing node where the second Pod is located. The computing node determined as the second target computing node sends a third virtual machine capacity change request to the physical machine management system according to the first identification information of the virtual machine to be changed in capacity, the target specification information included in the virtual machine capacity change indication information, and second identification information of the second computing node when the virtual machine capacity change indication information is received. The physical machine management system receives the third virtual machine capacity change request, determines a physical machine corresponding to the computing node according to the first identification information, determines a virtual machine corresponding to the first identification information in the physical machine as the virtual machine to be changed in capacity, and performs capacity change processing on the virtual machine to be changed in capacity according to the target specification information. The process in which the control node performs capacity change processing on the second Pod corresponding to the virtual machine to be changed in capacity according to the first virtual machine capacity change request can be referred to the related description hereinbefore.
[0161] In order to enable the user to know the capacity change result, the physical machine sends capacity change result information to the corresponding computing node after the capacity change processing on the virtual machine to be changed in capacity is completed, the computing node sends the capacity change result information to the control node, the control node sends the capacity change result information to the client through the virtual machine management system, and the client displays the received capacity change result information.
[0162] In this way, the computing node interacts with the control node and the physical machine management system to realize automatic management of virtual machine capacity change.
[0163] Further, considering that in actual application, the user can also have a migration request of the virtual machine, based on this, in one or more embodiments of the present application, the method can further include steps H2 to H6:
[0164] Step H2, receiving the first virtual machine migration indication information sent by the control node; the first virtual machine migration indication information includes the second annotation and the first identification information of the virtual machine to be migrated; the second annotation is the system attribute of the third Pod corresponding to the virtual machine to be migrated, and is used to represent the migration processing of the virtual machine to be migrated, and the first migration identification and the third identification information of the target physical machine are included in the second annotation;
[0165] Step H4, determining the third Pod according to the first identification information, and deleting the third Pod;
[0166] Step H6, updating the first migration identification to the second migration identification, so that the control node determines the fourth target computing node corresponding to the target physical machine according to the third identification information of the target physical machine when obtaining the second annotation containing the second migration identification; according to the first identification information and the second annotation containing the second migration identification, sending the second virtual machine migration indication information to the fourth target computing node; the second virtual machine migration indication information is used to instruct the fourth target computing node to create the third Pod in the fourth target computing node, update the creation record information of the third Pod in the storage system, and send the third virtual machine migration request to the physical machine management system; the third virtual machine migration request is used to request the physical machine management system to migrate the virtual machine to be migrated from the physical machine corresponding to the third target computing node to the target physical machine.
[0167] Specifically, when a user wants to migrate a to-be-migrated virtual machine from a current physical machine to a target physical machine, an operation client edits the first identification information of the to-be-migrated virtual machine, the third identification information of the target physical machine, and the like, and submits the edited information. The client, in response to the submission operation of the user, sends a second virtual machine migration request to the virtual machine management system according to the obtained first identification information, third identification information, and operation identification representing a migration operation. The virtual machine management system generates a second annotation according to the received second virtual machine migration request, and sends a first virtual machine migration request to a control node according to the second annotation and the first identification information included in the second virtual machine migration request. The control node determines a third target computing node where a third Pod corresponding to the to-be-migrated virtual machine is located according to the received first virtual machine migration request, and sends first virtual machine migration instruction information to the third target computing node according to the first identification information and the second annotation. The computing node determined as the third target computing node queries associated creation record information from a storage system according to the first identification when receiving the first virtual machine migration instruction information; determines a Pod corresponding to fourth identification information in the queried creation record information as a third Pod to be deleted, and deletes the third Pod from itself, and updates a first migration identification in the second annotation to a second migration identification. The control node determines a fourth target computing node corresponding to the target physical machine according to the third identification information of the target physical machine when obtaining the second annotation including the second migration identification, and sends second virtual machine migration instruction information to the fourth target computing node according to the first identification information and the second annotation containing the second migration identification. The computing node determined as the fourth target computing node queries creation record information of the third Pod from the storage system according to the first identification information included in the received second virtual machine migration instruction information, obtains virtual machine specification information and a virtual machine template from the queried creation record information, creates the third Pod in the fourth target computing node according to the virtual machine specification information and the virtual machine template, updates second identification information of the third target computing node included in the creation record information of the third Pod in the storage system to second identification information of itself, and sends a third virtual machine migration request to a physical machine management system according to the first identification information of the to-be-migrated virtual machine and the third identification information of the target physical machine. The physical machine management system migrates the to-be-migrated virtual machine from the current physical machine to the target physical machine according to the received third virtual machine migration request.
[0168] Therefore, the computing node, the control node, and the physical machine management system perform data interaction, and automatic management of virtual machine migration is realized.
[0169] In the embodiments of the present application, when the computing node receives the control instruction sent by the control node of the k8s cluster, the first Pod corresponding to the target virtual machine is processed according to the processing information of the target virtual machine included in the control instruction in the computing node, and a second virtual machine processing request is sent to the physical machine management system according to the processing information, so as to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, the management of the Pods based on the k8s cluster is equivalent to the management of the virtual machines, that is, no human intervention is required in the management process of the virtual machines, the automatic management of the virtual machines is realized, the time cost of virtual machine management is reduced, and the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management are improved.
[0170] Corresponding to the virtual machine management method described above, based on the same technical concept, one or more embodiments of the present application also provide a virtual machine management device, which is applied to a control node of a k8s cluster. Figure 7 A module composition schematic diagram of a virtual machine management device provided by one or more embodiments of the present application is shown in Figure 7 As shown in the figure, the device comprises:
[0171] The receiving module 301 is configured to receive a first virtual machine processing request sent by a client; the first virtual machine processing request comprises processing information of a target virtual machine to be processed;
[0172] The determining module 302 is configured to determine a first target computing node in a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes are in one-to-one correspondence with a plurality of physical machines included in a physical machine management system, and at least one virtual machine is installed on each of the physical machines;
[0173] The sending module 303 is configured to send a control instruction to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0174] The virtual machine management device provided by the embodiments of the present application receives a first virtual machine management request sent by a client, determines a first target computing node in a plurality of computing nodes included in a k8s cluster, and sends a control instruction to the first target computing node according to processing information of a target virtual machine to be processed, so that the first target computing node performs corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and sends a second virtual machine processing request to a physical machine management system according to the processing information to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, the management of the Pods based on the k8s cluster is equivalent to the management of the virtual machines, that is, no human intervention is required in the management process of the virtual machines, the automatic management of the virtual machines is realized, the time cost of virtual machine management is reduced, and the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management are improved.
[0175] It should be noted that the embodiments of the virtual machine management device in the present application and the embodiments of the virtual machine management method in the present application are based on the same inventive concept, so the specific implementation of the embodiments can be referred to the foregoing implementation of the corresponding virtual machine management method, and the repeated parts will not be described again.
[0176] Further, corresponding to another virtual machine management method described above, based on the same technical concept, one or more embodiments of the present application also provide another virtual machine management device, which is applied to a computing node of a k8s cluster, the computing node is any computing node in a plurality of computing nodes included in the k8s cluster; the plurality of computing nodes are in one-to-one correspondence with a plurality of physical machines included in a physical machine management system, and at least one virtual machine is installed on each physical machine. Figure 8 The module composition schematic diagram of another virtual machine management device provided by one or more embodiments of the present application is shown in Figure 8 As shown in the figure, the device comprises:
[0177] The receiving module 401 is configured to receive a control instruction sent by a control node of the k8s cluster; the control instruction comprises processing information of a target virtual machine to be processed;
[0178] The processing module 402 is configured to perform corresponding processing on a first Pod corresponding to the target virtual machine in the computing node according to the processing information;
[0179] The sending module 403 is configured to send a second virtual machine processing request to the physical machine management system according to the processing information, and the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0180] The virtual machine management apparatus provided by the embodiments of the present application receives the control instruction sent by the control node of the k8s cluster, performs corresponding processing on the first Pod corresponding to the target virtual machine in the computing node according to the processing information of the target virtual machine included in the control instruction, and sends a second virtual machine processing request to the physical machine management system according to the processing information, so as to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, the management of the Pods based on the k8s cluster is equivalent to the management of the virtual machines, that is, no human intervention is needed in the management process of the virtual machines, the automatic management of the virtual machines is realized, the time cost of the virtual machine management is reduced, and the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management are improved.
[0181] It should be noted that the embodiments of the image denoising apparatus in the present application and the embodiments of the image denoising method in the present application are based on the same inventive concept, and therefore the specific implementation of the embodiments can be referred to the foregoing implementation of the corresponding image denoising method, and the repeated parts will not be described herein.
[0182] Further, corresponding to the virtual machine management method described above, based on the same technical concept, one or more embodiments of the present application also provide an electronic device for executing the virtual machine management method described above, Figure 9 A structural schematic diagram of an electronic device provided by one or more embodiments of the present application.
[0183] As Figure 9As shown, the electronic device can have a large difference due to different configurations or performance, and can include one or more processors 501 and memories 502, and the memories 502 can store one or more stored applications or data. Among them, the memory 502 can be temporary storage or persistent storage. The application stored in the memory 502 can include one or more modules (not shown in the figure), and each module can include a series of computer executable instructions in the electronic device. Further, the processor 501 can be configured to communicate with the memory 502 and execute a series of computer executable instructions in the memory 502 on the electronic device. The electronic device can also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, and the like.
[0184] In one specific embodiment, the electronic device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs can include one or more modules, and each module can include a series of computer executable instructions in the electronic device, and the one or more programs configured to be executed by one or more processors include computer executable instructions for:
[0185] receiving a first virtual machine processing request sent by a client; the first virtual machine processing request includes processing information of a target virtual machine to be processed;
[0186] determining a first target computing node from a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes correspond one-to-one to a plurality of physical machines included in a physical machine management system, and at least one virtual machine is installed on each of the physical machines;
[0187] sending a control instruction to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0188] The electronic device provided by one or more embodiments of the present application receives a first virtual machine management request sent by a client, determines a first target computing node among a plurality of computing nodes included in a k8s cluster, and sends a control instruction to the first target computing node according to processing information of a target virtual machine to be processed, so that the first target computing node performs corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and sends a second virtual machine processing request to a physical machine management system according to the processing information to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is required in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability, and intelligence of the virtual machine management.
[0189] In another specific embodiment, the electronic device includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and one or more programs can include one or more modules, and each module can include a series of computer executable instructions in the electronic device, and is configured to be executed by one or more processors. The one or more programs include computer executable instructions for:
[0190] receiving a control instruction sent by a control node of the k8s cluster; the control instruction includes processing information of a target virtual machine to be processed;
[0191] performing corresponding processing on a first Pod corresponding to the target virtual machine in the computing node according to the processing information;
[0192] sending a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the computing node.
[0193] The electronic device provided in the embodiments of the present application, when receiving the control instruction sent by the control node of the k8s cluster, performs corresponding processing on the first Pod corresponding to the target virtual machine in the target computing node according to the processing information of the target virtual machine included in the control instruction, and sends a second virtual machine processing request to the physical machine management system according to the processing information, to request the physical machine management system to perform corresponding processing on the target virtual machine in the target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, therefore, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is needed in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management.
[0194] It should be noted that the embodiments of the electronic device in the present application and the embodiments of the virtual machine management method in the present application are based on the same inventive concept, so the specific implementation of the embodiments can be referred to the foregoing implementation of the corresponding virtual machine management method, and the repeated parts will not be described again.
[0195] Further, corresponding to the virtual machine management method described above, based on the same technical concept, one or more embodiments of the present application also provide a storage medium for storing computer executable instructions, in one specific embodiment, the storage medium can be a U disk, an optical disk, a hard disk, etc., the computer executable instructions stored in the storage medium can implement the following process when executed by a processor:
[0196] receiving a first virtual machine processing request sent by a client; the first virtual machine processing request includes processing information of a target virtual machine to be processed;
[0197] determining a first target computing node in a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes and a plurality of physical machines included in the physical machine management system are in one-to-one correspondence, and each of the physical machines has at least one virtual machine installed thereon;
[0198] sending a control instruction to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and to send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
[0199] The storage medium provided by one or more embodiments of the present application stores computer executable instructions which, when executed by a processor, receive a first virtual machine management request sent by a client, determine a first target computing node from a plurality of computing nodes included in a k8s cluster, and send a control instruction to the first target computing node according to processing information of a target virtual machine to be processed, so that the first target computing node performs corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and sends a second virtual machine processing request to a physical machine management system according to the processing information to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node. Since the computing nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the computing nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is required in the management process of the virtual machines, realizing automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability, and intelligence of the virtual machine management.
[0200] In another specific embodiment, the storage medium can be a U disk, an optical disk, a hard disk, etc. The computer executable instructions stored in the storage medium, when executed by a processor, can implement the following processes:
[0201] receiving a control instruction sent by a control node of the k8s cluster; the control instruction includes processing information of a target virtual machine to be processed;
[0202] performing corresponding processing on a first Pod corresponding to the target virtual machine in the computing node according to the processing information;
[0203] sending a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the computing node.
[0204] The storage medium storing the computer executable instructions provided by one or more embodiments of the present application, when executed by a processor, receives a control instruction sent by a control node of a k8s cluster, performs corresponding processing on a first Pod corresponding to a target virtual machine in the control node according to processing information of the target virtual machine included in the control instruction, and sends a second virtual machine processing request to a physical machine management system according to the processing information, to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target control node. Since the control nodes included in the k8s cluster and the physical machines included in the physical machine management system are in one-to-one correspondence, and the Pods in the control nodes and the virtual machines installed on the corresponding physical machines are in one-to-one correspondence, managing the Pods based on the k8s cluster is equivalent to managing the virtual machines, that is, no human intervention is required in the management process of the virtual machines, realizing the automatic management of the virtual machines, reducing the time cost of virtual machine management, and improving the management efficiency of the virtual machines and the stability, reliability and intelligence of the virtual machine management.
[0205] It should be noted that the embodiments of the storage medium in the present application and the embodiments of the virtual machine management method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the foregoing implementation of the corresponding virtual machine management method, and the repeated parts will not be described again.
[0206] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in an order other than that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order in order to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous or necessary.
[0207] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.
[0208] The controller can be implemented in any suitable way, e.g. the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, e.g. software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to being implemented in pure computer readable program code form, the controller can perfectly well be implemented to perform the same functions using logic gates, switches, an application specific integrated circuit, a programmable logic controller and an embedded microcontroller, etc. by means of a logical programming of the method steps. The controller can thus be considered a hardware component, and the means comprised therein for performing the various functions can be considered structures within the hardware component. Alternatively, or even, the means for performing the various functions can be considered both a software module implementing the method and a structure within the hardware component.
[0209] The systems, apparatuses, modules or units illustrated by the above embodiments can be implemented by computer chips or entities, or products with certain functions. A typical implementation device is a computer. Specifically, the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0210] For the sake of description, the above apparatuses are described in various units by functions respectively. Of course, the functions of each unit can be implemented in the same or multiple software and / or hardware in the implementation of the embodiments of the present application.
[0211] Those skilled in the art will appreciate that one or more embodiments of the application can provide a method, a system or a computer program product. Accordingly, one or more embodiments of the application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage media such as DVDs, etc.) embodying computer readable program code thereon for use by or in connection with an instruction execution system.
[0212] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0213] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0214] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.
[0215] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0216] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.
[0217] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0218] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0219] One or more embodiments of the application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. One or more embodiments of the application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including memory storage devices.
[0220] Various embodiments in the present application are described in progressive manner, and the same or similar parts between various embodiments can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0221] The above merely provides the example of the present document and is not intended to limit the present document. For those skilled in the art, the present document can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present document shall be included in the scope of claims of the present document.
Claims
1. A virtual machine management method characterized by comprising: A method applied to a control node of a k8s cluster, the method comprising: receiving a first virtual machine processing request sent by a client; the first virtual machine processing request comprising processing information of a target virtual machine to be processed; determining a first target computing node from a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes corresponding to a plurality of physical machines included in a physical machine management system one by one, and each of the physical machines being installed with at least one virtual machine; sending a control instruction to the first target computing node according to the processing information; the control instruction being used to instruct the first target computing node to perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request being used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
2. The method of claim 1, wherein, The first virtual machine processing request comprises a first virtual machine creation request, and the processing information comprises creation information; the control instruction is used to instruct the first target computing node to determine specification information and a virtual machine template of the target virtual machine according to the processing information, and perform creation processing on the first Pod corresponding to the target virtual machine in the first target computing node according to the specification information and the virtual machine template. The determining of the first target computing node from the plurality of computing nodes included in the k8s cluster according to the processing information comprises: determining whether a scheduling strategy of the first target computing node is included in the creation information; if yes, determining the first target computing node from the plurality of computing nodes included in the k8s cluster according to the scheduling strategy; if no, determining the first target computing node from the plurality of computing nodes included in the k8s cluster according to a default scheduling strategy.
3. The method of claim 2, wherein, The first virtual machine processing request further comprises a first virtual machine deletion request, and the processing information comprises deletion information; the determining of the first target computing node from the plurality of computing nodes included in the k8s cluster according to the processing information comprises: obtaining first identification information of the target virtual machine from the deletion information; querying associated creation record information from a storage system according to the first identification information; the creation record information being generated after the first target computing node performs creation processing on the first Pod corresponding to the target virtual machine; obtaining second identification information from the creation record information, and determining a computing node corresponding to the second identification information as the first target computing node.
4. The method of claim 2, wherein, The method further comprises: receiving a virtual machine query request sent by the client; the virtual machine query request comprising query information of a virtual machine to be queried; querying target creation record information matched with the query information from a storage system; the target creation record information being generated after a first target computing node performs creation processing on a first Pod corresponding to the virtual machine to be queried; and According to the target, record information is created to generate a query result, and the query result is sent to the client.
5. The method of claim 1, wherein, The method further comprises: receiving a first virtual machine capacity change request sent by a virtual machine management system; the first virtual machine capacity change request is sent based on a second virtual machine capacity change request sent by the client; the first virtual machine capacity change request comprises a first annotation and first identification information of a virtual machine to be changed in capacity; the first annotation is a system attribute of a second Pod corresponding to the virtual machine to be changed in capacity, and is used to represent that the virtual machine to be changed in capacity is subjected to capacity change processing; the first annotation comprises a target specification identifier; if it is determined that the first annotation conforms to a preset format, target specification information associated with the target specification identifier is acquired from an association relationship between specification identifiers and specification information saved by a storage system; according to the first identification information, second Pod creation record information is queried from the creation record information of the Pod saved by the storage system; specification information in the second Pod creation record information is updated as the target specification information; a computing node corresponding to second identification information in the second Pod creation record information is determined as a second target computing node corresponding to the virtual machine to be changed in capacity; according to the target specification information and the first identification information, virtual machine capacity change instruction information is sent to the second target computing node; the virtual machine capacity change instruction information is used to instruct the second target computing node to send a third virtual machine capacity change request to the physical machine management system; the third virtual machine capacity change request is used to request the physical machine management system to perform capacity change processing on the virtual machine to be changed in capacity in a physical machine corresponding to the second target computing node.
6. The method of claim 1, wherein, The method further comprises: receiving a first virtual machine migration request sent by a virtual machine management system; the first virtual machine migration request is sent based on a second virtual machine migration request sent by the client; the first virtual machine migration request comprises a second annotation and first identification information of a virtual machine to be migrated; the second annotation is a system attribute of a third Pod corresponding to the virtual machine to be migrated, and is used to represent that the virtual machine to be migrated is subjected to migration processing; the second annotation comprises a first migration identifier and third identification information of a target physical machine; if it is determined that the second annotation conforms to a second preset format, a third target computing node where the third Pod is located is determined according to the first identification information; according to the first identification information and the second annotation, first virtual machine migration instruction information is sent to the third target computing node; the first virtual machine migration instruction information is used to instruct the third target computing node to delete the third Pod and update the first migration identifier to a second migration identifier; if a second annotation containing the second migration identifier is acquired, a fourth target computing node corresponding to the target physical machine is determined according to the third identification information; According to the first identification information and the second annotation containing the second migration identification, second virtual machine migration indication information is sent to the fourth target computing node; the second virtual machine migration indication information is used to instruct the fourth target computing node to create the third Pod, update the creation record information of the third Pod in the storage system, and send a third virtual machine migration request to the physical machine management system; the third virtual machine migration request is used to request the physical machine management system to migrate the virtual machine to be migrated from the physical machine corresponding to the third target computing node to the target physical machine.
7. The method of claim 2, wherein, The method further comprises: receiving a virtual machine specification processing request sent by the client; the virtual machine specification processing request is used to request any processing of target specification information, such as creation, query, deletion, or update; processing the target specification information according to the virtual machine specification processing request.
8. The method of claim 2, wherein, The method further comprises: receiving a virtual machine template processing request sent by the client; the virtual machine template processing request is used to request any processing of a target virtual machine template, such as creation, query, or deletion; processing the target virtual machine template according to the virtual machine template processing request.
9. The method of claim 1, wherein, The k8s cluster further comprises a CRD controller, and the method further comprises: if it is determined that the snapshot processing condition is met, sending snapshot processing indication information to the CRD controller; the snapshot processing indication information is used to instruct the CRD controller to perform any processing of a target virtual machine snapshot, such as creation, query, deletion, or rollback.
10. A virtual machine management method characterized by comprising: The method comprises: receiving a control instruction sent by a control node of the k8s cluster; the control instruction comprises processing information of a target virtual machine to be processed; processing a first Pod corresponding to the target virtual machine in the computing node according to the processing information; sending a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to process the target virtual machine in a target physical machine corresponding to the computing node.
11. The method of claim 10, wherein, The processing information comprises creation information. The processing of the first Pod corresponding to the target virtual machine comprises creation processing of the first Pod corresponding to the target virtual machine. After the processing of the first Pod corresponding to the target virtual machine, the method further comprises generating creation record information of the first Pod according to the creation information and saving the creation record information in a storage system. The second virtual machine processing request comprises a second virtual machine creation request, which is used to request the physical machine management system to perform creation processing of the target virtual machine in a target physical machine corresponding to the computing node.
12. The method of claim 11, wherein, The creation processing of the first Pod corresponding to the target virtual machine comprises: Obtaining a specification identifier and a template identifier from the creation information; Obtaining specification information of an associated virtual machine in the storage system according to the specification identifier; Obtaining a virtual machine template associated in the storage system according to the template identifier; Creating the first Pod corresponding to the target virtual machine according to the specification information and the virtual machine template.
13. The method of claim 11, wherein, The processing information includes deletion information; The corresponding processing of the first Pod corresponding to the target virtual machine includes deletion processing of the first Pod corresponding to the target virtual machine; After the corresponding processing of the first Pod corresponding to the target virtual machine, the method further includes deleting the creation record information of the first Pod from the storage system; The second virtual machine processing request is used to request the physical machine management system to perform deletion processing on the target virtual machine in the target physical machine corresponding to the computing node.
14. The method of claim 10, wherein, The method further includes: Receiving virtual machine capacity change indication information sent by the control node; the virtual machine capacity change indication information includes first identification information of a virtual machine to be changed in capacity and target specification information; According to the first identification information, the target specification information and the second identification information of the computing node, a third virtual machine capacity change request is sent to the physical machine management system; the third virtual machine capacity change request is used to request the physical machine management system to perform capacity change processing on the virtual machine to be changed in capacity in the physical machine corresponding to the computing node.
15. The method of claim 10, wherein, The method further includes: Receiving first virtual machine migration indication information sent by the control node; the first virtual machine migration indication information includes second annotation and first identification information of a virtual machine to be migrated; the second annotation is a system attribute of a third Pod corresponding to the virtual machine to be migrated, and is used to indicate that the virtual machine to be migrated is subjected to migration processing, and the second annotation includes first migration identifier and third identification information of a target physical machine; According to the first identification information, the third Pod is determined and deleted; The first migration identifier is updated to a second migration identifier, so that the control node determines a fourth target computing node corresponding to the target physical machine according to the third identification information of the target physical machine when the second annotation containing the second migration identifier is acquired; according to the first identification information and the second annotation containing the second migration identifier, second virtual machine migration indication information is sent to the fourth target computing node; the second virtual machine migration indication information is used to instruct the fourth target computing node to create the third Pod in the fourth target computing node, update creation record information of the third Pod in the storage system, and send third virtual machine migration request to the physical machine management system; the third virtual machine migration request is used to request the physical machine management system to migrate the virtual machine to be migrated from a physical machine corresponding to the third target computing node to the target physical machine.
16. A virtual machine management apparatus characterized by comprising: The control node applied to the k8s cluster, the device includes: receive a first virtual machine processing request sent by a client; the first virtual machine processing request comprises processing information of a target virtual machine to be processed; determine a first target computing node from a plurality of computing nodes included in the k8s cluster according to the processing information; the plurality of computing nodes correspond one-to-one to a plurality of physical machines included in a physical machine management system, and each of the physical machines has at least one virtual machine installed thereon; send a control instruction to the first target computing node according to the processing information; the control instruction is used to instruct the first target computing node to perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
17. A virtual machine management apparatus characterized by comprising: A computing node applied to a k8s cluster, the computing node corresponds one-to-one to a physical machine included in a physical machine management system, and each of the physical machines has at least one virtual machine installed thereon, and the device comprises: receive a control instruction sent by a control node of the k8s cluster; the control instruction comprises processing information of a target virtual machine to be processed; perform corresponding processing on a first Pod corresponding to the target virtual machine in the computing node according to the processing information; send a second virtual machine processing request to the physical machine management system according to the processing information; the second virtual machine processing request is used to request the physical machine management system to perform corresponding processing on the target virtual machine in a target physical machine corresponding to the first target computing node.
18. A virtual machine management system, characterized by comprising: The system comprises a client, a k8s cluster and a physical machine management system; the k8s cluster comprises a control node and a plurality of computing nodes, the plurality of computing nodes correspond one-to-one to a plurality of physical machines included in the physical machine management system, and each of the physical machines has at least one virtual machine installed thereon; The client is configured to send a first virtual machine processing request to the control node in response to a user operation; the first virtual machine processing request comprises processing information of a target virtual machine to be processed; The control node is configured to receive the first virtual machine processing request, determine a first target computing node from the plurality of computing nodes according to the processing information, and send a control instruction to the first target computing node according to the processing information; The first target computing node is configured to receive the control instruction, perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; The first target computing node is configured to receive the control instruction, perform corresponding processing on a first Pod corresponding to the target virtual machine in the first target computing node according to the processing information, and send a second virtual machine processing request to the physical machine management system according to the processing information; The physical machine management system is configured to receive the second virtual machine processing request, determine a target physical machine corresponding to the first target computing node according to the processing information, and perform corresponding processing on the target virtual machine in the target physical machine.
19. The system of claim 18, wherein, The system further comprises a virtual machine management system. The client is configured to send a first virtual machine processing request to the virtual machine management system in response to a user operation. The virtual machine management system is configured to receive the first virtual machine processing request and send the first virtual machine processing request to the control node.
20. An electronic device, comprising: Comprise: a processor; and a memory arranged to store computer executable instructions configured to be executed by the processor, the executable instructions comprising instructions for performing steps in the virtual machine management method according to any one of claims 1-9, or the executable instructions comprising instructions for performing steps in the virtual machine management method according to any one of claims 10-15.
21. A storage medium, characterized by The storage medium is configured to store computer executable instructions, the executable instructions causing a computer to perform the virtual machine management method according to any one of claims 1-9, or the executable instructions causing a computer to perform the virtual machine management method according to any one of claims 10-15.
Citation Information
Patent Citations
Virtual machine management system and method and medium
CN115080187A
Unified resource management for containers and virtual machines
US20210141655A1