Storage volume management method, electronic device, storage medium and product
By creating a target host in the storage device and establishing mapping relationships, obtaining and managing the connection and multipath information of the target volume, the problem that cloud platforms cannot call storage supporting multipath devices is solved, and storage performance is improved.
Patent Information
- Application Number
- CN202510851588.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-24
AI Technical Summary
The cloud platform can only call the multipath command line that comes with the system, and cannot call the multipath equipment that is equipped with storage, affecting storage performance.
Create a target host in the storage device, establish a mapping relationship between the target volume and the target host, obtain the connection information of the target volume and the multi-path command line information, and manage the target volume based on this information.
It realizes the multi-path equipment that calls storage supporting facilities, and improves the storage performance of the cloud platform.
Smart Images

Figure CN120371220B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud platform technology, and in particular to storage volume management methods, electronic devices, storage media, and products. Background Art
[0002] In related storage volume management solutions, cloud platforms use built-in multipathing software to manage commercial storage from all storage vendors. Even if users install proprietary multipathing software on cloud platform compute nodes, the cloud platform will only invoke the built-in multipathing command line and will not be able to access the storage-specific multipathing devices, which can affect the cloud platform's storage performance. Summary of the Invention
[0003] This application provides a storage volume management method, electronic device, storage medium and product to at least solve the problem in the related art that the cloud platform can only call the multi-path command line provided by the system, but cannot call the multi-path device supporting the storage, thereby affecting the storage performance of the cloud platform.
[0004] This application provides a storage volume management method, including:
[0005] Create a target host in the storage device;
[0006] Search the target volume in the storage device according to the volume ID and create a mapping relationship between the target volume and the target host;
[0007] In response to the mapping relationship being successfully created, acquiring target information of the target volume, the target information including connection information and multipath command line information;
[0008] Manage the target volume based on the connection information and multipath command line information.
[0009] The present application also provides a storage volume management device, comprising:
[0010] A first creating unit, configured to create a target host in the storage device;
[0011] The second creating unit is configured to search the target volume in the storage device according to the volume identifier and create a mapping relationship between the target volume and the target host;
[0012] an acquiring unit, configured to acquire target information of a target volume in response to successful creation of the mapping relationship, the target information including connection information and multipath command line information;
[0013] The management unit is used to manage the target volume based on the connection information and the multipath command line information.
[0014] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned storage volume management methods when executing the computer program.
[0015] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned storage volume management methods are implemented.
[0016] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above storage volume management methods when executed by a processor.
[0017] The present application includes creating a target host in a storage device; searching for a target volume in the storage device according to a volume identifier, and creating a mapping relationship between the target volume and the target host; in response to successful creation of the mapping relationship, obtaining target information of the target volume, the target information including connection information and multipath command line information; and managing the target volume based on the connection information and multipath command line information. This solves the technical problem in related solutions that a cloud platform can only call the multipath command line provided by the system and cannot call the multipath device supporting the storage, thereby affecting the storage performance of the cloud platform. This achieves the technical effect of calling the multipath device supporting the storage and improving the storage performance of the cloud platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A schematic diagram of a process for mounting a volume on a cloud platform provided in an embodiment of the present application;
[0020] Figure 2 A flowchart of a storage volume management method provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the structure of a storage volume management device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0023] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0024] In order to facilitate those skilled in the art to better understand the technical solutions described in the embodiments of the present disclosure, the technical terms in the embodiments of the present disclosure are explained as follows before introducing the embodiments of the present disclosure.
[0025] Input / Output (IO): refers to the data exchange process between a computer system and external devices. In the storage field, I / O specifically refers to the data reading and writing operations between the host computer and the storage device.
[0026] Multipath refers to software that can send I / O requests over multiple network paths. It differs from single-path software in that single-path software can only send I / O over a single network path, while multipath software can use multiple network paths simultaneously.
[0027] OpenStack is a cloud computing operating system that manages a large amount of computing, storage, and network resources in a data center.
[0028] Nova service is a service in the OpenStack cloud platform responsible for the lifecycle management of virtual machine instances and the scheduling of computing resources.
[0029] The Cinder service is a volume management service of the OpenStack cloud platform, which can provide data persistence for virtual machine instances.
[0030] The os_brick service is dedicated to handling the connection and discovery of storage devices. It is responsible for communicating with different types of storage backends, establishing connections, and providing storage devices for use by Nova instances.
[0031] Multipath refers to the native multipath software of the Linux system.
[0032] Redundant Array of Inexpensive Disks (RAID) improves storage redundancy by combining multiple independent physical hard disks in different ways to form a logical hard disk.
[0033] Due to OpenStack's strong scalability and ease of use, more and more enterprises and organizations are leveraging OpenStack to build private clouds, establish cloud hosts, and deploy their businesses. As business scale expands, enterprises need to store large amounts of data. Therefore, they purchase commercial storage and connect it to the OpenStack cloud platform. Using OpenStack, they create data volumes within the storage and mount them on cloud hosts for use.
[0034] To ensure data security within cloud platform virtual machines, OpenStack typically uses multipathing software to utilize storage volumes. This software significantly improves storage system reliability, performance, and manageability through redundancy, load balancing, and intelligent fault recovery.
[0035] Multipathing software is categorized as either native system multipathing software or proprietary software developed by storage vendors. Proprietary multipathing software, such as PowerPath from a US company, is often proprietary, while native operating system multipathing software, such as Linux's MultiPath and Windows' MultiPath I / O (MPIO), is more versatile.
[0036] Compared with the system's built-in multipathing software, self-developed multipathing software has the following advantages:
[0037] Deep hardware integration optimizes vendor-specific storage devices, leveraging hardware features (such as caching and RAID strategies) to improve performance and stability. Support for vendor-specific protocols enables more efficient communication. A more optimized load balancing strategy tailored to storage needs: I / O is dynamically dispatched to the appropriate storage controller based on the I / O logical block addressing (LBA) address. Enhanced fault recovery: Faster path health detection enables timely recovery of failed paths.
[0038] Advanced feature support and storage virtualization support enable seamless integration with vendor virtualized storage solutions. Multi-protocol support allows for simultaneous management of protocols such as Fibre Channel (FC), Internet Small Computer System Interface (ISCSI), and Non-Volatile Memory Host Controller Interface Specification over Network Fabrics (NVMe-oF), adapting to complex storage architectures.
[0039] like Figure 1 As shown, Figure 1 A schematic diagram of the process of mounting volumes on a cloud platform provided in an embodiment of the present application includes: a user initiates a volume mount request, and mounts the storage volume to a virtual machine through a Nova API request. Nova notifies Cinder to prepare the volume, and Nova calls the Cinder API to trigger the Cinder volume mount process. In this process, Cinder returns the volume connection information, including the storage service port IP, the storage volume LUN ID and other information. Nova connects to the storage backend through os_brick. After Nova receives the volume connection information returned by Cinder, it calls os_brick to establish a connection with the storage device. In this process, multi-path related command lines are called to scan and aggregate the paths, and finally the multi-path device is discovered. Nova mounts the device to the virtual machine, and Nova attaches the multi-path device discovered in the previous step to the virtual machine instance.
[0040] In related storage volume management solutions, cloud platforms use built-in multipathing software to manage commercial storage from all storage vendors. Even if users install proprietary multipathing software on cloud platform compute nodes, the cloud platform will only invoke the built-in multipathing command line and will not be able to access the storage-specific multipathing devices, which can affect the cloud platform's storage performance.
[0041] The present application includes creating a target host in a storage device; searching for a target volume in the storage device according to a volume identifier, and creating a mapping relationship between the target volume and the target host; in response to successful creation of the mapping relationship, obtaining target information of the target volume, the target information including connection information and multipath command line information; and managing the target volume based on the connection information and multipath command line information. This solves the technical problem in related solutions that a cloud platform can only call the multipath command line provided by the system and cannot call the multipath device supporting the storage, thereby affecting the storage performance of the cloud platform. This achieves the technical effect of calling the multipath device supporting the storage and improving the storage performance of the cloud platform.
[0042] The present invention provides a storage volume management method that can be applied to iSCSI / FC links. This application uses iSCSI links as an example to describe the implementation process, and FC links are similar. The method can be executed by specific components and services in the cloud platform.
[0043] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0044] Figure 2 A flowchart of a storage volume management method provided by an embodiment of the present disclosure is provided.
[0045] like Figure 2 As shown, the method comprises the following steps:
[0046] Step 201, creating a target host in a storage device;
[0047] In some embodiments, a secure protocol may be used to connect the cloud platform and the storage device, and a target host may be created in the storage device, with the name of the target host being associated with the name of the computing node.
[0048] In some embodiments, the security protocol used in this application refers to the Secure Shell (SSH) protocol, which is used to establish a secure remote connection channel within an insecure network. It encrypts transmitted data using encryption technology to prevent eavesdropping, tampering, or forgery. It is commonly used in scenarios such as remote login, file transfer, and port forwarding.
[0049] In some embodiments, the storage device refers to the backend storage system, the target host refers to an entity on the storage device used to control access rights to the storage volume, and the computing node is simply a server running a virtual machine in the cloud platform, usually deployed with Nova services, etc.
[0050] In some embodiments, an SSH connection between the cloud platform and the storage device may be established through the OpenStack ssh_utils connection pool module.
[0051] In some embodiments, a target host named host-compute-node01 can be created in the storage device, which is consistent with the name of the computing node in the cloud platform; the ISCSI qualified name (IQN) of the computing node is added to the target host to complete the binding. Specifically, the target host can be created in the storage by calling the storage CLI command line; the name of the computing node where the OpenStack virtual machine is located can be passed through the initialize_connection interface to achieve the association between the name of the target host and the name of the computing node.
[0052] Step 202: Search the target volume in the storage device according to the volume identifier, and create a mapping relationship between the target volume and the target host;
[0053] In some embodiments, the volume identifier can be a universally unique identifier (UUID), a volume name, a logical unit number identifier (LUN ID), etc. The volume identifier is used to locate a specific storage volume. Specifically, the volume UUID can be passed through the initialize_connection parameter.
[0054] In some embodiments, the target volume refers to a storage volume that needs to be mounted for use by the virtual machine.
[0055] In some embodiments, the mapping relationship between the target volume and the target host is used to indicate which target host can access the target volume, ie, a binding is established between the LUN ID and the target host. For example, the LUN ID is 25, which is mapped to host-compute-node01.
[0056] Step 203: In response to the successful creation of the mapping relationship, target information of the target volume is obtained, the target information including connection information and multipath command line information;
[0057] In some embodiments, after the mapping relationship between the target volume and the target host is successfully created, a Cinder driver in the cloud platform obtains target information of the target volume.
[0058] In some embodiments, the connection information is used to construct parameters required for ISCSI login, and the multipath command line information is used to construct a multipath device.
[0059] In some embodiments, the connection information in the storage device can be obtained by calling a storage CLI command line.
[0060] In some embodiments, the target information of the target volume can be returned in a predetermined format, which is: {'target_iqns': [],}'target_portals': [],'target_luns': [],'multipath_commands': {'reconfig':'',
[0061] 'resize':'','addpath':'','delpath':'','delmap':''}. Among them, target_iqns is a list that contains the IQN information of each node. target_portals is a list that contains the IP and port of all business ports (for example, 1.1.1.1:3260). target_luns is a list that contains the Lun ids allocated to the volume. reconfig represents the command to reconfigure multipath in self-developed multipath. resize represents the command to re-identify the volume size in self-developed multipath. addpath represents the command to add a path device in self-developed multipath. delpath represents the command to delete a path device in self-developed multipath. delmap represents the command to delete a multipath device in self-developed multipath.
[0062] Step 204: Manage the target volume based on the connection information and the multipath command line information.
[0063] In some embodiments, managing the target volume refers to a series of control and maintenance operations performed on the target volume on the computing node, which can ensure that the target volume can be correctly identified, used, released and the capacity can be dynamically adjusted. Managing the target volume includes but is not limited to mounting, unmounting and expanding the target volume.
[0064] In some embodiments, by managing the target volume based on connection information and multi-path command line information, dynamic identification of storage paths, capacity updates, fault switching, and multi-path status synchronization can be achieved, thereby improving the high availability and flexibility of storage access in the cloud platform.
[0065] The present application includes creating a target host in a storage device; searching for a target volume in the storage device according to a volume identifier, and creating a mapping relationship between the target volume and the target host; in response to successful creation of the mapping relationship, obtaining target information of the target volume, the target information including connection information and multipath command line information; and managing the target volume based on the connection information and multipath command line information. This solves the technical problem in related solutions that a cloud platform can only call the multipath command line provided by the system and cannot call the multipath device supporting the storage, thereby affecting the storage performance of the cloud platform. This achieves the technical effect of calling the multipath device supporting the storage and improving the storage performance of the cloud platform.
[0066] In some embodiments, in response to the mapping relationship being successfully created, obtaining target information of the target volume includes:
[0067] In response to the successful creation of the mapping relationship, a computing service module of the cloud platform is used to perform a scanning operation on the disk device;
[0068] In some embodiments, the storage device has mapped the target volume to a target host, so that the host can access the target volume.
[0069] In some embodiments, the cloud platform's compute service module is the Nova module. Before using the Nova module to scan disk devices, the Nova module inherits the BaseLinuxConnector class from the OpenStack os_brick module and overrides the connect_volume method. The Nova module calls this method to connect and scan the disk device. After the storage client maps the target volume to the target host, the compute node must rescan the device to discover and use it.
[0070] In some embodiments, the scanning operation on the disk devices is performed to discover newly connected storage devices.
[0071] In response to the disk device scanning operation ending, target information of the target volume is acquired.
[0072] In some embodiments, after the scan operation is completed, the system generates a new device file and obtains the target information of the target volume through the OpenStackos_brick module.
[0073] In some embodiments, in response to the successful creation of the mapping relationship, the computing service module of the cloud platform is used to perform a scanning operation on the disk device; in response to the completion of the disk device scanning operation, the target information of the target volume is obtained, and the path identification, device binding and multi-path mapping update of the target volume can be realized, thereby ensuring that the target volume can be stably mounted on the computing node and can be normally accessed by the virtual machine.
[0074] In some embodiments, in response to the disk device scanning operation ending, obtaining target information of the target volume includes:
[0075] In response to the disk device scanning operation being completed, determining whether a volume management request from the cloud platform is received, the volume management request including a volume mount request, a volume unmount request, and a volume expansion request;
[0076] In some embodiments, a cloud platform volume management request refers to an instruction initiated by a user or cloud platform service to operate on a storage volume. A volume mount request is a request to mount a specified volume to a virtual machine instance, making it accessible. A volume unmount request is a request to unmount a volume from a virtual machine instance and disconnect it from the compute node. A volume expansion request is a request to increase the capacity of an existing volume, often used to meet data growth needs.
[0077] If a volume management request is received, the connection attribute parameters are parsed to obtain target information of the target volume.
[0078] In some embodiments, the connection property parameter is a set of structured data returned to Nova by the Cinder driver, which is used to describe how to connect to the target volume. In this application, it refers to the connection_properties parameter. The connection_properties parameter is parsed to obtain the target information of the volume, that is, the connection information of the volume and the command line of the self-developed multi-path.
[0079] In some embodiments, managing the target volume based on the connection information and the multipath command line information includes:
[0080] Based on the connection information, a plurality of triplet arrays are determined, where the triplet arrays are used for Internet Small Computer System Interface login;
[0081] In some embodiments, a triplet array refers to a set of three elements, which is used to uniquely identify an ISCSI login operation.
[0082] In some embodiments, in OpenStack, connection_properties contains information of multiple paths, and os-brick extracts multiple ('target_portal', 'target_iqn', 'target_lun') combinations therefrom; each connection information corresponds to a three-element array.
[0083] Get the session ID corresponding to the ternary array;
[0084] In some embodiments, the session identifier refers to a unique number used to identify an iSCSI session in the iSCSI protocol. Each time an iSCSI target is successfully logged in, the system assigns it a unique session identifier.
[0085] Manage the target volume based on the session ID and multipath command line information.
[0086] In some embodiments, the target volume is managed based on the session identifier and multipath information, including building a multipath device, path status monitoring, load balancing scheduling, and automatic failover.
[0087] In some embodiments, by determining multiple triplet arrays based on connection information, the triplet arrays are used for Internet Small Computer System Interface login; obtaining a session identifier corresponding to the triplet array; and managing the target volume based on the session identifier and multipath command line information, the reliability and performance of storage access can be improved.
[0088] In some embodiments, obtaining a session identifier corresponding to the ternary array includes:
[0089] Start the target thread corresponding to the connection information;
[0090] In some embodiments, the target thread corresponding to the connection information refers to multiple threads that can be started in the OpenStack os_brick module.
[0091] Based on the target thread, the ternary array is used to log in to the Internet Small Computer System Interface;
[0092] In some embodiments, each thread performs ISCSI login according to a triple array, and the specific command is iSCSIadm-m node-T{target_iqn}-p{target_portal}-l, where target_iqn and target_portal are the information obtained by the aforementioned cinder driver from the storage device.
[0093] In response to the login using the ternary array being completed, a login session is established and a session identifier corresponding to the ternary array is obtained.
[0094] In some embodiments, a login session refers to a successful iSCSI connection instance.
[0095] In some embodiments, a target thread corresponding to the connection information is started; based on the target thread, an Internet Small Computer System Interface login is performed using a ternary array; in response to the completion of the login using the ternary array, a login session is established and a session identifier corresponding to the ternary array is obtained for subsequent use in multi-path management, path monitoring, and fault switching operations.
[0096] In some embodiments, managing the target volume based on the session identifier and the multipath command line information includes:
[0097] Determining device identification information based on the session identifier, where the device identification information includes at least host adapter information;
[0098] In some embodiments, the device identification information refers to the block device information associated with the session in the operating system. The device identification information may also include a channel number, a target number, a lun number, etc. The host adapter information refers to the host number.
[0099] In some embodiments, specific device identification information, namely, HCTL information (host, channel, target, lun), can be obtained from the / sys / class / iscsi_host / host / device / session directory.
[0100] Based on the host adapter information and connection information, scan the compute node to generate the target path device;
[0101] In some embodiments, a disk scan operation refers to the system rescanning the iSCSI bus to discover newly connected storage devices.
[0102] In some embodiments, the target path device refers to all scanned path devices.
[0103] In some embodiments, a target path device, ie, an sdx path device, is generated by scanning the disk in the computing node according to the host information and target_lun. The specific command is: echo '- - {target_lun}' / sys / class / scsi_host / host{host}
[0104] / scan.
[0105] Based on the multipath command line information, add target path devices to manage the target volume.
[0106] In some embodiments, the sdx device is added to the multipath topology by executing the addpath command in the multipath command line information.
[0107] In some embodiments, device identification information is determined based on a session identifier, and the device identification information includes at least host adapter information; based on the host adapter information and connection information, a disk scan operation is performed on the computing node to generate a target path device; based on the multipath command line information, a target path device is added to manage the target volume, and the newly identified path can be added to the existing multipath device to enable it to participate in I / O path selection.
[0108] In some embodiments, the BaseLinuxConnector class of the OpenStack os_brick module is inherited, and the disconnect_volume method is rewritten. This method is called by the OpenStack Nova module to delete the multipath device and path device in the computing node.
[0109] In some embodiments, after obtaining the session identifier corresponding to the ternary array, the storage volume management method further includes:
[0110] Based on the session identifier, obtain the first path device under the login session;
[0111] In some embodiments, the corresponding session identifier in the target host is obtained according to the above ternary array, which is recorded as s_id. All path devices under the session can be obtained through the / sys / class / scsi_host / host / device / session{s_id} / target / block directory.
[0112] In some embodiments, the first path device refers to one or more path devices identified in the session, such as / dev / sda, / dev / sdb, and / dev / sdc, which represent devices accessing the same logical unit through different paths.
[0113] determining a second path device from the first path devices based on the connection information;
[0114] In some embodiments, the second path devices refer to those path devices that belong to a multipath device.
[0115] In some embodiments, the second path device may be filtered from the first path device according to target_lun in the connection information.
[0116] Based on the multipath command line information, the first path device or the second path device is deleted to manage the target volume.
[0117] In some embodiments, the delpath command in the multipath command line information may be executed to remove the second path device from the multipath topology, and the delmap command in the multipath command line information may be executed to delete the first path device, ie, the multipath device.
[0118] In some embodiments, path management, failover, and resource recovery operations on the target volume can be implemented by obtaining the first path device under the login session based on the session identifier; determining the second path device from the first path device based on the connection information; and deleting the first path device or the second path device based on the multipath command line information.
[0119] In some embodiments, the BaseLinuxConnector class of the OpenStack os_brick module is inherited, and the extend_volume method is rewritten. This method is called by the OpenStack Nova module to dynamically refresh the capacity of a multipath device and a normal path device in a computing node.
[0120] In some embodiments, after obtaining the session identifier corresponding to the ternary array, the storage volume management method further includes:
[0121] determining a third path device corresponding to the ternary array;
[0122] In some embodiments, the third path device refers to a path device among all path devices, and a unique common path device (sdx) can be obtained by matching each triplet array from the / dev / disk / by-path directory.
[0123] Based on the third path device, determining device identification information corresponding to the third path device;
[0124] In some embodiments, for each common path device, the corresponding HCTL information (host, channel, target, lun) in the target host is obtained.
[0125] Based on the device identification information, the capacity of the third path device is refreshed, and based on the multipath command line information, the device information of the second path device is refreshed to manage the target volume.
[0126] In some embodiments, you can use echo 1 / sys / bus / scsi / drivers / sd / {host}:{channel}:{target}:
[0127] The {lun} / rescan command refreshes the capacity of each common path device. Refreshing the capacity of the third path device means notifying the operating system to re-read the device capacity information for target volume expansion.
[0128] In some embodiments, refreshing the device information of the second path device refers to notifying the multipath tool to rescan and update the path status to ensure accurate multipath device mapping, wherein the device information of the second path device may include mapping table information and capacity information.
[0129] In some embodiments, a third path device corresponding to the ternary array is determined; based on the third path device, device identification information corresponding to the third path device is determined; based on the device identification information, the capacity of the third path device is refreshed; and based on the multipath command line information, the device information of the second path device is refreshed, thereby realizing dynamic capacity expansion of the target volume and synchronous management of multipath status.
[0130] In some embodiments, after refreshing the capacity of the third path device based on the device identification information, the storage volume management method further includes:
[0131] Get the domain name information of the target volume;
[0132] In some embodiments, the domain name information of the target volume refers to a World Wide Name (WWN), and the WWN information of the target volume can be obtained by executing the / lib / udev / scsi_id --page 0x83 --whitelisted / dev / sdx command.
[0133] Based on the domain name information of the target volume, determine the soft link information corresponding to the domain name information;
[0134] In some embodiments, the soft link information refers to a symbolic link in a Linux system, typically located in the / dev / disk / by-path / or / dev / disk / by-id / directory. The soft link information is used to map the device path to a more readable name.
[0135] Parse the soft link information to obtain the name of the second path device.
[0136] In some embodiments, based on the domain name information of the target volume, the name of the second path device can be determined by parsing / dev / disk / by-id / dm-uuid-mpath-{WWN} in the host, and the actual device path can be obtained by reading the target path in the soft link.
[0137] In some embodiments, refreshing the device information of the second path device based on the multipath command line information includes:
[0138] Based on the multipath command line information, a first command and a second command are obtained, where the first command is a reconfiguration command and the second command is a target volume size re-identification command;
[0139] The mapping table information of the second path device is refreshed using the first command, or the capacity information of the second path device is refreshed using the second command.
[0140] In some embodiments, the reconfiguration command is used to notify the system to reload the configuration or refresh the device mapping table to ensure path status synchronization.
[0141] In some embodiments, the re-identify target volume size command is used to notify the operating system or multipath to refresh device capacity information after the volume is expanded.
[0142] In some embodiments, the host multipath mapping table (map) information may be refreshed by executing a reconfig command in the multipath command line information. The mapping table information includes information such as the number of paths, path status, and load balancing policy.
[0143] In some embodiments, the capacity information of the multipath device may be refreshed by executing a resize command in the multipath command line information.
[0144] In some embodiments, a first command and a second command are obtained based on multi-path command line information, where the first command is a reconfiguration command and the second command is a command for re-identifying the target volume size; the mapping table information of the second path device is refreshed using the first command, or the capacity information of the second path device is refreshed using the second command, so that the path status and capacity of the target volume can be synchronized and updated, thereby improving the availability and flexibility of storage access.
[0145] In some embodiments, the connection information includes a network protocol address, a unique identifier of the storage device, and a volume identifier assigned by the storage device to the target volume mapping.
[0146] In some embodiments, the network protocol address is used to establish the network address and port number of the storage connection; the unique identifier of the storage device refers to the globally unique name or identifier of the storage device, which is the IQN in the ISCSI protocol, and the IQN in the current session can be viewed through the command line; the volume identifier assigned by the storage device to the target volume mapping refers to the aforementioned volume LUN ID, and different LUN IDs identify different storage volumes.
[0147] In some embodiments, the multipath command line information includes reconfiguring multipath command line information, re-identifying volume size information, adding path device information, deleting path device information, and deleting multipath device information.
[0148] In some embodiments, the multipath command line information is used to control and maintain multipath devices in a Linux system.
[0149] In some embodiments, reconfiguring multipath command line information is typically used after updating multipath policies, path priorities, and other configuration changes; re-identifying volume size information is used to notify the system to re-identify the capacity information of a block device. In a multipath environment, the capacity information of the underlying path device and the upper-level multipath device needs to be refreshed at the same time; adding path device information is used to add a newly discovered path device to the existing multipath device mapping; deleting path device information is used to remove a path device from the multipath device mapping; deleting multipath device information means deleting the entire multipath device, which is typically used when uninstalling volumes, cleaning resources, or rebuilding multipath mappings.
[0150] In some embodiments, by extending the functionality of the Cinder driver, the volume mount interface not only returns volume connection information but also returns a set of multipathing commands, including five standard actions: reconfig, resize, addpath, delpath, and delmap. Cinder drivers developed by different storage vendors can register their supported multipathing commands with the cloud platform's os_brick module in this way.
[0151] In some embodiments, by extending the OpenStack os_brick module and rewriting the volume mounting, unmounting, and expansion interfaces, and coordinating with the storage vendor's proprietary multipathing command set, host-side device discovery, device deletion, and device capacity refresh are accomplished, enabling the cloud platform to manage storage volumes through proprietary multipathing.
[0152] In some embodiments, by extending and enhancing the Cinder driver and OpenStack os_brick module, a set of custom multipathing command lines for storage is registered with the os_brick module, enabling the cloud platform to recognize and invoke custom multipathing commands during volume mounting, unmounting, and online volume expansion. This enables integration of custom multipathing within the OpenStack cloud platform to manage storage volumes, enabling the cloud platform to maximize storage performance when using storage volumes.
[0153] The present application includes creating a target host in a storage device; searching for a target volume in the storage device according to a volume identifier, and creating a mapping relationship between the target volume and the target host; in response to successful creation of the mapping relationship, obtaining target information of the target volume, the target information including connection information and multipath command line information; and managing the target volume based on the connection information and multipath command line information. This solves the technical problem in related solutions that a cloud platform can only call the multipath command line provided by the system and cannot call the multipath device supporting the storage, thereby affecting the storage performance of the cloud platform. This achieves the technical effect of calling the multipath device supporting the storage and improving the storage performance of the cloud platform.
[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0155] The embodiment of the present application further provides a storage volume management device 300, Figure 3 A schematic diagram of the structure of a storage volume management device provided by an embodiment of the present disclosure is shown in FIG. Figure 3 Shown, including:
[0156] A first creating unit 301 is configured to create a target host in a storage device;
[0157] The second creating unit 302 is configured to search for a target volume in the storage device according to the volume identifier and create a mapping relationship between the target volume and the target host;
[0158] An acquiring unit 303 is configured to acquire target information of a target volume in response to successful creation of the mapping relationship, the target information including connection information and multipath command line information;
[0159] The management unit 304 is configured to manage the target volume based on the connection information and the multipath command line information.
[0160] Furthermore, in a possible implementation of the embodiment of the present disclosure, the acquiring unit 303 is configured to:
[0161] In response to the successful creation of the mapping relationship, a computing service module of the cloud platform is used to perform a scanning operation on the disk device;
[0162] In response to the disk device scanning operation ending, target information of the target volume is acquired.
[0163] Furthermore, in a possible implementation of the embodiment of the present disclosure, the acquiring unit 303 is configured to:
[0164] In response to the disk device scanning operation being completed, determining whether a volume management request from the cloud platform is received, the volume management request including a volume mount request, a volume unmount request, and a volume expansion request;
[0165] If a volume management request is received, the connection attribute parameters are parsed to obtain target information of the target volume.
[0166] Furthermore, in a possible implementation of the embodiment of the present disclosure, the management unit 304 is configured to:
[0167] Based on the connection information, a plurality of triplet arrays are determined, where the triplet arrays are used for Internet Small Computer System Interface login;
[0168] Get the session ID corresponding to the ternary array;
[0169] Manage the target volume based on the session ID and multipath command line information.
[0170] Furthermore, in a possible implementation of the embodiment of the present disclosure, the management unit 304 is configured to:
[0171] Start the target thread corresponding to the connection information;
[0172] Based on the target thread, the ternary array is used to log in to the Internet Small Computer System Interface;
[0173] In response to the login using the ternary array being completed, a login session is established and a session identifier corresponding to the ternary array is obtained.
[0174] Furthermore, in a possible implementation of the embodiment of the present disclosure, the management unit 304 is configured to:
[0175] Determining device identification information based on the session identifier, where the device identification information includes at least host adapter information;
[0176] Based on the host adapter information and connection information, scan the compute node to generate the target path device;
[0177] Based on the multipath command line information, add target path devices to manage the target volume.
[0178] Furthermore, in a possible implementation of the embodiment of the present disclosure, the storage volume management apparatus 300 further includes a deletion unit, which is configured to:
[0179] Based on the session identifier, obtain the first path device under the login session;
[0180] determining a second path device from the first path devices based on the connection information;
[0181] Based on the multipath command line information, the first path device or the second path device is deleted to manage the target volume.
[0182] Furthermore, in a possible implementation of the embodiment of the present disclosure, the storage volume management apparatus 300 further includes a refresh unit, which is configured to:
[0183] determining a third path device corresponding to the ternary array;
[0184] Based on the third path device, determining device identification information corresponding to the third path device;
[0185] Based on the device identification information, the capacity of the third path device is refreshed, and based on the multipath command line information, the device information of the second path device is refreshed to manage the target volume.
[0186] Furthermore, in a possible implementation of the embodiment of the present disclosure, the storage volume management apparatus 300 further includes a parsing unit, which is configured to:
[0187] Get the domain name information of the target volume;
[0188] Based on the domain name information of the target volume, determine the soft link information corresponding to the domain name information;
[0189] Parse the soft link information to obtain the name of the second path device.
[0190] Furthermore, in a possible implementation of the embodiment of the present disclosure, the refresh unit is further configured to:
[0191] Based on the multipath command line information, a first command and a second command are obtained, where the first command is a reconfiguration command and the second command is a target volume size re-identification command;
[0192] The mapping table information of the second path device is refreshed using the first command, or the capacity information of the second path device is refreshed using the second command.
[0193] Furthermore, in a possible implementation of the embodiment of the present disclosure, the connection information includes a network protocol address, a unique identifier of the storage device, and a volume identifier allocated by the storage device for the target volume mapping.
[0194] Furthermore, in a possible implementation of the embodiment of the present disclosure, the multipath command line information includes reconfiguring multipath command line information, re-identifying volume size information, adding path device information, deleting path device information, and deleting multipath device information.
[0195] The present application includes creating a target host in a storage device; searching for a target volume in the storage device according to a volume identifier, and creating a mapping relationship between the target volume and the target host; in response to successful creation of the mapping relationship, obtaining target information of the target volume, the target information including connection information and multipath command line information; and managing the target volume based on the connection information and multipath command line information. This solves the technical problem in related solutions that a cloud platform can only call the multipath command line provided by the system and cannot call the multipath device supporting the storage, thereby affecting the storage performance of the cloud platform. This achieves the technical effect of calling the multipath device supporting the storage and improving the storage performance of the cloud platform.
[0196] For descriptions of features in the embodiments corresponding to the storage volume management apparatus, reference may be made to the relevant descriptions of the embodiments corresponding to the storage volume management method, which will not be detailed here.
[0197] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any of the above storage volume management method embodiments.
[0198] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned storage volume management method embodiments when running.
[0199] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0200] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above storage volume management method embodiments are implemented.
[0201] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned storage volume management method embodiments are implemented.
[0202] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0203] The above is a detailed introduction to a storage volume management method, electronic device, storage medium, and product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A storage volume management method, characterized in that: include: Create a target host in the storage device; Searching for a target volume in the storage device according to the volume identifier, and creating a mapping relationship between the target volume and the target host; In response to the successful creation of the mapping relationship, target information of the target volume is obtained, the target information including connection information and multipath command line information, the connection information including a network protocol address, a unique identifier of a storage device, and a volume identifier assigned by the storage device to the target volume mapping, the multipath command line information including reconfiguring multipath command line information, re-identifying volume size information, adding path device information, deleting path device information, and deleting multipath device information; Determining a plurality of triplet arrays based on the connection information, wherein the triplet arrays are used for Internet Small Computer System Interface login, and the triplet arrays are used to uniquely identify an Internet Small Computer System Interface (ISCSI) login operation; Starting a target thread corresponding to the connection information; Based on the target thread, using the ternary array to perform Internet Small Computer System Interface login; In response to the login completion using the triplet array, a login session is established and a session identifier corresponding to the triplet array is obtained, where the session identifier is a unique number used to identify an iSCSI session in the iSCSI protocol; Determining device identification information based on the session identifier, the device identification information including at least host adapter information; Performing a disk scan operation on the computing node based on the host adapter information and the connection information to generate a target path device; Based on the multipath command line information, the target path device is added to manage the target volume.
2. The storage volume management method according to claim 1, wherein: In response to the successful creation of the mapping relationship, obtaining target information of the target volume includes: In response to the successful creation of the mapping relationship, a scanning operation is performed on the disk device using a computing service module of the cloud platform; In response to the disk device scanning operation being completed, target information of the target volume is acquired.
3. The storage volume management method according to claim 2, wherein: In response to the disk device scanning operation being completed, obtaining target information of the target volume includes: In response to the disk device scanning operation being completed, determining whether a volume management request from the cloud platform is received, the volume management request including a volume mount request, a volume unmount request, and a volume expansion request; If the volume management request is received, the connection attribute parameters are parsed to obtain the target information of the target volume.
4. The storage volume management method according to claim 1, wherein: After obtaining the session identifier corresponding to the ternary array, the method further includes: Based on the session identifier, obtaining a first path device under the login session; determining a second path device from the first path devices based on the connection information; Based on the multipath command line information, the first path device or the second path device is deleted to manage the target volume.
5. The storage volume management method according to claim 4, wherein: After obtaining the session identifier corresponding to the ternary array, the method further includes: determining a third path device corresponding to the ternary array; Based on the third path device, determining device identification information corresponding to the third path device; Based on the device identification information, the capacity of the third path device is refreshed, and based on the multipath command line information, the device information of the second path device is refreshed to manage the target volume.
6. The storage volume management method according to claim 5, wherein: After refreshing the capacity of the third path device based on the device identification information, the method further includes: Obtaining domain name information of the target volume; Based on the domain name information of the target volume, determining soft link information corresponding to the domain name information; Parse the soft connection information to obtain the name of the second path device.
7. The storage volume management method according to claim 5, wherein: The refreshing of the device information of the second path device based on the multipath command line information includes: Based on the multipath command line information, a first command and a second command are acquired, where the first command is a reconfiguration command and the second command is a command for re-identifying the target volume size; The mapping table information of the second path device is refreshed using the first command, or the capacity information of the second path device is refreshed using the second command.
8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the storage volume management method according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the storage volume management method according to any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the storage volume management method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Management method and system for multi-path software based on multiple storage manufacturers
CN106814977A
Method, system and device for using storage device based on cloud platform and medium
CN112463035A