Virtual machine operation control method and equipment
By creating a root file system isolation environment on the host node and deploying virtual machine creation components, the semi-container isolation design of the virtual machine is realized, which solves the problems of virtual machine instability and resource overhead in the existing technology, improves the stability and lightweight of the virtual machine, and enhances dynamic management capabilities.
Patent Information
- Application Number
- CN202411814956.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
AI Technical Summary
The existing fully containerized virtual machine management solution leads to unstable virtual machines and high resource overhead, and the life cycle of virtual machines and containers conflicts, limiting the dynamic management and resource optimization of virtual machines.
By creating a root file system isolation environment in the host node, deploying virtual machine creation components, and generating virtual machine configuration files based on configuration information, implementing the semi-container isolation design of the virtual machine, and running the virtual machine directly on the host node.
It improves the stability and lightweight of virtual machines, reduces resource usage, avoids conflicts between containers and virtual machines' life cycles, and enhances the dynamic management capabilities of virtual machines.
Smart Images

Figure CN119759495A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer and network communication technology, and more particularly to a method and device for controlling the operation of a virtual machine. Background Art
[0002] A virtual machine (VM) is a computer program or system that simulates the hardware operating environment of a physical computer through software, allowing multiple operating systems to run simultaneously on the same physical machine.
[0003] Some related technologies usually use fully containerized virtual machine management and control solutions. However, in fully containerized virtual machine management and control solutions, containers are elastic, and virtual machines running in containers cause virtual machines to be unstable and have relatively large resource overhead. Summary of the invention
[0004] The embodiments of the present disclosure provide a method and device for controlling the operation of a virtual machine, so as to improve the stability and lightness of the virtual machine.
[0005] In a first aspect, an embodiment of the present disclosure provides a virtual machine operation control method, comprising:
[0006] Obtaining, through an agent unit in the host node, first configuration information of a first virtual machine to be created from the control node;
[0007] Calling the resource allocation unit in the host node through the proxy unit to allocate target resources to the first virtual machine according to the first configuration information;
[0008] Creating a first root file system isolation environment in the host node through the proxy unit, deploying a first virtual machine creation component in the first root file system isolation environment, and generating a first virtual machine configuration file according to the first configuration information;
[0009] The first virtual machine creation component creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource.
[0010] In a second aspect, an embodiment of the present disclosure provides a virtual machine operation control method, including:
[0011] receiving a virtual machine creation request through an interface in the control node, wherein the virtual machine creation request includes demand information of a first virtual machine to be created;
[0012] Allocating a host node for the first virtual machine according to the demand information by a scheduling unit in the control node;
[0013] Generate first configuration information of the first virtual machine according to the demand information by a control unit in the control node, and associate the first configuration information with the host node;
[0014] The first configuration information is sent to the agent unit in the host node through the control unit, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
[0015] In a third aspect, an embodiment of the present disclosure provides a virtual machine operation control device, including:
[0016] An agent unit, configured to obtain first configuration information of a first virtual machine to be created from a control node;
[0017] A resource allocation unit, configured to be called by the proxy unit to allocate target resources to the first virtual machine according to the first configuration information;
[0018] The proxy unit is further used to create a first root file system isolation environment in the host node, deploy a first virtual machine creation component in the first root file system isolation environment, and generate a first virtual machine configuration file according to the first configuration information;
[0019] A creating unit is used to create the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component.
[0020] In a fourth aspect, an embodiment of the present disclosure provides a virtual machine operation control device, including:
[0021] An interface unit, configured to receive a virtual machine creation request, wherein the virtual machine creation request includes requirement information of a first virtual machine to be created;
[0022] A scheduling unit, configured to allocate a host node to the first virtual machine according to the demand information;
[0023] A control unit is used to generate first configuration information of the first virtual machine according to the demand information, and associate the first configuration information with the host node; send the first configuration information to the agent unit in the host node, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
[0024] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0025] The memory stores computer-executable instructions;
[0026] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the virtual machine operation control method described in the first aspect and various possible designs of the first aspect, or the virtual machine operation control method described in the second aspect and various possible designs of the second aspect.
[0027] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the virtual machine operation control method described in the first aspect and various possible designs of the first aspect, or the virtual machine operation control method described in the second aspect and various possible designs of the second aspect is implemented.
[0028] In the seventh aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the virtual machine operation control method described in the first aspect and various possible designs of the first aspect, or the virtual machine operation control method described in the second aspect and various possible designs of the second aspect.
[0029] The virtual machine operation control method and device provided in the embodiment of the present disclosure obtains the first configuration information of the first virtual machine to be created from the control node through the agent unit in the host node; calls the resource allocation unit in the host node through the agent unit, and allocates the target resources to the first virtual machine according to the first configuration information; creates a first root file system isolation environment in the host node through the agent unit, deploys the first virtual machine creation component in the first root file system isolation environment, and generates a first virtual machine configuration file according to the first configuration information; creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component. The embodiment of the present disclosure deploys the virtual machine creation component for managing virtual machines in an independent root file system isolation environment, while the virtual machine runs directly on the host node, realizing the semi-containerized isolation design of the virtual machine, improving the stability of the virtual machine, and making the virtual machine more lightweight and less resource-intensive. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0031] Figure 1 A schematic diagram of a virtual machine operation control in the prior art;
[0032] Figure 2 A schematic diagram of the system architecture of a virtual machine operation control method provided by an embodiment of the present disclosure;
[0033] Figure 3 A schematic diagram of a flow chart of a virtual machine operation control method provided by an embodiment of the present disclosure;
[0034] Figure 4 A schematic diagram of a host node architecture of a virtual machine operation control method provided by another embodiment of the present disclosure;
[0035] Figure 5 A flowchart of a virtual machine operation control method provided by an embodiment of the present disclosure;
[0036] Figure 6 A structural block diagram of a virtual machine operation control device provided in an embodiment of the present disclosure;
[0037] Figure 7 A structural block diagram of a virtual machine operation control device provided by another embodiment of the present disclosure;
[0038] Figure 8 A schematic diagram of the hardware structure of a virtual machine operation control device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0040] Some related technologies usually use fully containerized virtual machine management solutions. Among them, fully containerized virtual machine management solutions, such as KubeVirt, run based on Kubernetes (container orchestration system), seamlessly extend existing clusters by using custom resources (CRD) and other Kubernetes features, and provide a set of virtualized APIs that can be used to manage virtual machines. In the KubeVirt solution, the virtual machine Pod architecture is as follows Figure 1 As shown in the figure, the KubeVirt solution includes four key components:
[0041] Virt-api: Provides API service capabilities for Kubevirt, such as many customized API requests, such as startup, shutdown, and restart operations. By using APIService as a plug-in for Kubernetes APIServer, businesses can directly request Virt-api through Kubernetes APIserver.
[0042] Virt-controller: Kubevirt's controller, which functions similarly to Kubernetes' controller-manager. It manages and monitors VMI (virtual machine instance) objects and their associated Pods (container groups), and updates their status.
[0043] Virt-handler: Deployed as a Daemonset (daemon process), it has similar functions to Kubelet and manages all virtual machine instances on the host by monitoring the local VMI and instance resources.
[0044] Virt-launcher: Kubevirt creates a Pod for each VMI object. The main process of the Pod is Virt-launcher. The Pod of Virt-launcher provides isolation of Cgroups and Namespaces. Virt-launcher is the main process of the virtual machine instance.
[0045] More specifically, Virt-handler notifies Virt-launcher to launch VMI by passing VMI's CRD object to Virt-launcher. Virt-launcher then uses a local Libvirt instance in its container to launch VMI. Virt-launcher hosts the VMI process and terminates after VMI exits. If the Kubernetes runtime attempts to shut down the Virt-launcher container before VMI exits, Virt-launcher forwards the signal from Kubernetes to the VMI process and attempts to postpone the termination of the container until VMI is successfully shut down.
[0046] Kubevirt has two obvious characteristics:
[0047] 1) It makes good use of the scalability of Kubernetes. The control plane components are all ordinary Pods running completely in the Kubernetes cluster. Virt-api registers its own interface with Kube-api, and then processes specific tasks such as virtual machine creation / deletion through Virt-controller. Virt-handler creates and manages virtual machines on the host machine.
[0048] 2) The virtual machine runs completely in the VM pod of Kubernetes. One virtual machine has one pod. Each pod contains the necessary components for running the virtual machine, such as Virt-lunchler, Libvirt, and Qemu. It is a complete containerized virtual machine solution.
[0049] It has the following problems:
[0050] 1) The elasticity of containers conflicts with the stability of virtual machines. Containers are designed to be stateless, while virtual machines are designed to be stateful. The requirements of containers and virtual machines for their life cycles are not completely consistent, which will lead to certain conflicts.
[0051] 2) The lifecycle of virtual machines and containers is bound, and the goals conflict. Containers tend to be stateless applications and are accessed through load balancing; virtual machines are stateful applications and can be controlled with stateful migration (hot migration, cold migration);
[0052] 3) Container hosting requires additional resource overhead, because each virtual machine requires an independent Virt-launcher pod to host the virtual machine, which will occupy additional resources. Each Virt-launcher pod will run a Virt-launcher / Libvirt, and certain resources must be allocated to it to ensure its normal operation; and a certain amount of resource cache (Buffer) must be reserved for each virtual machine instance for its direct device to improve the performance of the direct device;
[0053] 4) Functional restrictions: Currently, the virtual machine is bound to the Pod, and the dynamic functions of the virtual machine during operation are limited, mainly in the following aspects:
[0054] Hot-swappable capability: Since Pods are immutable, if you want to dynamically insert a disk, you need to use an additional Pod to insert the disk;
[0055] Vertical scaling: Once a Pod Spec is defined, it cannot be changed, and the corresponding resources are also immutable, which makes it impossible to dynamically expand the resource capacity of a running virtual machine.
[0056] Full containerization brings difficulties to the hot upgrade of virtual machine hosting components. For example, upgrading Qemu and Libvirt in the Virt-launcher pod may cause the user's virtual machine to shut down.
[0057] In order to solve at least one of the above technical problems, the embodiment of the present disclosure provides a virtual machine operation control method. In order to ensure the stability of the virtual machine, the virtual machine creation component that manages the virtual machine is deployed in an independent root file system isolation environment, and the virtual machine runs directly on the host node, realizing a semi-containerized isolation design, thereby effectively improving the stability of the virtual machine. In addition, each virtual machine does not need to deploy Virt-launcher and Libvirt like Kubevirt, so the virtual machine is lighter and occupies less resources.
[0058] The virtual machine operation control method disclosed in the present invention will be described in detail below in conjunction with specific embodiments.
[0059] refer to Figure 2 , Figure 2 A system architecture diagram of a virtual machine operation control method provided in an embodiment of the present disclosure. The method of this embodiment can be applied in a host node, wherein the system architecture of this embodiment includes a control node and a host node, and the control node (Master) or edge node can receive user virtual machine creation requests, allocate control nodes to virtual machines to be created, and manage configuration information and / or status information of virtual machines, etc.; and the host node is used to deploy virtual machines.
[0060] Optionally, the control node may include an interface (API), a control unit, a scheduling unit and a virtual machine configuration information management unit; wherein the interface (API) provides a unified API interface for the control node, which can realize arbitrary external interaction capabilities; the control unit (Controller) provides a unified control capability for the control node, can generate configuration information for the virtual machine to be created, and can also synchronize the virtual machine status; the scheduling unit (Scheduler) is used to allocate a control node to the virtual machine to be created; the virtual machine configuration information management unit (Custom Resource Definition, CRD) is used to manage the configuration information and / or status information of the virtual machine, etc.
[0061] The host node may include an agent unit and a resource allocation unit, wherein the agent unit is responsible for the lifecycle management of the virtual machine on the host node, and is responsible for the preparation and connection of storage devices and network devices, etc.; the resource allocation unit is used to allocate resources and report to the virtual machine, including CPU, storage resources, network resources, etc.
[0062] Optionally, the interface (API), control unit, scheduling unit and virtual machine configuration information management unit in the control node, as well as the agent unit and resource allocation unit in the host node, together constitute the control plane, which can be implemented in a containerized manner, that is, these units can all be implemented using components or containers (Pod) in a container orchestration system such as Kubernetes. Compared with binary deployment, it reduces complexity and has strong scalability. It can be quickly pulled up under abnormal circumstances, has stronger operation and maintenance capabilities, and is more agile and easier to operate and maintain. The virtual machines deployed in the host nodes are the data plane. In order to ensure the stability of the virtual machine operation and not be affected by changes in the containerized control plane, this embodiment can be deployed in a non-containerized manner, that is, binary deployment, which is completely decoupled from the container.
[0063] Figure 3 This is a flow chart of a virtual machine operation control method provided by an embodiment of the present disclosure. Based on the above system architecture, the virtual machine operation control method provided by this embodiment may include:
[0064] S201. Obtain first configuration information of a first virtual machine to be created from a control node through an agent unit in a host node.
[0065] In this embodiment, based on the above system architecture, when a user needs to create a virtual machine (referred to as a first virtual machine), a virtual machine creation request can be sent to the interface (API) of the control node, wherein the virtual machine creation request includes demand information of the first virtual machine to be created, and the demand information is some configuration information or specification information that the user expects for the first virtual machine, such as memory size, number of CPUs, operating system type, etc.
[0066] The interface (API) can generate the initial configuration information of the first virtual machine according to the demand information. The initial configuration information is the information obtained after converting the demand information into a specific format or template, which can be referred to as a Virtual InstanceTemplate (VIT, virtual instance template) object in this embodiment; and since the initial configuration information is only obtained by converting the demand information, the information may not be complete and may lack a lot of information necessary for the virtual machine creation process. Therefore, the control unit in the control node can improve the demand information or the initial configuration information to obtain the final configuration information of the first virtual machine, which is recorded as the first configuration information here, and can also be referred to as a Virtual Instance (VI, virtual instance) object in this embodiment. In addition, the scheduling unit in the control node can also allocate a host node to the first virtual machine according to the demand information and / or the initial configuration information. The process of allocating the host node and the process of generating the first configuration information can not distinguish the execution order. The control unit finally associates the first configuration information with the host node, and the host node information (such as an identifier, etc.) can be written into the first configuration information or associated in other ways. Optionally, the above initial configuration information and the first configuration information can be managed by the virtual machine configuration information management unit of the control node.
[0067] Furthermore, the agent unit of the host node may obtain the first configuration information from the control node.
[0068] Optionally, the agent unit of the host node may query whether there is first configuration information associated with the host node in the virtual machine configuration information management unit in the control node. If found, the first configuration information is obtained; wherein the query may be a real-time query, or a periodic query, or the query may be triggered by a specific method or instruction. When the agent unit obtains the first configuration information, it may send an acquisition request to the control unit or the virtual machine configuration information management unit of the control node, and then the control unit or the virtual machine configuration information management unit sends the first configuration information to the agent unit. Of course, the process of obtaining the first configuration information is not limited to the above example, and any feasible method may be used to obtain the first configuration information.
[0069] S202: Calling a resource allocation unit in the host node through the proxy unit to allocate target resources to the first virtual machine according to the first configuration information.
[0070] In this embodiment, after the proxy unit obtains the first configuration information, the resource allocation unit may be called to allocate target resources for the first virtual machine according to the first configuration information, including but not limited to network resources, storage resources, CPU, etc. For example, VNI (Virtual Network Identifier), CSI (Container Storage Interface), etc. may be allocated.
[0071] S203: Create a first root file system isolation environment in the host node through the agent unit, deploy a first virtual machine creation component in the first root file system isolation environment, and generate a first virtual machine configuration file according to the first configuration information.
[0072] In this embodiment, after completing the target resource allocation, the agent unit can create a root file system isolation environment in the host node, which is recorded here as the first root file system isolation environment, wherein the root file system isolation environment, namely Rootfs, is a technology in the container technology, and is a file system used to provide an isolated execution environment for the container process. In this embodiment, a container is not created in the first root file system isolation environment, but only the virtual machine creation component Libvirt is deployed in the first root file system isolation environment, which is recorded here as the first virtual machine creation component. The virtual machine creation component Libvirt is used to create and support the non-containerized first virtual machine. Since the virtual machine creation component Libvirt still needs to continue to run after creation, it is deployed in the first root file system isolation environment so that it no longer depends on the host-related library files. In this way, the upgrade and change of the host-related library files will not affect other services of the host. A stable operating environment is provided for the virtual machine creation component Libvirt, which can ensure independent support for the operation of the virtual machine and improve the stability of the virtual machine. In addition, it is also convenient for virtual machine upgrades. When the virtual machine created by the virtual machine creation component Libvirt is upgraded, it does not affect the operation of other virtual machines created by the virtual machine creation component Libvirt.
[0073] In addition, when creating the first virtual machine, the first virtual machine creation component needs to be based on a virtual machine configuration file, which is usually a virtual machine configuration file in XML format, referred to as the first virtual machine configuration file here. The first virtual machine configuration file can be generated by the agent unit according to the first configuration information.
[0074] In addition, the proxy unit can also connect to the allocated target resources. Optionally, when allocating target resources, the target resources can be marked with the identification information of the first virtual machine (or other identification), and then when the proxy unit connects to the target resources, it can call the corresponding target resources according to the identification information of the first virtual machine, for example, calling CSI to prepare the corresponding storage device in its own node according to the identification information of the first virtual machine, and calling VNI-API to prepare the corresponding network device in its own node.
[0075] S204: Create the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component.
[0076] In this embodiment, the first virtual machine creation component Libvirt can create the first virtual machine directly on the host node according to the first virtual machine configuration file and the target resources, instead of creating the first virtual machine in a container. Therefore, the created first virtual machine is in binary form, not in container form.
[0077] More specifically, the first virtual machine creation component Libvirt calls the virtual machine monitor Hypervisor, and executes a startup request according to the first virtual machine configuration file and the target resource to achieve the creation of the first virtual machine, wherein the virtual machine monitor Hypervisor is a virtualization technology, which is a software layer that can be installed on physical hardware to achieve virtualization.
[0078] Among them, the virtual machine monitor Hypervisor can generally include Xen, KVM, LXC, Qemu, UML, etc. In this embodiment, KVM and Qemu can be used, wherein KVM is a kernel virtual machine module, and KVM is called through the first virtual machine creation component Libvirt, and kernel virtualization can be performed based on target resources according to the first virtual machine configuration file, and Qemu is a virtual machine simulator, and Qemu is called through the first virtual machine creation component Libvirt, and network device virtualization and storage device virtualization can be performed based on target resources according to the first virtual machine configuration file, thereby forming a first virtual machine, and hardware can be simulated through KVM and QEMU to provide nearly native performance for the virtual machine. Of course, other virtual machine monitors can also be called, which will not be repeated here.
[0079] Furthermore, a virtual machine operating system may be deployed in the first virtual machine. The virtual machine operating system may be a user operating system GuestOS, which will not be described in detail here.
[0080] Optionally, after the creation of the first virtual machine is completed, the agent unit may also update the status information of the first virtual machine that has been created to the first configuration information of the first virtual machine stored in the virtual machine configuration information management unit, thereby realizing the status update, so as to facilitate the subsequent status query or maintenance of the first virtual machine. Optionally, when updating the status information, the agent unit may send the status information of the first virtual machine that has been created to the control unit of the control node, and the control unit may update the status information to the first configuration information of the first virtual machine stored in the virtual machine configuration information management unit, or the agent unit may directly send the status information of the first virtual machine that has been created to the virtual machine configuration information management unit for status update.
[0081] The virtual machine operation control method provided in the above embodiment obtains the first configuration information of the first virtual machine to be created from the control node through the agent unit in the host node; calls the resource allocation unit in the host node through the agent unit, and allocates target resources to the first virtual machine according to the first configuration information; creates a first root file system isolation environment in the host node through the agent unit, deploys the first virtual machine creation component in the first root file system isolation environment, and generates a first virtual machine configuration file according to the first configuration information; creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component. The above embodiment deploys the virtual machine creation component that manages the virtual machine in an independent root file system isolation environment, while the virtual machine runs directly on the host node, realizing the semi-containerized isolation design of the virtual machine, improving the stability of the virtual machine, and making the virtual machine lighter and less resource-intensive.
[0082] The reasons for achieving the above technical effects are as follows:
[0083] 1) Semi-containerized isolation design of virtual machines
[0084] Compared with kubevirt's fully containerized virtual machine, which runs completely in the Pod, the virtual machine in this embodiment runs directly on the host machine. The reason for using semi-containerization is to put the virtual machine creation component Libvirt, the most important component for managing virtual machines, and its dependencies in an independent Rootfs isolation environment, using Rootfs, one of the many isolation technologies of containers. This is also different from OpenSatck nova libvirt running directly on the host machine. The reason for this design is:
[0085] Libvirt and its dependencies (Qemu) are placed independently in a Rootfs isolated environment. In particular, its dependencies do not rely on the host-related library files, so that the upgrade and change of the relevant library files on the host will not affect Libvirt, and the upgrade and change of Libevirt's library files will not affect other services of the host, which provides a very stable operating environment for libvirt. When Libevirt and its dependencies are cold upgraded or hot upgraded, Libevirt and its dependencies are maintained independently, so they can be easily cold upgraded or hot upgraded without affecting the operation of the virtual machine. This has many advantages over Kubevirt's fully containerized Pod. For example, if you only want to upgrade the Libevirt component but not the Qemu-KVM component, this cannot be done for the fully containerized Pod, and the virtual machine needs to be shut down, affecting the customer experience.
[0086] 2) Virtual machines are lighter and use less resources, which is similar to Kubevirt's fully containerized Pods (such as Figure 1 ) has outstanding advantages. Each virtual machine Pod of Kubevirt is installed with the following components: Virt-launcher pod: the main process of the Pod of Kubevirt that carries the virtual machine; Libvirt: a general open source component for managing virtual machines; Qemu: a fully virtualized simulation component; GuestOS: the operating system of the virtual machine, including the Guest application and the Guest kernel; while in this embodiment, there is no Virt-launcher Pod, and it is not necessary to allocate the resources used by Virt-launcher to each virtual machine. Each host machine only needs one Libvirt, instead of one Libevirt for each virtual machine. Multiple virtual machines can share one Libevirt, and the virtual machines of the entire host machine can be managed by one Libvirt.
[0087] 3) The control plane is containerized, and the data plane is non-containerized, which improves the stability of the virtual machine. In this embodiment, the control plane components of the virtual machine, such as the interface (API), control unit, scheduling unit, etc. in the control node, and the agent unit and resource allocation unit in the host machine, are all containerized designs, while the Qemu-KVM on the data plane is binary. This design has the following advantages:
[0088] Control plane: Utilize the Kubernetes extension API to allow the system of this embodiment to be directly and seamlessly integrated with Kubernetes; use Kubernetes to customize the virtual machine configuration information management unit CRD to transmit important configuration data of the virtual machine; use the container elasticity of Kubernetes to allow components to be horizontally expanded and quickly pulled up in abnormal situations;
[0089] Data plane: Qemu-KVM on the data plane runs directly in binary mode, which is completely decoupled from Kubernetes and containers. Data changes on the Kubernetes container side will not affect the operation of the Qemu-KVM virtual machine. However, Kubevirt has a prominent disadvantage. Once the node status and label change, it may cause virtual machine drift and restart.
[0090] Based on any of the above embodiments, there are multiple first virtual machines to be created; multiple first virtual machines can be created using the same first virtual machine creation component, and the system architecture on the host node side is as follows: Figure 4 As shown, the creation process is as follows:
[0091] For the plurality of first virtual machines, create a first root file system isolation environment in the host node through the agent unit, and deploy a first virtual machine creation component in the first root file system isolation environment;
[0092] The first virtual machine creation component calls a virtual machine monitor for each first virtual machine respectively, and creates each first virtual machine based on the corresponding target resources according to the corresponding first virtual machine configuration file.
[0093] In this embodiment, the process of creating multiple virtual machines using the same first virtual machine creation component is similar to the above embodiment, which will not be repeated here.
[0094] Based on any of the above embodiments, the already created virtual machine can also be hot-upgraded, and the process is as follows:
[0095] Obtaining, by the proxy unit, an upgrade request for the first virtual machine from the control node, wherein the upgrade request includes second configuration information of a second virtual machine after the first virtual machine is upgraded;
[0096] Calling the resource allocation unit in the host node through the proxy unit to allocate target resources to the second virtual machine according to the second configuration information;
[0097] Creating a second root file system isolation environment in the host node through the proxy unit, deploying a second virtual machine creation component in the second root file system isolation environment, and generating a second virtual machine configuration file according to the second configuration information;
[0098] Calling a virtual machine monitor through the second virtual machine creation component, creating the second virtual machine according to the second virtual machine configuration file, and copying hot data in the first virtual machine to the second virtual machine;
[0099] The second virtual machine is run, and the first virtual machine is stopped.
[0100] In this embodiment, the operation of the first virtual machine cannot be stopped during the hot upgrade process, so the above process is equivalent to re-creating a second virtual machine, and the creation process is implemented by the second virtual machine creation component in the second root file system isolation environment, and does not affect the first virtual machine creation component in the first root file system isolation environment, and will not affect the operation of the first virtual machine; and after the second virtual machine is created, the hot data in the first virtual machine can be copied to the second virtual machine, and the second virtual machine can be used to take over the first virtual machine, that is, the second virtual machine is run and the first virtual machine is stopped. The stopping and destroying of the first virtual machine can also be performed by the first virtual machine creation component, which will not be repeated here.
[0101] Of course, you can also perform a cold upgrade on the first virtual machine. You need to stop the first virtual machine first, and then use the same process as above to create a second virtual machine. After the second virtual machine is created, you can copy the data in the first virtual machine to the second virtual machine, and then run the second virtual machine to complete the cold upgrade of the first virtual machine.
[0102] Based on any of the above embodiments, the container of the agent unit and the resource allocation unit in the host node can be containerized, and a container orchestration system container management component Kubelet can be deployed on the host node to create containers of the agent unit and the resource allocation unit in the host node.
[0103] refer to Figure 5 , Figure 5 A flowchart of a virtual machine operation control method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a control node (Master), and the virtual machine operation control method includes:
[0104] S501. Receive a virtual machine creation request through an interface in a control node, wherein the virtual machine creation request includes demand information of a first virtual machine to be created;
[0105] S502, allocating a host node for the first virtual machine according to the demand information by a scheduling unit in the control node;
[0106] S503: Generate first configuration information of the first virtual machine according to the demand information by a control unit in the control node, and associate the first configuration information with the host node;
[0107] S504: Send the first configuration information to the agent unit in the host node through the control unit, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
[0108] Further, sending the first configuration information to the agent unit in the host node through the control unit includes:
[0109] The control unit stores the first configuration information in the virtual machine configuration information management unit in the control node, and after receiving the acquisition request sent by the agent unit, the first configuration information is sent to the agent unit.
[0110] The above embodiment is a method embodiment of the control node side. Its principle and specific implementation can be found in the method embodiment of the host node side, which will not be repeated here.
[0111] Corresponding to the virtual machine operation control method on the host node side of the above embodiment, Figure 6 This is a structural block diagram of a virtual machine operation control device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 6 The virtual machine operation control device 600 includes: an agent unit 601, a resource allocation unit 602, and a creation unit 603.
[0112] The agent unit 601 is used to obtain first configuration information of a first virtual machine to be created from the control node;
[0113] A resource allocation unit 602, configured to be called by the agent unit 601 to allocate target resources to the first virtual machine according to the first configuration information;
[0114] The agent unit 601 is further used to create a first root file system isolation environment in the host node, deploy a first virtual machine creation component in the first root file system isolation environment, and generate a first virtual machine configuration file according to the first configuration information;
[0115] The creation unit 603 is configured to create the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component.
[0116] In one or more embodiments of the present disclosure, when the creation unit creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component, it is configured to:
[0117] The first virtual machine creation component calls a virtual machine monitor, and creates the first virtual machine based on the target resources according to the first virtual machine configuration file.
[0118] In one or more embodiments of the present disclosure, when the creating unit 603 calls the virtual machine monitor through the first virtual machine creation component and creates the first virtual machine based on the target resource according to the first virtual machine configuration file, it is configured to:
[0119] The first virtual machine creation component calls the kernel virtual machine module KVM to perform kernel virtualization based on the target resources according to the first virtual machine configuration file, and calls the virtual machine simulator Qemu to perform network device virtualization and storage device virtualization based on the target resources according to the first virtual machine configuration file to create the first virtual machine.
[0120] In one or more embodiments of the present disclosure, there are multiple first virtual machines to be created;
[0121] Accordingly, when the agent unit 601 creates a first root file system isolation environment in the host node through the agent unit 601 and deploys a first virtual machine creation component in the first root file system isolation environment, it is used to:
[0122] For the plurality of first virtual machines, a first root file system isolation environment is created in the host node through the agent unit 601, and a first virtual machine creation component is deployed in the first root file system isolation environment;
[0123] Accordingly, when creating the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component, the creation unit 603 is used to:
[0124] The first virtual machine creation component calls a virtual machine monitor for each first virtual machine respectively, and creates each first virtual machine based on the corresponding target resources according to the corresponding first virtual machine configuration file.
[0125] In one or more embodiments of the present disclosure, when the agent unit 601 obtains the first configuration information of the first virtual machine to be created from the control node, it is used to:
[0126] Querying, by the proxy unit 601, whether the first configuration information associated with the host node exists in the virtual machine configuration information management unit in the control node, wherein the first configuration information associated with the host node is obtained by associating the first configuration information of the first virtual machine with the host node after the scheduling unit in the control node allocates a host node for the first virtual machine to be created;
[0127] If it is found that the first configuration information associated with the host node exists in the virtual machine configuration information management unit, the first configuration information is acquired.
[0128] In one or more embodiments of the present disclosure, after creating the first virtual machine according to the first virtual machine configuration file, the agent unit 601 is further configured to:
[0129] The agent unit 601 updates the status information indicating that the creation of the first virtual machine has been completed to the first configuration information of the first virtual machine stored in the virtual machine configuration information management unit.
[0130] In one or more embodiments of the present disclosure, the agent unit 601 is further configured to obtain an upgrade request for the first virtual machine from the control node, wherein the upgrade request includes second configuration information of the second virtual machine after the first virtual machine is upgraded;
[0131] The resource allocation unit 602 is further configured to be called by the proxy unit 601 to allocate target resources to the second virtual machine according to the second configuration information;
[0132] The agent unit 601 is further used to create a second root file system isolation environment in the host node, deploy a second virtual machine creation component in the second root file system isolation environment, and generate a second virtual machine configuration file according to the second configuration information;
[0133] The creation unit 603 is also used to call the virtual machine monitor through the second virtual machine creation component, create the second virtual machine according to the second virtual machine configuration file, and copy the hot data in the first virtual machine to the second virtual machine; run the second virtual machine, and stop running the first virtual machine.
[0134] In one or more embodiments of the present disclosure, the device further includes:
[0135] The container management component of the container orchestration system is used to create a container of the agent unit 601 and a container of the resource allocation unit 602 in the host node.
[0136] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0137] Corresponding to the virtual machine operation control method on the control node side of the above embodiment, Figure 7 This is a structural block diagram of a virtual machine operation control device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 7 The virtual machine operation control device 700 includes: an interface unit 701, a scheduling unit 702, and a control unit 703.
[0138] The interface unit 701 is used to receive a virtual machine creation request, wherein the virtual machine creation request includes demand information of a first virtual machine to be created;
[0139] A scheduling unit 702 is configured to allocate a host node to the first virtual machine according to the demand information;
[0140] The control unit 703 is used to generate first configuration information of the first virtual machine according to the demand information, and associate the first configuration information with the host node; send the first configuration information to the agent unit in the host node, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
[0141] In one or more embodiments of the present disclosure, when the control unit 703 sends the first configuration information to the agent unit in the host node through the control unit, it is used to:
[0142] The control unit stores the first configuration information in the virtual machine configuration information management unit in the control node, and after receiving the acquisition request sent by the agent unit, the first configuration information is sent to the agent unit.
[0143] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0144] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.
[0145] refer to Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present disclosure, and the electronic device 800 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0146] like Figure 8As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0147] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0148] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0149] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0150] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0151] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0152] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0155] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0156] In a first aspect, according to one or more embodiments of the present disclosure, a method for controlling operation of a virtual machine is provided, comprising:
[0157] Obtaining, through an agent unit in the host node, first configuration information of a first virtual machine to be created from the control node;
[0158] Calling the resource allocation unit in the host node through the proxy unit to allocate target resources to the first virtual machine according to the first configuration information;
[0159] Creating a first root file system isolation environment in the host node through the proxy unit, deploying a first virtual machine creation component in the first root file system isolation environment, and generating a first virtual machine configuration file according to the first configuration information;
[0160] The first virtual machine creation component creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource.
[0161] According to one or more embodiments of the present disclosure, creating the first virtual machine on the host node according to the first virtual machine configuration file and the target resource by the first virtual machine creation component includes:
[0162] The first virtual machine creation component calls a virtual machine monitor, and creates the first virtual machine based on the target resources according to the first virtual machine configuration file.
[0163] According to one or more embodiments of the present disclosure, the step of calling a virtual machine monitor through the first virtual machine creation component and creating the first virtual machine based on the target resource according to the first virtual machine configuration file includes:
[0164] The first virtual machine creation component calls the kernel virtual machine module KVM to perform kernel virtualization based on the target resources according to the first virtual machine configuration file, and calls the virtual machine simulator Qemu to perform network device virtualization and storage device virtualization based on the target resources according to the first virtual machine configuration file to create the first virtual machine.
[0165] According to one or more embodiments of the present disclosure, there are multiple first virtual machines to be created;
[0166] Correspondingly, the step of creating a first root file system isolation environment in the host node through the proxy unit and deploying a first virtual machine creation component in the first root file system isolation environment includes:
[0167] For the plurality of first virtual machines, create a first root file system isolation environment in the host node through the agent unit, and deploy a first virtual machine creation component in the first root file system isolation environment;
[0168] Correspondingly, creating the first virtual machine on the host node according to the first virtual machine configuration file and the target resource by the first virtual machine creation component includes:
[0169] The first virtual machine creation component calls a virtual machine monitor for each first virtual machine respectively, and creates each first virtual machine based on the corresponding target resources according to the corresponding first virtual machine configuration file.
[0170] According to one or more embodiments of the present disclosure, obtaining, from the control node, first configuration information of the first virtual machine to be created through an agent unit in the host node, includes:
[0171] Querying, by the proxy unit, whether the first configuration information associated with the host node exists in the virtual machine configuration information management unit in the control node, wherein the first configuration information associated with the host node is obtained by associating the first configuration information of the first virtual machine with the host node after the scheduling unit in the control node allocates a host node for the first virtual machine to be created;
[0172] If it is found that the first configuration information associated with the host node exists in the virtual machine configuration information management unit, the first configuration information is acquired.
[0173] According to one or more embodiments of the present disclosure, after creating the first virtual machine according to the first virtual machine configuration file, the method further includes:
[0174] The agent unit updates the status information indicating that the creation of the first virtual machine has been completed to the first configuration information of the first virtual machine stored in the virtual machine configuration information management unit.
[0175] According to one or more embodiments of the present disclosure, the method further includes:
[0176] Obtaining, by the proxy unit, an upgrade request for the first virtual machine from the control node, wherein the upgrade request includes second configuration information of a second virtual machine after the first virtual machine is upgraded;
[0177] Calling the resource allocation unit in the host node through the proxy unit to allocate target resources to the second virtual machine according to the second configuration information;
[0178] Creating a second root file system isolation environment in the host node through the proxy unit, deploying a second virtual machine creation component in the second root file system isolation environment, and generating a second virtual machine configuration file according to the second configuration information;
[0179] Calling a virtual machine monitor through the second virtual machine creation component, creating the second virtual machine according to the second virtual machine configuration file, and copying hot data in the first virtual machine to the second virtual machine;
[0180] The second virtual machine is run, and the first virtual machine is stopped.
[0181] According to one or more embodiments of the present disclosure, the method further includes:
[0182] A container of the proxy unit and a container of the resource allocation unit are created in the host node through a container management component of the container orchestration system pre-deployed in the host node.
[0183] In a second aspect, according to one or more embodiments of the present disclosure, a method for controlling operation of a virtual machine is provided, comprising:
[0184] receiving a virtual machine creation request through an interface in the control node, wherein the virtual machine creation request includes demand information of a first virtual machine to be created;
[0185] Allocating a host node for the first virtual machine according to the demand information by a scheduling unit in the control node;
[0186] Generate first configuration information of the first virtual machine according to the demand information by a control unit in the control node, and associate the first configuration information with the host node;
[0187] The first configuration information is sent to the agent unit in the host node through the control unit, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
[0188] According to one or more embodiments of the present disclosure, sending the first configuration information to the agent unit in the host node by the control unit includes:
[0189] The control unit stores the first configuration information in the virtual machine configuration information management unit in the control node, and after receiving the acquisition request sent by the agent unit, the first configuration information is sent to the agent unit.
[0190] In a third aspect, according to one or more embodiments of the present disclosure, a virtual machine operation control device is provided, including:
[0191] An agent unit, configured to obtain first configuration information of a first virtual machine to be created from a control node;
[0192] A resource allocation unit, configured to be called by the proxy unit to allocate target resources to the first virtual machine according to the first configuration information;
[0193] The proxy unit is further used to create a first root file system isolation environment in the host node, deploy a first virtual machine creation component in the first root file system isolation environment, and generate a first virtual machine configuration file according to the first configuration information;
[0194] A creating unit is used to create the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component.
[0195] According to one or more embodiments of the present disclosure, when the creation unit creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component, it is used to:
[0196] The first virtual machine creation component calls a virtual machine monitor, and creates the first virtual machine based on the target resources according to the first virtual machine configuration file.
[0197] According to one or more embodiments of the present disclosure, when the creation unit calls the virtual machine monitor through the first virtual machine creation component and creates the first virtual machine based on the target resource according to the first virtual machine configuration file, it is configured to:
[0198] The first virtual machine creation component calls the kernel virtual machine module to perform kernel virtualization based on the target resources according to the first virtual machine configuration file, and calls the virtual machine simulator to perform network device virtualization and storage device virtualization based on the target resources according to the first virtual machine configuration file to create the first virtual machine.
[0199] According to one or more embodiments of the present disclosure, there are multiple first virtual machines to be created;
[0200] Correspondingly, when the agent unit creates a first root file system isolation environment in the host node through the agent unit and deploys a first virtual machine creation component in the first root file system isolation environment, it is used to:
[0201] For the plurality of first virtual machines, create a first root file system isolation environment in the host node through the agent unit, and deploy a first virtual machine creation component in the first root file system isolation environment;
[0202] Accordingly, when the creation unit creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component, it is configured to:
[0203] The first virtual machine creation component calls a virtual machine monitor for each first virtual machine respectively, and creates each first virtual machine based on the corresponding target resources according to the corresponding first virtual machine configuration file.
[0204] According to one or more embodiments of the present disclosure, when the agent unit obtains the first configuration information of the first virtual machine to be created from the control node, it is used to:
[0205] Querying, by the proxy unit, whether the first configuration information associated with the host node exists in the virtual machine configuration information management unit in the control node, wherein the first configuration information associated with the host node is obtained by associating the first configuration information of the first virtual machine with the host node after the scheduling unit in the control node allocates a host node for the first virtual machine to be created;
[0206] If it is found that the first configuration information associated with the host node exists in the virtual machine configuration information management unit, the first configuration information is acquired.
[0207] According to one or more embodiments of the present disclosure, after creating the first virtual machine according to the first virtual machine configuration file, the agent unit is further configured to:
[0208] The agent unit updates the status information indicating that the creation of the first virtual machine has been completed to the first configuration information of the first virtual machine stored in the virtual machine configuration information management unit.
[0209] According to one or more embodiments of the present disclosure, the proxy unit is further used to obtain an upgrade request for the first virtual machine from the control node, wherein the upgrade request includes second configuration information of the second virtual machine after the first virtual machine is upgraded;
[0210] The resource allocation unit is further configured to be called by the proxy unit to allocate target resources to the second virtual machine according to the second configuration information;
[0211] The proxy unit is further used to create a second root file system isolation environment in the host node, deploy a second virtual machine creation component in the second root file system isolation environment, and generate a second virtual machine configuration file according to the second configuration information;
[0212] The creation unit is also used to call the virtual machine monitor through the second virtual machine creation component, create the second virtual machine according to the second virtual machine configuration file, and copy the hot data in the first virtual machine to the second virtual machine; run the second virtual machine, and stop running the first virtual machine.
[0213] According to one or more embodiments of the present disclosure, the device further includes:
[0214] The container management component of the container orchestration system is used to create a container of the proxy unit and a container of the resource allocation unit in the host node.
[0215] In a fourth aspect, according to one or more embodiments of the present disclosure, a virtual machine operation control device is provided, including:
[0216] An interface unit, configured to receive a virtual machine creation request, wherein the virtual machine creation request includes requirement information of a first virtual machine to be created;
[0217] A scheduling unit, configured to allocate a host node to the first virtual machine according to the demand information;
[0218] A control unit is used to generate first configuration information of the first virtual machine according to the demand information, and associate the first configuration information with the host node; send the first configuration information to the agent unit in the host node, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
[0219] According to one or more embodiments of the present disclosure, when the control unit sends the first configuration information to the agent unit in the host node through the control unit, the control unit is used to:
[0220] The control unit stores the first configuration information in the virtual machine configuration information management unit in the control node, and after receiving the acquisition request sent by the agent unit, the first configuration information is sent to the agent unit.
[0221] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0222] The memory stores computer-executable instructions;
[0223] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the virtual machine operation control method described in the first aspect and various possible designs of the first aspect, or the virtual machine operation control method described in the second aspect and various possible designs of the second aspect.
[0224] In a sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the virtual machine operation control method described in the first aspect and various possible designs of the first aspect, or the virtual machine operation control method described in the second aspect and various possible designs of the second aspect is implemented.
[0225] In the seventh aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the virtual machine operation control method described in the first aspect and various possible designs of the first aspect, or the virtual machine operation control method described in the second aspect and various possible designs of the second aspect.
[0226] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0227] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0228] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A virtual machine operation control method, characterized in that: include: Obtaining, through an agent unit in the host node, first configuration information of a first virtual machine to be created from the control node; Calling the resource allocation unit in the host node through the proxy unit to allocate target resources to the first virtual machine according to the first configuration information; Creating a first root file system isolation environment in the host node through the proxy unit, deploying a first virtual machine creation component in the first root file system isolation environment, and generating a first virtual machine configuration file according to the first configuration information; The first virtual machine creation component creates the first virtual machine on the host node according to the first virtual machine configuration file and the target resource.
2. The method according to claim 1, characterized in that The step of creating the first virtual machine on the host node according to the first virtual machine configuration file and the target resource by the first virtual machine creation component includes: The first virtual machine creation component calls a virtual machine monitor, and creates the first virtual machine based on the target resources according to the first virtual machine configuration file.
3. The method according to claim 2, characterized in that The step of calling a virtual machine monitor through the first virtual machine creation component and creating the first virtual machine based on the target resource according to the first virtual machine configuration file includes: The first virtual machine creation component calls the kernel virtual machine module to perform kernel virtualization based on the target resources according to the first virtual machine configuration file, and calls the virtual machine simulator to perform network device virtualization and storage device virtualization based on the target resources according to the first virtual machine configuration file to create the first virtual machine.
4. The method according to claim 1, characterized in that: There are multiple first virtual machines to be created; Correspondingly, the step of creating a first root file system isolation environment in the host node through the proxy unit and deploying a first virtual machine creation component in the first root file system isolation environment includes: For the plurality of first virtual machines, create a first root file system isolation environment in the host node through the agent unit, and deploy a first virtual machine creation component in the first root file system isolation environment; Correspondingly, creating the first virtual machine on the host node according to the first virtual machine configuration file and the target resource by the first virtual machine creation component includes: The first virtual machine creation component calls a virtual machine monitor for each first virtual machine respectively, and creates each first virtual machine based on the corresponding target resources according to the corresponding first virtual machine configuration file.
5. The method according to claim 1, characterized in that: The step of obtaining, from the control node, first configuration information of a first virtual machine to be created through an agent unit in the host node includes: Querying, by the proxy unit, whether the first configuration information associated with the host node exists in the virtual machine configuration information management unit in the control node, wherein the first configuration information associated with the host node is obtained by associating the first configuration information of the first virtual machine with the host node after the scheduling unit in the control node allocates a host node for the first virtual machine to be created; If it is found that the first configuration information associated with the host node exists in the virtual machine configuration information management unit, the first configuration information is acquired.
6. The method according to claim 5, characterized in that After creating the first virtual machine according to the first virtual machine configuration file, the method further includes: The agent unit updates the status information indicating that the creation of the first virtual machine has been completed to the first configuration information of the first virtual machine stored in the virtual machine configuration information management unit.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Obtaining, by the proxy unit, an upgrade request for the first virtual machine from the control node, wherein the upgrade request includes second configuration information of a second virtual machine after the first virtual machine is upgraded; Calling the resource allocation unit in the host node through the proxy unit to allocate target resources to the second virtual machine according to the second configuration information; Creating a second root file system isolation environment in the host node through the proxy unit, deploying a second virtual machine creation component in the second root file system isolation environment, and generating a second virtual machine configuration file according to the second configuration information; Calling a virtual machine monitor through the second virtual machine creation component, creating the second virtual machine according to the second virtual machine configuration file, and copying hot data in the first virtual machine to the second virtual machine; The second virtual machine is run, and the first virtual machine is stopped.
8. The method according to claim 1, characterized in that The method further comprises: A container of the proxy unit and a container of the resource allocation unit are created in the host node through a container management component of the container orchestration system pre-deployed in the host node.
9. A virtual machine operation control method, characterized in that: include: receiving a virtual machine creation request through an interface in the control node, wherein the virtual machine creation request includes demand information of a first virtual machine to be created; Allocating a host node for the first virtual machine according to the demand information by a scheduling unit in the control node; Generate first configuration information of the first virtual machine according to the demand information by a control unit in the control node, and associate the first configuration information with the host node; The first configuration information is sent to the agent unit in the host node through the control unit, so that the agent unit starts the creation process of the first virtual machine according to the first configuration information.
10. The method according to claim 9, characterized in that The sending the first configuration information to the agent unit in the host node through the control unit includes: The control unit stores the first configuration information in the virtual machine configuration information management unit in the control node, and after receiving the acquisition request sent by the agent unit, the first configuration information is sent to the agent unit.
11. A virtual machine operation control device, characterized in that: include: An agent unit, configured to obtain first configuration information of a first virtual machine to be created from a control node; A resource allocation unit, configured to be called by the proxy unit to allocate target resources to the first virtual machine according to the first configuration information; The proxy unit is further used to create a first root file system isolation environment in the host node, deploy a first virtual machine creation component in the first root file system isolation environment, and generate a first virtual machine configuration file according to the first configuration information; A creation unit is used to create the first virtual machine on the host node according to the first virtual machine configuration file and the target resource through the first virtual machine creation component.
12. A virtual machine operation control device, characterized in that: include: An interface unit, configured to receive a virtual machine creation request, wherein the virtual machine creation request includes requirement information of a first virtual machine to be created; A scheduling unit, configured to allocate a host node to the first virtual machine according to the demand information; a control unit, configured to generate first configuration information of the first virtual machine according to the demand information, and associate the first configuration information with the host node; The first configuration information is sent to the agent unit in the host node, so that the agent unit starts a process of creating the first virtual machine according to the first configuration information.
13. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 10 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.