A method, apparatus, device, and storage medium for accelerating hardware management.
By querying the acceleration hardware database and configuring the acceleration management agent module in the OpenStack platform, dynamic switching of acceleration hardware between PF and VF modes is achieved, solving the problem of service interruption in acceleration hardware management, improving the security and utilization of acceleration hardware, and ensuring the continuity of virtual machine management services.
Patent Information
- Application Number
- CN202211074075.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2042-09-02
AI Technical Summary
In existing acceleration hardware management solutions, the Nova service needs to be manually restarted when the acceleration hardware switches between physical acceleration and virtualization acceleration methods, which causes virtual machine services to be interrupted and affects continuity.
By querying the acceleration hardware database, the target acceleration method is determined based on the hardware type and user scenario. The acceleration management agent module is then configured to execute the target conversion program, enabling dynamic switching of acceleration hardware between PF and VF modes, thus avoiding restarting the Nova service.
It enables dynamic switching of acceleration hardware between PF and VF modes, ensuring the continuity of virtual machine management services, improving the security and utilization of acceleration hardware, and reducing the operating pressure of nova services.
Smart Images

Figure CN116795530B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to cloud computing management technology, and more particularly to an accelerated hardware management method, apparatus, device, and storage medium. Background Technology
[0002] With the continuous development of technologies such as Artificial Intelligence (AI), live video streaming, and gene sequencing, relying solely on conventional hardware to complete high-density, high-input / output (IO), high-bandwidth, and low-latency services is inefficient and costly. Accelerated hardware devices (hereinafter referred to as accelerated hardware) can effectively relieve the pressure on traditional conventional hardware and improve its performance. In existing accelerated hardware management solutions, accelerated hardware can generally only be used as a physical function (PF) acceleration method, or requires manual switching between physical and virtual function (VF) acceleration methods by the administrator. However, in scenarios where PF and VF methods are manually switched, the nova service must be restarted. During this period, nova services are temporarily interrupted, and virtual machine management services cannot be provided, affecting the continuity of virtual machine services. Summary of the Invention
[0003] To address the aforementioned technical problems, embodiments of this application aim to provide an accelerated hardware management method, apparatus, device, and storage medium.
[0004] The technical solution of this application is implemented as follows:
[0005] Firstly, a method for accelerating hardware management is provided, applied to the OpenStack platform for managing open-source cloud computing. The method includes:
[0006] The acceleration hardware database is queried to determine the hardware type of the target acceleration hardware; wherein, the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, and the device information includes at least the hardware type of the acceleration hardware;
[0007] Based on the hardware type of the target acceleration hardware and the user scenario, the target acceleration method of the target acceleration hardware is determined; wherein, the target acceleration method is either physical acceleration (PF) or virtualization acceleration (VF).
[0008] Based on the current acceleration mode of the target acceleration hardware and the target acceleration mode, determine the target conversion program to be executed by the acceleration management agent module;
[0009] Configure the acceleration management agent module based on the target acceleration method of the target acceleration hardware;
[0010] The acceleration management agent module is controlled to restart and run the target conversion program, and the target acceleration hardware is converted from the current acceleration mode to the target acceleration mode.
[0011] In the above scheme, determining the target acceleration method of the target acceleration hardware based on the hardware type of the target acceleration hardware and the user usage scenario includes: when the hardware type of the target acceleration hardware is a separable type and the user usage scenario is a public cloud scenario, determining the target acceleration method of the target acceleration hardware as the VF method; when the hardware type of the target acceleration hardware is a separable type and the user usage scenario is a private cloud scenario, determining the target acceleration method of the target acceleration hardware as the PF method.
[0012] In the above scheme, determining the target conversion program executed by the acceleration management agent module based on the current acceleration mode of the target acceleration hardware and the target acceleration mode includes: if the target acceleration mode is the VF mode and the current acceleration mode is the PF mode, determining the target conversion program executed by the acceleration management agent module as a separation program; if the target acceleration mode is the PF mode and the current acceleration mode is the VF mode, determining the target conversion program executed by the acceleration management agent module as a restoration program.
[0013] In the above scheme, the method further includes: determining that the hardware type of the target acceleration hardware is an inseparable type, and determining that the target acceleration hardware does not perform acceleration mode conversion.
[0014] In the above scheme, the method further includes: controlling the acceleration management agent module to collect device information of acceleration hardware mounted on each virtual machine under the host machine in a polling manner, and controlling the acceleration management agent module to report the collected device information of acceleration hardware to the acceleration management control module after each polling; controlling the acceleration management control module to perform key search and comparison on the collected device information of acceleration hardware; based on the result of the key search and comparison, if it is determined that the collected device information of the first acceleration hardware is incomplete, deleting the device information corresponding to the first acceleration hardware in the acceleration hardware database; based on the result of the key search and comparison, if it is determined that the collected device information of the second acceleration hardware is complete, storing the device information of the second acceleration hardware in the acceleration hardware database.
[0015] In the above scheme, the acceleration hardware database further includes: resource pre-declaration information of at least one acceleration hardware mounted on the host machine. The method further includes: when receiving an acceleration hardware mounting request, querying the acceleration hardware database based on the mounting requirements in the acceleration hardware mounting request to determine a third acceleration hardware that meets the mounting requirements; when determining that a resource pre-declaration request from a computing service has been received, adding resource pre-declaration information corresponding to the third acceleration hardware to the acceleration hardware database; and sending the resource pre-declaration information to the computing service so that the computing service mounts the third acceleration hardware based on the resource pre-declaration information.
[0016] In the above scheme, the acceleration hardware database further includes: task status information of at least one acceleration hardware mounted on the host machine; the method further includes: when a task request for a fourth acceleration hardware is received, querying the acceleration hardware database to determine the task status information of the fourth acceleration hardware; when it is determined that the task status information of the fourth acceleration hardware is idle, forwarding the task request to the acceleration management agent module corresponding to the fourth acceleration hardware, and updating the task status information of the fourth acceleration hardware to non-idle.
[0017] Secondly, an accelerated hardware management device is provided, the device comprising:
[0018] The processing module is used to query the acceleration hardware database to determine the hardware type of the target acceleration hardware; wherein the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, and the device information includes at least the hardware type of the acceleration hardware; it is used to determine the target acceleration method of the target acceleration hardware based on the hardware type of the target acceleration hardware and the user usage scenario; wherein the target acceleration method is physical acceleration (PF) or virtualization acceleration (VF); and it determines the target conversion program to be executed by the acceleration management agent module based on the current acceleration method of the target acceleration hardware and the target acceleration method.
[0019] The control module is used to configure the acceleration management agent module based on the target acceleration mode of the target acceleration hardware; control the acceleration management agent module to restart and run the target conversion program, and execute the conversion of the target acceleration hardware from the current acceleration mode to the target acceleration mode.
[0020] Thirdly, an electronic device is provided, comprising: a processor and a memory configured to store a computer program capable of running on the processor, wherein the processor is configured to perform the steps of the aforementioned method when running the computer program.
[0021] Fourthly, a computer storage medium is provided that stores a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the aforementioned method.
[0022] This application discloses an acceleration hardware management method, apparatus, device, and storage medium. The target acceleration method determined according to the hardware type of the acceleration hardware and the user's usage scenario will better meet the requirements of the user's usage scenario. By configuring the target conversion program in the acceleration management agent module according to the target acceleration method and executing the conversion program, dynamic switching of the acceleration hardware between PF and VF modes can be realized without affecting the continuity of virtual machine management services. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the first process of the accelerated hardware management method in the embodiments of this application;
[0024] Figure 2 This is a schematic diagram of the second process of the accelerated hardware management method in the embodiments of this application;
[0025] Figure 3 This is a schematic diagram of the OpenStack platform in the embodiments of this application;
[0026] Figure 4 This is a schematic diagram of the composition of the accelerated hardware management device in the embodiments of this application;
[0027] Figure 5 This is a schematic diagram of the composition structure of the electronic device in the embodiments of this application. Detailed Implementation
[0028] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.
[0029] This application proposes a method for managing accelerated hardware applied to the OpenStack platform, an open-source cloud computing management platform, applicable to the management of various types of accelerated hardware. The OpenStack platform includes at least an accelerated hardware database and an accelerated management agent module. The accelerated hardware database stores relevant information about the accelerated hardware.
[0030] Figure 1 This is a schematic diagram of the first process of the accelerated hardware management method in the embodiments of this application, such as... Figure 1 As shown, the accelerated hardware management method may specifically include:
[0031] Step 101: Query the acceleration hardware database to determine the hardware type of the target acceleration hardware; wherein, the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, and the device information includes at least the hardware type of the acceleration hardware.
[0032] Here, the open-source cloud computing management platform OpenStack is used to manage at least one acceleration hardware mounted on the host machine. The acceleration hardware database is a database within the OpenStack platform used to store device information and other details about the acceleration hardware. For example, in practical applications, acceleration hardware can be a graphics processing unit (GPU), a field-programmable gate array (FPGA), a neural processing unit (NPU), a quick-assist technology (QAT), non-volatile memory (NVMe over Fabrics, NVMF), etc.
[0033] Here, the hardware types of acceleration hardware include: detachable and non-detachable. When the hardware type is detachable, it means that the acceleration hardware can be used as either a Physical Functions (PF) device or a Virtual Functions (VF) device. When used as a PF device, the corresponding acceleration method is physical acceleration (PF method); when used as a VF device, the corresponding acceleration method is virtualization acceleration (VF method). When the hardware type is non-detachable, it means that the acceleration hardware can only be used as a PF device.
[0034] Step 102: Determine the target acceleration method of the target acceleration hardware based on the hardware type of the target acceleration hardware and the user usage scenario; wherein the target acceleration method is either physical acceleration (PF) or virtualization acceleration (VF).
[0035] Here, the user scenario refers to the usage scenario where a user uses the target acceleration hardware for hardware acceleration. For example, user scenarios include public cloud scenarios and private cloud scenarios. In a private cloud scenario, the user can independently own and manage the hardware device, and the acceleration hardware can be directly provided to the user as a PF device. In a public cloud scenario, if the entire hardware is directly passed to the user, the user gains full management privileges. If the user forcibly changes the hardware driver type or version, it will directly threaten the security of the hardware device. Therefore, in a public cloud scenario, some user privileges of the acceleration hardware must be separated from the PF device and transferred to the VF device for user use, while administrator privileges remain on the PF device. This ensures the secure use of the acceleration hardware at the OpenStack layer. In other words, different user scenarios have different requirements for acceleration methods. This application determines the target acceleration method based on the hardware type of the target acceleration hardware and the user scenario to meet the needs of the user scenario.
[0036] For example, in some embodiments, determining the target acceleration method of the target acceleration hardware based on the hardware type of the target acceleration hardware and the user usage scenario includes: determining the target acceleration method of the target acceleration hardware as the VF method when the hardware type of the target acceleration hardware is a separable type and the user usage scenario is a public cloud scenario; and determining the target acceleration method of the target acceleration hardware as the PF method when the hardware type of the target acceleration hardware is a separable type and the user usage scenario is a private cloud scenario.
[0037] This application determines the target acceleration method based on whether the usage scenario is a public cloud scenario or a private cloud scenario, and then switches the acceleration method of the acceleration hardware device, which can improve the security and utilization of the complex acceleration hardware device itself.
[0038] For example, in practical applications, a virtual machine under the host machine can mount one or more PF devices or VF devices. The OpenStack platform based on the accelerated hardware management method of this application can support single PF and multiple VF management, that is, it can realize the management of various types of accelerated hardware.
[0039] Step 103: Based on the current acceleration mode of the target acceleration hardware and the target acceleration mode, determine the target conversion program to be executed by the acceleration management agent module.
[0040] Here, the acceleration management agent module can execute a target conversion program to change the acceleration mode of the acceleration hardware, causing the acceleration hardware to either separate from the power factor (PF) to a variable factor (VF) or vice versa. The target conversion program is either a separation program or a restoration program. When the acceleration management agent module executes the separation program, the acceleration hardware is separated from the PF to a VF; when the acceleration management agent module executes the restoration program, the acceleration hardware is restored from a VF to a PF.
[0041] For example, in some embodiments, determining the target conversion program executed by the acceleration management agent module based on the current acceleration mode of the target acceleration hardware and the target acceleration mode includes: if the target acceleration mode is the VF mode and the current acceleration mode is the PF mode, determining that the target conversion program executed by the acceleration management agent module is a separation program; if the target acceleration mode is the PF mode and the current acceleration mode is the VF mode, determining that the target conversion program executed by the acceleration management agent module is a restoration program.
[0042] Step 104: Configure the acceleration management agent module based on the target acceleration method of the target acceleration hardware.
[0043] For example, in the configuration file of the acceleration management agent module, the acceleration method of the target acceleration hardware is set to the target acceleration method, and the conversion program executed by the acceleration management agent module is set to the target conversion program.
[0044] Step 105: Control the acceleration management agent module to restart and run the target conversion program, and execute the conversion of the target acceleration hardware from the current acceleration mode to the target acceleration mode.
[0045] For example, when the target acceleration method of the target acceleration hardware is configured as VF mode in the acceleration management agent module (also referred to as acceleration hardware agent in this application) (i.e., the target acceleration hardware is configured to be used as a VF device), the acceleration hardware agent service is restarted. The acceleration hardware agent automatically loads the separation program and completes the separation of PF into VF. During this period, the Nova service is not affected and can provide continuous virtual machine management services.
[0046] For example, in practical applications, a virtual machine can optionally mount one or more VF devices. In this scenario, after the host server shuts down and restarts, the accelerated hardware agent service starts automatically with the host. During startup, the detachment program is automatically loaded to preserve the VF detached state, allowing the virtual machine to find the corresponding VF device and start successfully. When a VF device needs to be restored to a VF device, only the configuration of the accelerated hardware agent needs to be changed, setting the target accelerated hardware as a PF device. The accelerated hardware agent service is then restarted, and it automatically loads the restoration program to complete the VF restoration to PF. During this process, Nova services remain unaffected, providing continuous virtual machine management services.
[0047] For example, in some embodiments, the method further includes: determining that the hardware type of the target acceleration hardware is an inseparable type, and determining that the target acceleration hardware does not perform acceleration mode conversion.
[0048] Here, the target acceleration hardware is of the non-separable type, which means that the target acceleration hardware can only be used as a PF device, and its corresponding acceleration method is only physical acceleration method (PF method), without the need for acceleration method conversion.
[0049] For example, in some embodiments, the OpenStack platform further includes an acceleration management control module (also referred to as an acceleration management conductor in this application). For example, in some embodiments, the method further includes: controlling the acceleration management agent module to collect device information of acceleration hardware mounted on each virtual machine under the host in a polling manner, and controlling the acceleration management agent module to report the collected device information of acceleration hardware to the acceleration management control module after each polling; controlling the acceleration management control module to perform key search and comparison on the collected device information of acceleration hardware; based on the result of the key search and comparison, if it is determined that the collected device information of the first acceleration hardware is incomplete, deleting the device information corresponding to the first acceleration hardware in the acceleration hardware database; based on the result of the key search and comparison, if it is determined that the collected device information of the second acceleration hardware is complete, storing the device information of the second acceleration hardware in the acceleration hardware database.
[0050] For example, in practical applications, a host machine can host one or more virtual machines. For example, the device information of the acceleration hardware mounted on each virtual machine under the host machine includes: the type, model, status, device ID, and the virtual machine ID to which the acceleration hardware is mounted.
[0051] In existing technologies, hardware models are typically set in the Nova configuration file, and Nova performs a query task for accelerated hardware devices (non-polling). The information of the accelerated hardware is stored in the Nova database, which cannot guarantee the accuracy of the accelerated hardware information. Furthermore, once the types of accelerated hardware devices are expanded, the Nova management service and the Nova compute service must be restarted. Restarting the Nova management service will cause the cluster compute management service to be interrupted, resulting in a temporary interruption of cluster services; restarting the Nova compute service will cause the compute service of that compute node to be interrupted, disrupting the business continuity of the Nova compute service.
[0052] This solution allows configuring hardware models in the acceleration management agent's configuration file. The acceleration management agent then performs a dynamic polling task to collect device information of the acceleration hardware on each host machine. After each poll, the acceleration management agent reports the acceleration hardware information to the acceleration management conductor. The conductor performs key searches and comparisons before storing the acceleration hardware information in the acceleration hardware management database, ensuring the accuracy of the hardware information and eliminating the need to access the Nova database, thus reducing the access pressure on the Nova database. Therefore, when adding new acceleration hardware device types, only starting / restarting the acceleration management agent service is required to automatically poll and report hardware information, enabling expansion of acceleration hardware types. Nova management and Nova compute services need to be restarted, ensuring no impact on Nova business continuity. Furthermore, even if acceleration hardware fails, the acceleration management agent's polling task continues. The device information for the failed acceleration hardware is no longer fully acquired; after reporting, key searches and comparisons confirm the hardware failure, and the device information for the failed acceleration hardware is removed from the acceleration hardware database, ensuring the accuracy of the hardware information without restarting any OpenStack services.
[0053] For example, in some embodiments, the acceleration hardware database further includes: resource pre-declaration information of at least one acceleration hardware mounted on the host machine. The method further includes: upon receiving an acceleration hardware mounting request, querying the acceleration hardware database based on the mounting requirements in the acceleration hardware mounting request to determine a third acceleration hardware that meets the mounting requirements; sending the device information of the third acceleration hardware to the computing service; receiving a resource pre-declaration request from the computing service, adding resource pre-declaration information corresponding to the third acceleration hardware to the acceleration hardware database; and sending the resource pre-declaration information to the computing service so that the computing service mounts the third acceleration hardware based on the resource pre-declaration information.
[0054] Here, the resource pre-declaration information for the accelerated hardware is used to describe the resource usage of the accelerated hardware, preventing it from being invoked by other virtual machines. By adding the resource pre-declaration information of the accelerated hardware to the accelerated hardware database, resource conflicts during concurrency can be avoided when large-scale concurrent use of the accelerated hardware.
[0055] For example, in some embodiments, the acceleration hardware database further includes: task status information of at least one acceleration hardware mounted on the host machine; the method further includes: when a task request for a fourth acceleration hardware is received, querying the acceleration hardware database to determine the task status information of the fourth acceleration hardware; when it is determined that the task status of the fourth acceleration hardware is idle, forwarding the task request to the acceleration management agent module corresponding to the fourth acceleration hardware, and updating the task status information of the fourth acceleration hardware to non-idle.
[0056] Here, the task status information of the acceleration hardware is used to describe the task execution status of the acceleration hardware. When the task status information of the fourth acceleration hardware is idle, it means that the fourth acceleration hardware is not executing any tasks at this time and can execute new task requests; when the task status information of the fourth acceleration hardware is non-idle, it means that the fourth acceleration hardware is currently executing a task and cannot execute new task requests.
[0057] For example, in some embodiments, the method further includes: when the task status information of the fourth acceleration hardware is determined to be in a non-idle state, rejecting the current task request.
[0058] For example, in practical applications, the task status information for accelerating hardware includes: task status information such as loading FPGA image, verifying FPGA image, separating PF to VF, and restoring VF to PF.
[0059] By adding the task status information of the acceleration hardware to the acceleration hardware database, it can be ensured that the acceleration hardware can only execute a single task until the task ends or the error state is forcibly restored. The task status is not subject to competition or interruption by other tasks or similar tasks, keeping each task independent of the others and enabling dynamic execution of complex hardware tasks.
[0060] Here, the entity executing steps 101 to 105 can be the processor of an electronic device that implements the accelerated hardware management method of the embodiments of this application.
[0061] The technical solution of this application embodiment determines the target acceleration method based on the hardware type of the acceleration hardware and the user's usage scenario, which is more in line with the requirements of the user's usage scenario. By configuring the target conversion program in the acceleration management agent module according to the target acceleration method and executing the conversion program, the acceleration hardware can be dynamically switched between PF and VF modes without affecting the continuity of the virtual machine management service.
[0062] To better illustrate the purpose of this application, further examples are provided based on the embodiments described above. Figure 2 This is a schematic diagram of the second process of the accelerated hardware management method in an embodiment of this application. For example... Figure 2 As shown, the accelerated hardware management method includes:
[0063] Step 201: Query the acceleration hardware database to determine the hardware type of the target acceleration hardware; wherein, the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, and the device information includes at least the hardware type of the acceleration hardware.
[0064] Step 202: Determine whether the hardware type of the target acceleration hardware is a separable type; if yes, proceed to step 203 or 205; if no, proceed to step 209.
[0065] Step 203: When the user's usage scenario is determined to be a public cloud scenario, the target acceleration method of the target acceleration hardware is determined to be the VF method.
[0066] Step 204: The current acceleration mode is the PF mode, and the target conversion program executed by the acceleration management agent module is determined to be a separation program.
[0067] Step 205: When the user scenario is determined to be a private cloud scenario, the target acceleration method of the target acceleration hardware is determined to be the PF method.
[0068] Step 206: The current acceleration mode is the VF mode, and the target conversion program executed by the acceleration management agent module is determined to be the restoration program.
[0069] Step 207: Configure the acceleration management agent module based on the target acceleration method of the target acceleration hardware.
[0070] Step 208: Control the acceleration management agent module to restart and run the target conversion program, and execute the conversion of the target acceleration hardware from the current acceleration mode to the target acceleration mode.
[0071] Step 209: Determine that the target acceleration hardware does not perform acceleration mode conversion.
[0072] Here, the entity executing steps 201 to 209 can be the processor of an electronic device that implements the accelerated hardware management method of the embodiments of this application.
[0073] The technical solution of this application embodiment can improve the security and utilization of complex acceleration hardware devices by determining the target acceleration method and target conversion program of the acceleration hardware device according to whether the user's usage scenario is a public cloud scenario or a private cloud scenario. By configuring the target conversion program in the acceleration management agent module, the acceleration method of the acceleration hardware device can be automatically switched without affecting the continuity of nova business and virtual machine management services.
[0074] The management of existing acceleration hardware mostly relies on the Peripheral Component Interconnect (PCI) management scheme implemented by the cloud computing network control component nova. This scheme only manages acceleration hardware such as graphics processing units (GPUs) and field-programmable gate arrays (FPGAs), and there is no universal solution for managing multiple types of acceleration hardware based on the open-source cloud computing management platform OpenStack, such as neural processing units (NPUs), quick assist technology (QAT), and non-volatile memory (NVMe over Fabrics, NVMF).
[0075] Based on the above embodiments, this application proposes a method for managing accelerated hardware applied to the OpenStack platform for open-source cloud computing, applicable to the management of various types of accelerated hardware. (Exemplary) Figure 3 This is a schematic diagram of the OpenStack platform structure in an embodiment of this application. Figure 3 As shown, the OpenStack platform includes: image management components, compute management components, compute service components, acceleration management client, acceleration hardware management components, acceleration hardware task display module, host operating system and its virtual machines, and various types of acceleration hardware. The acceleration hardware management components include: acceleration management API, acceleration management conductor, acceleration management agent, and acceleration hardware database.
[0076] The system comprises the following components: image management component, compute management component, acceleration management client, acceleration management API, acceleration management conductor, and acceleration hardware database, all located on the control node; compute service component and acceleration management agent, located on the compute node; and acceleration hardware task display module, located on the user operation platform, allowing users to initiate tasks, query tasks, mount / unmount tasks, load content, etc., and receiving the current task status or previous task execution result. The acceleration management agent can interact with various virtual machines on the host machine to collect device information of the acceleration hardware mounted on each virtual machine. The compute service component can mount and unmount acceleration hardware by calling libvirt. Various types of acceleration hardware include GPUs, FPGAs, NPUs, QAT, and NVMF. Hardware drivers are used to load drivers and display the hardware attributes of the acceleration hardware.
[0077] The OpenStack platform described above can achieve functions such as dynamic PF-VF conversion, automatic management of accelerated hardware, loosely coupled interaction between the hardware management component and other components of the OpenStack platform, and management and display of hardware execution tasks by executing the accelerated hardware management method in the embodiments of this application.
[0078] The following section provides further explanation of how to implement the PF-VF dynamic conversion function.
[0079] Specifically, the method for managing accelerated hardware applied to the OpenStack platform for open-source cloud computing includes: querying an accelerated hardware database to determine the hardware type of the target accelerated hardware; wherein the accelerated hardware database includes: device information of at least one accelerated hardware mounted on the host machine, the device information including at least the hardware type of the accelerated hardware; determining that the hardware type of the target accelerated hardware is a separable type, and when the user scenario is a public cloud scenario, determining that the target acceleration method of the target accelerated hardware is the VF method; determining that the hardware type of the target accelerated hardware is a separable type, and when the user scenario is a private cloud scenario, determining that the target acceleration method of the target accelerated hardware is the PF method; The target acceleration hardware is defined as a non-separable type, and the target acceleration hardware is determined not to perform acceleration mode conversion; the target acceleration mode is the VF mode, and the current acceleration mode is the PF mode, and the target conversion program executed by the acceleration management agent module is determined to be a separation program; the target acceleration mode is the PF mode, and the current acceleration mode is the VF mode, and the target conversion program executed by the acceleration management agent module is determined to be a restore program; the acceleration management agent module is configured based on the target acceleration mode of the target acceleration hardware; the acceleration management agent module is controlled to restart and run the target conversion program, and the target acceleration hardware is converted from the current acceleration mode to the target acceleration mode.
[0080] In the technical solution of this application, the user can choose whether to separate acceleration hardware that supports separation into Virtual Functions (VFs) based on the user's usage scenario and hardware type. The acceleration hardware can automatically restore the PF to a VF or vice versa based on the read configuration. When the target acceleration hardware is configured to be used as a VF in the acceleration management agent: restarting the acceleration hardware agent service, the agent automatically loads the separation program, completing the PF separation into a VF. During this process, Nova services remain unaffected, providing continuous virtual machine management services. A virtual machine can optionally mount one or more VFs. In this scenario, after the host server shuts down and restarts, the acceleration hardware agent service starts automatically with the host machine. During startup, the separation program is automatically loaded, preserving the VF separation state, so the virtual machine can find the corresponding VF device, and the virtual machine starts successfully. Furthermore, in scenarios where a VF needs to be restored to a PF, only the agent configuration needs to be changed, setting the acceleration hardware to be used as a PF, and the acceleration hardware agent service needs to be restarted. The agent automatically loads the restoration program, completing the VF restoration into a PF. During this process, Nova services remain unaffected, providing continuous virtual machine management services.
[0081] The following section provides further explanation on how to implement the automatic hardware management function for acceleration.
[0082] Specifically, the acceleration hardware management method applied to the OpenStack platform further includes: controlling the acceleration management agent module to collect device information of acceleration hardware mounted on each virtual machine under the host machine in a polling manner, and controlling the acceleration management agent module to report the collected device information of acceleration hardware to the acceleration management control module after each polling; controlling the acceleration management control module to perform key search and comparison on the collected device information of acceleration hardware; based on the result of the key search and comparison, if it is determined that the collected device information of the first acceleration hardware is incomplete, deleting the device information corresponding to the first acceleration hardware from the acceleration hardware database; based on the result of the key search and comparison, if it is determined that the collected device information of the second acceleration hardware is complete, storing the device information of the second acceleration hardware in the acceleration hardware database.
[0083] In the technical solution of this application, hardware models can be configured in the configuration file of the acceleration management agent. The acceleration management agent then performs a dynamic polling task for the acceleration hardware, collecting device information of the acceleration hardware on each host machine. After each poll, the acceleration management agent reports the acceleration hardware information to the acceleration management conductor. The conductor performs key searches and comparisons and stores the acceleration hardware information in the acceleration hardware management database, thus ensuring the accuracy of the hardware information and eliminating the need to access the Nova database, reducing the access pressure on the Nova database. Therefore, when adding new types of acceleration hardware devices, only the acceleration management agent service needs to be started / restarted to automatically poll and report hardware information, enabling the expansion of acceleration hardware types. There is no need to restart the Nova management service and the Nova computing service, and Nova business continuity is unaffected. Furthermore, even if acceleration hardware fails, the polling task of the acceleration management agent continues. The device information of the damaged acceleration hardware is no longer fully obtained, so after reporting, key searches and comparisons confirm the acceleration hardware failure, and the device information of the damaged acceleration hardware is removed from the acceleration hardware database, ensuring the accuracy of the hardware information without restarting any OpenStack services.
[0084] The following section further explains how to achieve loosely coupled interaction between the accelerated hardware management component and other components of the OpenStack platform.
[0085] In the technical solution of this application, the management of acceleration hardware is centered on the acceleration hardware management component itself, which independently provides interfaces for querying, pre-declaring information, and updating status information. When the acceleration management API receives a user's acceleration hardware information query request, after user authentication, the acceleration management API queries the acceleration hardware database and returns the device information of the acceleration hardware that meets the query requirements to the user's virtual machine. The device information of the acceleration hardware may include information such as the quantity, model, status, and device number of the acceleration hardware.
[0086] Specifically, the accelerated hardware management method applied to the OpenStack platform further includes: upon receiving an accelerated hardware mounting request, querying the accelerated hardware database based on the mounting requirements in the accelerated hardware mounting request to determine a third accelerated hardware that meets the mounting requirements; upon determining that a resource pre-declaration request from a computing service has been received, adding resource pre-declaration information corresponding to the third accelerated hardware to the accelerated hardware database; and sending the resource pre-declaration information to the computing service so that the computing service mounts the third accelerated hardware based on the resource pre-declaration information.
[0087] For example, in some embodiments, the accelerated hardware management method applied to the OpenStack platform further includes: upon receiving an accelerated hardware mounting request, querying the accelerated hardware database based on the mounting requirements in the accelerated hardware mounting request to determine at least one fifth accelerated hardware that meets the mounting requirements; sending the device information of the fifth accelerated hardware to a computing service; upon determining that a resource pre-declaration request has been received from the computing service, determining a sixth accelerated hardware from the at least one fifth accelerated hardware; adding resource pre-declaration information corresponding to the sixth accelerated hardware to the accelerated hardware database; and sending the resource pre-declaration information to the computing service so that the computing service mounts the sixth accelerated hardware based on the resource pre-declaration information.
[0088] For example, steps 301-306 below illustrate the interaction process between the accelerated hardware management component and other components of the OpenStack platform.
[0089] Step 301: When a user creates a virtual machine with acceleration hardware, the acceleration management API is called during the scheduling process to perform real-time queries, thereby obtaining information on acceleration devices that meet the conditions, and then proceeding to step 303.
[0090] Step 302: When a user sends an acceleration hardware mounting request, the computing service queries the device information of the acceleration hardware on the computing node in real time and continues to execute step 303.
[0091] Step 303: Based on the scheduling results, select a compute node. During the resource declaration phase, the compute service (nova compute service) immediately initiates a resource pre-declaration request to the acceleration management API. Upon receiving the request, the acceleration management API immediately queries and verifies the available acceleration hardware resources of the requested compute node, selects the first device that meets the requirements, and adds the resource pre-declaration information of the acceleration hardware to the acceleration hardware database. Therefore, when the API initiates another query request for acceleration hardware information for that node, since the resource pre-declaration information already exists, it will no longer be included in the available resource computing scope, preventing other virtual machines from repeatedly occupying this acceleration hardware. After the pre-declaration is completed, the API returns a message to notify the nova compute service that the requested resource has been successfully pre-declared and to continue to step 305; otherwise, the current creation process is terminated, and the virtual machine creation is marked as failed.
[0092] Step 304: The nova compute service calls libvirt to mount the hardware. If the mounting is successful, the nova compute service immediately sends an acceleration hardware status update request to the acceleration management API. Upon receiving the request, the acceleration management API immediately updates the virtual machine ID and device number on the virtual machine to the acceleration hardware database. Otherwise, if the libvirt mounting fails, the nova compute service immediately sends a resource pre-declaration deletion request to the acceleration management API. Upon receiving the request, the acceleration management API immediately deletes the corresponding resource pre-declaration information from the acceleration hardware database and marks the virtual machine creation as failed.
[0093] Step 305: The user deletes the virtual machine with accelerated hardware. Nova calls libvirt to unload the hardware. If the unloading is successful, the Nova compute service immediately sends a request to the acceleration management API to delete the accelerated hardware information. Upon receiving the request, the acceleration management API immediately deletes the mount record and resource declaration record from the accelerated hardware database and re-includes it in the scope of available resource computing. Otherwise, if libvirt fails to unload the hardware, it is directly marked as unloading failed, the mount record and resource declaration record in the accelerated hardware database remain unchanged, and the accelerated hardware is not included in the scope of available resource computing.
[0094] Step 306: The user uninstalls the specified acceleration hardware device. The process is the same as in step 305. The computing hardware management component interacts loosely with other components of the OpenStack platform, so that mounting requests like in step 302 and uninstallation requests like in step 306 can be executed independently, instead of only being able to execute steps 301 and 305, which only manage acceleration hardware devices throughout the virtual machine's lifecycle.
[0095] By adding pre-declaration information of acceleration hardware resources to the acceleration hardware database, resource conflicts during concurrency can be avoided when using acceleration hardware on a large scale.
[0096] The following section provides a further explanation of the functions for managing and displaying hardware execution tasks.
[0097] Specifically, the accelerated hardware management method applied to the OpenStack platform also includes: adding an accelerated hardware task management module, which supports setting a unique hardware task status, recording task status such as loading FPGA image, verifying FPGA image, separating PF to VF, and restoring VF to PF, so that complex hardware such as FPGA can perform complex tasks and keep each task independent of the others, realizing the dynamic execution of complex hardware tasks.
[0098] The following example illustrates the process of loading an FPGA image: A user initiates a task request to load an FPGA image from the operating platform. After parameter verification and authorization, the request reaches the accelerated hardware management API component. It immediately checks if the FPGA device's task status is NULL (equivalent to an idle state) and if the requested image is valid (type, status, etc.). If both requirements are met, the task status is updated to prepare-program; otherwise, the API request is rejected, and the user is notified that the request cannot be accepted. If the task continues, the request is forwarded to the corresponding accelerated management agent, the task status is updated to programming, the FPGA image is downloaded to this node, and the image is loaded into the FPGA device. If the loading is successful, the task status is recorded as success; otherwise, it is set to error and returned to the API. If successful, the user is notified of successful loading, and the task status is restored to NULL; otherwise, the user is notified of loading failure and can choose whether to force a reset to NULL and reload. This ensures that the FPGA device can only execute a single FPGA loading task until the task ends or the error status is forcibly restored, and the task status is not subject to competition or interruption from other tasks or similar tasks.
[0099] Specifically, the OpenStack platform also adds a new hardware task display module, which allows users to initiate task queries independently through the user operation platform and return the current task status or the result of the last task execution.
[0100] The technical solution of this application embodiment designs a general multi-type acceleration hardware management method based on the OpenStack platform. It can automatically manage multiple types of hardware and has strong scalability. It can realize dynamic conversion of PF-VF, improving the security and utilization of complex acceleration hardware devices. It can realize a loosely coupled interaction design between the acceleration hardware management component and the nova component, ensuring the accuracy of acceleration hardware information, ensuring nova business continuity, and reducing nova operating pressure. By adding pre-declared resource information of acceleration hardware, the resource conflict rate can be reduced and the acceleration hardware binding success rate can be improved. By adding an acceleration hardware task display module, the dynamic execution and status management of complex hardware tasks can be realized.
[0101] Figure 4 This is a schematic diagram of the composition of the accelerated hardware management device in this application embodiment, illustrating an implementation device for an accelerated hardware management method applied to the OpenStack open-source cloud computing management platform. The device 40 specifically includes:
[0102] Processing module 401 is used to query the acceleration hardware database to determine the hardware type of the target acceleration hardware; wherein, the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, the device information including at least the hardware type of the acceleration hardware; used to determine the target acceleration method of the target acceleration hardware based on the hardware type of the target acceleration hardware and the user usage scenario; wherein, the target acceleration method is physical acceleration (PF) or virtualization acceleration (VF); and to determine the target conversion program to be executed by the acceleration management agent module based on the current acceleration method of the target acceleration hardware and the target acceleration method.
[0103] The control module 402 is used to configure the acceleration management agent module based on the target acceleration mode of the target acceleration hardware; control the acceleration management agent module to restart and run the target conversion program, and execute the conversion of the target acceleration hardware from the current acceleration mode to the target acceleration mode.
[0104] In some embodiments, the processing module 402 is configured to determine the target acceleration method of the target acceleration hardware as the VF method when the hardware type of the target acceleration hardware is determined to be a separable type and the user usage scenario is a public cloud scenario; and to determine the target acceleration method of the target acceleration hardware as the PF method when the hardware type of the target acceleration hardware is determined to be a separable type and the user usage scenario is a private cloud scenario.
[0105] In some embodiments, the processing module 402 is configured to: determine that the target conversion program executed by the acceleration management agent module is a separation program when the target acceleration mode is the VF mode and the current acceleration mode is the PF mode; and determine that the target conversion program executed by the acceleration management agent module is a restoration program when the target acceleration mode is the PF mode and the current acceleration mode is the VF mode.
[0106] In some embodiments, the processing module 402 is used to determine that the hardware type of the target acceleration hardware is an inseparable type, and to determine that the target acceleration hardware does not perform acceleration mode conversion.
[0107] In some embodiments, the processing module 402 is configured to control the acceleration management agent module to collect device information of acceleration hardware mounted on each virtual machine under the host machine in a polling manner, and to control the acceleration management agent module to report the collected device information of acceleration hardware to the acceleration management control module after each polling; to control the acceleration management control module to perform key search and comparison on the collected device information of acceleration hardware; based on the result of the key search and comparison, if it is determined that the collected device information of the first acceleration hardware is incomplete, delete the device information corresponding to the first acceleration hardware in the acceleration hardware database; based on the result of the key search and comparison, if it is determined that the collected device information of the second acceleration hardware is complete, store the device information of the second acceleration hardware in the acceleration hardware database.
[0108] In some embodiments, the acceleration hardware database further includes: resource pre-declaration information of at least one acceleration hardware mounted on the host machine. The processing module 402 is configured to, upon receiving an acceleration hardware mounting request, query the acceleration hardware database based on the mounting requirements in the acceleration hardware mounting request to determine a third acceleration hardware that meets the mounting requirements; upon determining that a resource pre-declaration request from a computing service has been received, add resource pre-declaration information corresponding to the third acceleration hardware to the acceleration hardware database; and send the resource pre-declaration information to the computing service so that the computing service mounts the third acceleration hardware based on the resource pre-declaration information.
[0109] In some embodiments, the acceleration hardware database further includes: task status information of at least one acceleration hardware mounted on the host machine; the processing module 402 is configured to, upon receiving a task request for the fourth acceleration hardware, query the acceleration hardware database to determine the task status information of the fourth acceleration hardware; when it is determined that the task status information of the fourth acceleration hardware is in an idle state, forward the task request to the acceleration management agent module corresponding to the fourth acceleration hardware, and update the task status information of the fourth acceleration hardware to a non-idle state.
[0110] Based on the hardware implementation of each unit in the above-described acceleration hardware management device, this application embodiment also provides an electronic device. Figure 5 This is a schematic diagram of the composition structure of the electronic device in an embodiment of this application. Figure 5 As shown, the device 50 includes: a processor 501 and a memory 502 configured to store computer programs capable of running on the processor;
[0111] Wherein, when the processor 501 is configured to run a computer program, it executes the steps of the method in the foregoing embodiments.
[0112] Of course, in practical applications, such as Figure 5 As shown, the various components in this electronic device are coupled together via a bus system 503. It can be understood that the bus system 503 is used to achieve communication between these components. In addition to a data bus, the bus system 503 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 The general designated all buses as Bus System 503.
[0113] In practical applications, the aforementioned processor can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (FPGA), controller, microcontroller, and microprocessor. It is understood that, for different devices, the electronic devices used to implement the functions of the aforementioned processor can also be other types, and the embodiments of this application do not specifically limit this.
[0114] The aforementioned memory can be volatile memory, such as random-access memory (RAM); or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the above types of memory, and provides instructions and data to the processor.
[0115] In an exemplary embodiment, this application also provides a computer-readable storage medium, such as a memory including a computer program, which can be executed by a processor of an electronic device to perform the steps of the aforementioned method.
[0116] It should be understood that the terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. The expressions “having,” “may have,” “comprising,” and “including,” or “may include” and “may contain” used herein may be used to indicate the presence of a corresponding feature (e.g., an element such as a number, function, operation, or component), but do not exclude the presence of additional features.
[0117] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other and are not necessarily used to describe a specific order or sequence. For example, without departing from the scope of the invention, first information can also be referred to as second information, and similarly, second information can also be referred to as first information. The technical solutions described in the embodiments of this application can be arbitrarily combined without conflict. In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatus, and devices can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division, and there may be other division methods in actual implementation, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical, or other forms.
[0118] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0119] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0120] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. An accelerated hardware management method, applied to the OpenStack open-source cloud computing management platform, characterized in that, The method includes: The acceleration hardware database is queried to determine the hardware type of the target acceleration hardware; wherein, the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, and the device information includes at least the hardware type of the acceleration hardware; When the hardware type of the target acceleration hardware is determined to be a separable type, and the user scenario is a public cloud scenario, the target acceleration method of the target acceleration hardware is determined to be VF method. When the hardware type of the target acceleration hardware is determined to be a separable type, and the user scenario is a private cloud scenario, the target acceleration method of the target acceleration hardware is determined to be PF method. The target acceleration method is the VF method, the current acceleration method of the target acceleration hardware is the PF method, and the target conversion program executed by the acceleration management agent module is determined to be a separation program; The target acceleration method is the PF method, the current acceleration method is the VF method, and the target conversion program executed by the acceleration management agent module is determined to be the restoration program; Configure the acceleration management agent module based on the target acceleration method of the target acceleration hardware; The acceleration management agent module is controlled to restart and run the target conversion program, and the target acceleration hardware is converted from the current acceleration mode to the target acceleration mode.
2. The method according to claim 1, characterized in that, The method further includes: The target acceleration hardware is determined to be of an inseparable type, and therefore the target acceleration hardware is determined not to perform acceleration mode conversion.
3. The method according to any one of claims 1 or 2, characterized in that, The method further includes: The acceleration management agent module is controlled to collect device information of acceleration hardware on each virtual machine under the host machine in a polling manner, and the acceleration management agent module is controlled to report the collected device information of acceleration hardware to the acceleration management control module after each polling. The acceleration management control module is controlled to perform key retrieval and comparison of the collected device information of the acceleration hardware; Based on the results of key search comparison, if it is determined that the collected device information of the first acceleration hardware is incomplete, the device information corresponding to the first acceleration hardware in the acceleration hardware database shall be deleted. Based on the results of key search comparison, when it is determined that the collected device information of the second acceleration hardware is complete, the device information of the second acceleration hardware is stored in the acceleration hardware database.
4. The method according to any one of claims 1 or 2, characterized in that, The acceleration hardware database also includes: resource pre-declaration information of at least one acceleration hardware mounted on the host machine, and the method further includes: When an acceleration hardware mounting request is received, the acceleration hardware database is queried based on the mounting requirements in the acceleration hardware mounting request to determine a third acceleration hardware that meets the mounting requirements. When a resource pre-declaration request for a computing service is received, the resource pre-declaration information corresponding to the third acceleration hardware is added to the acceleration hardware database. The resource pre-declaration information is sent to the computing service so that the computing service can mount the third acceleration hardware based on the resource pre-declaration information.
5. The method according to any one of claims 1 or 2, characterized in that, The acceleration hardware database also includes: task status information of at least one acceleration hardware mounted on the host machine; the method further includes: Upon receiving a task request for the fourth acceleration hardware, the acceleration hardware database is queried to determine the task status information of the fourth acceleration hardware. When the task status information of the fourth acceleration hardware is determined to be idle, the task request is forwarded to the acceleration management agent module corresponding to the fourth acceleration hardware, and the task status information of the fourth acceleration hardware is updated to non-idle.
6. An accelerated hardware management device, applied to the OpenStack open-source cloud computing management platform, characterized in that, The device includes: The processing module is used to query the acceleration hardware database to determine the hardware type of the target acceleration hardware; wherein, the acceleration hardware database includes: device information of at least one acceleration hardware mounted on the host machine, the device information including at least the hardware type of the acceleration hardware; it is used to determine the target acceleration method of the target acceleration hardware as VF mode when the hardware type of the target acceleration hardware is a separable type and the user scenario is a public cloud scenario; and to determine the target acceleration method of the target acceleration hardware as PF mode when the hardware type of the target acceleration hardware is a separable type and the user scenario is a private cloud scenario; and to determine the target conversion program to be executed by the acceleration management agent module based on the current acceleration method of the target acceleration hardware and the target acceleration method. The control module is configured to determine, based on the target acceleration mode being the VF mode and the current acceleration mode of the target acceleration hardware being the PF mode, to determine that the target conversion program executed by the acceleration management agent module is a separation program; and based on the target acceleration mode being the PF mode and the current acceleration mode being the VF mode, to determine that the target conversion program executed by the acceleration management agent module is a restoration program.
7. An electronic device, characterized in that, The electronic device includes: a processor and a memory configured to store computer programs capable of running on the processor. Wherein, when the processor is configured to run the computer program, it performs the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Hardware acceleration method and relevant device
IN201747042077A
