CN117075925B - Libvirt control surface unloading method, device, equipment and medium - Google Patents
Libvirt control surface unloading method, device, equipment and medium Download PDFInfo
- Publication number
- CN117075925B CN117075925B CN202311031223.XA CN202311031223A CN117075925B CN 117075925 B CN117075925 B CN 117075925B CN 202311031223 A CN202311031223 A CN 202311031223A CN 117075925 B CN117075925 B CN 117075925B
- Authority
- CN
- China
- Prior art keywords
- server
- component
- libvirt
- file system
- virtual machine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000013507 mapping Methods 0.000 claims description 86
- 238000009434 installation Methods 0.000 claims description 30
- 238000004891 communication Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 11
- 238000005457 optimization Methods 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 9
- 238000007726 management method Methods 0.000 description 79
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/62—Uninstallation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Stored Programmes (AREA)
Abstract
The disclosure relates to a libvirt management and control surface unloading method, device, equipment and medium. The method is applied to the DPU and comprises the following steps: installing a libvirt component; obtaining an access path of a target file directory in a server, wherein the target file directory is a file directory for storing configuration files related to management of a virtual machine; accessing a configuration file under the target file directory in the server according to the access path, and generating a control command about the virtual machine; and sending the control command to the server through the libvirt component so that the server calls a qemu component to execute the control command to manage the virtual machine on the server. According to the method and the device, the libvirt control surface component is unloaded onto the DPU, server resources occupied by the libvirt component are released, the system resource utilization rate of the virtual machine is improved, and the overall performance of the data center is enhanced.
Description
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a method, a device, equipment and a medium for unloading a libvirt control surface.
Background
In today's data centers, the physical resources of the servers are at a premium, including computing resources, storage resources, and the like. Server virtualization is to increase the utilization of computer resources. With the improvement of the operation capability of the server, the utilization rate of a single server is lower and lower. The virtualization technology can run a plurality of virtual machines on one server, so that the resource utilization rate of the server is improved. By virtualizing a plurality of virtual machines on one server, the computing power of the server can be fully utilized without purchasing a plurality of servers. In addition, the virtual machine can dynamically adjust resources according to the needs, and decoupling of hardware and software is achieved, so that the flexibility of the system is improved.
The libvirt component is a virtualization management tool that provides a set of APIs (Application Programming Interface, application program interfaces) and tools for managing virtualized platforms and virtual machines. The libvirt component can manage the virtualization platform and also support lifecycle management of virtual machines, such as start, stop, pause, migration, etc. The use of libvirt components can conveniently manage platforms and virtual machines for different virtualization technologies without requiring knowledge of the details of the various virtualization technologies.
Currently, management of Virtual machines on a server is mainly performed by installing a libvirt component on the server, and communicating with a daemon libvirtd of libvirt through a virsh component to manage VM (Virtual Machine), for example, defining a Virtual Machine, start-stop of the Virtual Machine, storage management, virtual network management, and the like. Because the libvirt component and the virtual machine are operated on the same server together, the daemon of the libvirt occupies the system resources of the server, so that the utilization rate of the system resources of the virtual machine is reduced, and the overall performance of the data center is affected.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a libvirt control surface unloading method, device, equipment and medium.
In a first aspect, the present disclosure provides a libvirt management and control plane offloading method, applied to a DPU, the method comprising:
installing a libvirt component;
Obtaining an access path of a target file directory in a server, wherein the target file directory is a file directory for storing configuration files related to management of a virtual machine;
Accessing a configuration file under the target file directory in the server according to the access path, and generating a control command about the virtual machine;
And sending the control command to the server through the libvirt component so that the server calls a qemu component to execute the control command to manage the virtual machine on the server.
Optionally, before the step of obtaining the access path of the target file directory in the server, the method further includes:
A client for installing a file system mapping component;
Sending a server installation instruction of the file system mapping component to the server so that the server installs the server of the file system mapping component, and the server of the file system mapping component and the client establish communication connection through sockets;
the obtaining the access path of the target file directory in the server comprises the following steps:
And acquiring an access path of a target file directory in the server through the file system mapping component, and mounting the target file directory into a DPU file system.
Optionally, the obtaining, by the file system mapping component, an access path of a target file directory in a server, and mounting the target file directory to a DPU file system includes:
Sending a path configuration instruction of the target file directory to a server side of the file system mapping component through a client side of the file system mapping component so that the server writes the access path into a configuration file of the server side of the file system mapping component;
And reading the access path from the server side of the file system mapping component through the client side of the file system mapping component so as to mount the target file directory into a DPU file system.
Optionally, the generating a control command about the virtual machine according to the configuration file under the target file directory in the access path access server includes:
accessing, by a client of the file system mapping component, the target file directory mounted in the DPU file system, and generating, using a virsh component, a management command for a virtual machine according to the configuration file, where the virsh component provides a command line tool for the libvirt component.
Optionally, before the sending, by the libvirt component, the control command to the server, the method further includes:
a client for installing a remote command execution component;
Sending a server installation instruction of the remote command execution component to the server so that the server installs the server of the remote command execution component, and the server of the remote command execution component and the client establish communication connection through a socket;
and sending an installation instruction of the qemu component to the server so as to enable the server to install the qemu component.
Optionally, the sending, by the libvirt component, the control command to the server, so that the server calls a qemu component to execute the control command, so as to manage the virtual machine on the server, including:
Controlling the virsh component to send the control command to a daemon of the libvirt component;
encapsulating and sending the control command to a client of the remote command execution component by a daemon of the libvirt component;
And sending the encapsulated management and control command to a server side of the remote command execution component through a client side of the remote command execution component, so that the server side of the remote command execution component calls the qemu component to execute the management and control command, and the virtual machine on the server is managed.
Optionally, the method further comprises:
transmitting taskset a component installation instruction to the server to enable the server to install taskset components;
When the management operation of the libvirt component on the virtual machine on the server is to create and start the virtual machine, the libvirt component sends a kernel optimization command to the server so that the server calls the taskset component to bind virtual kernels of the created virtual machine to different and adjacent physical kernels in the server respectively.
In a second aspect, the present disclosure provides a libvirt management surface unloading apparatus for use with a DPU, the apparatus comprising:
an installation module for installing the libvirt component;
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring an access path of a target file directory in a server, wherein the target file directory is a file directory for storing configuration files related to management of a virtual machine;
the generation module is used for accessing the configuration file under the target file directory in the server according to the access path and generating a control command about the virtual machine;
And the processing module is used for sending the control command to the server through the libvirt component so that the server calls the qemu component to execute the control command to manage the virtual machine on the server.
Optionally, before the access path of the target file directory in the server is obtained, the installation module is further configured to install a client of the file system mapping component; sending a server installation instruction of the file system mapping component to the server so that the server installs the server of the file system mapping component, and the server of the file system mapping component and the client establish communication connection through sockets;
The acquisition module is specifically configured to acquire an access path of a target file directory in the server through the file system mapping component and mount the target file directory in the DPU file system when acquiring the access path of the target file directory in the server.
Optionally, when the obtaining module obtains an access path of a target file directory in a server through the file system mapping component and mounts the target file directory in a DPU file system, the obtaining module is specifically configured to send, through a client of the file system mapping component, a path configuration instruction of the target file directory to a server of the file system mapping component, so that the server writes the access path into a configuration file of the server of the file system mapping component; and reading the access path from the server side of the file system mapping component through the client side of the file system mapping component so as to mount the target file directory into a DPU file system.
Optionally, when the generating module accesses the configuration file under the target file directory in the server according to the access path to generate a management command about the virtual machine, the generating module is specifically configured to access, through a client of the file system mapping component, the target file directory mounted in the DPU file system, and generate, using a virsh component, a management command about the virtual machine according to the configuration file, where the virsh component is a command line tool provided by the libvirt component.
Optionally, before the sending, by the libvirt component, the control command to the server, the installation module is further configured to install a client of a remote command execution component; sending a server installation instruction of the remote command execution component to the server so that the server installs the server of the remote command execution component, and the server of the remote command execution component and the client establish communication connection through a socket; and sending an installation instruction of the qemu component to the server so as to enable the server to install the qemu component.
Optionally, when the processing module sends the management command to the server through the libvirt component, so that the server invokes a qemu component to execute the management command to manage a virtual machine on the server, the processing module is specifically configured to control the virsh component to send the management command to a daemon of the libvirt component; encapsulating and sending the control command to a client of the remote command execution component by a daemon of the libvirt component; and sending the encapsulated management and control command to a server side of the remote command execution component through a client side of the remote command execution component, so that the server side of the remote command execution component calls the qemu component to execute the management and control command, and the virtual machine on the server is managed.
Optionally, the apparatus further includes an optimization module configured to send taskset a component installation instruction to the server, so that the server installs taskset a component; when the management operation of the libvirt component on the virtual machine on the server is to create and start the virtual machine, the libvirt component sends a kernel optimization command to the server so that the server calls the taskset component to bind virtual kernels of the created virtual machine to different and adjacent physical kernels in the server respectively.
In a third aspect, the present disclosure provides an electronic device comprising:
a memory;
A processor; and
A computer program;
Wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any of the first aspects.
In a fourth aspect, the present disclosure provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method according to any of the first aspects.
Compared with the prior art, the technical scheme provided by the disclosure has the following advantages:
According to the libvirt control surface unloading method, the device, the equipment and the medium, the libvirt component is installed on the DPU, and the access path of the target file directory storing the configuration files related to the management virtual machine in the server is obtained, so that the DPU can access the configuration files in the target file directory of the server according to the access path, a control command related to the virtual machine is generated, and finally the control command is sent to the server through the libvirt component on the DPU, so that the server calls the qemu component to execute the control command, management of the virtual machine on the server is completed, the libvirt component is unloaded onto the DPU, management of the virtual machine on the server is realized through the libvirt component on the DPU, server resources occupied by the libvirt component are released, the system resource utilization rate of the virtual machine is improved, and the overall performance of the data center is enhanced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a method for unloading a Libvirt control surface provided by an embodiment of the present disclosure;
Fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present disclosure;
Fig. 3 is a schematic structural diagram of a libvirt control surface unloading device according to an embodiment of the disclosure;
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
Currently, virtual machines on a server (HOST) are managed by installing a libvirt component on the server, and communicating with a libvirt daemon libvirtd through virsh components, for example, defining a virtual machine, starting and stopping of the virtual machine, storage management, virtual network management, and the like. Because the libvirt component and the virtual machine are operated on the same server together, the daemon of the libvirt occupies the system resources of the server, so that the utilization rate of the system resources of the virtual machine is reduced, and the overall performance of the data center is affected.
In order to solve the problem that the libvirt component occupies the system resource of the server, the embodiment of the disclosure provides a libvirt management and control plane unloading method, by unloading the management and control plane component libvirt of the virtual machine on the management server to the DPU (Data Processing Unit, data processor), so that the service related to the libvirt component does not occupy the system resource on the server, and therefore, the full life cycle management and maintenance operation can be performed on the virtual machine on the server on the DPU.
Fig. 1 is a flowchart of a libvirt control surface unloading method provided in an embodiment of the disclosure. The libvirt control surface unloading method is applied to the DPU and can be executed by the DPU or a libvirt control surface unloading device which can be configured in the DPU. Fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present disclosure, where the scenario includes a server 210 and a DPU220. The libvirt control surface unloading method comprises the following steps:
S101, installing a libvirt component.
Libvirt is a set of open source APIs, daemons and management tools for managing hardware virtualization that provides interfaces and functions for virtual machine management. Referring to the example of fig. 2, the libvirt component 221 is installed by the DPU 220.
S102, acquiring an access path of a target file directory in the server, wherein the target file directory is a file directory for storing configuration files related to management of the virtual machine.
In the embodiment of the disclosure, the target file directory refers to a file directory in the server for storing and managing configuration files of the virtual machine, and generally includes a file directory for storing a management command transmitted by a libvirt component in the DPU after the server receives the management command, where a path is generally/var/lib/libvirt, and a file directory for storing image files and definition files of the virtual machine.
DPU220 may obtain the access path of the target file directory in server 210 by way of system mapping, telecommunications, etc. In the disclosed embodiment, DPU220 obtains the access path of the target file directory in server 210 through a file system mapping (FILESYSTEM MOUNTING) component.
Specifically, a client of a file system mapping component is installed before an access path of a target file directory in a server is acquired; and sending a server installation instruction of the file system mapping component to the server so that the server installs the server of the file system mapping component, and the server of the file system mapping component and the client establish communication connection through sockets.
DPU220 installs file system mapping component client 222 in its own system and causes server 210 to install file system mapping component server 212 in its own system by sending a server installation instruction for the file system mapping component to server 210, where client 222 and server 212 of the file system mapping component establish a communication connection through sockets (ports) according to the IP and ports configured at run-time.
File system mapping refers to linking files and directories on a storage device to specific locations (mount points) of the file system so that the files and directories are visible and accessible in the file system. Therefore, the file system mapping component can mount the file directory appointed by the server side on the DPU, and after the mounting is successful, the contents in the mounted server file system directory can be accessed and operated in the file system of the DPU.
Correspondingly, when the access path of the target file directory in the server is obtained after the installation of the file system mapping component is completed, the access path of the target file directory in the server can be obtained through the file system mapping component, and the target file directory is mounted in the DPU file system, so that the DPU can access and operate the files in the target file directory through the file system mapping component.
Specifically, the method for obtaining the access path of the target file directory in the server through the file system mapping component and mounting the target file directory to the DPU file system comprises the following steps: sending a path configuration instruction of the target file directory to a server side of the file system mapping component through a client side of the file system mapping component so that a server writes an access path of the target file directory into a configuration file of the server side of the file system mapping component; and reading the access path from the server side of the file system mapping component by the client side of the file system mapping component to mount the target file directory into the DPU file system.
When the target file directory is mounted in the file system of the DPU220, the DPU220 first sends a path configuration instruction of the target file directory to the file system mapping component server 212 through the file system mapping component client 222, and after receiving the instruction, the server 210 fills in a file system path of the target file directory that needs to be exposed to the DPU220 side into a configuration file of the file system mapping component server 212, taking the file system mapping component yusur fs as an example, the server 210 will receive and store the path of the file directory of the management command: the path of the file directory storing the virtual machine image file and definition file is written to the configuration file of the file system mapping component server 212: per etc/yusur _ fs/whitelist.
After the writing is completed, DPU220 reads the written access path from file system mapping component server 212 of server 210 through file system mapping component client 222, and then uses the mount command to create a mount point on DPU220 to mount the target file directory. After successful mount, the contents of the target file directory may be accessed and manipulated in the file system of DPU220 through the mount point.
S103, accessing the configuration file under the target file directory in the server according to the access path, and generating a management and control command about the virtual machine.
DPU220 may access configuration files under the target file directory in server 210 according to the access path of the target file directory, and libvirt component 221 may generate virtual machine management commands according to the configuration files associated with the virtual machines.
In the case where DPU220 uses a file system mapping component to mount a target file directory in server 210 under the file system of DPU220, the target file directory in server 210 may be accessed directly through the mount point of the file system mapping component, such that DPU220 may use virsh components directly in its own file system to manage virtual machines on server 210, such as create, start, stop, delete virtual machines, etc. The virsh component is a command line tool that is part of the libvirt component 221 for managing and controlling virtual machines, virsh commands complete management operations by invoking interfaces provided by libvirt. The user may also command the virtual machine of management server 210 by configuring virsh on DPU 220.
Therefore, when the DPU220 accesses the configuration file under the target file directory in the server according to the access path, it can access the target file directory mounted in the DPU file system through the client of the file system mapping component, and uses virsh component to generate the management command about the virtual machine according to the configuration file.
Taking the management and control command of creating the virtual machine as an example, the DPU220 uses the file system mapping component client 222 to enter a target file directory of the mount, that is, a directory storing the virtual machine image file and the definition file, determines configuration parameters of creating the virtual machine according to the virtual machine image file and the definition file, and then uses the virsh component to generate a virsh command of creating the virtual machine according to the virtual machine configuration parameters, that is, generate a virtual machine creation instruction. The process of generating the control command such as starting, stopping, deleting the virtual machine is similar to the process of creating the command, and will not be described herein.
And S104, sending the management and control command to the server through the libvirt component so that the server calls the qemu component to execute the management and control command to manage the virtual machines on the server.
The management command is sent to the server 210 through the libvirt component 221 at the DPU220, and the server 210 invokes the qemu component 211 to execute the management operation corresponding to the management command, thereby completing the management of the virtual machine on the server 210.
The qemu component in the disclosed embodiments may be qemu (Quick Emulator) or qemu-kvm (Kernel-based Virtual Machine), qemu and qemu-kvm being two related open source virtual machine monitors (hypervisors) and emulators for virtualization and emulation on a host system.
Qemu is an open source virtual machine monitor and simulator that can run on a variety of processor architectures and provides extensive device simulation support. qemu can be used to perform complete system simulations, including simulating other hardware and operating systems so that it can run operating systems of different architectures. qemu-kvm is a virtualization solution based on qemu, which combines kvm and qemu functions, and utilizes hardware provided by kvm to accelerate virtualization expansion to improve the performance of the virtual machine. kvm is a virtualization module provided by the Linux kernel, and can make full use of the virtualization extension (such as Intel VT and AMD-V) of the processor to run a more efficient virtualization environment.
The libvirt component 221 in the DPU220 may send the policing command to the qemu component 211 through a remote command execution component, which may be yusurrexec (Remote Execution), for example. The remote command execution component is typically composed of two parts: client and server. The client is used for sending an execution instruction to the server, and the server is responsible for receiving the instruction and executing corresponding operation on the remote computer. A remote command execution component client 223 and a remote command execution component server 213 as shown in fig. 2.
Thus, the DPU will install the client of the remote command execution component before sending the management command to the server through the libvirt component; sending a server installation instruction of the remote command execution assembly to the server so that the server installs the server of the remote command execution assembly, and the server of the remote command execution assembly and the client establish communication connection through a socket; and sending an installation instruction of the qemu component to the server so as to enable the server to install the qemu component.
The yusurrexec component is mainly used for sending a command executed on the DPU to a server for remote execution, the DPU runs yusurrexec component client, and the server runs yusurrexec component server, and the component multiplexes Socket connection in the file system mapping component for remote communication. According to the embodiment of the disclosure, the qemu-kvm is used for executing the virtual machine management command on the server, the original qemu-kvm command can be replaced by the custom script, the original qemu-kvm command is replaced by the script packaged with yusurrexec commands, and therefore when the virtual machine is managed by virsh on the DPU, the management command is automatically executed on the server, namely the qemu-kvm on the server is called for execution, and the purpose of managing the virtual machine on the server on the DPU can be achieved.
Specifically, the libvirt component sends the management and control command to the server, so that the server calls the qemu component to execute the management and control command to manage the virtual machine on the server, and the method comprises the following steps: the control virsh component sends a control command to the daemon of the libvirt component; encapsulating and transmitting a management and control command to a client of a remote command execution component by a daemon of the libvirt component; and sending the encapsulated management and control command to a server side of the remote command execution component through a client side of the remote command execution component, so that the server side of the remote command execution component calls the qemu component to execute the management and control command, and the virtual machine on the server is managed.
After the virsh component provided by the libvirt component 221 generates a management command for the virtual machine on the server 210, the virsh component sends the management command to the daemon of the libvirt component 221, i.e., the libvirtd daemon. libvirtd is a daemon of libvirt, libvirtd is a background service or process responsible for listening for requests from clients and then communicating and operating on behalf of the clients with the underlying virtualization platform that provides the infrastructure needed to interact with the libvirt components.
Libvirtd daemon encapsulates the control command and then sends the encapsulated control command to remote command execution component client 223, and remote command execution component client 223 sends the encapsulated control command to remote command execution component server 213 through communication connection established between Socket and server 210, and remote command execution component server 213 invokes qemu component 211 on server 210 to execute the control command, and performs corresponding operation on virtual machine on server 210. For example, in the above embodiment, when the service end of the yusurrexec component invokes qemu-kvm to execute the virtual machine creation command according to the virtual machine creation command generated by the virsh component according to the configuration parameters for creating the virtual machine, the qemu-kvm creates a virtual machine with corresponding parameters according to the configuration parameters for creating the virtual machine in the virtual machine creation command.
According to the embodiment of the disclosure, the libvirt component is installed on the DPU, and the access path of the target file directory storing the configuration file related to the management virtual machine in the server is obtained, so that the DPU can access the configuration file under the target file directory in the server according to the access path, a management control command related to the virtual machine is generated, and finally the management control command is sent to the server through the libvirt component on the DPU, so that the server calls the qemu component to execute the management control command, management of the virtual machine on the server is completed, the libvirt component is unloaded onto the DPU, management of the virtual machine on the server is realized through the libvirt component on the DPU, server resources occupied by the libvirt component are released, the system resource utilization rate of the virtual machine is improved, and the overall performance of the data center is enhanced.
In some embodiments, the method further comprises: sending taskset a component installation instruction to the server to enable the server to install taskset components; when the management operation performed on the virtual machine on the server by the libvirt component is to create and start the virtual machine, the libvirt component sends a kernel optimization command to the server, so that the server call taskset component binds the virtual kernels of the created virtual machine to different and adjacent physical kernels in the server respectively.
The DPU may also send taskset component install instructions to the server to cause the server to install taskset components, thereby optimizing the performance of virtual machines on the server through the libvirt component using taskset components. taskset command component is used to set the CPU Affinity (Affinity) of a process or thread on the operating system, i.e., bind it to a particular CPU core for execution. This is to better control and manage system resources to improve performance and efficiency.
When the libvirt component creates and starts the virtual machine, the taskset command component can be used for binding vCPU (Virtual Central Processing Unit) threads of the virtual machine to a specific CPU core of a server, and dispersing and binding vCPU threads of the virtual machine to different CPU physical cores, so that vCPU can be prevented from competing for resources of the same core. In addition, the vCPU threads of the same virtual machine can be bound to adjacent CPU physical cores according to the topological relation between the vCPU and the physical CPU, so that the switching overhead between the cores is reduced. In addition, the vCPU sensitive to the I/O response is bound to a specific core, the vCPU with intensive computation is bound to other cores, NUMA (Non-Uniform Memory Access) optimization is realized, and resources are prevented from being contended between the virtual machines by isolating the vCPUs of different virtual machines to different CPU physical cores.
When the libvirt component on the DPU calls the taskset component on the server, the kernel optimization command can be transmitted to the remote command execution component client, the kernel optimization command is sent to the remote command execution component server through the remote command execution component client, and the remote command execution component server calls the taskset component on the server to execute the kernel optimization command, so that the binding of the virtual kernel of the virtual machine and the physical kernel of the server is completed.
Fig. 3 is a schematic structural diagram of a libvirt control surface unloading device according to an embodiment of the disclosure. The libvirt management surface unloading device may be applied to a DPU, which may be a component or assembly in the DPU. The libvirt control surface unloading device provided by the embodiment of the present disclosure may execute the process flow provided by the embodiment of the libvirt control surface unloading method, as shown in fig. 3, the libvirt control surface unloading device 300 includes:
A mounting module 301 for mounting a libvirt component;
The obtaining module 302 is configured to obtain an access path of a target file directory in the server, where the target file directory is a file directory storing a configuration file related to managing the virtual machine;
a generating module 303, configured to generate a management and control command about the virtual machine according to the configuration file under the target file directory in the access path access server;
And the processing module 304 is configured to send a management command to the server through the libvirt component, so that the server invokes the qemu component to execute the management command to manage the virtual machines on the server.
In some embodiments, before obtaining the access path of the target file directory in the server, the installation module 301 is further configured to install the client of the file system mapping component; sending a server installation instruction of the file system mapping component to a server so that the server installs the server of the file system mapping component, and the server of the file system mapping component and a client establish communication connection through a socket; the obtaining module 302 is specifically configured to obtain, through the file system mapping component, an access path of the target file directory in the server, and mount the target file directory to the DPU file system when obtaining the access path of the target file directory in the server.
In some embodiments, when the obtaining module 302 obtains, through the file system mapping component, an access path of the target file directory in the server and mounts the target file directory in the DPU file system, the obtaining module is specifically configured to send, through the client of the file system mapping component, a path configuration instruction of the target file directory to the server of the file system mapping component, so that the server writes the access path into a configuration file of the server of the file system mapping component; and reading the access path from the server side of the file system mapping component by the client side of the file system mapping component to mount the target file directory into the DPU file system.
In some embodiments, the generating module 303 is specifically configured to access, when accessing a configuration file under a target file directory in a server according to an access path, a target file directory mounted in a DPU file system through a client of a file system mapping component, and generate, using a virsh component, a command line tool provided by a virsh component for a libvirt component according to the configuration file, the control command for the virtual machine.
In some embodiments, the installation module 301 is further configured to install a client of the remote command execution component before the administration command is sent to the server via the libvirt component; sending a server installation instruction of the remote command execution assembly to the server so that the server installs the server of the remote command execution assembly, and the server of the remote command execution assembly and the client establish communication connection through a socket; and sending an installation instruction of the qemu component to the server so as to enable the server to install the qemu component.
In some embodiments, the processing module 304 is specifically configured to control virsh the component to send the management command to the daemon of the libvirt component when sending the management command to the server through the libvirt component to cause the server to invoke the qemu component to execute the management command to manage the virtual machine on the server; encapsulating and transmitting a management and control command to a client of a remote command execution component by a daemon of the libvirt component; and sending the encapsulated management and control command to a server side of the remote command execution component through a client side of the remote command execution component, so that the server side of the remote command execution component calls the qemu component to execute the management and control command, and the virtual machine on the server is managed.
In some embodiments, the ibvirt management and control plane offload device 300 further includes an optimization module 305 for sending taskset component installation instructions to the server to cause the server to install taskset components; when the management operation performed on the virtual machine on the server by the libvirt component is to create and start the virtual machine, the libvirt component sends a kernel optimization command to the server, so that the server call taskset component binds the virtual kernels of the created virtual machine to different and adjacent physical kernels in the server respectively.
The libvirt control surface unloading device in the embodiment shown in fig. 3 may be used to implement the technical solution of the above method embodiment, and its implementation principle and technical effects are similar, and are not repeated here.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. The electronic device may be a server as described in the above embodiments. The electronic device provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the libvirt control plane unloading method, as shown in fig. 4, the electronic device 400 includes: memory 401, processor 402, computer programs and communication interface 403; wherein a computer program is stored in the memory 401 and configured to be executed by the processor 402 to perform the libvirt management plane offload method as described above. In a particular embodiment, the memory 401 may be a non-volatile solid state memory. In a particular embodiment, the Memory 401 includes a Read-Only Memory ROM (Read-Only Memory). The ROM may be mask programmed ROM, programmable ROM (PROM), erasable PROM (ELECTRICAL PROGRAMMABLE ROM, EPROM), electrically erasable PROM (ELECTRICALLY ERASABLE PROGRAMMABLE ROM, EEPROM), electrically rewritable ROM (ELECTRICALLY ALTERABLE ROM, EAROM), or flash memory, or a combination of two or more of these, where appropriate.
In addition, the embodiment of the present disclosure further provides a computer readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the libvirt management and control plane unloading method described in the foregoing embodiment. The storage medium may be a non-volatile/non-transitory computer readable storage medium, for example, a ROM, a random access memory (Random Access Memory, RAM), a Compact Disc ROM (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (9)
1. A libvirt management and control plane unloading method applied to a DPU, the method comprising:
installing a libvirt component;
Obtaining an access path of a target file directory in a server, wherein the target file directory is a file directory for storing configuration files related to management of a virtual machine;
Accessing a configuration file under the target file directory in the server according to the access path, and generating a control command about the virtual machine;
sending the control command to the server through the libvirt component so that the server calls a qemu component to execute the control command to manage the virtual machine on the server;
before the access path of the target file directory in the server is obtained, the method further comprises:
A client for installing a file system mapping component;
Sending a server installation instruction of the file system mapping component to the server so that the server installs the server of the file system mapping component, and the server of the file system mapping component and the client establish communication connection through sockets;
the obtaining the access path of the target file directory in the server comprises the following steps:
And acquiring an access path of a target file directory in the server through the file system mapping component, and mounting the target file directory into a DPU file system.
2. The method of claim 1, wherein the obtaining, by the file system mapping component, the access path of the target file directory in the server and mounting the target file directory to the DPU file system comprises:
Sending a path configuration instruction of the target file directory to a server side of the file system mapping component through a client side of the file system mapping component so that the server writes the access path into a configuration file of the server side of the file system mapping component;
And reading the access path from the server side of the file system mapping component through the client side of the file system mapping component so as to mount the target file directory into a DPU file system.
3. The method of claim 1, wherein the accessing the configuration file under the target file directory in the server according to the access path generates a management command for a virtual machine, comprising:
accessing, by a client of the file system mapping component, the target file directory mounted in the DPU file system, and generating, using a virsh component, a management command for a virtual machine according to the configuration file, where the virsh component provides a command line tool for the libvirt component.
4. The method of claim 3, wherein prior to the sending the policing command to the server by the libvirt component, further comprising:
a client for installing a remote command execution component;
Sending a server installation instruction of the remote command execution component to the server so that the server installs the server of the remote command execution component, and the server of the remote command execution component and the client establish communication connection through a socket;
and sending an installation instruction of the qemu component to the server so as to enable the server to install the qemu component.
5. The method of claim 4, wherein the sending the management command to the server by the libvirt component to cause the server to invoke a qemu component to execute the management command to manage virtual machines on the server comprises:
Controlling the virsh component to send the control command to a daemon of the libvirt component;
encapsulating and sending the control command to a client of the remote command execution component by a daemon of the libvirt component;
And sending the encapsulated management and control command to a server side of the remote command execution component through a client side of the remote command execution component, so that the server side of the remote command execution component calls the qemu component to execute the management and control command, and the virtual machine on the server is managed.
6. The method of claim 1, wherein the method further comprises:
transmitting taskset a component installation instruction to the server to enable the server to install taskset components;
When the management operation of the libvirt component on the virtual machine on the server is to create and start the virtual machine, the libvirt component sends a kernel optimization command to the server so that the server calls the taskset component to bind virtual kernels of the created virtual machine to different and adjacent physical kernels in the server respectively.
7. A libvirt management and control plane unloading device for use with a DPU, the device comprising:
an installation module for installing the libvirt component;
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring an access path of a target file directory in a server, wherein the target file directory is a file directory for storing configuration files related to management of a virtual machine;
the generation module is used for accessing the configuration file under the target file directory in the server according to the access path and generating a control command about the virtual machine;
The processing module is used for sending the control command to the server through the libvirt component so that the server calls a qemu component to execute the control command to manage the virtual machine on the server;
The installation module is also used for installing the client of the file system mapping component; sending a server installation instruction of the file system mapping component to a server so that the server installs the server of the file system mapping component, and the server of the file system mapping component and a client establish communication connection through a socket;
The acquisition module is specifically configured to acquire an access path of a target file directory in the server through the file system mapping component, and mount the target file directory in the DPU file system.
8. An electronic device, comprising:
a memory;
A processor; and
A computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.
9. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311031223.XA CN117075925B (en) | 2023-08-16 | 2023-08-16 | Libvirt control surface unloading method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311031223.XA CN117075925B (en) | 2023-08-16 | 2023-08-16 | Libvirt control surface unloading method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117075925A CN117075925A (en) | 2023-11-17 |
CN117075925B true CN117075925B (en) | 2024-06-07 |
Family
ID=88717828
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311031223.XA Active CN117075925B (en) | 2023-08-16 | 2023-08-16 | Libvirt control surface unloading method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117075925B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103699430A (en) * | 2014-01-06 | 2014-04-02 | 山东大学 | Working method of remote KVM (Kernel-based Virtual Machine) management system based on J2EE (Java 2 Platform Enterprise Edition) framework |
CN108632360A (en) * | 2018-04-12 | 2018-10-09 | 北京百悟科技有限公司 | A kind of virtual cloud terminal and virtual cloud terminal server |
CN108897603A (en) * | 2018-07-03 | 2018-11-27 | 郑州云海信息技术有限公司 | A kind of memory source management method and device |
CN112416509A (en) * | 2019-08-23 | 2021-02-26 | 腾讯科技(深圳)有限公司 | Virtual machine control system and related equipment |
CN115562734A (en) * | 2022-09-22 | 2023-01-03 | 珠海星云智联科技有限公司 | Data processor configuration method, device, equipment and medium |
CN116521320A (en) * | 2023-05-15 | 2023-08-01 | 中移动信息技术有限公司 | Virtual machine creation method, device, equipment and computer storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20230091753A1 (en) * | 2021-09-23 | 2023-03-23 | Dell Products L.P. | Systems and methods for data processing unit aware workload migration in a virtualized datacenter environment |
-
2023
- 2023-08-16 CN CN202311031223.XA patent/CN117075925B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103699430A (en) * | 2014-01-06 | 2014-04-02 | 山东大学 | Working method of remote KVM (Kernel-based Virtual Machine) management system based on J2EE (Java 2 Platform Enterprise Edition) framework |
CN108632360A (en) * | 2018-04-12 | 2018-10-09 | 北京百悟科技有限公司 | A kind of virtual cloud terminal and virtual cloud terminal server |
CN108897603A (en) * | 2018-07-03 | 2018-11-27 | 郑州云海信息技术有限公司 | A kind of memory source management method and device |
CN112416509A (en) * | 2019-08-23 | 2021-02-26 | 腾讯科技(深圳)有限公司 | Virtual machine control system and related equipment |
CN115562734A (en) * | 2022-09-22 | 2023-01-03 | 珠海星云智联科技有限公司 | Data processor configuration method, device, equipment and medium |
CN116521320A (en) * | 2023-05-15 | 2023-08-01 | 中移动信息技术有限公司 | Virtual machine creation method, device, equipment and computer storage medium |
Non-Patent Citations (1)
Title |
---|
"以KVM-QEMU与Libvirt为依托的虚拟化资源池建设探究";贺伟 等;《计算机产品与流通》;20181215;第130-131页 * |
Also Published As
Publication number | Publication date |
---|---|
CN117075925A (en) | 2023-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12061896B2 (en) | System and method for upgrading kernels in cloud computing environments | |
US20210349706A1 (en) | Release lifecycle management system for multi-node application | |
US11301562B2 (en) | Function execution based on data locality and securing integration flows | |
US20180039507A1 (en) | System and method for management of a virtual machine environment | |
US9081601B2 (en) | Virtual mobile infrastructure and its base platform | |
US9413819B1 (en) | Operating system interface implementation using network-accessible services | |
US20130132950A1 (en) | Automation of virtual machine installation by splitting an installation into a minimal installation and customization | |
US10212045B2 (en) | Method and system for testing and analyzing management servers | |
US10728169B1 (en) | Instance upgrade migration | |
CN114168255A (en) | Operation method and device of heterogeneous instruction set container in container cloud platform | |
US20190310874A1 (en) | Driver management method and host | |
US11829792B1 (en) | In-place live migration of compute instances for efficient host domain patching | |
Lupu et al. | Nephele: Extending Virtualization Environments for Cloning Unikernel-Based VMs | |
CN117193936A (en) | Virtual machine management method, device and equipment under super fusion architecture | |
Logan et al. | LabStor: A modular and extensible platform for developing high-performance, customized I/O stacks in userspace | |
CN117075925B (en) | Libvirt control surface unloading method, device, equipment and medium | |
Tan et al. | How Low Can You Go? Practical cold-start performance limits in FaaS | |
US11762672B2 (en) | Dynamic linker for loading and running an application over a plurality of nodes | |
JP2019164757A (en) | Mainframe computer having virtualized proprietary mainframe software environment | |
WO2023065922A1 (en) | Interactive method, computer device, and computer storage medium | |
CN113986456A (en) | Interrupt virtualization real-time processing method and device, storage medium and terminal | |
Struckmann | vTorque: Introducing Virtualization Capabilities to Torque | |
CN117851276A (en) | Memory configuration method and device for analog peripheral | |
CN115879095A (en) | Password resetting method and device, computing equipment and computer storage medium | |
CN117389677A (en) | Cloud computing technology-based server and cloud system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |