Block device generation method, storage system and server

By delaying the volume information query duration and using status codes for control, the problem of block devices not being usable during storage system startup was solved, ensuring the continuity of upper-layer services and the normal use of block devices.

CN120929023AInactive Publication Date: 2025-11-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511468729.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2025-11-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the storage system starts up, the generated block devices cannot be used normally, affecting the continuity of upper-layer services. This is because the storage system is unavailable during volume configuration recovery, causing the server to be unable to access it normally.

Method used

By delaying the volume information query time, block devices are generated only after all volumes have been restored and configured. Status codes are used to control the query process, delaying the time it takes for the server to discover volumes, and ensuring that subsequent instructions are executed only after the volumes have been restored.

Benefits of technology

This reduces the number of times generated block devices cannot be used normally during volume unavailability, ensuring the continuity of upper-layer services and improving the success rate of block device usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929023A_ABST
    Figure CN120929023A_ABST
Patent Text Reader

Abstract

The invention discloses a block device generation method, a storage system and a server, and particularly relates to the technical field of computer storage, after a first information query instruction sent by the server is received, in the process of querying important information of at least one volume, the query duration of volume information is delayed through a state code, and the query time of the volume information is shortened. And subsequent instructions are executed after the configuration of all the volumes is recovered. Therefore, the time for discovering the volume by the server can be delayed, the situation that the generated block device cannot be normally used when the volume is unavailable is reduced, the generated block device can be ensured to normally provide service for the upper-layer service, and the continuity of the upper-layer service is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer storage technology, and in particular to methods for generating block devices, storage systems, and servers. Background Technology

[0002] In a storage system, to facilitate data read and write operations by the server, the storage system is configured with multiple volumes for the server. These multiple volumes can be associated with the server, thereby ensuring that the server can perform data read and write operations on each volume in the storage system through the generated block devices.

[0003] However, storage system startup requires a significant amount of time for configuration recovery, during which volumes within the storage system are unusable. Since the server automatically generates block devices upon detecting storage system startup, this can lead to situations where the server completes block device generation while volumes are unavailable. Consequently, the generated block devices become unusable, impacting the continuity of upper-layer services. Summary of the Invention

[0004] This application provides a method for generating block devices, a storage system, and a server to at least solve the problem in related technologies where generated block devices cannot be used normally, affecting the continuity of upper-layer services.

[0005] This application provides a method for generating block devices, applied to a storage system, the storage system including at least one volume corresponding to a server, comprising: Receive a first information query instruction sent by the server; wherein the first information query instruction is used to trigger the storage system to query important information of at least one volume; Repeatedly execute the first information query command to obtain the information query result and status code, and send the information query result and status code to the server until the port group query command sent by the server is received; Query the port group information of at least one volume and send the port group information of at least one volume to the server; wherein, the port group information of at least one volume and the important information of at least one volume are used to enable the server to generate block devices corresponding to at least one volume respectively.

[0006] This application also provides a method for generating block devices, applied to a server, the server being able to establish an association with at least one volume in a storage system, including: Send a first information query instruction to the storage system; wherein the first information query instruction is used to trigger the storage system to query important information of at least one volume; Receive information query results and status codes sent by the storage system; If the status code is the first status code, resend the first information query instruction to the storage system until the status code is no longer the first status code; Send a port group query command to the storage system; wherein, the port group query command is used to trigger the storage system to query the port group information of at least one volume; Receive port group information for at least one volume from the storage system; Based on the important information of at least one volume and the port group information of at least one volume, generate block devices corresponding to at least one volume respectively.

[0007] This application provides a block device generation apparatus, applied to a storage system, the storage system including at least one volume corresponding to a server, comprising: The instruction receiving unit is used to receive a first information query instruction sent by the server; wherein the first information query instruction is used to trigger the storage system to query important information of at least one volume; The instruction execution unit is used to repeatedly execute the first information query instruction, obtain the information query result and status code, and send the information query result and status code to the server until it receives the port group query instruction sent by the server. The information sending unit is used to query the port group information of at least one volume and send the port group information of at least one volume to the server; wherein the port group information of at least one volume and the important information of at least one volume are used to enable the server to generate block devices corresponding to at least one volume respectively.

[0008] This application also provides a block device generation apparatus, applied to a server, the server being able to establish an association with at least one volume in a storage system, including: The instruction sending unit is used to send a first information query instruction to the storage system; wherein the first information query instruction is used to trigger the storage system to query important information of at least one volume; The information receiving unit is used to receive information query results and status codes sent by the storage system. The instruction sending unit is also used to resend the first information query instruction to the storage system when the status code is the first status code, until the status code is no longer the first status code; Send a port group query command to the storage system; wherein, the port group query command is used to trigger the storage system to query the port group information of at least one volume; The information receiving unit is also used to receive port group information of at least one volume sent by the storage system; A block device generation unit is used to generate block devices corresponding to at least one volume based on the important information of at least one volume and the port group information of at least one volume.

[0009] This application also provides a storage system, including: at least one processor; and A storage device that is communicatively connected to at least one processor; The storage device stores instructions that can be executed by at least one processor, which are executed by at least one processor to enable the at least one processor to perform the steps of any of the above methods.

[0010] This application also provides a server, including: at least one processor; and Memory that is communicatively connected to at least one processor; The memory stores instructions that can be executed by at least one processor, which are executed by at least one processor to enable the at least one processor to perform the steps of any of the above methods.

[0011] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above methods.

[0012] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0013] This application provides a method for generating block devices, a storage system, and a server. During the querying of critical information for at least one volume, the query duration is delayed using status codes to ensure that subsequent instructions are executed only after all volumes have been restored to their configurations. This delays the time it takes for the server to discover volumes, reducing the likelihood of block devices generated during volume unavailability becoming unusable. It ensures that the generated block devices can provide services to upper-layer applications, guaranteeing the continuity of those services. Attached Figure Description

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

[0015] Figure 1 This application provides a schematic diagram illustrating the relationship between a volume and a server in a storage system. Figure 2 This is a schematic diagram illustrating the connection between a volume and a server in a storage system, provided as an embodiment of this application. Figure 3 A flowchart illustrating a method for generating a block device according to an embodiment of this application; Figure 4 A flowchart illustrating the timing process of a first information query instruction provided in an embodiment of this application; Figure 5 A flowchart illustrating the timing process of another first information query instruction provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a block device generation apparatus provided in an embodiment of this application; Figure 7 This application provides a schematic diagram of the structure of another block device generation apparatus. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0018] In a storage system, to facilitate data read and write operations by the server, the storage system is configured with multiple volumes for the server. These multiple volumes can establish association relationships with the server, thereby ensuring that the server can perform data read and write operations on various volumes in the storage system through the generated block devices.

[0019] For example, such as Figure 1 As shown, the storage system may include six volumes (or logical units), namely Volume 0, Volume 1, Volume 2, Volume 3, Volume 4, and Volume 5. Volumes 0, 1, and 2 are associated with server A, and Volumes 3, 4, and 5 are associated with server B. It should be noted that the storage system may include multiple volumes; the number of volumes in this embodiment is merely illustrative and not limited to a specific number.

[0020] It's understandable that if volumes 0, 1, and 2 are associated with server A, then server A can only query volumes 0, 1, and 2, and will generate the block device corresponding to volume 0 (e.g., / dev / sdaa), volume 1 (e.g., / dev / sdab), and volume 2 (e.g., / dev / sdac) on server A. Similarly, if volumes 3, 4, and 5 are associated with server B, then server B can only query volumes 3, 4, and 5, and will generate the block device corresponding to volume 3 (e.g., / dev / sdba), volume 4 (e.g., / dev / sdbb), and volume 5 (e.g., / dev / sdbc) on server B.

[0021] Subsequently, upon detecting that the storage system has started, the server automatically establishes an association with the storage system's volume. After the association is established, the server's Small Computer System Interface (SCSI) kernel module automatically initiates instructions to generate a block device corresponding to the volume. In other words, after the block device is generated, the server can use it to write or read data from the volume corresponding to the block device. That is, the server can indirectly access the volume corresponding to the block device through the block device.

[0022] For example, such as Figure 2 As shown, a server can establish a connection with a storage system volume via a Fibre Channel (FC) switch. Taking the association between server A and storage system volume 0 as an example, port M of server A can be connected to port N of volume 0 on the storage system via an FC switch. With a connection established between port M of server A and port N of volume 0 on the storage system, the server can create a block device ( / dev / sdaa) corresponding to volume 0 and perform read and write operations on volume 0 through this block device ( / dev / sdaa). However, if the controller controlling the storage device needs a spare part replacement, or if the controller's microcode needs an upgrade, configuration recovery is required during the storage system restart process. The configuration recovery time depends on the size of the configuration, meaning it could take anywhere from tens of seconds to several minutes. Furthermore, volumes on the storage system may be unavailable until the configuration is fully restored; if volumes are unavailable, the storage system will not provide the server with volume attribute information (such as volume capacity information).

[0023] For a server's operating system, if it cannot obtain the volume's attribute information, it means the volume is unusable. Therefore, even if the server can automatically generate block devices after detecting that the storage system has started, the server cannot access the storage system through the block devices. In other words, the generated block devices are still unusable, thus affecting the continuity of upper-layer services.

[0024] Therefore, to ensure the normal operation of block devices, this application provides a method for generating block devices. In this method, a first information query instruction sent by a server is received. This first information query instruction triggers the storage system to query important information of at least one volume. Subsequently, the first information query instruction is repeatedly executed to obtain information query results and status codes, and these results and status codes are sent to the server until a port group query instruction is received from the server. Then, the port group information of at least one volume is queried, and this information is sent to the server. The port group information and important information of at least one volume are used to enable the server to generate block devices corresponding to each of the at least one volume.

[0025] In this embodiment, during the query of important information for at least one volume, the query duration is delayed using status codes to ensure that subsequent instructions are executed only after all volumes have been restored to their configurations. This delays the time it takes for the server to discover volumes, reduces the likelihood of block devices generated during volume unavailability becoming unusable, and ensures that the generated block devices can provide services to upper-layer services, thus guaranteeing the continuity of upper-layer services.

[0026] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0027] Embodiments of this application provide a method for generating a block device. Figure 3 This is a schematic flowchart illustrating a method for generating a block device according to an embodiment of this application.

[0028] like Figure 3 As shown, the method includes the following steps: S3001, the server sends a second information query command to the storage system.

[0029] The second information query command is used to trigger the storage system to query the device information of the storage devices within the system. The device information may include the vendor ID, product ID, and feature support status. Feature support status includes whether features such as Auto Contingent Allegiance (ACA) and Asymmetric Logical Unit Access (ALUA) are supported.

[0030] S3002, upon receiving a second information query instruction from the server, the storage system queries the device information of the storage devices in the storage system.

[0031] S3003, the storage system sends device information of the storage device to the server.

[0032] S3004: Upon receiving device information of the storage device from the storage system, the server sends a volume list read command to the storage system.

[0033] The volume list read command (report LUN) triggers the storage system to query the volume list, which includes at least one volume in the storage system that can be associated with the server. For example, see [link to relevant documentation]. Figure 1 Taking server A as an example, the volume list can include volume 0, volume 1 and volume 2 in the storage system.

[0034] S3005, upon receiving a volume list read instruction from the server, the storage system queries the volume list.

[0035] S3006, The storage system sends a volume list to the server.

[0036] S3007, upon receiving the volume list from the storage system, the server sends a first information query instruction to the storage system.

[0037] The first information query instruction is used to trigger the storage system to query important information for at least one volume. The important information is Vital Product Data (VPD). This VPD information may include a Universally Unique Identifier (UUID), serial number, etc.

[0038] S3008, upon receiving the first information query instruction sent by the server, the storage system executes the first information query instruction and obtains the information query result and status code.

[0039] The information query results can be the VPD information of the starting page or the VPD information of at least one volume. The starting page refers to the page with page ID 0, equivalent to the homepage or directory page. The status code indicates whether the storage system has been configured after power-on. Specifically, if the status code is the first status code, it means the storage system has been powered on but is still in the process of configuration recovery. If the status code is not the first status code, it means the storage system has been powered on and has been configured. For example, the first status code could be 062900.

[0040] Specifically, after receiving the aforementioned first information query instruction, the storage system can execute the first information query instruction, that is, query important information of at least one volume, thereby obtaining the information query results and status codes.

[0041] In one implementation, the execution process of the aforementioned first information query instruction may specifically include: the storage system querying the VPD information with page ID 0. This VPD information with page ID 0 may include all VPD information supported by the storage system. Subsequently, the storage system can further determine the VPD information of at least one volume using the VPD information with page ID 0.

[0042] However, this application delays the VPD information query time, ensuring that block devices are generated only after the volumes in the storage system have been restored to their configurations. If the volumes in the storage system have not been restored to their configurations, the VPD information for at least one volume will not be determined. In other words, before the volumes in the storage system are restored to their configurations, the storage system only performs the step of "querying the VPD information for page ID 0". Only if the volumes in the storage system are restored to their configurations will the storage system proceed to perform the step of "determining the VPD information for at least one volume".

[0043] Furthermore, during the execution of the first information query instruction, the storage system also generates a status code. That is, before the volume recovery configuration in the storage system, when the storage system queries the VPD information for page ID 0, it generates the aforementioned first status code to inform the server that the storage system is powered on but still in the configuration recovery process. Only when the volume recovery configuration in the storage system is complete will the storage system determine the VPD information for at least one volume and generate a status code different from the first status code to inform the server that the storage system is powered on and has recovered its configuration. This allows the server to continue generating block devices, reducing the likelihood of block devices generated during volume unavailability becoming unusable, ensuring that the generated block devices can normally provide services to upper-layer businesses, and guaranteeing the continuity of upper-layer services.

[0044] S3009, the storage system sends the information query results and status code to the server.

[0045] S3010: When the server receives the information query result and status code sent by the storage system, it determines whether the status code is the first status code.

[0046] In some instances, after receiving the above information query results and status code, the server can determine whether the status code is the first status code (062900). If the status code is the first status code, it indicates that the storage system has not fully recovered its configuration. Therefore, the server can execute step S3011 to continue sending the first information query instruction to the storage system, delaying the query time for volume information, and ensuring that subsequent instructions are executed only after all volumes have recovered their configuration. If the status code is not the first status code, it indicates that the storage system has completed its configuration recovery. Therefore, the server can execute step S3012 to continue sending the port group query instruction to the storage system, thereby generating the block device. This enables the generated block device to provide normal services to upper-layer services, ensuring the continuity of upper-layer services.

[0047] S3011, if the status code is the first status code, the server continues to send the first information query command to the storage system.

[0048] Specifically, after determining that the aforementioned status code is the first status code, the server can continue to send a first information query command to the storage system and return to execute steps S3008~S3010 above until the status code is no longer the first status code, at which point it sends a port group query command to the storage system. This delays the time it takes for the server to discover the volume, reduces the likelihood of block devices generated during volume unavailability becoming unusable, ensures that the generated block devices can normally provide services to upper-layer services, and guarantees the continuity of upper-layer services.

[0049] Furthermore, since the execution process of the aforementioned first information query instruction is a mechanism specific to the server's kernel module, the method of delaying the query time for volume information using status codes during the query process for important information of at least one volume can be adapted to all operating systems, maximizing the success rate of block device usage.

[0050] S3012, if the status code is not the first status code, the server sends a port group query command to the storage system.

[0051] The port group query command (mgmt protocol in) triggers the storage system to query the port group information of at least one volume. The port group information can include the port number used for the corresponding block device. It can be understood that a volume can correspond to one or more block devices. If a volume corresponds to multiple block devices, then the port group information can include multiple port numbers.

[0052] S3013, Upon receiving a port group query instruction from the server, the storage system queries the port group information of at least one volume.

[0053] S3014, The storage system sends port group information for at least one volume to the server.

[0054] S3015, upon receiving port group information for at least one volume from the storage system, the server sends a capacity query command to the storage system.

[0055] The capacity query command (read capacity) is used to trigger the storage system to query the capacity information of at least one volume.

[0056] S3016, Upon receiving a capacity query command from the server, the storage system queries the capacity information of at least one volume.

[0057] S3017, the storage system sends capacity information for at least one volume to the server.

[0058] S3018, upon receiving capacity information of at least one volume from the storage system, the server generates block devices corresponding to at least one volume based on the capacity information of at least one volume, the importance information of at least one volume, and the port group information of at least one volume.

[0059] Specifically, after obtaining the capacity information of at least one volume, the server can generate block devices corresponding to each of the at least one volume based on the capacity information, importance information, and port group information of the at least one volume. This ensures that the generated block devices can normally provide services to upper-layer services, guaranteeing the continuity of those services.

[0060] In one implementation, the storage system can use a timer to periodically process the first information query command and respond with a first status code, thereby triggering the server to retry the first information query command and extending the server's volume discovery time. Specifically, the storage system can include a configuration recovery thread and at least one information query thread. The configuration recovery thread acts as a main thread, used to detect whether the timer of the at least one information query thread has exited. The at least one information query thread acts as a sub-thread, used only to execute information query tasks for at least one volume. That is, the task processing speed of the information query thread is faster than that of the configuration recovery thread. It can be understood that one information query thread can handle information query tasks for one or more volumes. For example, taking a storage system with 4 information query threads and 12 volumes as an example, one information query thread can handle information query tasks for 3 volumes.

[0061] It's important to note that each thread in the storage system runs independently on a single processor (Central Processing Unit, CPU) core, and each thread has its own task list. Threads continuously process tasks on this list. This means each thread can independently handle tasks on different links, and data on a single link is processed independently on a single processor core. This allows the processor to process data on different links in parallel. A link is defined as the connection established between a port on the server and a port on the storage system. For example, please refer to [link to example]. Figure 2 A link can be a link generated when a connection is established between port M of server A and port N of volume 0 on the storage system.

[0062] In this application, considering that data in a shared memory area is allocated to different threads for processing, locking is required when a thread processes data in this shared area to ensure data security during operations. This significantly reduces data processing speed. Therefore, to improve data processing speed, serializing data on the same thread can reduce the use of resource locks, thereby increasing data processing speed.

[0063] In some embodiments, such as Figure 4 As shown, the timed processing procedure for the aforementioned first information query instruction may specifically include: S401 registers the port corresponding to each information query thread to the storage system.

[0064] S402 receives the first information query instruction sent by the server through the port corresponding to the information query thread.

[0065] S403, add the first information query instruction to the task queue of the information query thread.

[0066] S404, a timer to start the information query thread.

[0067] The timer duration for the information query thread can be preset according to actual conditions. In this application, considering that the timeout for the first information query instruction in all operating systems is a first preset time (e.g., 6 seconds), the timer duration for the information query thread is set to a second preset time (e.g., 3 seconds, 2 seconds) to maximize the number of executions of the first information query instruction. The first preset time is an integer multiple of the second preset time (e.g., double, triple, etc.). That is, if the information query thread does not find the volume's VPD information within the second preset time, it has one more opportunity to query the volume's VPD information again. This improves the success rate of information queries and facilitates the subsequent rapid generation of block devices.

[0068] S405 executes the first information query instruction periodically according to the timer setting of the information query thread, and obtains the information query result and status code.

[0069] Specifically, the storage system can execute the first information query command once every set interval of the timer for the information query thread. This enables timely querying of volume information, meaning that the volume's VPD information can be retrieved promptly during configuration recovery, facilitating the subsequent rapid generation of block devices. Simultaneously, it can generate a first status code promptly even if configuration recovery has not yet occurred, informing the server that the storage system is powered on but still in the process of configuration recovery. This allows the server to continue sending the first information query command, thus delaying the time it takes for the server to discover the volume.

[0070] In one implementation, the storage system can periodically query critical information from the starting page. In response to a power-on event, the storage system can generate a first status code. Then, the storage system can send the critical information from the starting page and the first status code to the server. Subsequently, the storage system can receive and repeatedly execute the first information query command from the server until the status code is no longer the first status code, at which point it continues to receive port group query commands from the server. In this way, by generating different status codes, the server is triggered to resend the information query command, thereby delaying the server's volume discovery time and providing a foundation for better subsequent block device generation.

[0071] In another implementation, after retrieving critical information from the starting page of the storage system, the storage system can further determine critical information for at least one volume based on that information. Furthermore, in response to a configuration recovery event, the storage system can generate a second status code, which differs from the first status code. Afterward, the storage system can directly receive sent port group query commands.

[0072] S406 sends the information query results and status codes to the server through the port corresponding to the information query thread.

[0073] S407, in response to a configuration recovery event, starts a timer for the configuration recovery thread.

[0074] Specifically, upon detecting a configuration recovery event, the storage device can start a timer for the configuration recovery thread. The configuration recovery event indicates that at least one volume of the storage system has established an association with the server. The timer for the configuration recovery thread starts earlier than the start time of at least one information query thread.

[0075] The timer duration for the configuration recovery thread can be preset according to actual conditions. In this application, considering that the timeout for the second information query instruction in all operating systems is a third preset time (e.g., 20 seconds), the timer duration for the configuration recovery thread is set to the third preset time to ensure that the block device can be successfully generated to the greatest extent possible. That is, if the configuration recovery thread does not find the volume's VPD information within the third preset time, it will not execute subsequent instructions, that is, it will not execute the port group query instruction and the capacity query instruction.

[0076] S408 checks whether the timers of each information query thread have exited within the set duration of the timer configured for the recovery thread.

[0077] Whether the timer for the information query thread exits is determined based on whether the volume corresponding to the information query thread has been restored to its configuration. Specifically, if all volumes corresponding to the information query thread have been restored to their configuration, the storage system can determine that the timer for the information query thread has exited. However, if the volumes corresponding to the information query thread have not been restored to their configuration, the storage system can determine that the timer for the information query thread has not exited.

[0078] In some embodiments, after starting the timer for the configuration recovery thread, the storage system can detect whether the timers for each information query thread have exited within the set duration of the timer for the configuration recovery thread. If it is detected that the timers for all information query threads have exited, it indicates that all volumes in the volume list have been restored to configuration and can provide services externally. Therefore, the storage system can execute step S409 to continue executing subsequent instructions until the block devices corresponding to each volume in the volume list are generated. If it is detected that the timers for any information query thread have not exited, it indicates that some volumes in the storage system have not been restored to configuration. Therefore, the storage system can execute step S411 and stop executing the block device generation operation, that is, it will no longer execute the port group query instruction and the capacity query instruction.

[0079] S409: When it is detected that the timers of all information query threads have exited, the port group query command is added to the task queue of each information query thread.

[0080] S410 controls each information query thread and executes port group query commands.

[0081] Specifically, after confirming that all timers for the information query threads have exited, the storage system can continue to control each information query thread to execute port group query commands. This delays the execution time of the port group query commands, ensuring that they are executed only after each volume has been reconfigured. This reduces the likelihood of the generated block devices becoming unusable due to the storage system executing subsequent commands before the volumes have been reconfigured, thus ensuring that the generated block devices can provide normal services to upper-layer applications and guaranteeing the continuity of those services.

[0082] S411: If it is detected that the timer of any information query thread has not exited, the block device generation operation is not performed.

[0083] In this application, considering that the connection establishment time between the server and the storage system may differ, if the connection is established earlier, the volume configuration recovery speed may be faster. Therefore, after confirming that the timer of any information query thread has not exited, the storage system can stop executing the block device generation operation, that is, it will no longer execute port group query commands and capacity query commands. This reduces unnecessary resource waste and improves system resource utilization.

[0084] In other embodiments, the storage system may not perform step S411 as described above. Instead, the storage system may start the timer of the configuration recovery thread multiple times to increase the waiting time for configuration recovery. For example, Figure 5 As shown, the timed processing procedure for the aforementioned first information query instruction may further include: S412, if it is detected that the timer of any information query thread has not exited, determine whether the number of times the timer of the configuration recovery thread has been started has reached the preset number of times.

[0085] In some embodiments, considering that the connection establishment time between the server and the storage system may differ, if the connection establishment time between the server and the storage system is earlier, the volume configuration recovery speed may also be later. Therefore, after determining that the timer of any information query thread has not exited, the storage system can start the timer of the information query thread multiple times until all volumes in the storage system have completed configuration recovery and can provide services externally, before exiting the timer of the configuration recovery thread.

[0086] Optionally, the storage system can determine whether the timer for the configuration recovery thread has been started multiple times. If the timer has been started multiple times, it indicates that the volume in the storage system is unlikely to recover its configuration. Therefore, the storage system can execute step S413 to stop the block device generation operation, i.e., stop executing the port group query command and capacity query command. If the timer for the configuration recovery thread has not been started multiple times, it indicates that the volume in the storage system is likely to recover its configuration. Therefore, the storage system can execute step S414 to restart the timer for the configuration recovery thread and continue waiting for the volume in the storage system to perform configuration recovery.

[0087] The preset number of startups can be set according to actual needs. For example, the preset number of startups can be 7 times, 6 times, etc., without any specific limitation.

[0088] S413: If the number of times the timer for configuring the recovery thread is started reaches the preset number of starts, the block device generation operation will not be performed.

[0089] Specifically, once the timer for configuring the recovery thread has been started a preset number of times, the storage system can choose not to perform block device generation operations. This reduces unnecessary resource waste and improves system resource utilization.

[0090] S414: If the number of times the timer for configuring the recovery thread has been started has not reached the preset number of times, restart the timer for configuring the recovery thread.

[0091] Specifically, after determining that the timer for configuring the recovery thread has not reached the preset number of starts, the storage system can restart the timer for configuring the recovery thread and return to the execution of step S408 above. This reduces the likelihood of block devices becoming unusable due to timer settings being too short, maximizing the guarantee of normal block device operation.

[0092] It should be noted that the embodiments of this disclosure may include multiple steps. For ease of description, these steps are numbered, but these numbers are not a limitation on the execution time slots or execution order between the steps; these steps can be implemented in any order, and the embodiments of this disclosure do not limit this.

[0093] Corresponding to the block device generation method described above, this disclosure also proposes a block device generation apparatus. Since the apparatus embodiments of this disclosure correspond to the method embodiments described above, details not disclosed in the apparatus embodiments can be referred to the method embodiments described above, and will not be repeated here.

[0094] Figure 6 This is a schematic diagram of the structure of a block device generation apparatus provided in an embodiment of the present disclosure, such as... Figure 6 As shown, it includes: an instruction receiving unit 61, an instruction execution unit 62, and an information sending unit 63.

[0095] The instruction receiving unit 61 is used to receive a first information query instruction sent by the server; wherein the first information query instruction is used to trigger the storage system to query important information of at least one volume; The instruction execution unit 62 is used to repeatedly execute the first information query instruction, obtain the information query result and status code, and send the information query result and status code to the server until it receives the port group query instruction sent by the server. The information sending unit 63 is used to query the port group information of at least one volume and send the port group information of at least one volume to the server; wherein the port group information of at least one volume and the important information of at least one volume are used to enable the server to generate block devices corresponding to at least one volume respectively.

[0096] Furthermore, in one possible implementation of this embodiment, such as Figure 6 As shown, the instruction receiving unit 61 is also used to receive the first information query instruction sent by the server through the port corresponding to each information query thread; Add the first information query instruction to the task queue of each information query thread; Start the timers for each information query thread; According to the timer settings of each information query thread, the first information query instruction is executed periodically to obtain the information query results and status codes.

[0097] Furthermore, in one possible implementation of this embodiment, such as Figure 6 As shown, the instruction receiving unit 61 is also used to query important information of the starting page in the storage system; In response to the power-on event of the storage system, a first status code is generated; Send important information about the start page and the first status code to the server; Receive the first information query instruction sent by the server and repeatedly execute the first information query instruction until the status code is not the first status code; Receive port group query command sent by the server.

[0098] Furthermore, in one possible implementation of this embodiment, such as Figure 6 As shown, the instruction receiving unit 61 is also used to start a timer for the configuration recovery thread in response to a configuration recovery event; wherein, the configuration recovery event is used to indicate that at least one volume of the storage system has established an association with the server; Within the set duration of the timer configured for the recovery thread, check whether the timer for each information query thread has exited; If it is detected that the timers of all information query threads have exited, add the port group query command to the task queue of each information query thread; Control each information query thread to execute port group query commands.

[0099] Furthermore, in one possible implementation of this embodiment, such as Figure 6 As shown, the instruction receiving unit 61 is also used to not perform the block device generation operation if it is detected that the timer of any information query thread has not exited. If it is detected that the timer of any information query thread has not exited, the timer for starting the configuration recovery thread will be executed repeatedly until the number of times the timer for starting the configuration recovery thread reaches the preset number of times, and the block device generation operation will not be executed.

[0100] Furthermore, in one possible implementation of this embodiment, such as Figure 6 As shown, the instruction receiving unit 61 is also used to receive a second information query instruction sent by the server; The instruction execution unit 62 is also used to query the device information of the storage device in the storage system and send the device information of the storage device to the server; The instruction receiving unit 61 is also used to receive volume list read instructions sent by the server; The instruction execution unit 62 is also used to query the list of volumes in the storage system that have established an association with the server, and send the list of volumes to the server; wherein the list of volumes includes at least one volume in the storage system that can establish an association with the server.

[0101] Furthermore, in one possible implementation of this embodiment, such as Figure 6 As shown, the instruction receiving unit 61 is also used to receive a capacity query instruction sent by the server; wherein, the capacity query instruction is used to trigger the storage system to query the capacity information of at least one volume; The instruction execution unit 62 is also used to query the capacity information of at least one volume and send the capacity information of at least one volume to the server; wherein the capacity information of at least one volume is used to generate block devices corresponding to at least one volume respectively.

[0102] Figure 7 This is a schematic diagram of the structure of another block device generation apparatus provided in an embodiment of the present disclosure, as shown below. Figure 7 As shown, it includes: an instruction sending unit 71, an information receiving unit 72, and a block device generation unit 73.

[0103] The instruction sending unit 71 is used to send a first information query instruction to the storage system; wherein, the first information query instruction is used to trigger the storage system to query important information of at least one volume; Information receiving unit 72 is used to receive information query results and status codes sent by the storage system; The instruction sending unit 71 is also used to resend the first information query instruction to the storage system when the status code is the first status code, until the status code is no longer the first status code; Send a port group query command to the storage system; wherein, the port group query command is used to trigger the storage system to query the port group information of at least one volume; The information receiving unit 72 is also used to receive port group information of at least one volume sent by the storage system; The block device generation unit 73 is used to generate block devices corresponding to at least one volume based on the important information of at least one volume and the port group information of at least one volume.

[0104] Furthermore, in one possible implementation of this embodiment, such as Figure 7 As shown, the instruction sending unit 71 is further configured to send a second information query instruction to the storage system in response to the startup operation of the storage system; wherein, the second information query instruction is configured to trigger the storage system to query the device information of the storage devices in the storage system; The information receiving unit 72 is also used to receive device information of the storage device sent by the storage system; The instruction sending unit 71 is further configured to send a volume list read instruction to the storage system; wherein, the volume list read instruction is used to trigger the storage system to query the volume list, and the volume list includes at least one volume in the storage system that can establish an association with the server; The information receiving unit 72 is also used to receive the volume list sent by the storage system.

[0105] Furthermore, in one possible implementation of this embodiment, such as Figure 7 As shown, the instruction sending unit 71 is further configured to send a capacity query instruction to the storage system; wherein the capacity query instruction is used to trigger the storage system to query the capacity information of the at least one volume; The information receiving unit 72 is also used to receive capacity information of at least one volume sent by the storage system; The block device generation unit 73 is further configured to generate block devices corresponding to the at least one volume based on the capacity information of the at least one volume, the importance information of the at least one volume, and the port group information of the at least one volume.

[0106] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of this embodiment, and the principle is the same, so it is not limited in this embodiment.

[0107] For a description of the features in the embodiment corresponding to the block device generation apparatus, please refer to the relevant description in the embodiment corresponding to the block device generation method, which will not be repeated here.

[0108] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the block device generation method embodiments described above.

[0109] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described block device generation method embodiments when running.

[0110] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0111] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described block device generation method embodiments.

[0112] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the block device generation method embodiments described above.

[0113] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0114] The foregoing has provided a detailed description of a method for generating a block device, a storage system, and a server provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for generating a block device, characterized in that, Applied to a storage system, the storage system including at least one volume capable of establishing an association with a server, the method includes: The system receives a first information query instruction sent by the server; wherein the first information query instruction is used to trigger the storage system to query important information of the at least one volume. Repeatedly execute the first information query instruction to obtain the information query result and status code, and send the information query result and status code to the server until a port group query instruction sent by the server is received; The port group information of the at least one volume is queried, and the port group information of the at least one volume is sent to the server; wherein, the port group information of the at least one volume and the important information of the at least one volume are used to enable the server to generate block devices corresponding to the at least one volume respectively.

2. The method according to claim 1, characterized in that, The storage system includes at least one information query thread, and receiving the first information query instruction sent by the server includes: The first information query instruction sent by the server is received through the port corresponding to each information query thread. Add the first information query instruction to the task queue of each information query thread; Start the timer for each of the information query threads; The step of repeatedly executing the first information query instruction to obtain the information query result and status code includes: According to the timer settings of each information query thread, the first information query instruction is executed periodically to obtain the information query result and the status code.

3. The method according to claim 2, characterized in that, The step of periodically executing the first information query instruction to obtain the information query result and the status code includes: Query important information about the starting page in the storage system; In response to a power-on event of the storage system, a first status code is generated; The process of sending the information query result and the status code to the server until receiving the port group query instruction sent by the server includes: Send the important information of the starting page and the first status code to the server; Receive the first information query instruction sent by the server, and repeatedly execute the first information query instruction until the status code is not the first status code; Receive the port group query command sent by the server.

4. The method according to claim 2, characterized in that, The storage system further includes configuring a recovery thread, and the method further includes: In response to a configuration recovery event, a timer for the configuration recovery thread is started; wherein the configuration recovery event is used to indicate that at least one volume of the storage system has established an association with the server; Within the set duration of the timer for the configured recovery thread, check whether the timer for each information query thread has exited; If it is detected that the timers of all information query threads have exited, the port group query instruction is added to the task queue of each information query thread; Control each information query thread to execute the port group query command.

5. The method according to claim 4, characterized in that, The method further includes: If it is detected that the timer of any information query thread has not exited, the block device generation operation will not be performed; If it is detected that the timer of any information query thread has not exited, the timer for starting the configuration recovery thread is repeatedly executed until the number of times the timer for starting the configuration recovery thread reaches the preset number of times, and the block device generation operation is not executed.

6. The method according to any one of claims 1-5, characterized in that, Before receiving the first information query instruction sent by the server, the method further includes: Receive the second information query instruction sent by the server; Query the device information of the storage devices in the storage system, and send the device information of the storage devices to the server; Receive the volume list read instruction sent by the server; Query the list of volumes in the storage system that are associated with the server, and send the list of volumes to the server; wherein the list of volumes includes at least one volume in the storage system that can be associated with the server.

7. The method according to any one of claims 1-5, characterized in that, After querying the port group information of the at least one volume and sending the port group information of the at least one volume to the server, the method further includes: The system receives a capacity query instruction sent by the server; wherein the capacity query instruction is used to trigger the storage system to query the capacity information of at least one volume. The capacity information of the at least one volume is queried, and the capacity information of the at least one volume is sent to the server; wherein the capacity information of the at least one volume is used to enable the server to generate block devices corresponding to the at least one volume respectively.

8. A method for generating a block device, characterized in that, Applied to a server, the server being able to establish an association with at least one volume in a storage system, the method includes: Send a first information query instruction to the storage system; wherein the first information query instruction is used to trigger the storage system to query important information of at least one volume; Receive the information query results and status codes sent by the storage system; If the status code is the first status code, the first information query instruction is resent to the storage system until the status code is no longer the first status code; Send a port group query command to the storage system; wherein the port group query command is used to trigger the storage system to query the port group information of the at least one volume; Receive port group information of at least one volume sent by the storage system; Based on the important information of the at least one volume and the port group information of the at least one volume, generate block devices corresponding to the at least one volume respectively.

9. The method according to claim 8, characterized in that, Before sending the first information query instruction to the storage system, the method further includes: In response to the startup operation of the storage system, a second information query instruction is sent to the storage system; wherein, the second information query instruction is used to trigger the storage system to query the device information of the storage devices in the storage system; Receive device information of the storage device sent by the storage system; Send a volume list read instruction to the storage system; wherein, the volume list read instruction is used to trigger the storage system to query the volume list, the volume list including at least one volume in the storage system that can establish an association with the server; Receive the volume list sent by the storage system.

10. The method according to claim 8 or 9, characterized in that, After receiving the port group information of the at least one volume sent by the storage system, the method further includes: Send a capacity query command to the storage system; wherein the capacity query command is used to trigger the storage system to query the capacity information of the at least one volume; Receive capacity information of at least one volume sent by the storage system; The step of generating block devices corresponding to the at least one volume based on the important information and port group information of the at least one volume includes: Based on the capacity information of the at least one volume, the importance information of the at least one volume, and the port group information of the at least one volume, generate block devices corresponding to the at least one volume respectively.

11. A storage system, characterized in that, include: At least one processor; as well as A storage device communicatively connected to the at least one processor; wherein, The storage device stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the block device generation method according to any one of claims 1-7.

12. A server, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the block device generation method according to any one of claims 8-10.

Citation Information

Patent Citations

  • Query instruction processing method and device, electronic equipment and medium

    CN119166652A

  • Delay generation method and device of block device, storage system and storage medium

    CN120295669A

  • Server connection establishment over fibre channel using a block device access model

    US9591099B1