[go: up one dir, main page]

CN119759488A - Method and device for managing super aggregation host based on LIBVIRT - Google Patents

Method and device for managing super aggregation host based on LIBVIRT Download PDF

Info

Publication number
CN119759488A
CN119759488A CN202411782520.2A CN202411782520A CN119759488A CN 119759488 A CN119759488 A CN 119759488A CN 202411782520 A CN202411782520 A CN 202411782520A CN 119759488 A CN119759488 A CN 119759488A
Authority
CN
China
Prior art keywords
host
libvirt
virtual machine
node
virtual
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.)
Pending
Application number
CN202411782520.2A
Other languages
Chinese (zh)
Inventor
王阳
司兵松
涂国义
龚楠
齐良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Cloud Technology Co Ltd
Original Assignee
China Telecom Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Cloud Technology Co Ltd filed Critical China Telecom Cloud Technology Co Ltd
Priority to CN202411782520.2A priority Critical patent/CN119759488A/en
Publication of CN119759488A publication Critical patent/CN119759488A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

本申请提供了一种基于LIBVIRT管理超级聚合主机方法及装置,包括:接收虚拟机的资源请求,所述资源请求为硬件资源标识;根据预先设置的虚拟处理器配置与硬件资源标识对应的底层的虚拟操作系统命令;根据所述底层的虚拟操作系统命令,确定与所述虚拟机对应的主机;根据所述主机,对与所述主机对应的多个虚拟机进行资源分配,通过libvirt实现对分布式CPU资源的统一管理和调度,提升计算资源的利用率和调度效率。这一管理方式将原来的单一节点管理模式改为一对多的模式,使多个虚拟化主机可以共享一个CPU资源池,从而实现资源的高效聚合和分配。

The present application provides a method and device for managing super-aggregated hosts based on LIBVIRT, including: receiving a resource request from a virtual machine, the resource request being a hardware resource identifier; configuring the underlying virtual operating system command corresponding to the hardware resource identifier according to a pre-set virtual processor; determining the host corresponding to the virtual machine according to the underlying virtual operating system command; allocating resources to multiple virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of distributed CPU resources through libvirt, thereby improving the utilization rate and scheduling efficiency of computing resources. This management method changes the original single-node management mode to a one-to-many mode, so that multiple virtualized hosts can share a CPU resource pool, thereby realizing efficient aggregation and allocation of resources.

Description

Method and device for managing super aggregation host based on LIBVIRT
Technical Field
The application relates to the technical field of cloud computing virtualization, in particular to a method and a device for managing a super aggregation host based on LIBVIRT.
Background
In the current cloud computing and virtualization field, traditional techniques focus mainly on resource management and virtualization on a single physical server. By abstracting the physical resources of the compute nodes into virtual resources, cloud hosts can run on these virtual resources, providing an efficient and isolated computing environment. However, this technology has limitation in resource utilization, and is difficult to meet the high-performance computing demands of modern big data mining, AI model training, chip simulation and the like, especially the demands of CPU (CENTRAL PROCESSING UNIT) cpu-intensive and memory-intensive services on resources exceed the bearing capacity of a single physical node, so the distributed virtualization technology becomes an important trend for solving these problems.
The existing distributed virtualization technology needs to perform data transmission among nodes to achieve data synchronization and resource utilization, but this mode can lead to higher data transmission delay and face cache consistency and memory consistency problems.
Disclosure of Invention
The application discloses a method and a device for managing a super aggregation host based on libvirt.
In a first aspect, the present application shows a libvirt-based method of managing a super aggregation host, the method comprising:
receiving a resource request of a virtual machine, wherein the resource request is a hardware resource identifier;
Configuring a virtual operating system command of a bottom layer corresponding to the hardware resource identifier according to a preset virtual processor;
determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer;
And according to the host, performing resource allocation on a plurality of virtual machines corresponding to the host, and realizing unified management and scheduling of the distributed CPU (CENTRAL PROCESSING UNIT) central processing unit resources through libvirt.
Optionally, the method further comprises:
And distributing the memory of the host according to the preset memory block names, wherein the plurality of virtual machines use the same CXL memory.
Optionally, the method further comprises:
Managing the life cycle of the aggregation host through libvirt;
The method specifically comprises the following steps:
modifying an XML file of the virtual machine through libvirt, wherein the XML file at least comprises IP address information of a plurality of hosts and CPU (CENTRALPROCESSING UNIT) CPU conditions actually used by each host;
Initializing the libvirt of the host computer, and connecting to each slave computer through API (APPLICATIONPROGRAMMING INTERFACE) protocol interfaces of the libvirt;
analyzing and processing the virtual machine XML file based on the host computer to obtain a processed virtual machine XML file;
and starting the virtual machine according to the processed virtual machine XML file and the processed disk information.
Optionally, the modifying the XML file of the virtual machine by libvirt, where the XML file includes at least IP address information of a plurality of hosts, and CPU (CENTRAL PROCESSING UNIT) central processing unit cases actually used by each host, includes:
and adding an identification tag of a host in the XML file of the virtual machine, wherein the identification is used for describing configuration information of the host, and the configuration information at least comprises IP addresses of all nodes, the number of virtual machines corresponding to the IP addresses, whether the current IP address is a master node, CXL memory block names and memory sizes.
Optionally, the initializing connection to the libvirt of the master is connected to each slave through a API (APPLICATION PROGRAMMING INTERFACE) protocol interface of the libvirt, including:
connecting a master node and each slave node by using virConnectOpen functions;
In the event that all connections are successfully established, the master node will hold connection handles for all slave nodes, which handles are used for virtual machine management operations.
Optionally, the analyzing and processing the virtual machine XML file based on the host computer, to obtain a processed virtual machine XML file, includes:
judging whether the current computing node is a host node or not;
If the master node is the master node, the slave nodes are called remotely through a virtual machine monitor, and a virDomainDefineXML function is called to define virtual machines on all the nodes so that the definition process of all the slave nodes is consistent;
and if the virtual machine is not the master host node, storing the virtual machine XML file after the analysis of the virtual machine monitor function.
Optionally, the processing, according to the host, the disk information of the virtual machine to obtain processed disk information includes:
If the identification label of the host exists and the current node is the host node, the disk information is reserved and analyzed, and the disk information is stored on the host;
if the current node is not the host node, the analysis and the processing of the disk information are skipped, and only the computing resource of the node is processed.
In a second aspect, the present application shows a libvirt-based management super aggregation host device, the device comprising:
The receiving module is used for receiving a resource request of the virtual machine, wherein the resource request is a hardware resource identifier;
The calling module is used for configuring a virtual operating system command of the bottom layer corresponding to the hardware resource identifier according to a preset virtual processor;
The determining module is used for determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer;
And the allocation module is used for allocating resources of a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of the distributed CPU (CENTRAL PROCESSING UNIT) central processing unit resources through libvirt.
Optionally, the allocation module is configured to:
And distributing the memory of the host according to the preset memory block names, wherein the plurality of virtual machines use the same CXL memory.
Optionally, the allocation module is configured to:
Managing the life cycle of the aggregation host through libvirt;
The method specifically comprises the following steps:
modifying an XML file of the virtual machine through libvirt, wherein the XML file at least comprises IP address information of a plurality of hosts and CPU (CENTRALPROCESSING UNIT) CPU conditions actually used by each host;
Initializing the libvirt of the host computer, and connecting to each slave computer through API (APPLICATIONPROGRAMMING INTERFACE) protocol interfaces of the libvirt;
analyzing and processing the virtual machine XML file based on the host computer to obtain a processed virtual machine XML file;
and starting the virtual machine according to the processed virtual machine XML file and the processed disk information.
Optionally, the allocation module is configured to:
and adding an identification tag of a host in the XML file of the virtual machine, wherein the identification is used for describing configuration information of the host, and the configuration information at least comprises IP addresses of all nodes, the number of virtual machines corresponding to the IP addresses, whether the current IP address is a master node, CXL memory block names and memory sizes.
Optionally, the allocation module is configured to:
connecting a master node and each slave node by using virConnectOpen functions;
In the event that all connections are successfully established, the master node will hold connection handles for all slave nodes, which handles are used for virtual machine management operations.
Optionally, the allocation module is configured to:
judging whether the current computing node is a host node or not;
If the master node is the master node, the slave nodes are called remotely through a virtual machine monitor, and a virDomainDefineXML function is called to define virtual machines on all the nodes so that the definition process of all the slave nodes is consistent;
and if the virtual machine is not the master host node, storing the virtual machine XML file after the analysis of the virtual machine monitor function.
Optionally, the allocation module is configured to:
If the identification label of the host exists and the current node is the host node, the disk information is reserved and analyzed, and the disk information is stored on the host;
if the current node is not the host node, the analysis and the processing of the disk information are skipped, and only the computing resource of the node is processed.
In a third aspect, the application features an electronic device including a processor, a memory for storing processor-executable instructions, wherein the processor is configured to perform a method as described in any of the above aspects.
In a fourth aspect, the application features a non-transitory computer-readable storage medium that, when executed by a processor of an electronic device, enables the electronic device to perform a method as described in any of the above aspects.
In a fifth aspect, the application shows a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to perform the method as described in any of the above aspects.
The technical scheme provided by the application can comprise the following beneficial effects:
Unified management, namely operating a plurality of virtualized hosts in a manual mode is not needed. The virtualized environment is comprehensively managed through an integrated system provided by libvirt.
The operation is simplified, the user does not need to know the parameters of the bottom command line, and the high-level management function is realized through the libvirt interface, so that the operation complexity is reduced.
The flexibility is improved, the running mode of the existing single host is maintained, diversified virtualized management requirements are supported, and the adaptability and expansibility of the system are enhanced.
The system coupling is reduced, namely the client is decoupled from the libvirt instance, only interaction with a master node is needed, the dependency among components is reduced, only the master node is needed to be adjusted during system expansion, the client does not need to be changed, and the complexity of expansion and upgrading is reduced.
Simplified learning curve, improved on original libvirt interface, and the related user can use the needed advanced functions without learning new API (APPLICATION PROGRAMMING INTERFACE) protocol.
Drawings
FIG. 1 is a flow chart of the steps of a libvirt-based method of managing a super aggregate host in accordance with the present application;
FIG. 2 is a schematic diagram of the overall structure of a super-aggregate host according to the present application;
FIG. 3 is a method of managing a super aggregate host by libvirt in accordance with the present application;
FIG. 4 is a schematic diagram of the results of the present application compared to a method of libvirt management of a super aggregation host;
FIG. 5 is a schematic diagram of the logic for processing newly added label and disk information, showing details of processing by a libvirt management super aggregation host according to the present application;
FIG. 6 is a flow chart of a Libvirt management super aggregate host lifecycle of the present application;
FIG. 7 is a block diagram of a libvirt-based management super aggregation host device of the present application;
FIG. 8 is a block diagram of an electronic device of the present application;
Fig. 9 is a block diagram of a computer readable storage medium of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The embodiment of the application provides a method for aggregating physical resources of a plurality of computing nodes, which constructs a multi-node shared memory pool as a hardware base of a super aggregation host, thereby breaking the resource isolation among the computing nodes. FIG. 1 shows the overall structure and manner of use of the super-aggregate host.
On this basis, the embodiment of the application is described with respect to a distributed virtualized libvirt side management method. By integrating libvirt to construct a management layer tool, the scheme not only reserves the advantages of resource aggregation, but also realizes centralized and unified management of aggregation hosts. Such integration aims at simplifying the management flow and expanding management, thereby greatly improving the management efficiency and usability of the virtualized environment.
Referring to fig. 1, a flowchart of steps of a method for managing a super aggregation host based on libvirt according to the present application is shown, the method may be applied to an electronic device, where the method may specifically include the following steps:
S101, receiving a resource request of a virtual machine, wherein the resource request is a hardware resource identifier;
Currently, the super aggregation host has been implemented in hardware to separate CPU (CENTRAL PROCESSING UNIT) resources of a central processing unit pool, a memory pool and a storage pool, and has also completed the aggregation development of KVM (KEYBOARDVIDEO MOUSE) ports and QEMU simulation processor software sides in the distributed virtualization technology. One master node is designated among the aggregation hosts, the other master nodes are slave nodes, all aggregation machines are managed by the master nodes, and only the master node machines are operable by the Client scheduling platform.
The master is a master node, and the slave node plays an important role in the distributed computing system. They are computing nodes managed by the master node, responsible for receiving and executing tasks assigned by the master, and then returning the results to the master. The functions of the slave node include load balancing, parallel computing, high reliability and elastic scaling.
QEMU is a set of analog processor software written by fabricberla (fabricbergard) that distributes source code in GPL licenses, and is widely used on GNU/Linux platforms.
Wherein Libvirt is an open source API (APPLICATIONPROGRAMMING INTERFACE) protocol, daemon and management tool for managing virtualized platforms. It supports multiple virtualization technologies and provides a unified set of interfaces to manage these virtualization platforms.
The main functions of Libvirt include:
And the management virtualization platform Libvirt supports various virtualization platforms and manages the various virtualization platforms through a unified API (APPLICATION PROGRAMMING INTERFACE) protocol.
And managing the life cycle of the virtual machine, wherein the life cycle comprises operations such as starting, stopping, pausing, saving, restoring, dynamic migration and the like.
And managing the virtual network and the storage, wherein the virtual network and the storage are provided with a management function, and a plurality of storage formats and remote management are supported.
The API (APPLICATION PROGRAMMING INTERFACE) protocol (ApplicationProgramming Interface) is a set of predefined functions or protocols that are intended to provide the application and developer with the ability to access a set of routines without having to access the source code or understand the details of the internal operating mechanisms. The main purpose of the API (APPLICATION PROGRAMMING INTERFACE) protocol is to facilitate communication and data exchange between different software systems.
S102, configuring a virtual operating system command of a bottom layer corresponding to a hardware resource identifier according to a preset virtual processor;
libvirt has 2 parameters in XML to manage CPU (CENTRAL PROCESSING UNIT) the central processor, CPU (CENTRAL PROCESSING UNIT) central processor and VCPU (virtualization technology of CPU), respectively. CPU (CENTRAL PROCESSING UNIT) the CPU is mainly used to avoid contention for resources by multiple virtual machines on a host, but when the virtual machines are actually started, libvirt calls the underlying QEMU analog processor software command according to the configuration information of the VCPU (virtualization technology of the CPU). The aggregation host adds the parameters of local-cpu during qemu side development, so that vcpu and local-cpu need to be bound during libvirt side development.
The XML is extensible markup language (Extensible Markup Language, XML), is a subset of standard general markup language, can be used for marking data and defining data types, and is a source language allowing a user to define the markup language of the user.
S103, determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer;
And S104, distributing resources of a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of the distributed CPU (CENTRAL PROCESSING UNIT) central processing unit resources through libvirt.
The aggregation host specifically allocates VCPU (virtualization technology of CPU) resources by local-CPU on QEMU simulation processor software side, so that the VCPU (virtualization technology of CPU) on libvirt side needs to be bound with local-CPU to ensure effective and reasonable utilization of resources.
In the application, one host is selected as the host, the other hosts are selected as the slaves, and the Libvirt is further utilized for the remote management of a single host (namely the selected host), so that the Libvirt is used for carrying out data synchronization and resource utilization with the host, and the prior distributed virtualization technology mentioned in the background art is different from the prior distributed virtualization technology in that data transmission is needed to be carried out among all nodes so as to realize data synchronization and resource utilization, but the mode can lead to higher data transmission delay.
The embodiment of the application provides a method for managing a super aggregation host based on libvirt, which realizes unified and centralized management of a plurality of virtualized hosts crossing a computing node on the basis of maintaining a single host operation mode on the existing computing node. The method aims to solve the problem that the current distributed virtualization technology lacks a unified management mode after resource aggregation, and simultaneously overcomes the limitation of libvirt in the aspect of multi-host resource management across computing nodes, more elastic and efficient computing resources are provided in a cloud environment, so that the management flow is further simplified, and the system flexibility is improved. The requirements of application scenes such as modern big data processing, high-performance computing and AI model training are met, and further development of cloud computing and virtualization technology is promoted.
The embodiment of the application provides an aggregation computing technology, wherein the whole framework of a super aggregation host comprises four main parts, as shown in fig. 2, (1) a hardware layer, a CPU (CENTRAL PROCESSING UNIT) central processing unit pool, a memory pool and a memory pool, (2) a kernel and operating system layer, wherein CXL memory adaptation is realized, and (3) a distributed virtualization layer consists of KVM (KEYBOARDVIDEO MOUSE) ports, QEMU simulation processor software and libvirt. (4) The application focuses on realizing the Libvirt side of the distributed virtualization technology, and the specific targets are as follows:
Wherein CXL (Compute Express Link) is a new high-speed interconnect technology aimed at providing higher data throughput and lower latency to meet the requirements Libvirt of modern computing and storage systems is the API (APPLICATIONPROGRAMMING INTERFACE) protocol for managing open sources of virtualized platforms, background programs and management tools. It can be used to manage KVM (KEYBOARDVIDEO MOUSE) ports, xen, VMware ESX, QEMU analog processor software, and other virtualization techniques.
And CPU (CENTRAL PROCESSING UNIT), managing a central processing unit resource pool, namely realizing unified management and scheduling of the distributed CPU (CENTRAL PROCESSING UNIT) central processing unit resources through libvirt, and improving the utilization rate and scheduling efficiency of computing resources. The management mode changes the original single-node management mode into a one-to-many mode, so that a plurality of virtualized hosts can share a CPU (CENTRAL PROCESSING UNIT) central processing unit resource pool, thereby realizing efficient aggregation and allocation of resources.
The method is based on an independently developed distributed virtualization technology, wherein the current super aggregation host machine realizes CPU (CENTRAL PROCESSING UNIT) separation of resources of a central processing unit pool, a memory pool and a storage pool in terms of hardware, and aggregation development of KVM (KEYBOARDVIDEO MOUSE) ports and QEMU simulation processor software sides is completed in the distributed virtualization technology.
The use of libvirt's remote management capability-although libvirt is currently primarily used to manage a single host, it provides powerful remote management capability, a virtual machine monitor connected to a remote machine. Based on the characteristic of libvirt, a scheme for realizing unified management of a plurality of cloud hosts through libvirt can be designed.
The application provides a method and a device for managing a super-aggregation host based on LIBVIRT, which comprise the steps of receiving a resource request of a virtual machine, configuring a virtual operating system command of a bottom layer corresponding to a hardware resource identifier according to a preset virtual processor, determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer, distributing resources of a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of distributed CPU (CENTRAL PROCESSING UNIT) central processor resources through libvirt, so that the utilization rate and scheduling efficiency of computing resources are improved. The management mode changes the original single-node management mode into a one-to-many mode, so that a plurality of virtualized hosts can share a CPU (CENTRAL PROCESSINGUNIT) central processing unit resource pool, thereby realizing efficient aggregation and allocation of resources.
The present application further provides a method for managing super aggregation host based on libvirt according to the above embodiment.
In some embodiments of the present application, the method may further include allocating memory of the host according to a preset memory block name, where the plurality of virtual machines use the same block of CXL memory.
Specifically, CXL shared memory is used at the bottom of the aggregate computing layer, so device adaptation at libvirt is required, and the memory size of the super aggregate host may be specified as needed. In order to be compatible with the running mode of a single host managed by libvirt, the memory needs to come from a plurality of memory back ends, so that the mark needs to be set, and the memory-backend parameter of the QEMU simulation processor software side and the original memory in XML are used for jointly managing the memory resources.
The memory-backend is mainly used for supporting the hot plug function of the memory in the QEMU, and can refer to different back-end technologies of memory management, including basic RAM hot plug and using files as the back-end of the memory, where the memory represents the memory.
The method comprises the following specific steps:
The current test development uses CXL devices in the environment of QEMU simulation processor software simulation.
The required region area and the name space for the nacespace are created in the emulated CXL device, where the size of the memory and the memory block name are managed.
The XML indicates the memory block name needed to be used as the memory back end of the super aggregation host. The memory is larger than the CXL memory, and the local memory can still be used.
The back end of the memory can be used as a parameter and transmitted into QEMU simulation processor software, and the QEMU simulation processor software can be further used.
The embodiment of the application can also be used for CXL memory pool resource management, the CXL memory is designated as the memory back end through libvirt, and the memory size is allocated according to the requirement. And the CXL memory pool is managed and allocated through a libvirt unified interface, so that the consistency and the efficient utilization of the cross-node memory resources are ensured. Therefore, a plurality of virtualized hosts can share one memory pool, flexible scheduling and efficient management of memory resources are realized, and the limitation of the traditional single-node memory is broken through.
Further, the method also includes managing lifecycles of the aggregation hosts by libvirt. The method comprises the steps of modifying an XML file of a virtual machine through libvirt, wherein the XML file at least comprises IP address information of a plurality of hosts and CPU (CENTRALPROCESSING UNIT) central processing units actually used by each host, initializing and connecting the libvirt of the hosts to each slave through a API (APPLICATION PROGRAMMING INTERFACE) protocol interface of the libvirt, analyzing and processing the XML file of the virtual machine based on the hosts to obtain the XML file of the virtual machine after processing, and starting the virtual machine according to the XML file of the virtual machine after processing and disc information after processing.
And the life cycle management can provide a unified interface of the aggregation host to realize the life cycle management of the virtual machine, and specifically can comprise operations such as creation, starting, suspension, restoration, destruction and the like, so that the management flow is simplified, and the management efficiency is improved. Through unified life cycle management, a plurality of virtualization hosts can be controlled and managed in a centralized mode, and flexibility and reliability of the system are improved.
In addition, the virtual machine XML file may be modified by libvirt, where the XML file includes at least IP address information of a plurality of hosts, and CPU (CENTRALPROCESSING UNIT) central processing unit cases actually used by each host, including:
Based on the XML file of the virtual machine, the identification tag of the host is added, and the configuration information for describing the host is identified, wherein the configuration information at least comprises the IP addresses of all nodes, the number of the virtual machines corresponding to the IP addresses, whether the current IP address is a master main node, CXL memory block names and memory sizes.
In some embodiments of the present application, initializing a libvirt connection to a master, connecting to each slave through a API (APPLICATION PROGRAMMING INTERFACE) protocol interface of libvirt, includes:
connecting a master node and each slave node by using virConnectOpen functions;
In the event that all connections are successfully established, the master node will hold the connection handles of all the slave nodes, which are used for virtual machine management operations.
Specifically, the libvirt on master node is initialized. At the master node, the libvirt API (APPLICATION PROGRAMMING INTERFACE) protocol is used to connect to the individual slave nodes. The operation steps are as follows:
the virConnectOpen functions are used to connect to the master node and to the individual slave nodes, ensuring that all connections are successfully established.
After connection establishment, the master node will hold connection handles for all slave nodes, which are used for subsequent virtual machine management operations.
This approach ensures that the master node can uniformly manage and schedule virtual machine resources on all slave nodes.
Further, based on the host, analyzing and processing the virtual machine XML file to obtain a processed virtual machine XML file, including:
judging whether the current computing node is a host node or not;
If the master node is the master node, the slave nodes are called remotely through a virtual machine monitor, and a virDomainDefineXML function is called to define virtual machines on all the nodes so that the definition process of all the slave nodes is consistent;
virDomainDefineXML is a function in the libvirt library that defines the configuration file of a virtual machine. The primary role of this function is to pass an XML-formatted virtual machine definition file to libvirt in order to create or update a virtual machine's configuration.
And if the virtual machine is not the master host node, storing the virtual machine XML file after the analysis of the virtual machine monitor function.
In the application, on master node, XML files of the virtual machine are analyzed and processed, and the following steps are executed:
Judging whether the current computing node is a master node or not;
If the master node is the master node, the remote slave node is called, and after the call is successful, the Hypervisor of the slave node is used for calling.
Invoking virDomainDefineXML functions to define virtual machines on each node ensures that the definition process of all nodes is consistent.
If the function is not the master node, the function is parsed to xml and directly saved. This does not destroy the original definition.
In still other embodiments of the present application, processing disk information of a virtual machine according to a host computer to obtain processed disk information specifically includes:
If the identification label of the host exists and the current node is the host node, the disk information is reserved and analyzed, and the disk information is stored on the host;
if the current node is not the host node, the analysis and the processing of the disk information are skipped, and only the computing resource of the node is processed.
In order to achieve the above objective, the embodiment of the present application provides a method for managing a super aggregation host based on libvirt, which specifically includes the following steps:
libvirt manages the overall framework design of the super aggregation host.
In contrast to fig. 3 and fig. 4, the design structure selected in the present invention is fig. 3, that is, one master node is designated among a plurality of aggregation hosts, the other master nodes are slave nodes, all aggregation machines are managed by the master nodes, and only the master node machines are operable by the Client scheduling platform.
Libvirt manages the hardware resources of the aggregation host:
Adaptation CPU (CENTRAL PROCESSING UNIT) central processor resources libvirt has 2 parameters in XML to manage CPU (CENTRAL PROCESSING UNIT) the central processor, CPU (CENTRAL PROCESSING UNIT) central processor and VCPU (virtualization technology of CPU), respectively. CPU (CENTRAL PROCESSING UNIT) the CPU is mainly used to avoid contention for resources by multiple virtual machines on a host, but when the virtual machines are actually started, libvirt will call the underlying virtual operating system command according to the configuration information of the VCPU (virtualization technology of the CPU). The aggregation host specifically allocates VCPU (virtual technology of CPU) (virtual central processing unit) resources by local-CPU on QEMU simulation processor software side, so that the VCPU (virtual technology of CPU) on libvirt side needs to be bound with local-CPU to ensure effective and reasonable utilization of resources.
And (3) adapting the back end of the CXL memory, namely using the CXL shared memory at the bottom layer of the aggregation calculation, so that equipment adaptation is required at libvirt, and the memory size of the super aggregation host can be specified as required. In order to be compatible with the running mode of a single host managed by libvirt, the memory needs to come from a plurality of memory back ends, so that the mark needs to be set, and the memory-backend parameter of the QEMU simulation processor software side and the original memory storage in XML are used for jointly managing the memory resources. CXL (ComputeExpress Link) technology is a new type of high-speed interconnect technology aimed at providing higher data throughput and lower latency to meet the demands of modern computing and storage systems. The method comprises the following specific steps:
The current test development uses CXL devices in the environment of QEMU simulation processor software simulation.
The required region area and the name space for the nacespace are created in the emulated CXL device, where the size of the memory and the memory block name are managed.
The XML indicates the memory block name needed to be used as the memory back end of the super aggregation host. The Memory is used for storing parameters larger than CXL Memory, and the local Memory can still be used.
The back end of the memory can be used as a parameter and transmitted into QEMU simulation processor software, and the QEMU simulation processor software can be further used.
Libvirt manages lifecycle of syndication hosts
XML file modification, namely, libvirt is managed by XML, so that when the hardware resource of the aggregation host is adapted, XML needs to be modified and designed, firstly, the XML of the master node host needs to contain IP address information of a plurality of hosts, and CPU (CENTRAL PROCESSING UNIT) central processing units are actually used by each host. The specifically modified XML design is as follows:
FIG. 5 shows the processing details of the libvirt management super aggregation host, the logic to process the newly added tag < aggregate >, disk information. The method comprises the steps of IP address information reading, local-CPU information reading, CXL memory block name and memory size reading of a host in the multi-computing node.
The identification label < aggregate > of the super aggregation host is newly added in the xml and is used for describing the relevant information of the aggregation host.
The < IP >: tag is used to identify the IP address of each node.
CPUnums the number of VCPUs used for each IP address is identified for the attributes of the < IP > node.
Mark is the attribute of the < IP > node, and identifies whether the current IP address is master.
< CXL >: identifies CXL memory block name, internal size attribute identifies size.
(2) Initializing the libvirt on master node. At the master node, the libvirtAPI (APPLICATION PROGRAMMING INTERFACE) protocol is used to connect to the individual slave nodes. The method comprises the following specific steps:
the virConnectOpen functions are used to connect to the master node and to the individual slave nodes, ensuring that all connections are successfully established.
After connection establishment, the master node will hold connection handles for all slave nodes, which are used for subsequent virtual machine management operations.
This approach ensures that the master node can uniformly manage and schedule virtual machine resources on all slave nodes.
(3) A virtual machine is defined. On the master node, analyzing and processing XML files of the virtual machine, and executing the following steps:
judging whether the current computing node is master
And if the master node is the master node, calling the remote slave node, and after the remote slave node is successfully called, calling by using a virtual machine monitor of the slave node.
Invoking virDomainDefineXML functions to define virtual machines on each node ensures that the definition process of all nodes is consistent.
If the function is not the master node, the function is parsed to xml and directly saved. This does not destroy the original definition.
(4) Processing disk information, and considering the design condition of the current aggregation host when processing the disk information in the virtual machine definition:
If the identification label of the aggregation host exists and the current node is a master node, the disk information is reserved and analyzed, and the disk resource is ensured to be managed on the master node.
If the current node is not the master node, the parsing and processing of the disk information is skipped and only the computing resources of that node (e.g., VCPU (virtualization technology of CPU)) are processed.
This approach ensures that disk resources are managed centrally at the master node, while computing resources are managed distributed across the nodes.
(5) And starting the virtual machine. This function is tightly coupled to the required parameter local-CPU of the QEMU analog processor software bottom layer. The method comprises the following specific steps:
Local-CPU refers to each individual CPU core in a multi-core processor. In a multi-core processor, each CPU core has its own processing power, and can independently execute tasks without sharing resources with other cores. The design enables the multi-core processor to process a plurality of tasks simultaneously, and improves the overall processing efficiency.
If the number of local-CPUs of the current computing node is the same as that of VCPUs (virtualization technology of the CPU).
If the two nodes are the same, the node is directly started, and the aggregation function is not required to be started.
If the nodes are different, remote connection is carried out according to the IP address, QEMU simulation processor software parameters are constructed on each node according to the nums attribute of the central processing unit CPU (CentralProcessing Unit), and a virtual machine is started, so that the starting processes of all the nodes are consistent and coordinated.
(6) The virtual machine is cancelled, destroyed and closed, and how libvirt manages the life cycle of the super aggregation host is shown in fig. 6, and the life cycle is mainly reflected in the information of error feedback by constructing the software parameter part of the QEMU simulation processor and the RPC protocol mechanism according to xml.
The RPC protocol is a protocol that requests services from a remote computer program over a network without requiring knowledge of underlying network technology.
Judging whether the current computing node is master
And if the master node is the master node, calling the remote slave node, and after the remote slave node is successfully called, calling by using a virtual machine monitor of the slave node.
Calling interfaces of libvirt, virDomainUndefine functions, virDomainDestroy functions and virDomainShutdown functions to analyze XML files on each node and perform related operation of a virtual machine, so that the definition process of all nodes is consistent.
Other extended function interfaces
(1) Querying virtual machine state
The user may query the state of the current virtual machine through the VIRSH LIST interface and determine whether the current machine is an aggregate host or a general host. This way it is ensured that the user can intuitively understand the running state of each virtual machine and its aggregation.
Wherein VIRSH LIST commands are used to display a list of virtual machines currently running.
The specific conditions are as follows:
attributes isaggregate of the list are added.
If the identification label exists, whether the master node or the slave node is further judged and displayed.
If the identification tag is not present, it is directly empty.
And returning an operation result and error information by using an RPC protocol mechanism, and displaying the operation result and the error information on the master node. The specific implementation steps are as follows:
defining an RPC protocol communication protocol, namely defining a communication protocol between a master node and slave for transmitting operation results and error information. The communication protocol may be in JSON format, containing operation type, operation status, and detailed error information.
The method comprises the steps of realizing an RPC protocol client and a server, wherein the RPC protocol server is realized on a master node and is used for receiving messages from slave nodes, and the RPC protocol client is realized on each slave node and is used for sending operation results and error information to the master node.
The RPC protocol is used in the virtual machine management operation, namely, in each virtual machine management operation, an RPC protocol interface is called to transmit operation results and error information to a master node. And on the master node, analyzing and displaying an operation result and error information after receiving the message.
And (5) expanding functions. This work includes, but is not limited to, the interfaces above, but the idea is consistent that for an aggregated cloud host, the user can operate only master nodes, and the user cannot directly operate slave nodes.
The invention realizes a super aggregation host management method by implementing the related working principle on the code level. The feasibility and benefits of the method in actual operation are verified through actual programming and system configuration.
The operation mode of managing a single host on the existing computing node by the existing libvirt is broken, and unified and centralized management of a plurality of virtualized hosts crossing the computing node is realized.
A libvirt-based super aggregation host management method is provided, including but not limited to CPU (CENTRAL PROCESSING UNIT) CPU resource pool management, CXL memory pool resource management and virtual machine lifecycle management described above. By improving the cross-node resource management and scheduling method realized by the original libvirt interface, the consistency and the high-efficiency utilization of resources are ensured.
The embodiment of the application has the following technical effects:
Unified management, namely operating a plurality of virtualized hosts in a manual mode is not needed. The virtualized environment is comprehensively managed through an integrated system provided by libvirt.
The operation is simplified, the user does not need to know the parameters of the bottom command line, and the high-level management function is realized through the libvirt interface, so that the operation complexity is reduced.
The flexibility is improved, the running mode of the existing single host is maintained, diversified virtualized management requirements are supported, and the adaptability and expansibility of the system are enhanced.
The system coupling is reduced, namely the client is decoupled from the libvirt instance, only interaction with a master node is needed, the dependency among components is reduced, only the master node is needed to be adjusted during system expansion, the client does not need to be changed, and the complexity of expansion and upgrading is reduced.
Simplified learning curve, improved on original libvirt interface, and the related user can use the needed advanced functions without learning new API (APPLICATION PROGRAMMING INTERFACE) protocol.
It should be noted that, in this embodiment, each of the embodiments may be implemented separately, or may be implemented in any combination without conflict, without limiting the application.
The application provides a method for managing a super aggregation host based on LIBVIRT, which comprises the steps of receiving a resource request of a virtual machine, configuring a virtual operating system command of a bottom layer corresponding to a hardware resource identifier according to a preset virtual processor, determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer, distributing resources of a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of distributed CPU (CENTRAL PROCESSING UNIT) central processor resources through libvirt, so that the utilization rate and scheduling efficiency of computing resources are improved. The management mode changes the original single node management mode into a one-to-many mode, so that a plurality of virtualized hosts can share a CPU (CENTRAL PROCESSINGUNIT) central processing unit resource pool, thereby realizing the efficient aggregation and allocation of resources
Another embodiment of the present application provides a libvirt-based management super aggregation host device, configured to perform the libvirt-based management super aggregation host method provided in the foregoing embodiment.
Fig. 7 is a schematic structural diagram of a libvirt-based management super aggregation host device according to an embodiment of the present application. The libvirt-based management super aggregation host device includes, wherein:
the receiving module 701 is configured to receive a resource request of a virtual machine, where the resource request is a hardware resource identifier;
the calling module 702 is configured to configure a virtual operating system command of a bottom layer corresponding to the hardware resource identifier according to a preset virtual processor;
The determining module 703 is configured to determine, according to the underlying virtual operating system command, a host corresponding to the virtual machine;
The allocation module 704 is configured to allocate resources to a plurality of virtual machines corresponding to a host according to the host, and implement unified management and scheduling of distributed CPU (CENTRAL PROCESSING UNIT) central processing unit resources through libvirt.
The specific manner in which the individual modules perform the operations of the apparatus of this embodiment has been described in detail in connection with embodiments of the method and will not be described in detail herein.
The application provides a super aggregation host device based on LIBVIRT management, which comprises the steps of receiving a resource request of a virtual machine, configuring a virtual operating system command of a bottom layer corresponding to a hardware resource identifier according to a preset virtual processor, determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer, distributing resources of a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of distributed CPU (CENTRAL PROCESSING UNIT) central processor resources through libvirt, so that the utilization rate and scheduling efficiency of computing resources are improved. The management mode changes the original single-node management mode into a one-to-many mode, so that a plurality of virtualized hosts can share a CPU (CENTRAL PROCESSINGUNIT) central processing unit resource pool, thereby realizing efficient aggregation and distribution of resources.
In some embodiments of the application, the allocation module is configured to:
And distributing the memory of the host according to the preset memory block names, wherein the plurality of virtual machines use the same CXL memory.
In some embodiments of the application, the allocation module is configured to:
Managing the life cycle of the aggregation host through libvirt;
The method specifically comprises the following steps:
Modifying an XML file of the virtual machine through libvirt, wherein the XML file at least comprises IP address information of a plurality of hosts and CPU (CENTRAL PROCESSINGUNIT) CPU conditions actually used by each host;
Initializing the libvirt of the host computer, and connecting to each slave computer through API (APPLICATIONPROGRAMMING INTERFACE) protocol interfaces of the libvirt;
analyzing and processing the virtual machine XML file based on the host computer to obtain a processed virtual machine XML file;
and starting the virtual machine according to the processed virtual machine XML file and the processed disk information.
In some embodiments of the application, the allocation module is configured to:
Based on the XML file of the virtual machine, the identification tag of the host is added, and the configuration information for describing the host is identified, wherein the configuration information at least comprises the IP addresses of all nodes, the number of the virtual machines corresponding to the IP addresses, whether the current IP address is a master main node, CXL memory block names and memory sizes.
In some embodiments of the application, the allocation module is configured to:
connecting a master node and each slave node by using virConnectOpen functions;
In the event that all connections are successfully established, the master node will hold the connection handles of all the slave nodes, which are used for virtual machine management operations.
In some embodiments of the application, the allocation module is configured to:
judging whether the current computing node is a host node or not;
If the master node is the master node, the slave nodes are called remotely through a virtual machine monitor, and a virDomainDefineXML function is called to define virtual machines on all the nodes so that the definition process of all the slave nodes is consistent;
and if the virtual machine is not the master host node, storing the virtual machine XML file after the analysis of the virtual machine monitor function.
In some embodiments of the application, the allocation module is configured to:
If the identification label of the host exists and the current node is the host node, the disk information is reserved and analyzed, and the disk information is stored on the host;
if the current node is not the host node, the analysis and the processing of the disk information are skipped, and only the computing resource of the node is processed.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The application provides a super aggregation host device based on LIBVIRT management, which comprises the steps of receiving a resource request of a virtual machine, configuring a virtual operating system command of a bottom layer corresponding to a hardware resource identifier according to a preset virtual processor, determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer, distributing resources of a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of distributed CPU (CENTRAL PROCESSING UNIT) central processor resources through libvirt, so that the utilization rate and scheduling efficiency of computing resources are improved. The management mode changes the original single node management mode into a one-to-many mode, so that a plurality of virtualized hosts can share a CPU (CENTRAL PROCESSINGUNIT) central processing unit resource pool, thereby realizing the efficient aggregation and allocation of resources
Optionally, the embodiment of the application further provides an electronic device, which comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program realizes the processes of the above method embodiment when being executed by the processor, and can achieve the same technical effects, and the repetition is avoided, so that the description is omitted.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the above method embodiment and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. The computer readable storage medium is, for example, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk or an optical disk.
Fig. 8 is a block diagram of an electronic device 800 in accordance with the present application. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to FIG. 8, an electronic device 800 can include one or more of a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, images, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen between the electronic device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, an activate button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of a user's contact with the electronic device 800, an orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices, either wired or wireless. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast operation information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of electronic device 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 9 is a block diagram of a computer-readable storage medium 1900 in accordance with the present application. For example, computer-readable storage medium 1900 may be provided as a server.
Referring to fig. 9, computer-readable storage medium 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
Computer-readable storage medium 1900 may also include a power component 1926 configured to perform power management of computer-readable storage medium 1900, a wired or wireless network interface 1950 configured to connect computer-readable storage medium 1900 to a network, and an input output (I/O) interface 1958. The computer-readable storage medium 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
It should be noted that, in this document, 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.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. The storage medium includes various media capable of storing program codes such as a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A libvirt-based method of managing a super aggregation host, the method comprising:
receiving a resource request of a virtual machine, wherein the resource request is a hardware resource identifier;
Configuring a virtual operating system command of a bottom layer corresponding to the hardware resource identifier according to a preset virtual processor;
determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer;
and according to the host, performing resource allocation on a plurality of virtual machines corresponding to the host, and realizing unified management and scheduling on the distributed CPU through libvirt.
2. The libvirt based management superaggregate host method of claim 1, wherein the method further comprises:
And distributing the memory of the host according to the preset memory block names, wherein the plurality of virtual machines use the same CXL memory.
3. The libvirt based management superaggregate host method of claim 1, wherein the method further comprises:
Managing the life cycle of the aggregation host through libvirt;
The method specifically comprises the following steps:
Modifying an XML file of the virtual machine through libvirt, wherein the XML file at least comprises IP address information of a plurality of hosts and CPU conditions actually used by each host;
Initializing and connecting libvirt of a host computer, and connecting to each slave computer through an API protocol interface of the libvirt;
analyzing and processing the virtual machine XML file based on the host computer to obtain a processed virtual machine XML file;
and starting the virtual machine according to the processed virtual machine XML file and the processed disk information.
4. The libvirt based management superaggregate host method according to claim 3 wherein the modifying the virtual machine XML file by libvirt, wherein the XML file includes at least IP address information of a plurality of hosts and CPU conditions actually used by each host comprises:
And adding an identification tag of the host in the XML file of the virtual machine, wherein the identification is used for describing configuration information of the host, and the configuration information at least comprises IP addresses of all nodes, the number of virtual machines corresponding to the IP addresses, whether the current IP address is a host node, CXL memory block names and memory sizes.
5. The libvirt based management superaggregate host method according to claim 3 wherein the initializing the host to libvirt interfaces to each slave through the API protocol of libvirt comprising:
connecting a master node and each slave node by using virConnectOpen functions;
In the event that all connections are successfully established, the master node will hold connection handles for all slave nodes, which handles are used for virtual machine management operations.
6. The libvirt based management superaggregate host method of claim 3 wherein the parsing and processing the virtual machine XML file based on the host resulting in a processed virtual machine XML file comprises:
judging whether the current computing node is a host node or not;
if the host node is the slave node, the slave node is called remotely through a virtual machine monitor, and a virDomainDefineXML function is called to define virtual machines on all the nodes so that the definition process of all the slave nodes is consistent;
and if the virtual machine is not the host node, storing the virtual machine XML file after the analysis of the virtual machine monitor function.
7. The libvirt based management superaggregate host method according to claim 1, wherein the allocating resources to the virtual machines corresponding to the hosts according to the hosts comprises:
If the identification label of the host exists and the current node is the host node, the disk information is reserved and analyzed, and the disk information is stored on the host;
If the current node is not the host node, the analysis and the processing of the disk information are skipped, and only the computing resource of the current node is processed.
8. A libvirt-based management superaggregate host device, the device comprising:
The receiving module is used for receiving a resource request of the virtual machine, wherein the resource request is a hardware resource identifier;
The calling module is used for configuring a virtual operating system command of the bottom layer corresponding to the hardware resource identifier according to a preset virtual processor;
The determining module is used for determining a host corresponding to the virtual machine according to the virtual operating system command of the bottom layer;
And the allocation module is used for allocating resources to a plurality of virtual machines corresponding to the host according to the host, and realizing unified management and scheduling of distributed CPU resources through libvirt.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program implementing the method of any one of claims 1 to 7 when executed by the processor.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the method according to any of claims 1 to 7.
CN202411782520.2A 2024-12-05 2024-12-05 Method and device for managing super aggregation host based on LIBVIRT Pending CN119759488A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411782520.2A CN119759488A (en) 2024-12-05 2024-12-05 Method and device for managing super aggregation host based on LIBVIRT

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411782520.2A CN119759488A (en) 2024-12-05 2024-12-05 Method and device for managing super aggregation host based on LIBVIRT

Publications (1)

Publication Number Publication Date
CN119759488A true CN119759488A (en) 2025-04-04

Family

ID=95184184

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411782520.2A Pending CN119759488A (en) 2024-12-05 2024-12-05 Method and device for managing super aggregation host based on LIBVIRT

Country Status (1)

Country Link
CN (1) CN119759488A (en)

Similar Documents

Publication Publication Date Title
JP7018463B2 (en) Managing the delivery of code and dependent data using the application container
CN109101352B (en) Image processing algorithm architecture, algorithm calling method, device, storage medium and mobile terminal
KR101740327B1 (en) Apparatus and system for providing software service using software virtualization and method thereof
KR101702729B1 (en) System and method for switching between environments in a multi-environment operating system
RU2700188C2 (en) Representing computing environment on multiple devices
CN110300328B (en) Video playing control method and device and readable storage medium
CN107291456B (en) Multi-screen display control method and system
WO2016090902A1 (en) Hot-handover method and device for operating systems, and mobile terminal
CN109308241B (en) Method and device for monitoring starting process of application program, terminal equipment and storage medium
JP7100154B6 (en) Processor core scheduling method, device, terminal and storage medium
CN104281478B (en) The method and device of more new application
KR20200042798A (en) Method for controlling the execution of different operating systems, electronic device and storage medium therefor
KR101907837B1 (en) Application activation framework
WO2015176352A1 (en) Android system-based method and device for information exchange between applications
US11249771B2 (en) Terminal input invocation
WO2018086454A1 (en) Page data processing method and device
CN110795205B (en) System and method for providing cloud service based on software container
CN109033393A (en) Sticker processing method, device, storage medium and electronic equipment
WO2015176422A1 (en) Android system-based application management method and device thereof
US9047134B2 (en) System and method for increasing the capabilities of a mobile device
CN116820527B (en) Program upgrading method, device, computer equipment and storage medium
EP4583481A1 (en) Multi-device networking system and method, and terminal devices
WO2017211260A1 (en) Data access method and related device
CN119759488A (en) Method and device for managing super aggregation host based on LIBVIRT
WO2023035619A1 (en) Scene rendering method and apparatus, device and 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