Cloud disk implementation method and device, intelligent network card, server and storage medium

By determining the cloud disk's readiness status using the virtio-blk device status in the smart network interface card, the problem of bare metal server startup failures was resolved, thus improving server reliability.

CN116450046BActive Publication Date: 2026-07-24MAIPU COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MAIPU COMM TECH CO LTD
Filing Date
2023-04-20
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

During the startup process of a bare metal server, the cloud disk was not ready, causing the startup to fail and affecting the reliability of the server.

Method used

The server determines whether the cloud disk is ready by checking the status of the virtio-blk device in the smart network card. The server will only continue to start if the cloud disk is ready. By utilizing the logical correspondence between the virtio-blk device and the cloud disk, the normal mounting and startup of the cloud disk can be achieved.

Benefits of technology

This improves the startup reliability of bare metal servers and avoids startup failures caused by cloud disks not being ready.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450046B_ABST
    Figure CN116450046B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cloud computing and smart network cards, and provides a cloud disk implementation method and device, a smart network card, a server and a storage medium, the method comprising the following steps: when the server is started, reading an Expansion Rom file from the smart network card, loading a virtual device driver program in the file, reading the state of a virtio-blk device in the smart network card through the virtual device driver program, the state being set by the smart network card according to the mounting condition of a detected cloud disk, and a one-to-one logical relationship existing between the virtio-blk device and the corresponding cloud disk; judging whether the cloud disk is in a ready state according to the state of the virtio-blk device; if the cloud disk is in the ready state, continuing to execute the virtual device driver program and starting the cloud disk after the execution is completed. The application can reduce the failure probability of starting the server with the cloud disk as a system disk, and improve the reliability.
Need to check novelty before this filing date? Find Prior Art

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 implementation method, apparatus, smart NIC, server, and storage medium. Background Technology

[0002] In cloud data center environments, bare metal servers are provided to customers as products. Each customer has different requirements for the server's operating system, and the traditional method of using local disks as system disks is difficult to meet the elastic needs of bare metal servers.

[0003] By providing cloud disks to bare metal servers through smart network interface cards (NICs) and centralized storage services, these cloud disks serve as the system disks for the bare metal servers. This separation of the bare metal server and the cloud disk effectively improves the elastic configuration requirements of the bare metal server. Specifically, the smart NIC provides the server with a virtio-blk device as the system disk, while centralized storage provides the physical storage service for the actual virtio-blk device. The cloud disk visible to the server is remotely mounted to a physical disk in the centralized storage via the smart NIC, thus meeting the elastic bare metal requirements of the cloud data center. In this scenario, the server and the cloud disk serving as the system disk are separate entities. Deploying the system disk on the server becomes a matter of the smart NIC mounting a specific remote system disk (i.e., the cloud disk). However, since the server's use of the cloud disk presupposes the successful mounting of the remote system disk, and this mounting is handled by the cloud management center and the smart NIC, the server's use of the system disk is determined by its own boot process. Due to differences in server boot speeds, this can lead to situations where the remote cloud disk is not yet ready during the server's boot process, resulting in server boot failure.

[0004] Therefore, in scenarios where cloud disks are used as the system disk for bare metal servers, the probability of bare metal server startup failure is relatively high, which greatly affects the reliability of bare metal servers. Summary of the Invention

[0005] The purpose of this invention is to provide a cloud disk implementation method, device, smart network card, server, and storage medium, which can reduce the probability of server startup failure when using cloud disk as system disk and improve its reliability.

[0006] The embodiments of the present invention can be implemented as follows:

[0007] In a first aspect, the present invention provides a cloud disk implementation method applied to a server, wherein the server is communicatively connected to a smart network interface card via a bus, the method comprising:

[0008] When the server starts, it reads the Expansion ROM file from the smart network card and loads the virtual device driver in the Expansion ROM file. The virtual device driver is used to read the status of the virtio-blk device in the smart network card. The status of the virtio-blk device is set by the smart network card according to the mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk.

[0009] Determine whether the cloud disk is in a ready state based on the status of the virtio-blk device;

[0010] If the cloud disk is in a ready state, the virtual device driver will continue to be executed and the cloud disk will be started after execution is completed.

[0011] In an optional implementation, the smart network interface card (NIC) includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. The step of determining whether the cloud disk is in a ready state based on the status of the virtio-blk device includes:

[0012] If the value in the status register is the preset value, the cloud disk is determined to be in a non-ready state; otherwise, the cloud disk is determined to be in a ready state.

[0013] In an optional implementation, the status register is a feature register or a custom register of the virtio-blk device.

[0014] In an optional implementation, when the server is powered on, it reads the Expansion ROM file from the smart network card, specifically including:

[0015] When the server is powered on, it reads the Expansion ROM file from the network card chip of the smart network card. The Expansion ROM file is loaded into the network card chip from the CPU system when the smart network card starts up.

[0016] In an optional implementation, the method further includes:

[0017] If the cloud disk is in a not-ready state, the status of the virtio-blk device will continue to be monitored until it is determined that the cloud disk is in a ready state. Then, the virtual device driver will continue to be executed and the cloud disk will be started after execution is completed.

[0018] Secondly, the present invention provides a cloud disk implementation method, applied to a smart network interface card (NIC), wherein the smart NIC is connected to a server via a bus, and the method includes:

[0019] When the smart network card starts up, it detects the mounting status of the cloud disk corresponding to the virtio-blk device;

[0020] The state of the virtio-blk device is set according to the mounting status of the cloud disk, so that when the server starts, it reads the Expansion ROM file from the smart network card, loads the virtual device driver in the Expansion ROM file, reads the state of the virtio-blk device in the smart network card through the virtual device driver, and determines whether the cloud disk is in a ready state based on the state of the virtio-blk device. If the cloud disk is in a ready state, the virtual device driver continues to be executed and starts the cloud disk after execution. The state of the virtio-blk device is set by the smart network card according to the detected mounting status of the corresponding cloud disk, and there is a one-to-one logical relationship between the cloud disk and the virtio-blk device.

[0021] In an optional implementation, the smart network interface card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. The step of setting the status of the virtio-blk device according to the mounting status of the cloud disk includes:

[0022] If the cloud disk is successfully mounted, the preset value of the status register is modified to a specified value that is different from the preset value. The status register is a feature register or a custom register of the virtio-blk device.

[0023] In an optional implementation, before detecting the mounting status of the cloud disk corresponding to the virtio-blk device, the method further includes:

[0024] When the smart network card starts up, it reads the Expansion ROM file from the CPU system and writes the Expansion ROM file into the network card chip of the smart network card, so that when the server powers on, it reads the Expansion ROM file from the network card chip of the smart network card and loads the virtual device driver in the Expansion ROM file.

[0025] Thirdly, the present invention provides a cloud disk implementation device applied to a server, wherein the server is communicatively connected to a smart network card via a bus, and the device includes:

[0026] The reading module is used to read the Expansion ROM file from the smart network card when the server starts up, load the virtual device driver in the Expansion ROM file, and read the status of the virtio-blk device in the smart network card through the virtual device driver. The status of the virtio-blk device is set by the smart network card according to the mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk.

[0027] The judgment module is used to determine whether the cloud disk is in a ready state based on the status of the virtio-blk device;

[0028] The startup module is used to continue executing the virtual device driver and start the cloud disk after execution is completed if the cloud disk is in a ready state.

[0029] Fourthly, the present invention provides a cloud disk implementation device applied to a smart network interface card (NIC), wherein the smart NIC is communicatively connected to a server via a bus, and the device includes:

[0030] The detection module is used to detect the mounting status of the cloud disk corresponding to the virtio-blk device when the smart network card starts up;

[0031] The configuration module is used to set the status of the virtio-blk device according to the cloud disk's mounting status. This allows the server to read the Expansion ROM file from the smart network interface card (NIC) upon startup, load the virtual device driver from the Expansion ROM file, read the status of the virtio-blk device in the smart NIC through the virtual device driver, determine whether the cloud disk is in a ready state based on the virtio-blk device's status, and if the cloud disk is in a ready state, continue executing the virtual device driver and start the cloud disk after execution. The status of the virtio-blk device is set by the smart NIC based on the detected cloud disk mounting status, and there is a one-to-one logical relationship between the cloud disk and the virtio-blk device.

[0032] Fifthly, 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 implementation method described in any of the foregoing embodiments when executing the program.

[0033] In a sixth aspect, the present invention provides a server, the server including a processor, a memory and a bus, the server establishing a connection with a smart network card as described in the foregoing embodiments via the bus, the memory being used to store a program, and the processor being used to implement the cloud disk implementation method as described in any one of the foregoing embodiments when executing the program.

[0034] In a seventh aspect, 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 implementation method as described in any of the foregoing embodiments, or implements the cloud disk implementation method as described in any of the foregoing embodiments.

[0035] Compared to existing technologies, the smart network interface card (NIC) sets the status of the virtio-blk device based on the mounted status of the corresponding cloud disk during startup. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk. When the server starts, it reads the status of the virtio-blk device in the smart NIC and determines whether the cloud disk is ready based on the status of the virtio-blk device. If the cloud disk is ready, the virtual device driver continues to execute and starts the cloud disk after execution, ultimately enabling the server to start normally. Since the server starts when the cloud disk is ready, it can avoid server startup failure caused by the cloud disk not being ready when the server starts, thereby improving the reliability of the server. Attached Figure Description

[0036] 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.

[0037] Figure 1 This is an example diagram illustrating an application scenario provided in this embodiment.

[0038] Figure 2 This is a block diagram of the server provided in this embodiment.

[0039] Figure 3 This is a block diagram of the smart network card provided in this embodiment.

[0040] Figure 4 This embodiment provides a flowchart example of the cloud disk implementation method applied to a server. Figure 1 .

[0041] Figure 5 This embodiment provides a flowchart example of the cloud disk implementation method applied to a server. Figure 2 .

[0042] Figure 6 This is a flowchart illustrating the cloud disk implementation method for smart network interface cards provided in this embodiment.

[0043] Figure 7 This is an example diagram illustrating the logical architecture of the cloud disk implementation method provided in this embodiment.

[0044] Figure 8 This is a block diagram of the first cloud disk implementation device provided in this embodiment.

[0045] Figure 9 This is a block diagram of the second cloud disk implementation device provided in this embodiment.

[0046] Icons: 10-Server; 11-First Processor; 12-First Memory; 13-Bus; 20-Smart Network Interface Card; 21-Second Processor; 22-Second Memory; 23-Network Interface Card Chip; 30-Centralized Storage Device; 100-First Cloud Disk Implementation Device; 110-Read Module; 120-Judgment Module; 130-Startup Module; 200-Second Cloud Disk Implementation Device; 210-Detection Module; 220-Setting Module; 230-Write Module. Detailed Implementation

[0047] 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.

[0048] 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.

[0049] 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.

[0050] 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.

[0051] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0052] 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.

[0053] Typically, there are ways to provide system disks for servers, such as installing local system disks, deploying system disks using PXE (PrebooteXecution Environment), and distributed file systems. However, these technologies cannot meet the requirements of elastic bare metal in cloud data centers due to reasons such as deployment, operation and maintenance, and security.

[0054] This embodiment provides a cloud disk implementation method, device, smart network card, server, and storage medium. Its core improvement lies in the status of the virtio-blk device in the smart network card. This status enables the server to start normally when the cloud disk is booting normally, avoiding server startup failure caused by the cloud disk not being ready. It will be described in detail below.

[0055] Please refer to Figure 1 , Figure 1 This is an example diagram illustrating an application scenario provided in this embodiment. Figure 1 In this configuration, the smart network interface card (NIC) 20 can be directly plugged into the server 10 and communicates with the server 10 via a bus (such as PCIe). The smart NIC 20 also communicates with the remote centralized storage device 30 via a network. The smart NIC 20 provides the server 10 with a virtio-blk device. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk (the centralized storage device provides the physical storage space for the virtio-blk device). The smart NIC 20 mounts the virtio-blk device to the centralized storage device 30 via a network storage protocol, thereby providing the server with backend storage access services for the cloud disk.

[0056] Server 10 is typically a hardware device that combines the characteristics of a traditional physical server with the virtualization service capabilities of cloud computing technology. It is a product of the combination of hardware and software advantages, also known as a BMS (Bare Metal Server). Server 10 can provide enterprises with a dedicated physical server in the cloud, offering superior computing performance and data security for core databases, critical application systems, high-performance computing, big data, and other business operations. This allows cloud service users to flexibly apply for and use services on demand.

[0057] The smart network interface card 20 is a network interface card with an independent computing unit that can perform specific infrastructure functions. The smart network interface card 20 simulates a storage virtio-blk device through the PCIE (Peripheral Component Interconnect Express) bus and communicates with the remote centralized storage device 30 through software to convert communication protocols and storage protocols, providing the server 10 with cloud disk storage access functions.

[0058] Centralized storage device 30 is a storage device that provides storage space for cloud disks.

[0059] exist Figure 1 Based on this, this embodiment also provides Figure 1 Please refer to the diagram of the box representing server 10 in the image. Figure 2 , Figure 2 This is a block diagram of the server 10 provided in this embodiment. The server 10 includes a first processor 11, a first memory 12 and a bus 13. The first processor 11 is electrically connected to the first memory 12 through the bus 13.

[0060] The first processor 11 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the cloud disk implementation method applied to the server 10 can be completed through the integrated logic circuits in the hardware of the first processor 11 or through software instructions. The aforementioned first 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.

[0061] The first memory 12 is used to store programs, such as the first cloud disk implementation device in the following embodiments. The first cloud disk implementation device 100 includes at least one software functional module that can be stored in the first memory 12 or embedded in the server 10 in the form of software or firmware. After receiving an execution instruction, the first processor 11 executes the program to implement the cloud disk implementation method for the server 10 disclosed in the above embodiments.

[0062] Server 10 boots in a UEFI (Unified Extensible Firmware Interface) environment. UEFI is responsible for the power-on self-test (POST) of server 10 and provides an interface for connecting the operating system and hardware.

[0063] exist Figure 1 Based on this, this embodiment also provides Figure 1 Please refer to the block diagram of the smart network card 20 in the image. Figure 3 , Figure 3 The block diagram of the smart network card 20 provided in this embodiment is shown. The smart network card 20 includes a second processor 21, a second memory 22, and a network card chip 23. The second processor 21 is electrically connected to the second memory 22 and the network card chip 23.

[0064] The second processor 21 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the cloud disk implementation method applied to the smart network card 20 can be completed through the integrated logic circuits in the hardware of the second processor 21 or through software instructions. The aforementioned second processor 21 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.

[0065] The second memory 22 is used to store programs, such as the second cloud disk implementation device 200 in the following embodiments. The second cloud disk implementation device 200 includes at least one software functional module that can be stored in the second memory 22 or embedded in the smart network card 20 in the form of software or firmware. After receiving an execution instruction, the second processor 21 executes the program to implement the cloud disk implementation method for the smart network card disclosed in the above embodiments.

[0066] The network interface card (NIC) chip 23 is integrated into the smart NIC 20 and is used to store the status of the virtio-blk device corresponding to the cloud disk. Furthermore, since the smart NIC 20 simulates a virtio-blk device via the PCIe bus, PCI / PCIe devices typically have an external read-only memory (ROM) to store the initialization code or system startup code of that PCI / PCIe device. During the power-on self-test (POST) phase of the smart NIC 20, the second processor 21 copies the extended read-only memory (EPROM) file from the ROM to the NIC chip 23 of the smart NIC 20, and then the server 10 reads and executes it from the NIC chip 23.

[0067] exist Figure 1 and Figure 2 Based on this, this embodiment provides an application for Figure 1 and Figure 2 For instructions on implementing cloud disks on server 10, please refer to [link / reference]. Figure 4 , Figure 4 This embodiment provides a flowchart example of the cloud disk implementation method applied to a server. Figure 1 The method includes the following steps:

[0068] In step S101, when the server starts, it reads the Expansion ROM file from the smart network card and loads the virtual device driver in the Expansion ROM file. The virtual device driver reads the status of the virtio-blk device in the smart network card. The status of the virtio-blk device is set by the smart network card according to the mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk.

[0069] In this embodiment, the cloud disk is accessed as a virtio-blk device. A virtio-blk device stores information in fixed-size blocks, each with its own address. Data of a certain length can be read from any location on the virtio-blk device. The smart network interface card 20 virtualizes the storage space provided by the centralized storage device 30 into a virtio-blk device. That is, from the perspective of the smart network interface card, the pre-defined storage space on the centralized storage device 30 is a virtio-blk device, while the server 10 treats this virtio-blk device as a cloud disk. Therefore, there is a one-to-one logical relationship between the cloud disk and the virtio-blk device. When the cloud disk is successfully mounted, it means that the access connection between the smart network interface card 20 and the centralized storage device 30 is normal, and the server 10 can access the cloud disk through the virtio-blk device access method provided by the smart network interface card 20; otherwise, it cannot be accessed.

[0070] In this embodiment, in order to enable the server to know the status of the cloud disk in a timely manner when it starts up, so that the server startup process can proceed after the cloud disk is normal, and to ensure the timing between the startup of the server 10 and the normal operation of the cloud disk, the smart network card 20 detects the mounting status of the cloud disk in real time when it starts up, and sets the status of the virtio-blk device according to the mounting status of the cloud disk. The status of the virtio-blk device indicates whether the cloud disk is in a ready state.

[0071] Step S102: Determine whether the cloud disk is in a ready state based on the status of the virtio-blk device.

[0072] In this embodiment, the cloud disk is in a ready state, which means that the cloud disk can provide storage access services normally. In this state, the server 10 with the cloud disk as the system disk can start normally; otherwise, the server 10 will fail to start.

[0073] Step S103: If the cloud disk is in a ready state, continue to execute the virtual device driver and start the cloud disk after execution is complete.

[0074] The method provided in this embodiment determines whether the cloud disk is in a ready state based on the status of the virtio-blk device. The virtual device driver will continue to be executed only when the cloud disk is in a ready state, and the cloud disk will be started after execution, thus enabling the server to start normally. Since the server starts when the cloud disk is in a ready state, it can avoid the server startup failure caused by the cloud disk not being in a ready state when the server starts, thereby improving the reliability of the server.

[0075] In an optional implementation, the smart network interface card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. One way to determine whether the cloud disk is in a ready state is as follows:

[0076] If the value in the status register is a preset value, the cloud disk is determined to be in an unready state; otherwise, the cloud disk is determined to be in a ready state.

[0077] In this embodiment, when the smart network card detects that the cloud disk has been successfully mounted, it will set the value in the status register to a specified value. The preset value can be any value that is different from the specified value. For example, the preset value is set to 0x5a5a5a5a. Of course, it can also be set to other special values, as long as it is different from the specified value.

[0078] In this embodiment, one implementation of the status register is to add a dedicated register as the status register. This method requires hardware modifications to the chip to provide additional support for the status register. In order to avoid making too many changes to the existing hardware architecture and reduce hardware costs, this embodiment also provides another implementation method. Since the virtio-blk device driver of the smart network card 20 already defines a feature register, this embodiment reuses this feature register as the status register. That is, the status register is a feature register defined by the virtio-blk device driver. Therefore, no hardware adaptation modifications are required, and only software adaptation is needed to meet the requirements of the status register. The status register can also be a custom register.

[0079] In an optional implementation, in order to detect the status of the virtio-blk device in the smart network card in a timely manner when the server powers on, the Expansion ROM file is read from the smart network card when the server powers on. This embodiment also provides an implementation method for reading the Expansion ROM file:

[0080] When the server powers on, it reads the Expansion ROM file from the network card chip of the smart network card. The Expansion ROM file is loaded into the network card chip from the CPU system when the smart network card starts up.

[0081] In this embodiment, the Expansion ROM file is the initialization code or system startup code of the PCI / PCIE device stored in the Expansion ROM. When the smart network card 20 starts up, it reads the Expansion ROM file from the Expansion ROM during the power-on self-test phase and stores the read Expansion ROM file in the network card chip 23. The server 10 reads and runs the Expansion ROM file from the network card chip 23 to detect the status of the virtio-blk device stored in the smart network card 20.

[0082] based on Figure 4 This embodiment also provides a handling method when the cloud disk is not in a ready state. Please refer to [link / reference]. Figure 5 , Figure 5 This embodiment provides a flowchart example of the cloud disk implementation method applied to a server. Figure 2 The method further includes step S104:

[0083] Step S104: If the cloud disk is in an unready state, continue to check the status of the virtio-blk device until it is determined that the cloud disk is in a ready state. Then, continue to execute the virtual device driver and start the cloud disk after execution.

[0084] In this embodiment, if the cloud disk is in an unready state, it means that the server's system disk is abnormal. In this case, the server will block and wait, and continue to monitor the status of the virtio-blk device in real time or periodically.

[0085] To cooperate with server 10, smart network interface card 20 needs to detect the cloud disk's mounting status upon startup and set the virtio-blk device's status accordingly. This embodiment also provides a cloud disk implementation method applied to the smart network interface card; please refer to [link / reference]. Figure 6 , Figure 6 This is a flowchart illustrating a cloud disk implementation method for a smart network interface card (NIC) provided in this embodiment. The method includes the following steps:

[0086] Step S201: When the smart network card starts up, it checks the mounting status of the cloud disk corresponding to the virtio-blk device.

[0087] In this embodiment, when the smart network card 20 starts up, it will detect the connection status of the cloud disk in real time, that is, whether it can communicate normally with the centralized storage device and whether it can access the storage space provided by the centralized storage device normally. If the connection is normal, the cloud disk is considered to be successfully mounted; otherwise, the cloud disk mounting fails.

[0088] Step S202: Set the state of the virtio-blk device according to the cloud disk's mounting status. This allows the server to read the Expansion ROM file from the smart network interface card (NIC) and load the virtual device driver from the Expansion ROM file when it starts up. The virtual device driver then reads the state of the virtio-blk device in the smart NIC and determines whether the cloud disk is ready based on its state. If the cloud disk is ready, the virtual device driver continues to execute and starts the cloud disk after execution. The state of the virtio-blk device is set by the smart NIC based on the detected cloud disk's mounting status. There is a one-to-one logical relationship between the cloud disk and the virtio-blk device.

[0089] In an optional implementation, the smart network interface card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value, and the status of the virtio-blk device can be set according to the cloud disk mounting status in the following ways:

[0090] If the cloud disk is successfully mounted, the default value of the status register will be modified to a specified value that is different from the default value. The status register is the characteristic register of the virtio-blk device or a custom register.

[0091] If the cloud disk mounting fails, no modifications are made to the preset value. Therefore, before the cloud disk is successfully mounted, the server 10 detects that the status register remains at the preset value, and the server 10 remains blocked and waiting until the cloud disk is successfully mounted. At this point, the preset value is modified to the specified value, the server 10 determines that the cloud disk is successfully mounted, starts the cloud disk, and the server 10 starts normally.

[0092] In an optional implementation, to enable the server 10 to read and run the Expansion ROM file in a timely manner, the smart network interface card 20 also provides a method for writing the Expansion ROM file before detecting the mounting status of the cloud disk corresponding to the virtio-blk device:

[0093] When the smart network card starts up, it reads the Expansion ROM file from the CPU system and writes the Expansion ROM file into the network card chip of the smart network card, so that when the server powers on, it reads the Expansion ROM file from the network card chip of the smart network card and loads the virtual device driver in the Expansion ROM file.

[0094] In this embodiment, the network interface card (NIC) chip can be Figure 3 In the network card chip 23, one method for writing an Expansion ROM file that supports cloud disk functionality into the network card chip is as follows:

[0095] During the boot phase of the smart network card or the operating system startup phase, the Expansion ROM file that supports cloud disk functionality is written into the network card chip.

[0096] In this embodiment, the Expansion ROM file can be written to the network card chip and executed during the boot phase, or it can be executed during the operating system startup phase, as long as it can be ensured that the Expansion ROM file can be read from the network card chip of the smart network card when the server is powered on.

[0097] To illustrate this solution more clearly from a logical architecture perspective, please refer to... Figure 7 , Figure 7 This is an example diagram illustrating the logical architecture of the cloud disk implementation method provided in this embodiment. Figure 7 In this context, server 10 operates in a UEFI environment. The cloud disk implementation involves the interaction between server 10, the network interface card (NIC) chip of smart NIC 20, and the NIC CPU. Server 10 runs an Expansion ROM runtime module, the NIC chip runs an Expansion ROM file storage module and a virtio-blk device module, and the NIC CPU runs an Expansion ROM file loading module and a cloud disk status checking module. The specific interaction process of the NIC chip is as follows:

[0098] S1: After the server 10 is powered on, the network card CPU starts running. The network card CPU's Expansion ROM file loading module is responsible for writing the Expansion ROM file that supports cloud disk functionality into the network card chip so that the server 10 can read and run it in the UEFI environment. The Expansion ROM file loading module can be implemented in the boot environment (also known as the BOOT environment) or in the operating system environment (also known as the OS environment).

[0099] S2: After server 10 powers on, it reads and executes the Expansion ROM file in the UEFI environment. The actual driver executed is the virtio-blk driver, which is a driver for the virtualized virtio-blk device implemented based on virtio. Virtio is a general-purpose virtualization device emulation standard. Virtio consists of a driver and a device, operating in a producer-consumer pattern: the driver produces memory, and the device consumes memory. The virtio-blk driver checks if the virtio-blk device in the network interface card chip is ready. If not, it blocks and waits; otherwise, it loads the virtio-blk device driver normally and starts the cloud disk after loading.

[0100] S3: After the network card CPU enters the OS environment, the cloud disk status check module starts. This module will continuously check the connection status of the cloud disk. If the cloud disk has been successfully connected (meaning it can be accessed), it will pass control information to the virtio-blk device module to allow the cloud disk in the UEFI of server 10 to continue loading.

[0101] S4: The Expansion ROM runtime module running in the UEFI environment continuously checks the control status of the virtio-blk device. If it is ready, it loads the driver normally; if it is not ready, it waits indefinitely.

[0102] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation method of the first cloud disk implementation device 100 is given below. Please refer to... Figure 8 , Figure 8 This is a block diagram of the first cloud disk implementation device 100 provided in this embodiment. It should be noted that the basic principle and technical effects of the first cloud disk implementation 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.

[0103] The first cloud disk implementation device 100 includes a reading module 110, a judgment module 120, and a startup module 130.

[0104] The reading module 110 is used to read the Expansion ROM file from the smart network card when the server starts up, and load the virtual device driver in the Expansion ROM file. The virtual device driver is used to read the status of the virtio-blk device in the smart network card. The status of the virtio-blk device is set by the smart network card according to the mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk.

[0105] In an optional implementation, the reading module 110 is further configured to: read the Expansion ROM file from the smart network card when the server is powered on, specifically: read the Expansion ROM file from the network card chip of the smart network card when the server is powered on, wherein the Expansion ROM file is loaded into the network card chip from its own CPU system when the smart network card starts up.

[0106] The judgment module 120 is used to determine whether the cloud disk is in a ready state based on the status of the virtio-blk device;

[0107] In an optional implementation, the smart network card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. The judgment module 120 is specifically used to: if the value in the status register is the preset value, then determine that the cloud disk is in an unready state; otherwise, determine that the cloud disk is in a ready state.

[0108] In an optional implementation, the status register is a feature register of the virtio-blk device or a custom register.

[0109] The startup module 130 is used to continue executing the virtual device driver and start the cloud disk after execution is completed if the cloud disk is in a ready state.

[0110] In an optional implementation, the startup module 130 is further configured to: if the cloud disk is in an unready state, continue to detect the status of the virtio-blk device until it is determined that the cloud disk is in a ready state, continue to execute the virtual device driver, and start the cloud disk after execution is completed.

[0111] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation method of the second cloud disk implementation device 200 is given below. Please refer to... Figure 9 , Figure 9 This is a block diagram of the second cloud disk implementation device 200 provided in this embodiment. It should be noted that the basic principle and technical effects of the second cloud disk implementation device 200 provided in this embodiment are the same as those in the above embodiments; however, for the sake of brevity, some details are not mentioned in this embodiment.

[0112] The second cloud disk implementation device 200 includes a detection module 210, a setting module 220, and a writing module 230.

[0113] The detection module 210 is used to detect the mounting status of the cloud disk corresponding to the virtio-blk device when the smart network card starts up;

[0114] The configuration module 220 is used to configure the status of the virtio-blk device according to the mounting status of the cloud disk. This allows the server to read the Expansion ROM file from the smart network interface card (NIC) and load the virtual device driver from the Expansion ROM file when it starts up. The virtual device driver is then used to read the status of the virtio-blk device in the smart NIC. Based on the status of the virtio-blk device, the server determines whether the cloud disk is in a ready state. If the cloud disk is in a ready state, the server continues to execute the virtual device driver and starts the cloud disk after execution. There is a one-to-one logical relationship between the cloud disk and the virtio-blk device.

[0115] In an optional implementation, the smart network card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. The setting module 220 is specifically used to: if the cloud disk is successfully mounted, modify the preset value of the status register to a specified value that is different from the preset value. The status register is a feature register or a custom register of the virtio-blk device.

[0116] In an optional implementation, before detecting the mounting status of the cloud disk corresponding to the virtio-blk device, the writing module 230 is used to: read the Expansion ROM file from the CPU system and write the Expansion ROM file into the network card chip of the smart network card when the smart network card starts up, so that when the server is powered on, it reads the Expansion ROM file from the network card chip of the smart network card and loads the virtual device driver in the Expansion ROM file.

[0117] In an optional implementation, the writing module 230 is specifically used to write the Expansion ROM supporting cloud disk functionality into the network card chip during the boot phase of the smart network card or during the operating system boot phase.

[0118] The present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the cloud disk implementation method applied to a server in the foregoing embodiments, or implements the cloud disk implementation method applied to a smart network card in the foregoing embodiments.

[0119] In summary, this invention provides a cloud disk implementation method, apparatus, smart network interface card (NIC), server, and storage medium, applied to a server. The server communicates with the smart NIC via a bus. The method includes: when the server starts, reading the Expansion ROM file from the smart NIC and loading the virtual device driver in the Expansion ROM file; reading the status of the virtio-blk device in the smart NIC through the virtual device driver, the status of the virtio-blk device being set by the smart NIC based on the detected cloud disk mounting status, and a one-to-one logical relationship existing between the virtio-blk device and the cloud disk; determining whether the cloud disk is in a ready state based on the status of the virtio-blk device; if the cloud disk is in a ready state, continuing to execute the virtual device driver and starting the cloud disk after execution. Compared with the prior art, the embodiments of the present invention have at least the following advantages: (1) It solves the problem that the cloud disk function fails due to the server loading speed being faster than the time it takes for the smart network card to connect to the remote cloud disk and prepare, thus preventing the server from starting normally, thereby improving the reliability of the server; (2) By solving the problem that the server cannot start normally due to improper timing control between the server's startup speed and the cloud disk mounting, the cloud disk solution based on the smart network card is made more perfect, expanding its application prospects; (3) It supports ROM customization or upgrades without changing the chip firmware, giving the cloud disk function good scalability and adaptability; (4) It can adapt well to servers with different startup speeds, and also ensures that the connection speed between the smart network card and the cloud management platform does not affect the server's cloud disk service, making it simple and easy to implement.

[0120] 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 implementing cloud storage, characterized in that, Applied to a server, the server being connected to a smart network interface card via a bus, the method includes: When the server starts, it reads the Expansion ROM file from the smart network card and loads the virtual device driver in the Expansion ROM file. The virtual device driver is used to read the status of the virtio-blk device in the smart network card. The status of the virtio-blk device is set by the smart network card according to the mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk. Determine whether the cloud disk is in a ready state based on the status of the virtio-blk device; If the cloud disk is in a ready state, the virtual device driver will continue to be executed and the cloud disk will be started after execution is completed.

2. The cloud disk implementation method as described in claim 1, characterized in that, The smart network interface card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. The step of determining whether the cloud disk is in a ready state based on the status of the virtio-blk device includes: If the value in the status register is the preset value, the cloud disk is determined to be in a non-ready state; otherwise, the cloud disk is determined to be in a ready state.

3. The cloud disk implementation method as described in claim 2, characterized in that, The status register is a feature register or a custom register of the virtio-blk device.

4. The cloud disk implementation method as described in claim 1, characterized in that, When the server powers on, it reads the Expansion ROM file from the smart network interface card, specifically including: When the server is powered on, it reads the Expansion ROM file from the network card chip of the smart network card. The Expansion ROM file is loaded into the network card chip from the CPU system when the smart network card starts up.

5. The cloud disk implementation method as described in any one of claims 1-4, characterized in that, The method further includes: If the cloud disk is in a not-ready state, the status of the virtio-blk device will continue to be monitored until it is determined that the cloud disk is in a ready state. Then, the virtual device driver will continue to be executed and the cloud disk will be started after execution is completed.

6. A method for implementing cloud storage, characterized in that, Applied to a smart network interface card (NIC), wherein the smart NIC communicates with a server via a bus, the method includes: When the smart network card starts up, it detects the mounting status of the cloud disk corresponding to the virtio-blk device; The state of the virtio-blk device is set according to the mounting status of the cloud disk, so that when the server starts, it reads the Expansion ROM file from the smart network card, loads the virtual device driver in the Expansion ROM file, reads the state of the virtio-blk device in the smart network card through the virtual device driver, and determines whether the cloud disk is in a ready state based on the state of the virtio-blk device. If the cloud disk is in a ready state, the virtual device driver continues to be executed and starts the cloud disk after execution. The state of the virtio-blk device is set by the smart network card according to the detected mounting status of the corresponding cloud disk, and there is a one-to-one logical relationship between the cloud disk and the virtio-blk device.

7. The cloud disk implementation method as described in claim 6, characterized in that, The smart network interface card includes a status register that stores the status of the virtio-blk device. The status register is initialized to a preset value. The step of setting the status of the virtio-blk device according to the mounting status of the cloud disk includes: If the cloud disk is successfully mounted, the preset value of the status register is modified to a specified value that is different from the preset value. The status register is a feature register or a custom register of the virtio-blk device.

8. The cloud disk implementation method as described in claim 6, characterized in that, Before detecting the mounting status of the cloud disk corresponding to the virtio-blk device, the method further includes: When the smart network card starts up, it reads the Expansion ROM file from the CPU system and writes the Expansion ROM file into the network card chip of the smart network card, so that when the server powers on, it reads the Expansion ROM file from the network card chip of the smart network card and loads the virtual device driver in the Expansion ROM file.

9. A cloud storage implementation device, characterized in that, Applied to a server, the server is communicatively connected to a smart network interface card via a bus, the device includes: The reading module is used to read the Expansion ROM file from the smart network card when the server starts up, load the virtual device driver in the Expansion ROM file, and read the status of the virtio-blk device in the smart network card through the virtual device driver. The status of the virtio-blk device is set by the smart network card according to the mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the virtio-blk device and the cloud disk. The judgment module is used to determine whether the cloud disk is in a ready state based on the status of the virtio-blk device; The startup module is used to continue executing the virtual device driver and start the cloud disk after execution is completed if the cloud disk is in a ready state.

10. A cloud storage implementation device, characterized in that, Applied to a smart network interface card (NIC), wherein the smart NIC communicates with a server via a bus, the device includes: The detection module is used to detect the mounting status of the cloud disk corresponding to the virtio-blk device when the smart network card starts up; The configuration module is used to set the state of the virtio-blk device according to the mounting status of the cloud disk. This allows the server to read the Expansion ROM file from the smart network interface card (NIC) and load the virtual device driver from the Expansion ROM file when it starts up. The virtual device driver is then used to read the state of the virtio-blk device in the smart NIC. Based on the state of the virtio-blk device, the server determines whether the cloud disk is in a ready state. If the cloud disk is in a ready state, the server continues to execute the virtual device driver and starts the cloud disk after execution. The state of the virtio-blk device is set by the smart NIC based on the detected mounting status of the corresponding cloud disk. There is a one-to-one logical relationship between the cloud disk and the virtio-blk device.

11. 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 implementation method according to any one of claims 6-8 when executing the program.

12. A server, characterized in that, The server includes a processor, a memory, and a bus. The server establishes a connection with the smart network card as described in claim 11 through the bus. The memory is used to store a program, and the processor is used to implement the cloud disk implementation method as described in any one of claims 1-5 when executing the program.

13. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the cloud disk implementation method of any one of claims 1-5, or implements the cloud disk implementation method of any one of claims 6-8.