A method and system for constructing a virtualized computing cluster

CN122570076APending Publication Date: 2026-08-14COMP NETWORK INFORMATION CENT CHINESE ACADEMY OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

传统HPC集群软件栈固化、环境灵活性差,难以适配AI框架切换、异构加速卡驱动共存等高度定制化需求,环境调试成本高、研发效率低

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122570076A_ABST
    Figure CN122570076A_ABST
Patent Text Reader

Abstract

This application provides a method and system for constructing a virtualized computing cluster. The method includes: virtualizing the physical hardware resources of computing nodes to obtain a virtualized resource pool containing virtual functional input / output pass-through devices; a job scheduling system injects custom resource scheduling logic before task startup through a plug-in architecture, allocates matching pass-through devices from the virtualized resource pool, and generates virtual machine configuration files; starting virtual machine instances based on the configuration files and configuring network parameters; providing standardized base image templates and creating incremental images using copy-on-write technology; and using virtual machine instances to load user-specific images to execute computing tasks. This invention solves the problems of complex heterogeneous resource management, uneven resource utilization, cumbersome user operations, and poor customizability of the operating environment in existing technologies, achieving the construction of high-performance, low-loss, easy-to-use, and customizable virtualized computing clusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the fields of computer virtualization and cluster computing technology, and in particular to a method and system for constructing virtualized computing clusters for heterogeneous acceleration resources such as GPUs / DCUs / NPUs. This method is applicable to technical scenarios such as artificial intelligence and high-performance computing that require customized computing environments and high computing power density. Background Technology

[0002] With the development of technologies such as artificial intelligence, big data, and the Internet of Things, the industry's demand for heterogeneous computing power has grown dramatically. Traditional HPC clusters have rigid software stacks and poor environmental flexibility, making it difficult to adapt to highly customized requirements such as switching AI frameworks and coexisting heterogeneous accelerator card drivers. This results in high environment debugging costs and low R&D efficiency.

[0003] After the introduction of virtualization technology, existing solutions still have significant shortcomings in managing high-performance heterogeneous devices such as GPUs and InfiniBand: heterogeneous resources are difficult to schedule uniformly, resource utilization is uneven, user operations are cumbersome, and the operating environment cannot be customized.

[0004] The lack of a cluster construction solution that can efficiently integrate heterogeneous computing resources, achieve high-performance, low-loss virtualization, and simultaneously ensure ease of use and environment customization capabilities has become a key bottleneck restricting the large-scale and efficient utilization of heterogeneous computing power. Summary of the Invention

[0005] This application describes a method and system for constructing a virtualized computing cluster, which can solve the above-mentioned technical problems.

[0006] Firstly, a method for constructing a virtualized computing cluster is provided, including:

[0007] The physical hardware resources of at least one computing node are virtualized to obtain a virtualized resource pool containing virtual function input / output pass-through devices.

[0008] In response to resource requests from virtualized computing tasks, the job scheduling system injects custom resource scheduling logic before task startup through a plug-in architecture. Based on the resource requests, it allocates matching virtual function input / output pass-through devices from the virtualized resource pool and generates virtual machine configuration files based on the allocated devices.

[0009] Start a virtual machine instance based on the virtual machine configuration file, and configure network parameters for the virtual machine instance;

[0010] It provides a standardized base image template, allowing users to customize and modify it based on the base image template and save the modified content as a user-specific image; it uses copy-on-write technology to create incremental images for the user-specific image and stores the difference data between the user-specific image and the base image;

[0011] The user-specific image is loaded using the virtual machine instance to execute the virtualization computing task.

[0012] In this way, by dynamically injecting custom scheduling logic into the job scheduling system's plug-in architecture before task startup, precise allocation of virtual function input / output through-devices is achieved, avoiding resource contention and idleness. Combined with user-level image customization and write-time copy incremental storage, it not only meets the needs of personalized environments but also significantly reduces cluster storage overhead. Ultimately, a virtualized computing cluster with high resource utilization, convenient operation, and customizable environment is constructed, effectively solving the problems of complex heterogeneous resource management, uneven resource utilization, cumbersome user operation, and poor customizability of the operating environment in existing technologies.

[0013] Among some possible implementations, virtualization of physical hardware resources includes:

[0014] Enable the auxiliary virtualization function of the input / output memory management unit to unbind the heterogeneous accelerator card from the host machine's native driver, pass it through the virtual function input / output technology to the virtual machine, and load the corresponding device driver by the virtual machine. The virtual function input / output driver and the input / output memory management unit work together to complete the direct memory access address remapping of the heterogeneous accelerator card.

[0015] The physical network card is virtualized into multiple independent virtual function network cards. The single root input / output virtualization function of the physical network card is enabled and a specified number of virtual function network cards are generated. The virtual function network cards are then driver-bound using virtual function input / output technology.

[0016] In this way, hardware-assisted virtualization technology enables direct pass-through between heterogeneous accelerator cards and physical network cards, eliminating the performance loss of traditional virtualization and enabling virtual machines to achieve computing and network performance close to that of physical machines.

[0017] In some possible implementations, when the job scheduling system injects custom resource scheduling logic through a plug-in architecture, the virtualization management plug-ins used include: a first type of plug-in for managing accelerator cards, a second type of plug-in for managing Ethernet virtual function network cards, and a third type of plug-in for managing InfiniBand virtual function network cards.

[0018] In this way, by developing dedicated management plugins for different heterogeneous resource types, the decoupling and unified scheduling of resource types are achieved, which facilitates system expansion and maintenance.

[0019] In some possible implementations, the virtual machine instance is configured with network parameters including:

[0020] Each virtual machine is assigned a unique media access control address, and a differentiated network service mode is adopted according to the cluster node size;

[0021] When the number of compute nodes is less than a preset threshold, a lightweight dynamic host configuration protocol server is deployed on the host machine to provide automatic allocation of Internet Protocol addresses for virtual machines.

[0022] When the number of computing nodes is greater than or equal to a preset threshold, an Internet Protocol address pool is pre-planned, and a mapping table of Internet Protocol addresses, Media Access Control addresses and virtual machine resources is established. When the virtual machine starts, the initialization script automatically reads the mapping table to complete the network configuration.

[0023] In this way, the network configuration mode is adaptively selected according to the cluster size, which not only ensures the lightweight deployment of small-scale clusters, but also meets the efficient management needs of large-scale clusters, avoiding the bottleneck problem of a single DHCP service in large-scale scenarios.

[0024] In some possible implementations, supporting users to make customized modifications based on the base image template includes: entering the image editing mode through a dedicated task submission command, allowing users to install custom software or adapt specific driver versions on the base image.

[0025] In this way, users do not need to master the underlying image creation technology to complete the customization of personalized environments through simple command-line interaction, which lowers the threshold for use and improves R&D efficiency.

[0026] Some possible implementations also include full lifecycle management of virtualized computing tasks, specifically including:

[0027] By submitting commands through a dedicated virtualization task, users can complete a one-click application for resources by specifying the image name and the number of accelerator cards.

[0028] The control node monitors the running status of virtual machine instances on each compute node in real time through a heartbeat detection mechanism and synchronizes the status information to the job scheduling system.

[0029] After the virtualization computing task is completed, the job scheduling system automatically issues a virtual machine shutdown command, releases the passed-through hardware resources and reclaims them to the virtualization resource pool, and notifies the control node to update the resource pool status.

[0030] In this way, a fully automated closed loop is achieved for virtualization tasks, from application and execution to resource recycling. Users only need to focus on the business itself, and the system automatically manages and releases the underlying resources, which significantly improves the utilization efficiency of heterogeneous computing power and the resource turnover rate of the cluster.

[0031] Secondly, a virtualized computing cluster construction device is provided, comprising:

[0032] The first processing module is used to virtualize the physical hardware resources of at least one computing node to obtain a virtualized resource pool containing virtual function input / output pass-through devices.

[0033] The second processing module is used to respond to resource requests from virtualized computing tasks. The job scheduling system injects custom resource scheduling logic before the task starts through a plug-in architecture. Based on the resource request, it allocates a matching virtual function input / output pass-through device from the virtualized resource pool and generates a virtual machine configuration file based on the allocated device.

[0034] The third processing module is used to start a virtual machine instance based on the virtual machine configuration file and configure network parameters for the virtual machine instance.

[0035] The fourth processing module is used to provide a standardized base image template, allowing users to customize and modify the base image template and save the modified content as a user-specific image; it uses copy-on-write technology to create incremental images for the user-specific image and stores the difference data between the user-specific image and the base image.

[0036] The fifth processing module is used to load the user-specific image using the virtual machine instance and execute the virtualization computing task.

[0037] In some possible implementations, the first processing module is specifically used to: enable the auxiliary virtualization function of the input / output memory management unit, unbind the heterogeneous accelerator card from the host machine's native driver, pass it through to the virtual machine via virtual function input / output technology, load the corresponding device driver by the virtual machine, and use the virtual function input / output driver and the input / output memory management unit to work together to complete the direct memory access address remapping of the heterogeneous accelerator card;

[0038] The physical network card is virtualized into multiple independent virtual function network cards. The single root input / output virtualization function of the physical network card is enabled and a specified number of virtual function network cards are generated. The virtual function network cards are then driver-bound using virtual function input / output technology.

[0039] In some possible implementations, the second processing module is specifically used to: inject custom resource scheduling logic before task startup through the plug-in architecture of the job scheduling system. The virtualization management plug-ins used include a first type of plug-in for managing accelerator cards, a second type of plug-in for managing Ethernet virtual function network cards, and a third type of plug-in for managing InfiniBand virtual function network cards.

[0040] In some possible implementations, the third processing module is specifically used to: assign a unique media access control address to each virtual machine and adopt a differentiated network service mode according to the cluster node scale; when the number of compute nodes is less than a preset threshold, deploy a lightweight dynamic host configuration protocol server on the host machine to provide automatic allocation of Internet Protocol addresses for virtual machines; when the number of compute nodes is greater than or equal to the preset threshold, pre-plan an Internet Protocol address pool, establish a mapping table between Internet Protocol addresses, media access control addresses and virtual machine resources, and automatically read the mapping table to complete network configuration when the virtual machine starts up through an initialization script.

[0041] In some possible implementations, the fourth processing module is specifically used to: enter the image editing mode through a dedicated task submission command, allowing users to install custom software or adapt specific driver versions on the base image, and save all modifications to the user-specific image; and use copy-on-write technology to create an incremental image for the user-specific image, storing the difference data between the base image and the incremental image.

[0042] In some possible implementations, the device further includes a sixth processing module for full lifecycle management of virtualized computing tasks, specifically including: enabling users to submit resources with a single click by specifying the image name and the number of accelerator cards through a dedicated virtualization task submission command; the control node monitoring the running status of virtual machine instances on each computing node in real time through a heartbeat detection mechanism and synchronizing the status information to the job scheduling system; after the virtualized computing task is completed, the job scheduling system automatically issues a virtual machine shutdown command, releasing and reclaiming the passed-through hardware resources to the virtualization resource pool, and simultaneously notifying the control node to update the resource pool status.

[0043] Thirdly, an electronic device is provided, comprising: one or more processors; one or more memories; and one or more programs, wherein the one or more programs are stored in the one or more memories, and the one or more programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any of the first aspects.

[0044] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by one or more processors, implements the method as described in any of the first aspects.

[0045] Fifthly, a computer program product is provided, the computer program product storing instructions that, when executed by a computer, cause the computer to perform the method as described in any of the first aspects.

[0046] The beneficial effects of the second to fifth aspects can be referred to the introduction of the beneficial effects of the first aspect above, and will not be repeated here. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This diagram illustrates the principle of a virtualized computing cluster construction method provided in an embodiment of this specification.

[0049] Figure 2 This document illustrates a business logic diagram of a virtualized computing cluster construction method provided in an embodiment of this specification.

[0050] Figure 3 This diagram illustrates a flowchart of a virtualized computing cluster construction system provided in an embodiment of this specification.

[0051] Figure 4 This diagram illustrates a virtualized computing cluster construction apparatus provided in an embodiment of this specification.

[0052] Figure 5 An electronic device is shown. Detailed Implementation

[0053] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0054] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be described below with reference to the accompanying drawings.

[0055] In the description of the embodiments of this application, the words "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.

[0056] In the description of the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, B existing alone, and A and B existing simultaneously. Furthermore, unless otherwise stated, the term "multiple" means two or more.

[0057] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0058] With the rapid development of technologies such as artificial intelligence, big data, and the Internet of Things, the demand for computing power from heterogeneous computing resources across various industries is growing exponentially. While traditional high-performance computing (HPC) clusters possess strong computing power capabilities, their fixed software stacks and insufficient environmental flexibility make them difficult to adapt to the highly customized needs of the artificial intelligence field. For example, switching between different AI frameworks such as PyTorch and TensorFlow, and coexisting deployments of different driver versions for heterogeneous accelerator cards such as GPUs, DCUs, and NPUs, all require users to invest significant manpower in environment adaptation and debugging, resulting in low R&D efficiency and high barriers to entry.

[0059] To achieve the integration and unified management of computing resources, virtualization technology has been introduced into the field of high-performance computing. However, traditional virtualization solutions still have significant technical shortcomings when dealing with high-performance heterogeneous devices such as GPUs and InfiniBand network cards, specifically:

[0060] Unified management of heterogeneous resources is difficult: different types of accelerator cards differ significantly in hardware interfaces, driver frameworks and programming models, making it difficult to achieve unified virtualization abstraction and scheduling management.

[0061] Uneven resource utilization: The task-resource matching strategy is crude, which easily leads to some high-performance devices (such as GPUs) being overloaded for a long time and some resources being idle for a long time, resulting in low overall resource utilization.

[0062] The user process is cumbersome: When using virtualization resources, users need to manually configure underlying details such as network, device passthrough, and virtual machine parameters, which is complicated and lacks the convenient user experience of "one-click application and automatic configuration".

[0063] Weak customization capabilities for the operating environment: Traditional virtualization cluster image templates are fixed and cannot meet users' personalized customization needs for AI frameworks, driver versions, and software toolchains, resulting in insufficient flexibility in adapting to diverse scientific research and business tasks.

[0064] In summary, the lack of a virtualization computing cluster construction scheme that can efficiently integrate heterogeneous computing resources, achieve high-performance, low-loss virtualization, and simultaneously take into account ease of use and environment customization capabilities has become a key bottleneck restricting the large-scale and efficient utilization of heterogeneous computing power.

[0065] This invention addresses the technical problems of existing technologies, such as complex heterogeneous computing resource management, uneven resource utilization, cumbersome user operations, and poor customizability of the operating environment. It proposes a method and system for constructing virtualized computing clusters for heterogeneous computing resources. This invention aims to build a unified, efficient, easy-to-use, and customizable virtualized computing cluster platform by combining hardware-assisted virtualization technology with fine-grained scheduling strategies. This platform achieves high-performance virtualization and intensive scheduling of heterogeneous resources such as GPUs and high-speed network cards, providing users with a customized virtual computing environment that approximates the performance of physical machines, ultimately improving the utilization rate of heterogeneous resources in the cluster and enhancing user R&D efficiency.

[0066] To achieve the above objectives, the present invention provides a method for constructing a virtualized computing cluster, wherein the virtualized computing cluster includes a control node, a storage node, and multiple computing nodes. Figure 1 This is a schematic diagram illustrating the principle of the virtualized computing cluster construction method of this invention, showing the core steps of the entire process from resource preparation to task application in sequence. Sub-diagram (a) Heterogeneous Resource Virtualization: This demonstrates the process of transforming physical hardware resources into a uniformly schedulable virtualized resource pool, including heterogeneous accelerator card virtualization (hardware passthrough achieved through IOMMU / SMMU and VFIO) and network resource virtualization (virtualizing physical network cards into multiple VFs through SR-IOV and binding them via VFIO drivers). Sub-diagram (b) Multi-Runtime Environment Customization: This demonstrates the core principles of user-level image customization and management, including the base image layer, the user customization layer, and storage optimization using copy-on-write technology. Sub-diagram (c) Virtualized Resource Management: This demonstrates the fine-grained management mechanism for virtualized resources, including three types of management plugins (vfiogpu, vfioeth, vfioib) and the resource pool management logic where the control node collects resource status in real time through management plugins and synchronizes it to the job scheduling system. Subgraph (d) Virtualization Resource Scheduling: Demonstrates the core process of resource scheduling and virtual machine deployment, including SLURM injecting scheduling logic through the SPANK plugin, allocating VFIO passthrough devices according to requests, automatically generating KVMXML configuration files in accordance with the Libvirt specification, and starting virtual machines through virsh define and virsh start. Subgraph (e) Virtualization Task Application: Demonstrates the convenient process where users can complete a one-click application by logging into the node and using dedicated commands such as sbatch-vm and srun-vm with simple parameters.

[0067] This invention provides a method for constructing a virtualized computing cluster, comprising the following steps:

[0068] First, perform step 110: heterogeneous resource virtualization processing to build a unified virtual resource pool.

[0069] Standardized virtualization processing is performed on physical hardware resources on each computing node to form a virtualized resource pool that can be uniformly scheduled and supports hardware passthrough. This includes two aspects: 1. Heterogeneous accelerator card virtualization. IOMMU / SMMU hardware-assisted virtualization capabilities are enabled. Through VFIO (Virtual Function I / O) technology, physical accelerator cards are unbound from the host machine's native drivers and rebound to the VFIO driver, enabling hardware passthrough for the accelerator card devices. The physical accelerator cards can be GPUs, DCUs, NPUs, etc.

[0070] The accelerator card device identifier is identified by the lspci command, and the device information is written to the / etc / modprobe.d / vfio.conf configuration file to ensure that the VFIO driver is automatically loaded when the system starts. The VFIO driver and IOMMU work together to complete the device DMA address remapping, ensuring that the accelerator card can have secure direct access to the virtual machine memory space.

[0071] Using SR-IOV (Single Root I / O Virtualization) technology, physical Ethernet cards and InfiniBand network cards are virtualized into multiple independent virtual function (VF) network cards. For example, the SR-IOV function of the physical network card can be enabled to generate a specified number of VF network cards, and all VF network cards can be driver-bound through VFIO for subsequent pass-through to the virtual machine.

[0072] Next, proceed to step 120: Virtualization resource management and scheduling.

[0073] Based on job scheduling systems, such as SLURM and its SPANK plugin architecture, a lightweight virtualization resource management component is developed to achieve fine-grained scheduling and allocation of virtualization resources.

[0074] In this embodiment, virtualization management plugins are developed, including vfiogpu, vfioeth, and vfioib plugins for different types of resources, to achieve specialized management of GPU-like accelerator cards, Ethernet VF network cards, and IBVF network cards, respectively. When a user submits a virtualization computing task, the SLURM scheduling system injects custom resource scheduling logic through the SPANK plugin before the task starts. Based on the resource request type and quantity of the task, it accurately allocates matching VFIO passthrough devices from the virtualization resource pool. Based on the allocated virtualization resources, a KVM virtual machine XML configuration file conforming to the Libvirt specification is automatically generated. This configuration file contains full hardware configuration information such as the number of CPU cores, memory capacity, and VFIO passthrough device mapping relationships.

[0075] Then, proceed to step 130: Virtual machine instantiation and network configuration.

[0076] In this embodiment, the virtual machine is automatically started, deployed, and network configured based on a dynamically generated LibvirtXML configuration file, enabling the virtual machine to achieve hardware access performance close to that of a physical machine. Specifically, this includes: virtual machine instantiation and startup, using the virshdefine and virshstart commands to start the virtual machine instance based on QEMU / KVM virtualization technology; and the virtual machine operating system directly recognizing and driving the hardware devices passed through to VFIO, eliminating the performance overhead of traditional virtualization.

[0077] Intelligent network configuration based on scale assigns a unique MAC address to each virtual machine and adopts differentiated network service modes according to the cluster node scale to achieve automated configuration of network parameters: when the number of compute nodes is less than a preset threshold, such as 10 nodes, a lightweight dnsmasq server is deployed on the host machine to provide DHCP service for virtual machines and achieve automatic IP address allocation; when the number of compute nodes is greater than or equal to the preset threshold, based on the existing network architecture of the host machine, an IP address pool is pre-planned, and a mapping table of IP addresses, MAC addresses and virtual machine resources is established. When the virtual machine starts, the initialization script automatically reads the mapping table to complete the network parameter configuration.

[0078] Next, proceed to step 140: User-level image customization and management.

[0079] In this embodiment, a "standardized + personalized" image customization capability is provided to meet users' customization needs for the operating environment, while a lightweight storage strategy is adopted to reduce cluster storage overhead.

[0080] First, the base image templates are standardized, providing standardized base image templates pre-installed with mainstream operating systems, universal drivers for heterogeneous accelerators, and mainstream AI frameworks such as PyTorch / TensorFlow, covering the basic usage needs of most users. User-level image personalization is offered, providing dedicated task submission commands, such as `sbatch-vm--kvm-edit`, allowing users to enter image editing mode to install custom software, adapt specific driver versions, or update AI frameworks on the base image; all modifications are saved to the user's dedicated image, enabling independent user-level customization of the image.

[0081] Incremental image lightweight storage uses copy-on-write technology to create incremental images for user-customized images, storing only the differences between the image and the base image, significantly reducing the cluster's storage resource consumption.

[0082] Finally, proceed to step 150: Virtualization task lifecycle management.

[0083] In this embodiment, closed-loop management of the entire lifecycle of virtualized computing tasks, from application and execution to termination, is realized, achieving an automated process of "one-click application, automatic execution, real-time monitoring, and automatic recycling".

[0084] Specifically, this includes: streamlined task submission, providing dedicated virtualization task submission commands such as sbatch-vm and srun-vm. Users only need to specify the image using --kvm-name and the number of accelerator cards using --gres=vfiogpu:num to complete one-click application for virtualization resources.

[0085] Real-time monitoring of task execution: The control node monitors the running status (including running, paused, and abnormal) of virtual machine instances on each compute node in real time through a heartbeat detection mechanism, and synchronizes the status information to the SLURM scheduling system. Automated resource reclamation: After the virtualization task is completed, the system automatically issues a virtual machine shutdown command, releasing and reclaiming the passed-through heterogeneous hardware resources (accelerator cards, VF network cards, etc.) to the virtualization resource pool. At the same time, the control node is notified to update the resource pool status to ensure that the released resources can be rescheduled for subsequent tasks.

[0086] Figure 2 This is a business logic diagram of the virtualized computing cluster of the present invention, which shows the entire process of virtualized task submission, scheduling, execution and resource reclamation from the user side and the system side respectively.

[0087] The following is in conjunction with the appendix Figure 2 A specific embodiment of the present invention will be further described below.

[0088] During the system initialization and resource virtualization phase: In the cluster deployment phase, complete the initialization configuration and heterogeneous resource virtualization of each compute node. Hardware layer configuration: Enable Intel VT-d (IOMMU) in the BIOS of each compute node to ensure that hardware-assisted virtualization functions are available. System layer configuration: Add the intel_iommu=on parameter to the GRUB configuration file of the operating system, and load the vfio-pci kernel module after reboot. Resource virtualization processing: Run the self-developed sriov_vfio script to identify the device IDs of GPUs, IB network cards, and Ethernet cards through lspci, and write the device IDs to / etc / modprobe.d / vfio.conf; enable the physical network card SR-IOV function, generate 8 VFs for each IB network card and 8 VFs for each Ethernet card, and complete driver binding for all VF network cards through VFIO. Scheduling system configuration: Enter the virtualization resource information (available GPUs, IBVFs, Ethernet VFs, etc. on each node) into SLURM's gres.conf to complete the association between virtualization resources and the scheduling system.

[0089] During the user virtualization task submission phase: The user submits an AI model training task based on the PyTorch framework through the cluster login node, requesting 12 nodes. Each node requires the following resources: 4 GPU accelerator cards, 8 CPU cores, 32GB of memory, 1 IBVF network card, and 1 Ethernet VF network card. The user-defined image `ubuntu2404_bert_mpi` is used, and the training script `bert_train.sh` is executed. The submission command is:

[0090] sbatch-vm \

[0091] --nodes=12 \

[0092] --kvm-name=ubuntu2404_bert_mpi \

[0093] --partition=gpu \

[0094] --gres=vfiogpu:4 \

[0095] --kvm-param=8:32 \

[0096] / home / mpitest / VMSTORE / LLM_Work / BELLE / train / scripts / bert_train.sh

[0097] in:

[0098] --nodes specifies the number of nodes to use.

[0099] The `--kvm-name` option specifies that a user-defined image should be used.

[0100] --partition specifies the queue to use.

[0101] --gres=vfiogpu:4 requests 4 virtualized GPU resources per node.

[0102] --kvm-param=8:32 specifies CPU and memory resources.

[0103] If vfioeth and vfioib are not specified, one IBVF network card and one Ethernet VF card will be used by default.

[0104] During the resource scheduling and automated virtual machine deployment phase: After receiving the task, the scheduling system uses the SPANK plugin to call management plugins such as vfiogpu and vfioib to verify the availability of the virtualization resource pool and allocate 12 compute nodes and matching virtualization resources to the task. Based on the allocated resources, the plugins automatically generate an XML configuration file conforming to the Libvirt specification, containing full hardware configurations such as CPU, memory, GPU VFIO mapping, and IBVF network card mapping. The system calls virshdefine to load the XML configuration and then starts the KVM virtual machine via virshstart. The system reads the pre-configured IP-MAC-virtual machine mapping table through the initialization script, automatically configuring IP addresses and network parameters for the virtual machine to complete network deployment.

[0105] During the task execution and status monitoring phase: After the virtual machine starts, users can view the task running status using the `squeue-vm` command, view the virtual machine network information using the `showip` command, and log in directly to the virtual machine via SSH. Users within the virtual machine have root privileges and can directly access the GPU to execute PyTorch-based BERT model training tasks. The virtual machine directly accesses the physical GPU, achieving training performance close to that of a physical machine. The control node sends detection commands to the compute nodes every 10 seconds via a heartbeat detection mechanism to monitor the virtual machine's running status in real time and synchronize the status information to the scheduling system, ensuring stable task operation.

[0106] During the task completion and automated resource reclamation phase: After the training script bert_train.sh finishes execution, the virtualization task terminates normally, and the system automatically executes the shutdown command to shut down the virtual machine. After the virtual machine shuts down, all pass-through hardware resources such as GPUs and IBVF network cards are released and reclaimed to the virtualization resource pool. The compute node sends a resource reclamation notification to the control node, and the control node updates the resource status in SLURM's gres.conf file. The released virtualization resources can then be rescheduled for use by subsequent tasks.

[0107] Through the above methods, this invention successfully constructs a virtualized computing cluster of heterogeneous computing resources, achieving high-performance virtualization, fine-grained scheduling, and automated management of heterogeneous resources. Tests show that the cluster's GPU resource utilization rate has increased from 60% in traditional solutions to over 85%, and the user task environment adaptation time has been shortened from an average of 8 hours to within 30 minutes, significantly improving the utilization efficiency of heterogeneous computing power and the user's R&D efficiency.

[0108] Figure 3 This is a flowchart illustrating a method for constructing a virtualized computing cluster according to the present invention, as shown below. Figure 3 As shown, it includes the following steps:

[0109] 310: Virtualize the physical hardware resources of at least one computing node to obtain a virtualized resource pool containing virtual function input / output pass-through devices;

[0110] 320: In response to resource requests from virtualized computing tasks, the job scheduling system injects custom resource scheduling logic before task startup through a plug-in architecture, allocates matching virtual function input / output pass-through devices from the virtualization resource pool according to the resource requests, and generates virtual machine configuration files based on the allocated devices;

[0111] 330: Start a virtual machine instance based on the virtual machine configuration file and configure network parameters for the virtual machine instance;

[0112] 340: Provides a standardized base image template, allowing users to customize and modify it based on the base image template and save the modified content as a user-specific image; uses copy-on-write technology to create incremental images for the user-specific image and stores the difference data between the user-specific image and the base image;

[0113] 350: Load the user-specific image using the virtual machine instance and execute the virtualization computing task.

[0114] By dynamically injecting custom scheduling logic into the job scheduling system's plug-in architecture before task startup, precise allocation of virtual function input / output through-devices is achieved, avoiding resource contention and idleness. Combined with user-level image customization and write-time copy incremental storage, it not only meets the needs of personalized environments but also significantly reduces cluster storage overhead. Ultimately, a virtualized computing cluster with high resource utilization, convenient operation, and customizable environment is constructed, effectively solving the problems of complex heterogeneous resource management, uneven resource utilization, cumbersome user operation, and poor customizability of the operating environment in existing technologies.

[0115] In some embodiments, virtualizing physical hardware resources includes:

[0116] Enable the auxiliary virtualization function of the input / output memory management unit to unbind the heterogeneous accelerator card from the host machine's native driver, pass it through the virtual function input / output technology to the virtual machine, and load the corresponding device driver by the virtual machine. The virtual function input / output driver and the input / output memory management unit work together to complete the direct memory access address remapping of the heterogeneous accelerator card.

[0117] The physical network card is virtualized into multiple independent virtual function network cards. The single root input / output virtualization function of the physical network card is enabled and a specified number of virtual function network cards are generated. The virtual function network cards are then driver-bound using virtual function input / output technology.

[0118] In this way, hardware-assisted virtualization technology enables direct pass-through between heterogeneous accelerator cards and physical network cards, eliminating the performance loss of traditional virtualization and enabling virtual machines to achieve computing and network performance close to that of physical machines.

[0119] In some embodiments, when the job scheduling system injects custom resource scheduling logic through a plug-in architecture, the virtualization management plug-ins used include: a first type of plug-in for managing accelerator cards, a second type of plug-in for managing Ethernet virtual function network cards, and a third type of plug-in for managing InfiniBand virtual function network cards.

[0120] In this way, by developing dedicated management plugins for different heterogeneous resource types, the decoupling and unified scheduling of resource types are achieved, which facilitates system expansion and maintenance.

[0121] In some embodiments, configuring network parameters for the virtual machine instance includes:

[0122] Each virtual machine is assigned a unique media access control address, and a differentiated network service mode is adopted according to the cluster node size;

[0123] When the number of compute nodes is less than a preset threshold, a lightweight dynamic host configuration protocol server is deployed on the host machine to provide automatic allocation of Internet Protocol addresses for virtual machines.

[0124] When the number of computing nodes is greater than or equal to a preset threshold, an Internet Protocol address pool is pre-planned, and a mapping table of Internet Protocol addresses, Media Access Control addresses and virtual machine resources is established. When the virtual machine starts, the initialization script automatically reads the mapping table to complete the network configuration.

[0125] In this way, the network configuration mode is adaptively selected according to the cluster size, which not only ensures the lightweight deployment of small-scale clusters, but also meets the efficient management needs of large-scale clusters, avoiding the bottleneck problem of a single DHCP service in large-scale scenarios.

[0126] In some embodiments, supporting users to make customized modifications based on the base image template includes: entering the image editing mode through a dedicated task submission command, whereby users can install custom software or adapt specific driver versions on the base image.

[0127] In this way, users do not need to master the underlying image creation technology to complete the customization of personalized environments through simple command-line interaction, which lowers the threshold for use and improves R&D efficiency.

[0128] In some embodiments, the method further includes full lifecycle management of virtualized computing tasks, specifically including:

[0129] By submitting commands through a dedicated virtualization task, users can complete a one-click application for resources by specifying the image name and the number of accelerator cards.

[0130] The control node monitors the running status of virtual machine instances on each compute node in real time through a heartbeat detection mechanism and synchronizes the status information to the job scheduling system.

[0131] After the virtualization computing task is completed, the job scheduling system automatically issues a virtual machine shutdown command, releases the passed-through hardware resources and reclaims them to the virtualization resource pool, and notifies the control node to update the resource pool status.

[0132] It achieves a fully automated closed loop for virtualization tasks, from application and execution to resource recycling. Users only need to focus on the business itself, and the system automatically manages and releases the underlying resources, which significantly improves the utilization efficiency of heterogeneous computing power and the resource turnover rate of the cluster.

[0133] Figure 4 This is a schematic diagram of a virtualized computing cluster construction device according to the present invention, as shown below. Figure 4 As shown, it includes:

[0134] Secondly, a virtualized computing cluster construction device is provided, comprising:

[0135] The first processing module is used to virtualize the physical hardware resources of at least one computing node to obtain a virtualized resource pool containing virtual function input / output pass-through devices.

[0136] The second processing module is used to respond to resource requests from virtualized computing tasks. The job scheduling system injects custom resource scheduling logic before the task starts through a plug-in architecture. Based on the resource request, it allocates a matching virtual function input / output pass-through device from the virtualized resource pool and generates a virtual machine configuration file based on the allocated device.

[0137] The third processing module is used to start a virtual machine instance based on the virtual machine configuration file and configure network parameters for the virtual machine instance.

[0138] The fourth processing module is used to provide a standardized base image template, allowing users to customize and modify the base image template and save the modified content as a user-specific image; it uses copy-on-write technology to create incremental images for the user-specific image and stores the difference data between the user-specific image and the base image.

[0139] The fifth processing module is used to load the user-specific image using the virtual machine instance and execute the virtualization computing task.

[0140] In some embodiments, the first processing module is specifically used to: enable the auxiliary virtualization function of the input / output memory management unit, unbind the heterogeneous accelerator card from the host machine's native driver, pass it through to the virtual machine via virtual function input / output technology, load the corresponding device driver by the virtual machine, and use the virtual function input / output driver and the input / output memory management unit to work together to complete the direct memory access address remapping of the heterogeneous accelerator card.

[0141] The physical network card is virtualized into multiple independent virtual function network cards. The single root input / output virtualization function of the physical network card is enabled and a specified number of virtual function network cards are generated. The virtual function network cards are then driver-bound using virtual function input / output technology.

[0142] In some embodiments, the second processing module is specifically used to: inject custom resource scheduling logic before task startup through the plug-in architecture of the job scheduling system, wherein the virtualization management plug-ins used include a first type of plug-in for managing accelerator cards, a second type of plug-in for managing Ethernet virtual function network cards, and a third type of plug-in for managing InfiniBand virtual function network cards.

[0143] In some embodiments, the third processing module is specifically used to: allocate a unique media access control address to each virtual machine and adopt a differentiated network service mode according to the cluster node scale; when the number of compute nodes is less than a preset threshold, deploy a lightweight dynamic host configuration protocol server on the host machine to provide automatic allocation of Internet protocol addresses for virtual machines; when the number of compute nodes is greater than or equal to the preset threshold, pre-plan an Internet protocol address pool, establish a mapping table between Internet protocol addresses, media access control addresses and virtual machine resources, and automatically read the mapping table to complete network configuration when the virtual machine starts up through an initialization script.

[0144] In some embodiments, the fourth processing module is specifically used to: enter the image editing mode through a dedicated task submission command, whereby the user can install custom software or adapt to a specific driver version on the base image, and save all modifications to the user-specific image; and use copy-on-write technology to create an incremental image for the user-specific image, storing the difference data between the base image and the incremental image.

[0145] In some embodiments, the device further includes a sixth processing module for performing full lifecycle management of virtualized computing tasks, specifically including: enabling users to submit resources with a single click by specifying the image name and the number of accelerator cards through a dedicated virtualization task submission command; the control node monitoring the running status of virtual machine instances on each computing node in real time through a heartbeat detection mechanism and synchronizing the status information to the job scheduling system; after the virtualized computing task is completed, the job scheduling system automatically issues a virtual machine shutdown command, releasing and reclaiming the passed-through hardware resources to the virtualization resource pool, and simultaneously notifying the control node to update the resource pool status.

[0146] Those skilled in the art will readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the present invention.

[0147] It should be noted that, Figure 4 The division of modules / units is illustrative and represents only one logical functional division; in actual implementation, other division methods are possible. For example, two or more functions can be integrated into a single data acquisition module. The integrated modules described above can be implemented either in hardware or as software functional modules.

[0148] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned virtualized computing cluster construction methods. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute a virtualized computing cluster construction method shown in any embodiment of the present invention by calling the computer program.

[0149] In one alternative embodiment, an electronic device is provided, such as Figure 5 As shown, Figure 5The illustrated electronic device 500 includes a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, for example, via a bus 502. Optionally, the electronic device 500 may further include a transceiver 504, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 504 is not limited to one type, and the structure of the electronic device 500 does not constitute a limitation on the embodiments of the present invention.

[0150] Among them, electronic devices can also be terminal devices, which can be any device that can install applications, including at least one of smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.

[0151] It should be noted that, Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0152] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described virtualized computing cluster construction methods.

[0153] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0154] It should be noted that the terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of the invention described herein can be implemented in an order other than that shown or described.

[0155] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.

[0156] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for constructing a virtualized computing cluster, characterized in that, include: The physical hardware resources of at least one computing node are virtualized to obtain a virtualized resource pool containing virtual function input / output pass-through devices. In response to resource requests from virtualized computing tasks, the job scheduling system injects custom resource scheduling logic before task startup through a plug-in architecture. Based on the resource requests, it allocates matching virtual function input / output pass-through devices from the virtualized resource pool and generates virtual machine configuration files based on the allocated devices. Start a virtual machine instance based on the virtual machine configuration file, and configure network parameters for the virtual machine instance; It provides a standardized base image template, allowing users to customize and modify it based on the base image template and save the modified content as a user-specific image; it uses copy-on-write technology to create incremental images for the user-specific image and stores the difference data between the user-specific image and the base image; The user-specific image is loaded using the virtual machine instance to execute the virtualization computing task.

2. The method according to claim 1, characterized in that, Virtualization of physical hardware resources includes: Enable the auxiliary virtualization function of the input / output memory management unit to unbind the heterogeneous accelerator card from the host machine's native driver, pass it through the virtual function input / output technology to the virtual machine, and load the corresponding device driver by the virtual machine. The virtual function input / output driver and the input / output memory management unit work together to complete the direct memory access address remapping of the heterogeneous accelerator card. The physical network card is virtualized into multiple independent virtual function network cards. The single root input / output virtualization function of the physical network card is enabled and a specified number of virtual function network cards are generated. The virtual function network cards are then driver-bound using virtual function input / output technology.

3. The method according to claim 1, characterized in that, When the job scheduling system injects custom resource scheduling logic through a plug-in architecture, the virtualization management plug-ins used include: a first type of plug-in for managing accelerator cards, a second type of plug-in for managing Ethernet virtual function network cards, and a third type of plug-in for managing InfiniBand virtual function network cards.

4. The method according to claim 1, characterized in that, The network parameters configured for the virtual machine instance include: Each virtual machine is assigned a unique media access control address, and a differentiated network service mode is adopted according to the cluster node size; When the number of compute nodes is less than a preset threshold, a lightweight dynamic host configuration protocol server is deployed on the host machine to provide automatic allocation of Internet Protocol addresses for virtual machines. When the number of computing nodes is greater than or equal to a preset threshold, an Internet Protocol address pool is pre-planned, and a mapping table of Internet Protocol addresses, Media Access Control addresses and virtual machine resources is established. When the virtual machine starts, the initialization script automatically reads the mapping table to complete the network configuration.

5. The method according to claim 1, characterized in that, The provision that users can customize modifications based on the base image template includes: entering the image editing mode through a dedicated task submission command, allowing users to install custom software or adapt specific driver versions on the base image.

6. The method according to claim 1, characterized in that, It also includes full lifecycle management of virtualized computing tasks, specifically including: By submitting commands through a dedicated virtualization task, users can complete a one-click application for resources by specifying the image name and the number of accelerator cards. The control node monitors the running status of virtual machine instances on each compute node in real time through a heartbeat detection mechanism and synchronizes the status information to the job scheduling system. After the virtualization computing task is completed, the job scheduling system automatically issues a virtual machine shutdown command, releases the passed-through hardware resources and reclaims them to the virtualization resource pool, and notifies the control node to update the resource pool status.

7. A virtualized computing cluster construction system, characterized in that, It includes a control node, a storage node, and multiple computing nodes; the control node is configured with a job scheduling system and a plug-in architecture for executing the method of any one of claims 1 to 6.

8. A virtualized computing cluster construction device, characterized in that, include: The first processing module is used to virtualize the physical hardware resources of at least one computing node to obtain a virtualized resource pool containing virtual function input / output pass-through devices. The second processing module is used to respond to resource requests from virtualized computing tasks. The job scheduling system injects custom resource scheduling logic before the task starts through a plug-in architecture. Based on the resource request, it allocates a matching virtual function input / output pass-through device from the virtualized resource pool and generates a virtual machine configuration file based on the allocated device. The third processing module is used to start a virtual machine instance based on the virtual machine configuration file and configure network parameters for the virtual machine instance. The fourth processing module is used to provide a standardized base image template, allowing users to customize and modify the base image template and save the modified content as a user-specific image. An incremental image is created for the user-specific image using copy-on-write technology, storing the difference data between the incremental image and the base image; The fifth processing module is used to load the user-specific image using the virtual machine instance and execute the virtualization computing task.

9. An electronic device, characterized in that, It includes a memory and one or more processors, wherein a computer program is stored on the memory, and the computer program, when executed by the one or more processors, implements the virtualized computing cluster construction method as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to enable the computer to implement the virtualized computing cluster construction method as described in any one of claims 1 to 6.