Cloud disk hot plug method and device, intelligent network card, host and storage medium
By using a smart network interface card (NIC) to receive configuration commands for hot-swapping of cloud disks, the problem of needing to restart the host when the smart NIC changes the cloud disk configuration is solved, achieving flexible configuration and reducing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MAIPU COMM TECH CO LTD
- Filing Date
- 2022-12-14
- Publication Date
- 2026-04-28
AI Technical Summary
Existing smart network cards require a host restart when cloud disk configurations change, and the CPU does not support PCIe hot-swapping, limiting the flexibility of cloud disk configuration and the use of hardware resources.
The cloud disk is hot-swapped by receiving configuration commands through a smart network card and sending an interrupt signal to the host to obtain the current configuration information, thereby realizing the hot-swapping of the cloud disk and reducing the requirements for CPU and hardware resources.
It enables flexible configuration and minute-level delivery of cloud disks, reduces hardware costs, supports cloud disk configuration changes without restarting the host, and adapts to the needs of different user scenarios.
Smart Images

Figure CN116010320B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of cloud computing and smart network interface card (NIC) technology, and more specifically, to a cloud disk hot-swappable method, apparatus, smart NIC, host, and storage medium. Background Technology
[0002] With the development of cloud computing, more and more enterprise users are using cloud servers or BMS (Bare Metal Server) provided by cloud service providers to deploy their businesses. BMS is a scalable, dedicated computing service that offers computing performance and security isolation indistinguishable from traditional physical machines. It can meet the high performance, security, and stability requirements of enterprise-critical businesses, and such products are required to provide delivery capabilities within minutes.
[0003] Bare-metal servers are controlled by the user. To provide the elastic scaling and minute-level delivery required for cloud services, independent computing components must be used to provide such functionality, with smart network interface cards (NICs) being a common choice.
[0004] Given the limited hardware resources of smart network cards, how to flexibly support various user scenarios and meet the needs of cloud disk configuration changes, and how to adapt to the fact that the CPU of the smart network card does not support PCIe hot-swapping while still providing the function of cloud disk hot-swapping, are problems that urgently need to be solved by people in this field. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, smart network card, host, and storage medium for hot-swapping cloud disks, which can realize hot-swapping of cloud disks.
[0006] The embodiments of the present invention can be implemented as follows:
[0007] In a first aspect, the present invention provides a cloud disk hot-swappable method applied to a smart network interface card (NIC), wherein the smart NIC is communicatively connected to a host via a bus and network connected to a storage server, and a logical correspondence is established between the cloud disk created on the host and the storage components of the storage server. The method includes:
[0008] Receive configuration instructions for hot-swapping the cloud disk;
[0009] Based on the configuration instructions, the cloud disk is configured for hot-swapping;
[0010] An interrupt signal is sent to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and to hot-swap the cloud disk based on the current configuration information.
[0011] In an optional implementation, the smart network interface card (NIC) includes a preset port and a block device capacity register. The block device capacity register stores the capacity of a local block device bound to the preset port. The configuration instruction is a hot-plug instruction for the cloud disk. The hot-plug configuration of the cloud disk based on the configuration instruction includes:
[0012] Based on the instruction to hot-plug the cloud disk, a local block device corresponding to the cloud disk is created;
[0013] Bind the local block device to the preset port and open the data communication channel between the local block device and the storage server;
[0014] The current capacity of the cloud disk is obtained from the storage server and written to the block device capacity register to perform hot-plug configuration of the cloud disk.
[0015] In an optional implementation, the cloud disk has been hot-swapped, the smart network interface card (NIC) has created a local block device corresponding to the cloud disk, the smart NIC includes a preset port, the local block device is bound to the preset port, and the configuration command is a command to hot-swap the cloud disk.
[0016] The hot-swap configuration of the cloud disk based on the configuration instructions includes:
[0017] Based on the instruction to hot-plug the cloud disk, the local block device is unbound from the preset port;
[0018] Set the block device capacity register to 0 to configure the cloud disk for hot-swapping.
[0019] In an optional implementation, after the step of sending an interrupt signal to the host to instruct the host to obtain the configuration information of the hot-swappable cloud disk from the smart network card based on the interrupt signal, and to implement the hot-swappable configuration of the cloud disk based on the current configuration information, the method further includes:
[0020] After hot-swapping the cloud disk, the data communication channel between the local block device and the storage server is closed.
[0021] Delete the local block device.
[0022] In an optional implementation, the configuration information of the cloud disk includes the capacity of the cloud disk. Sending an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network interface card based on the interrupt signal, and performing hot-swapping of the cloud disk based on the current configuration information, includes:
[0023] An interrupt signal is sent to the host to instruct the host to read the capacity of the local block device from the block device capacity register of the smart network card, and to hot-swap the cloud disk based on the read capacity of the local block device.
[0024] In an optional implementation, the smart network interface card (NIC) includes a preset port, the preset port corresponding to a block device capacity register, the block device capacity register being used to store the capacity of a local block device bound to the preset port, and the method further includes:
[0025] During the initialization of the smart network card, the block device capacity register is set to 0 so that the host can start without cloud disk configuration.
[0026] Secondly, the present invention provides a cloud disk hot-swappable device applied to a smart network interface card (NIC). The smart NIC is connected to a host via a bus and to a storage server via a network connection. A logical correspondence is established between the cloud disk created on the host and the storage components of the storage server. The device includes:
[0027] A receiving module is used to receive configuration instructions for hot-plugging the cloud disk;
[0028] A configuration module is used to perform hot-swap configuration of the cloud disk based on the configuration instructions;
[0029] The sending module is used to send an interrupt signal to the host, instructing the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and to realize the hot-plugging of the cloud disk based on the current configuration information.
[0030] Thirdly, the present invention provides a smart network card, including a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the cloud disk hot-swap method described in any of the foregoing embodiments when executing the program.
[0031] Fourthly, the present invention provides a host computer, the host computer including a bus, the host computer establishing a connection with the smart network card described in the foregoing embodiments through the bus.
[0032] Fifthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cloud disk hot-plugging method described in any of the foregoing embodiments.
[0033] Compared to existing technologies, the cloud disk hot-swappable method, apparatus, smart network interface card (NIC), host, and storage medium provided in this embodiment enable the smart NIC to configure the cloud disk for hot-swapping based on configuration instructions. Then, the smart NIC sends an interrupt signal to the host, instructing the host to obtain the current configuration information of the cloud disk from the smart NIC based on the interrupt signal, and to perform hot-swapping based on this information. Because cloud disk hot-swapping is implemented, the requirements for the smart NIC's CPU and the number of hardware resource ports are reduced, significantly lowering the hardware cost of the smart NIC. Furthermore, the support for booting without cloud disk configuration increases the application scenarios of the smart NIC and the flexibility of cloud disk configuration. Attached Figure Description
[0034] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is an example diagram illustrating an application scenario provided in this embodiment.
[0036] Figure 2 This is a block diagram of the smart network interface card provided in this embodiment.
[0037] Figure 3 A flowchart of the cloud disk hot-plugging method provided in this embodiment Figure 1 .
[0038] Figure 4 A flowchart of the cloud disk hot-plugging method provided in this embodiment Figure 2 .
[0039] Figure 5 A flowchart of the cloud disk hot-plugging method provided in this embodiment Figure 3 .
[0040] Figure 6 This is a block diagram of the cloud disk hot-swap device provided in this embodiment.
[0041] Icons: 10-Smart Network Interface Card; 11-Processor; 12-Memory; 13-Bus; 20-Host; 30-Storage Server; 100-Cloud Disk Hot-Swap Device; 110-Receive Module; 120-Configuration Module; 130-Transmit Module; 140-Initialization Module. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0043] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0044] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0045] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0046] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0047] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.
[0048] Please refer to Figure 1 , Figure 1 This is an example diagram illustrating an application scenario provided in this embodiment. Figure 1 In this process, the smart network card 10 communicates with the host 20 via a bus. One communication connection method is that the smart network card 10 is plugged into the host 20, and the smart network card 10 communicates with various types of remote storage servers 30 via a network.
[0049] The smart network interface card (NIC) 10 is a NIC with an independent computing unit capable of performing specific infrastructure functions. It not only provides connectivity but also typically offloads some CPU processing tasks, such as network acceleration, security acceleration, storage offloading, storage acceleration, and cloud platform management. In storage offloading scenarios, the smart NIC 10 simulates a storage block device via the PCIe (Peripheral Component Interconnect Express) bus. The backend of the virtual block device is implemented within the smart NIC 10, and communication protocols and storage protocols are converted via software to communicate with various types of remote storage servers 30, providing cloud storage access to the host 20. The storage offloading function of the smart NIC 10 allows the host 20 to use the storage components on the remote storage server 30 without being aware of the specific type of the remote storage server 30 or the physical type of the storage components on the server 30. On the host 20, a cloud disk is loaded via the smart NIC. The cloud disk corresponds one-to-one with the shared block device provided by the remote storage server 30, which is provided by the storage service on the storage server 30 by mapping the underlying physical storage components. Figure 1 The host 20 and the smart network card 10 constitute a bare metal server, which can provide bare metal services in a cloud computing network.
[0050] Host 20 can be a standalone computer device or a physical server.
[0051] Storage server 30 can be IPSAN (IP Storage Area Network), CEPH distributed file system, etc., and storage server 30 includes one or more shared block devices.
[0052] In the prior art, the host 20 provides cloud disk services to users by using the storage service provided by the storage server 30 through the smart network card 10 inserted on the PCIe bus. However, due to the limitations of the PF (Physical Function) hardware resources on the PCIe in the smart network card, if hot-swapping is not supported, only the number of cloud disk block devices equal to the number of PFs can be loaded when the host starts up. This limits user scenarios, as some users need more cloud disks, while others do not require cloud disk allocation at startup.
[0053] Additionally, if the CPU of a smart network card or host does not support PCIe hot-swapping, it will require restarting the host to adapt to changes in cloud disk configuration when adding or deleting cloud disks. This limits the use of such smart network cards or hosts in bare metal service scenarios.
[0054] In view of this, this embodiment provides a cloud disk hot-swappable method, apparatus, smart network interface card (NIC), host, and storage medium. It enables hot-swapping of the cloud disk, which on the one hand is not limited by the number of power field (PF) on the smart NIC 10; on the other hand, it reduces the CPU requirements of the smart NIC, significantly lowering its hardware cost. Furthermore, because it supports hot-swapping, cloud disk configuration changes take effect without restarting the host, meeting the minute-level delivery requirements of bare metal servers. A detailed description follows.
[0055] based on Figure 1 In addition to the application scenarios, this embodiment also provides a block diagram example of a smart network interface card (NIC). Please refer to it. Figure 2 , Figure 2 This is a block diagram of the smart network interface card provided in this embodiment.
[0056] The smart network card 10 includes a processor 11, a memory 12, and a bus 13, with the processor 11 and the memory 12 connected via the bus 13.
[0057] Processor 11 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the cloud disk hot-plug method can be completed through the integrated logic circuitry in the processor 11 or through software instructions. The processor 11 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0058] The memory 12 is used to store programs, such as the cloud disk hot-swappable device in the following embodiments. The cloud disk hot-swappable device 100 includes at least one software functional module that can be stored in the memory 12 or embedded in the smart network card 10 in the form of software or firmware. After receiving an execution instruction, the processor 11 executes the program to implement the cloud disk hot-swappable method disclosed in the above embodiments.
[0059] based on Figure 1 and Figure 2 This embodiment also provides an application for Figure 1 and Figure 2 For instructions on hot-swapping the cloud drive of the Smart NIC 10, please refer to [link / reference]. Figure 3 , Figure 3 A flowchart of the cloud disk hot-plugging method provided in this embodiment Figure 1 The method includes the following steps:
[0060] Step S101: Receive configuration instructions for hot-swapping the cloud disk.
[0061] In this embodiment, the configuration command can be issued by an operator (usually an administrator) through the smart network card, or by third-party software calling the configuration interface provided by the smart network card, or it can be generated by the cloud platform controlling the smart network card to read a preset configuration file used for hot-swapping configuration of the cloud disk.
[0062] Step S102: Configure the cloud disk for hot-swapping based on the configuration instructions.
[0063] In this embodiment, the configuration instructions include instructions for hot-plugging or hot-plugging the cloud disk.
[0064] Step S103: Send an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and to realize the hot-plugging of the cloud disk based on the current configuration information.
[0065] In this embodiment, to ensure the host is promptly informed of the latest cloud disk configuration after hot-plugging, the smart network interface card 10 sends an interrupt signal to the host. Upon receiving the interrupt signal, the host triggers its block device driver to reread the current configuration information of the cloud disk from the smart network interface card 10. This current configuration information may include the cloud disk's current capacity, current identifier, and current accessibility status. When the cloud disk is successfully hot-plugged, the current capacity of the cloud disk in the smart network interface card is the capacity of the hot-plugged cloud disk. When the cloud disk is successfully hot-plugged, the current capacity of the cloud disk in the smart network interface card is 0.
[0066] The method provided in this embodiment utilizes the smart network card 10 to perform hot-swap configuration of the cloud disk and sends an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk based on the interrupt signal, thereby realizing the hot-swap of the cloud disk.
[0067] exist Figure 3 Based on this, this embodiment also provides a method for inserting cloud disks. Please refer to... Figure 4 , Figure 4 A flowchart of the cloud disk hot-plugging method provided in this embodiment Figure 2 Step S102 includes the following sub-steps:
[0068] Sub-step S102-10: Based on the instruction to hot-insert the cloud disk, create a local block device corresponding to the cloud disk.
[0069] In this embodiment, the smart network interface card includes a preset port and a block device capacity register. The block device capacity register is used to store the capacity of the local block device bound to the preset port. If there are multiple cloud disks, the smart network interface card creates a corresponding local block device for each cloud disk. Each local block device has its own block device capacity register to store the capacity of the local block device corresponding to each cloud disk.
[0070] Sub-step S102-11: Bind the local block device to a preset port and open the data communication channel between the local block device and the storage server.
[0071] In this embodiment, the preset port can be a PF (Power Function) or a VF (Virtual Function) extended from the PF. In this step, the preset port is first bound to the local block device created in the previous step, and then a data communication channel is opened between the local block device and the storage server 30. This completes the creation of a communication channel between the cloud disk visible from the host 20 and the shared block device of the storage server 30. On the smart network interface card (NIC), a send / receive queue needs to be allocated to this data communication channel, and a CPU core needs to be bound to it. This prepares the communication for cloud disk data I / O operations on the host 20 and data communication between the block devices of the storage server 30.
[0072] Sub-steps S102-12 involve obtaining the current capacity of the cloud disk from the storage server and writing the current capacity of the cloud disk to the block device capacity register to perform hot-plug configuration of the cloud disk.
[0073] The method provided in this embodiment creates a local block device for the cloud disk, binds the local block device to a preset port, opens a data communication channel between the local block device and the storage server, obtains the current capacity of the cloud disk, and writes the current capacity of the cloud disk into the block device capacity register. This prepares for data communication between the host and the cloud disk of the storage server 30, so that the host 20 can access the cloud disk normally after obtaining the current capacity of the cloud disk without restarting the host 20, thus achieving the delivery requirement at the minute level.
[0074] In this implementation, the cloud disk has been configured for hot-plugging. The smart network interface card 10 has created a local block device corresponding to the cloud disk. This local block device is bound to a preset port. When the cloud disk needs to be switched or reclaimed, a hot-plug command will be triggered. To achieve hot-plugging of the cloud disk, in... Figure 3 Based on this, this embodiment also provides a method for unplugging the cloud disk. Please refer to... Figure 5 , Figure 5 This embodiment provides a flowchart example of the cloud disk hot-plugging method. Figure 3 Step S102 includes the following sub-steps:
[0075] Sub-step S102-20: Based on the instruction to hot-swap the cloud disk, unbind the local block device from the preset port.
[0076] Sub-step S102-21: Set the block device capacity register to 0 to configure hot-plugging of the cloud disk.
[0077] In this embodiment, hot-plugging and hot-plugging of cloud disks are the reverse processes. When hot-plugging a cloud disk, it is necessary to unbind the local device from the preset port and set the block device capacity register to 0 so that the host can promptly know that the cloud disk is unavailable when it reads that the block device capacity is 0.
[0078] After the smart network interface card 10 performs a hot-swap configuration for the cloud disk, it sends an interrupt signal to the host 20 to promptly notify the host 20 to obtain the latest configuration information of the cloud disk. After sending the interrupt signal, the host 20 responds promptly and, based on the known cloud disk capacity of 0, determines that the cloud disk has become unavailable. At this point, in order to promptly release the resources occupied by the local block device corresponding to the cloud disk, the smart network interface card 10 needs to perform follow-up processing after sending the interrupt signal to the host 20. Please continue to refer to... Figure 5 After sending an interrupt signal to the host to instruct the host to obtain the configuration information of the cloud disk after hot-plug configuration from the smart network card based on the interrupt signal, and realizing the hot-plugging of the cloud disk based on the current configuration information, step S102 further includes the following sub-steps:
[0079] Sub-step S102-22: After configuring the cloud disk to be hot-swapped, close the data communication channel between the local block device and the storage server.
[0080] Sub-step S102-23: Delete the local block device.
[0081] In this embodiment, in order to delete the local block device in a timely manner and release the resources occupied by the local block device, it is necessary to first close the data communication channel between the local block device and the storage server 30, so that the host 20 stops data communication through the storage components of the local block device and the storage server 30.
[0082] Upon receiving an interrupt signal, host 20 reads the capacity of the local block device from the block device capacity register of the smart network interface card and sends an event notification to the kernel, indicating the change in block device capacity. This triggers the file system driver to update the capacity of the disk corresponding to the cloud disk on host 20. If the block device capacity is not 0, the cloud disk is currently available to the user; if the block device capacity is 0, the cloud disk is currently unavailable to the user, and the cloud disk on host 20 is hidden from the user.
[0083] In this embodiment, to make the cloud disk configuration more flexible, the host 20 is not limited by the status and configuration of the storage server during startup. This embodiment also provides a startup process with zero cloud disks. This startup process can achieve normal startup of the host 20 without configuring cloud disks. One implementation method is as follows:
[0084] During the initialization of the smart network card, the block device capacity register corresponding to the preset port is set to 0 so that the host can start without cloud disk configuration.
[0085] In this embodiment, the smart network interface card 10 may include one or more preset ports. When multiple preset ports are included, each preset port corresponds to a block device capacity register. Each block device capacity register is used to store the capacity of the local block device bound to the corresponding preset port. When the smart network interface card 10 is initialized, the block device capacity register corresponding to each preset port is set to 0.
[0086] When loading the storage driver, host 20 reads the capacity register of each device in turn. If the value is 0, it skips that device and continues loading other block devices until all block devices corresponding to PF or VF are loaded. Since the smart network card 10 initializes all PF or VF with a capacity of 0, the number of cloud disks available to the user is 0. Host 20 still completed loading the storage driver even with 0 cloud disks available.
[0087] During operation, when needed, the smart network card 10 can read the cloud disk configuration in the configuration file and perform hot-insertion operation on each cloud disk in sequence to complete the dynamic loading of the cloud disk.
[0088] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation of a cloud disk hot-swap device 100 is given below. Please refer to... Figure 6 , Figure 6 A block diagram of the cloud disk hot-swap device 100 provided in this embodiment of the invention is shown. It should be noted that the basic principle and technical effects of the cloud disk hot-swap device 100 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, some of these aspects are not mentioned in this embodiment.
[0089] The cloud disk hot-swap device 100 includes a receiving module 110, a configuration module 120, a sending module 130, and an initialization module 140.
[0090] The receiving module 110 is used to receive configuration commands for hot-plugging the cloud disk;
[0091] Configuration module 120 is used to perform hot-swap configuration of the cloud disk based on configuration commands;
[0092] The sending module 130 is used to send an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and to realize the hot-plugging of the cloud disk based on the current configuration information.
[0093] In an optional implementation, the smart network interface card includes a preset port and a block device capacity register. The block device capacity register is used to store the capacity of the local block device bound to the preset port. The configuration instruction is a hot-insertion instruction for the cloud disk. The configuration module 120 is specifically used to: create a local block device corresponding to the cloud disk based on the hot-insertion instruction for the cloud disk; bind the local block device to the preset port and open the data communication channel between the local block device and the storage server; obtain the current capacity of the cloud disk from the storage server and write the current capacity of the cloud disk to the block device capacity register to perform hot-insertion configuration for the cloud disk.
[0094] In an optional implementation, the cloud disk has been hot-plugged, the smart network interface card (NIC) has created a local block device corresponding to the cloud disk, the smart NIC includes a preset port, the local block device is bound to the preset port, and the configuration command is the command to hot-plug the cloud disk; the configuration module 120 is specifically used to: unbind the local block device from the preset port based on the command to hot-plug the cloud disk; and set the block device capacity register to 0 to configure the cloud disk to hot-plug.
[0095] In an optional implementation, after the sending module 130 sends an interrupt signal to the host to instruct the host to obtain the configuration information of the hot-swappable cloud disk from the smart network card based on the interrupt signal, and realizes the hot-swappable cloud disk based on the current configuration information, the configuration module 120 is also used to: close the data communication channel between the local block device and the storage server after hot-swapping the cloud disk; and delete the local block device.
[0096] In an optional implementation, the cloud disk configuration information includes the cloud disk capacity. The sending module 130 is specifically used to: send an interrupt signal to the host to instruct the host to read the capacity of the local block device from the block device capacity register of the smart network card, and to realize the hot-plugging of the cloud disk based on the read capacity of the local block device.
[0097] In an optional implementation, the smart network card includes a preset port, a block device capacity register corresponding to the preset port, and the block device capacity register is used to store the capacity of the local block device bound to the preset port. The configuration module 120 is also used to: set the block device capacity register corresponding to the preset port to 0 when the smart network card is initialized, so that the host can start without cloud disk configuration when it starts up.
[0098] In summary, this invention provides a cloud disk hot-plugging method, apparatus, smart network interface card (NIC), host, and storage medium. Applied to a smart NIC, the smart NIC is communicatively connected to a host and a storage server. The storage server includes a cloud disk. The method includes: receiving a configuration command for hot-plugging the cloud disk; configuring the cloud disk for hot-plugging based on the configuration command; and sending an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart NIC based on the interrupt signal, and then performing hot-plugging of the cloud disk based on the current configuration information. Compared with existing technologies, the smart NIC configures the cloud disk for hot-plugging based on the configuration command, and then sends an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart NIC based on the interrupt signal, and then performs hot-plugging of the cloud disk based on the current configuration information. Because it enables hot-swappable cloud disks, firstly, when switching or reclaiming a cloud disk causes changes in the cloud disk configuration, the changes take effect without restarting the host, meeting the requirement of minute-level delivery; secondly, based on hot-swappable cloud disks, it can support startup without cloud disk configuration, and configure and dynamically load cloud disks as needed during operation, so that users do not need to rely on the working status of the backend storage service when starting the host, making it more adaptable to different user scenarios.
[0099] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for hot-swapping cloud storage, characterized in that, The method is applied to a smart network interface card (NIC), which communicates with a host via a bus and connects to a storage server via a network. A cloud disk created on the host establishes a logical correspondence with the storage components of the storage server. The smart NIC includes a preset port and a block device capacity register. The block device capacity register stores the capacity of a local block device bound to the preset port. Receive configuration instructions for hot-swapping the cloud disk; Based on the configuration instructions, the cloud disk is configured for hot-swapping; An interrupt signal is sent to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and to hot-swap the cloud disk based on the current configuration information; When the configuration instruction is a hot-plug instruction for the cloud disk, the hot-plug configuration of the cloud disk based on the configuration instruction includes: Based on the instruction to hot-plug the cloud disk, a local block device corresponding to the cloud disk is created; Bind the local block device to the preset port and open the data communication channel between the local block device and the storage server; The current capacity of the cloud disk is obtained from the storage server and written to the block device capacity register to perform hot-plug configuration of the cloud disk; When the cloud disk has been hot-swapped, the smart network interface card (NIC) has created a local block device corresponding to the cloud disk, the smart NIC includes a preset port, the local block device is bound to the preset port, and the configuration command is a command to hot-swap the cloud disk, the hot-swap configuration of the cloud disk based on the configuration command includes: Based on the instruction to hot-plug the cloud disk, the local block device is unbound from the preset port; Set the block device capacity register to 0 to configure the cloud disk for hot-swapping.
2. The cloud disk hot-swap method as described in claim 1, characterized in that, The step of sending an interrupt signal to the host to instruct the host to obtain the configuration information of the hot-swappable cloud disk from the smart network card based on the interrupt signal, and to implement hot-swapping of the cloud disk based on the current configuration information, further includes: After hot-swapping the cloud disk, the data communication channel between the local block device and the storage server is closed. Delete the local block device.
3. The cloud disk hot-swap method as described in claim 1, characterized in that, The configuration information of the cloud disk includes the capacity of the cloud disk. Sending an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and implementing hot-swapping of the cloud disk based on the current configuration information, includes: An interrupt signal is sent to the host to instruct the host to read the capacity of the local block device from the block device capacity register of the smart network card, and to hot-swap the cloud disk based on the read capacity of the local block device.
4. The cloud disk hot-swap method as described in claim 1, characterized in that, The smart network interface card includes a preset port, the preset port corresponding to a block device capacity register, the block device capacity register being used to store the capacity of the local block device bound to the preset port, and the method further includes: During the initialization of the smart network card, the block device capacity register is set to 0 so that the host can start without cloud disk configuration.
5. A cloud disk hot-swap device, characterized in that, An application is made to a smart network interface card (NIC), which is connected to a host via a bus and to a storage server via a network. A cloud disk created on the host establishes a logical correspondence with the storage components of the storage server. The smart NIC includes a preset port and a block device capacity register. The block device capacity register stores the capacity of a local block device bound to the preset port. The device includes: A receiving module is used to receive configuration instructions for hot-plugging the cloud disk; A configuration module is used to perform hot-swap configuration of the cloud disk based on the configuration instructions; The sending module is used to send an interrupt signal to the host to instruct the host to obtain the current configuration information of the cloud disk from the smart network card based on the interrupt signal, and to realize the hot-plugging of the cloud disk based on the current configuration information; The configuration module is specifically used for: when the configuration instruction is a hot-insertion instruction for the cloud disk, creating a local block device corresponding to the cloud disk based on the hot-insertion instruction for the cloud disk; binding the local block device to the preset port and opening a data communication channel between the local block device and the storage server; obtaining the current capacity of the cloud disk from the storage server and writing the current capacity of the cloud disk to the block device capacity register, so as to perform hot-insertion configuration for the cloud disk; The configuration module is further configured to: when the cloud disk has been hot-plugged, the smart network interface card (NIC) has created a local block device corresponding to the cloud disk, the smart NIC includes a preset port, the local block device is bound to the preset port, and the configuration instruction is a hot-plug instruction for the cloud disk, unbind the local block device from the preset port based on the hot-plug instruction for the cloud disk; and set the block device capacity register to 0 to perform hot-plug configuration for the cloud disk.
6. A smart network interface card, characterized in that, It includes a processor and a memory, the memory being used to store a program, and the processor being used to implement the cloud disk hot-plugging method according to any one of claims 1-4 when executing the program.
7. A host computer, characterized in that, The host includes a bus, and the host establishes a connection with the smart network card as described in claim 6 through the bus.
8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the cloud disk hot-plugging method according to any one of claims 1-4.
Citation Information
Patent Citations
Bare metal server data disk hot plugging method under Feiteng CPU architecture based on intelligent network card
CN114546920A
Bare metal server implementation method and system based on intelligent network card
CN114610447A