CN115185467A - Storage block equipment management method, device, equipment and storage medium - Google Patents

Storage block equipment management method, device, equipment and storage medium Download PDF

Info

Publication number
CN115185467A
CN115185467A CN202210895923.2A CN202210895923A CN115185467A CN 115185467 A CN115185467 A CN 115185467A CN 202210895923 A CN202210895923 A CN 202210895923A CN 115185467 A CN115185467 A CN 115185467A
Authority
CN
China
Prior art keywords
block device
storage block
type
storage
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210895923.2A
Other languages
Chinese (zh)
Inventor
宋文平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202210895923.2A priority Critical patent/CN115185467A/en
Publication of CN115185467A publication Critical patent/CN115185467A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Abstract

The application discloses a method, a device, equipment and a storage medium for managing storage block equipment, which relate to the technical field of computers and comprise the following steps: receiving a target request for managing the storage block device to be processed; identifying a device type field of a request message body in a target request, and determining a block device type based on the device type field; the device type field is a field which is added in a target position in the request message body in advance and is used for marking the device type of the storage block; and carrying out mounting or unloading on the storage block device to be processed according to the storage block device mounting flow or the storage block device unloading flow which is called by the received calling request and corresponds to the block device type. According to the method and the device, the type of the block device is determined according to the device type field of the identified request message body, so that the corresponding mounting flow and unloading flow are called according to the type of the block device, mounting or unloading processing is carried out on the storage block device to be processed, and unified management and scheduling of different types of disks can be achieved.

Description

Storage block device management method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for managing a storage block device.
Background
Currently, none of the technical solutions for device management of storage blocks relates to unified management and scheduling of different types of disks, and therefore, how to provide a technical solution for unified management and scheduling of different types of disks is a problem to be solved in the art.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a device and a storage medium for managing a storage block device, which can implement unified management and scheduling of different types of disks. The specific scheme is as follows:
in a first aspect, the present application discloses a storage block device management method, including:
receiving a target request for managing the storage block device to be processed;
identifying a device type field of a request message body in the target request, and determining a block device type of the storage block device to be processed based on the device type field; the device type field is a field which is added in the target position in the request message body in advance and is used for marking the device type of the storage block;
calling a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type according to the received calling request;
and mounting or unloading the storage block device to be processed according to the storage block device mounting flow or the storage block device unloading flow.
Optionally, the determining the block device type of the to-be-processed storage block device based on the device type field includes:
when the device type field is normal, determining that the block device type of the storage block device to be processed is a common storage block device type;
when the device type field is ISO, determining that the block device type of the storage block device to be processed is a read-only optical disc type;
when the device type field is local, determining that the block device type of the storage block device to be processed is a local disk type;
and when the device type field is the vhostuser, determining that the block device type of the storage block device to be processed is the SPDK disk type.
Optionally, the mounting the current storage block device to be processed according to the storage block device mounting process includes:
when the block device type is the common storage block device type, acquiring connection information of a storage back end, and determining the type of the storage back end to obtain the type of the storage back end;
when the storage back end type is a ceph storage type, executing corresponding connection operation according to an rbd protocol and the connection information to acquire mapping information of the to-be-processed block device, and mounting the current to-be-processed storage block device by using the mapping information;
and when the storage back end type is a centralized storage type, performing a disk scanning operation according to the connection information to acquire the mapping information of the to-be-processed block device, and mounting the current to-be-processed storage block device by using the mapping information.
Optionally, the mounting the current storage block device to be processed according to the storage block device mounting process includes:
and when the type of the block device is the read-only optical disk type, acquiring the storage block device information of the storage block device to be processed from the work service, and mounting the current storage block device to be processed by using the storage block device information.
Optionally, the mounting the current storage block device to be processed according to the storage block device mounting process includes:
and when the block device type is the local disk type, acquiring a disk identifier device on the host machine, and mounting the current storage block device to be processed according to the disk identifier device.
Optionally, the mounting the current storage block device to be processed according to the storage block device mounting process includes:
when the block device type is the SPDK disk type, judging whether the SPDK service is deployed on the current node where the virtual machine is located;
if the SPDK service is deployed at the current node, converting the storage block equipment to be processed into socket-type bdev equipment by using the SPDK service, and mounting the bdev equipment;
and if the SPDK service is not deployed at the current node, returning corresponding error prompt information.
Optionally, the method for managing a storage block device further includes:
reading the storage block device information of the storage block device to be processed corresponding to the type of the block device in a block device data record table according to the received information query instruction, and sending the storage block device information to a user interface for displaying; the block device data record table is a data table for recording block device information of each storage block device corresponding to each block device type.
In a second aspect, the present application discloses a storage block device management apparatus, including:
the request receiving module is used for receiving a target request for managing the storage block equipment to be processed;
a field identification module, configured to identify a device type field of a request message body in the target request;
a device type determining module, configured to determine a block device type of the to-be-processed storage block device based on the device type field; the device type field is a field which is added in the target position in the request message body in advance and is used for marking the device type of the storage block;
the flow calling module is used for calling a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type according to the received calling request;
and the block device mounting or unloading module is used for mounting or unloading the storage block device to be processed according to the storage block device mounting flow or the storage block device unloading flow.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the memory block device management method disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program realizes the steps of the memory block device management method disclosed in the foregoing when executed by a processor.
Therefore, the present application provides a storage block device management method, including: receiving a target request for managing the storage block device to be processed; identifying a device type field of a request message body in the target request, and determining a block device type of the storage block device to be processed based on the device type field; the device type field is a field which is added in a target position in the request message body in advance and is used for marking the device type of the storage block; calling a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type according to the received calling request; and mounting or unloading the storage block device to be processed according to the storage block device mounting flow or the storage block device unloading flow. Therefore, the method and the device for managing the storage block device to be processed receive the target request for managing the storage block device to be processed, then identify the device type field of the request message body in the target request, determine the block device type of the storage block device to be processed based on the device type field, call the storage block device mounting flow or the storage block device unloading flow corresponding to the block device type according to the received call request, and further mount or unload the storage block device to be processed, so that unified management and scheduling of different types of disks can be achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a method for managing a storage block device disclosed in the present application;
FIG. 2 is a schematic diagram of a disk mount management disclosed in the present application;
FIG. 3 is a schematic view of a disk offload management disclosed herein;
FIG. 4 is a flowchart illustrating a specific method for managing a storage block device according to the present disclosure;
FIG. 5 is a flowchart of a specific method for managing a storage block device disclosed herein;
FIG. 6 is a flowchart illustrating a specific method for managing a storage block device according to the present disclosure;
FIG. 7 is a flow diagram of various service interactions disclosed herein;
FIG. 8 is a flowchart illustrating a specific method for managing a storage block device according to the present disclosure;
FIG. 9 is a flowchart illustrating a specific method for managing a storage block device according to the present disclosure;
FIG. 10 is a flowchart of a specific method for managing a storage block device disclosed herein;
fig. 11 is a schematic structural diagram of a storage block device management apparatus disclosed in the present application;
fig. 12 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, in the prior art, none of the technical solutions for storage block device management relates to unified management and scheduling of different types of disks. Therefore, the storage block device management scheme is provided, and unified management and scheduling of different types of disks can be achieved.
The embodiment of the invention discloses a storage block device management method, which is shown in figure 1 and comprises the following steps:
step S11: and receiving a target request for managing the storage block device to be processed.
In this embodiment, a target request for managing a to-be-processed storage block device is received. It should be noted that, in this embodiment, the device for processing the storage block may be implemented by a URL (Uniform Resource Locator).
Step S12: identifying a device type field of a request message body in the target request, and determining a block device type of the storage block device to be processed based on the device type field; the device type field is a field which is added in a target position in the request message body in advance and is used for marking the device type of the storage block.
In this embodiment, after receiving a target request for managing a to-be-processed storage block device, a device type field of a request message body in the target request may be identified, and a block device type of the to-be-processed storage block device may be determined based on the device type field. It can be understood that the Device type field is a field added in advance at a target position in the request message body for marking a storage Block Device type, that is, a Block Device type of a storage Block Device to be currently processed may be marked by setting an attach _ dev _ protocol field in the request message body in the target request, for example, in order to indicate that different types of storage Block devices are managed, an attach _ dev _ protocol field is added in a request message body of an API (Application Program Interface) for marking a type of a storage Block Device to be currently managed, and a BDM (Block _ Mapping) data table is used for uniformly recording the storage Block Device to be processed.
Step S13: and calling a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type according to the received calling request.
In this embodiment, after determining the block device type of the storage block device to be processed based on the device type field, a storage block device mount flow or a storage block device unload flow corresponding to the block device type is called according to the received call request.
Step S14: and mounting or unloading the storage block device to be processed according to the storage block device mounting flow or the storage block device unloading flow.
In this embodiment, a storage block device mount flow or a storage block device uninstall flow corresponding to the block device type is called, and then mount or uninstall the storage block device to be processed according to the storage block device mount flow or the storage block device uninstall flow. That is to say, for different storage block device types, a specific storage block device mounting or unloading process may be performed on a node where the cloud host is located by using the called storage block device mounting process or storage block device unloading process corresponding to the block device type, so that a uniform form of management of various storage block devices is achieved. It should be noted that a cloud host can mount a normal disk (i.e. a normal cloud hard disk), or mount a SPDK (Storage Performance Development Kit) Storage disk, a pass-through disk, and an ISO (i.e. an optical disk image file), etc., and indicate what type of Storage block device is currently desired to be mounted through a field in a request message body. The SPDK is a storage performance development kit developed by Intel, and provides a group of tool libraries to provide a retractable user mode storage application program, namely all necessary driving programs are moved to a user space, so that system call can be avoided and zero-copy access of the application program can be enabled; meanwhile, the problems of delay and the like caused by interruption are avoided in a hardware polling mode. The SPDK can thus provide a highly parallel IO (Input/Output, i.e., input/Output) access mechanism by mechanisms such as polling, asynchronous, and lock-free in the application space. And simultaneously, the SPDK provides servers based on NVMe-oF, iSCSI and vhost, so that the aim oF high-performance storage can be achieved. Through the operation, unified management of various storage block device interfaces can be realized, the storage block devices are managed and unified in form, and deployment and user use on an OpenStack cloud platform are facilitated. The OpenStack is a cloud computing management platform project based on OpenStack open source, and is a combination of a series of software open source projects. As shown in fig. 2, when mounting a disk, a cloud host first generates a BDM data table, and fills storage block device information to be mounted into the BDM data table, where the storage block device information may include storage block device type information: attach _ dev _ protocol. That is, by putting the storage block device information into the unified data table, the cloud host can reduce the times of querying the database in the processes of starting, restarting, cold migration and hot migration, thereby greatly reducing the pressure of database access and improving the execution efficiency of the service level. Meanwhile, unification and flow of hot adding and unloading of the storage block device are realized at the architecture level. After the BDM data table is constructed, an RPC (Remote Procedure Call) cast request is sent to the computer service of the node where the cloud host is located, and a specific block device mount process is started. As shown in fig. 3, when the cloud host unloads the disk, it may first determine the type of the current disk, and if the current disk is a normal disk, the current disk is unloaded according to the unloading process of the normal disk; if the ISO is the ISO, generating an empty ISO device to replace the current ISO device; if the current disc is the through disc, unloading is directly carried out according to the unloading process of the through disc; if the storage disk is the SPDK storage disk, whether the SPDK service exists on the current host machine or not is judged firstly, and if the storage disk exists, the current disk is unloaded and the SPDK service is called to delete the corresponding bdev equipment. That is to say, the embodiment provides a unified management measure, and performs unified management and scheduling on a common disk, an ISO disk, a pass-through disk, and an SPDK storage disk; unified flow and specification are realized on the mounting and the unloading of the cloud host, and the mounted storage equipment is recorded in the BDM data table. And specific hanging and unloading processes are carried out on the nodes where the cloud hosts are located according to different disk types.
Therefore, in the embodiment of the application, a target request for managing the storage block device to be processed is received, then the device type field of the request message body in the target request is identified, the block device type of the storage block device to be processed is determined based on the device type field, a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type is called according to the received call request, and then mounting or unloading processing is performed on the storage block device to be processed, so that unified management and scheduling of different types of disks can be realized.
Referring to fig. 4, an embodiment of the present invention discloses a specific storage block device management method, and compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
Step S21: and receiving a target request for managing the storage block device to be processed.
Step S22: identifying a device type field of a request message body in the target request, and determining a block device type of the storage block device to be processed based on the device type field; the device type field is a field which is added in a target position in the request message body in advance and is used for marking the device type of the storage block.
Step S23: reading the storage block device information of the storage block device to be processed corresponding to the type of the block device in a data record table of the block device according to the received information query instruction, and sending the storage block device information to a user interface for displaying; the block device data record table is a data table for recording block device information of each storage block device corresponding to each block device type.
In this embodiment, the type of the block device of the storage block device to be processed is determined based on the device type field, and then the storage block device information of the storage block device to be processed, which corresponds to the type of the block device, in the data record table of the block device is read according to the received information query instruction, and the storage block device information is sent to the user interface for display. It can be understood that the block device data record table is a data table that records block device information of each of the storage block devices corresponding to each of the block device types. For example, when an information query instruction that a User Interface (UI) needs to query information of a storage block device currently managed by a cloud host is received, a BDM data table is read according to the information query instruction, and an attach _ dev _ protocol field is identified to display specific block device information of different types of currently managed storage block devices, so that efficiency of querying the block device by the cloud host is improved, and meanwhile, the block device can be queried more conveniently when the information of the storage block device is displayed on the UI Interface. That is, in the embodiment, the BDM data table in the database may be queried through the UI interface, so that various storage device types owned by the cloud host are obtained, user operation and identification are facilitated, and the learning and operating costs of the user are greatly simplified.
For the specific contents of the above steps S21 to S23, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
Therefore, the method and the device for managing the storage block device improve the efficiency of the cloud host for querying the storage block device and can achieve unified management and scheduling of different types of disks by receiving the target request for managing the storage block device to be processed, identifying the device type field of the request message body in the target request, determining the block device type of the storage block device to be processed based on the device type field, reading the storage block device information of the storage block device to be processed corresponding to the block device type in the data record table of the block device according to the received information query instruction, and sending the storage block device information to the user interface for displaying.
Referring to fig. 5, an embodiment of the present invention discloses a specific storage block device management method, and compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
Step S31: and receiving a target request for managing the storage block device to be processed.
Step S32: and identifying the equipment type field of the request message body in the target request.
Step S33: and when the device type field is normal, determining that the block device type of the storage block device to be processed is a common storage block device type.
In this embodiment, the device type field of the request message body in the target request is identified, and when the identified device type field is normal, it is determined that the block device type of the to-be-processed storage block device is a common storage block device type. It can be understood that, if the attach _ dev _ protocol field in the request message body in the target request is set to normal, the block device type of the memory block device to be currently processed is marked as the normal memory block device type.
Step S34: and calling a memory block device mounting flow corresponding to the block device type according to the received calling request.
Step S35: and acquiring connection information of a storage back end according to the storage block device mounting process, and determining the type of the storage back end to obtain the type of the storage back end.
In this embodiment, the determined block device type of the storage block device to be processed is a common storage block device type, a storage block device mount flow corresponding to the common storage block device type is called, in the storage block device mount flow, connection information of a storage back end is first acquired, and the type of the storage back end is determined to obtain the storage back end type.
Step S36: and when the storage back end type is a ceph storage type, executing corresponding connection operation according to an rbd protocol and the connection information to acquire mapping information of the to-be-processed block device, and mounting the current to-be-processed storage block device by using the mapping information.
In this embodiment, when it is determined that the type of the storage back end is a ceph storage type, corresponding connection operation is performed according to an rbd protocol and the connection information to obtain mapping information of a common storage block device, and the mapping information is used to mount the current common storage block device.
Step S37: and when the storage back end type is a centralized storage type, performing a disk scanning operation according to the connection information to acquire the mapping information of the to-be-processed block device, and mounting the current to-be-processed storage block device by using the mapping information.
In this embodiment, when it is determined that the type of the storage back end is the centralized storage type, a disk scanning operation is performed according to the connection information to obtain the mapping information of the common storage block device, and the mapping information is used to mount the current common storage block device.
For example, as shown in fig. 6, for a normal disk, that is, for an attribute _ dev _ protocol = normal, a Block device field added in a request message body of an API, the connection information of a storage back end is obtained through a shader, and a current storage back end type is determined, and if ceph storage is performed, connection is performed according to an RBD (radius Block development) protocol; wherein, the RBD protocol is a block storage protocol provided externally based on rados. If the storage is centralized storage, the disk scanning operation is carried out according to the connection information so as to obtain the disk mapping information, and finally a libvirt interface is called to realize the mounting of the block equipment.
For the specific contents of the steps S31 to S32 and S34, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
As can be seen, in the embodiment of the present application, by receiving a target request for managing a storage block device to be processed, then recognizing that a device type field of a request message body in the target request is normal, determining that a block device type of the storage block device to be processed is a normal storage block device type based on the normal, invoking a storage block device mount flow corresponding to the normal storage block device type according to the received invocation request, and then performing mount processing on a normal disk under the storage block device mount flow.
Referring to fig. 7, an embodiment of the present invention discloses a specific storage block device management method, and compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
Step S41: and receiving a target request for managing the storage block device to be processed.
Step S42: and identifying the equipment type field of the request message body in the target request.
Step S43: and when the equipment type field is ISO, determining that the block equipment type of the storage block equipment to be processed is a read-only optical disc type.
In this embodiment, the device type field of the request message body in the target request is identified, and when the identified device type field is ISO, it is determined that the block device type of the storage block device to be processed is the read-only optical disc type. It can be understood that, if the attach _ dev _ protocol field in the request message body in the target request is set to ISO, the block device type of the current storage block device to be processed is marked as the read-only disk type.
Step S44: and calling a memory block device mounting flow corresponding to the block device type according to the received calling request.
Step S45: and acquiring the storage block device information of the storage block device to be processed from the work service according to the storage block device mounting process, and mounting the current storage block device to be processed by using the storage block device information.
In this embodiment, the determined block device type of the storage block device to be processed is a Read-Only optical disc type, and a storage block device mounting procedure corresponding to the common storage block device type is called, in the storage block device mounting procedure, first, storage block device information of a CDROM (Compact Disk Read Only Memory), that is, compact Disk Read Only Memory, is obtained from a work service, and the storage block device information is used to mount the CDROM at present.
For the details of the steps S41 to S42 and S44, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
As can be seen, in the embodiment of the present application, a target request for managing a storage block device to be processed is received, then, it is identified that a device type field of a request message body in the target request is ISO, it is determined based on the ISO that the block device type of the storage block device to be processed is a read-only disk type, a storage block device mounting procedure corresponding to the read-only disk type is called according to the received call request, and then, mounting processing is performed on a CDROM under the storage block device mounting procedure.
Referring to fig. 8, an embodiment of the present invention discloses a specific storage block device management method, and compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
Step S51: and receiving a target request for managing the storage block device to be processed.
Step S52: and identifying the equipment type field of the request message body in the target request.
Step S53: and when the device type field is local, determining that the block device type of the storage block device to be processed is a local disk type.
In this embodiment, a device type field of a request message body in the target request is identified, and when the identified device type field is local, it is determined that a block device type of the to-be-processed storage block device is a local disk type. It can be understood that, if the attach _ dev _ protocol field in the request message body in the target request is set to be the local disk type, the block device type of the storage block device to be currently processed is marked as the local disk type.
Step S54: and calling a memory block device mounting flow corresponding to the block device type according to the received calling request.
Step S55: and acquiring the drive letter equipment on the host according to the storage block equipment mounting process, and mounting the current storage block equipment to be processed according to the drive letter equipment.
In this embodiment, the determined block device type of the storage block device to be processed is a local disk type, a storage block device mount process corresponding to the local disk type is called, a disk identifier device on the host is directly obtained in the storage block device mount process, and a local through disk is mounted according to the disk identifier device. For example, for a local through disk type, the disk identifier device on the host is acquired, and the mounting of the through disk storage device is realized.
For the details of the steps S51 to S52 and S54, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
As can be seen, in the embodiment of the present application, by receiving a target request for managing a storage block device to be processed, identifying that a device type field of a request message body in the target request is local, determining, based on the local, that a block device type of the storage block device to be processed is a local disk type, calling, according to a received call request, a storage block device mount process corresponding to the local disk type, and then performing mount processing on a local through disk under the storage block device mount process.
Referring to fig. 9, the embodiment of the present invention discloses a specific method for managing a storage block device, and compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
Step S61: and receiving a target request for managing the storage block device to be processed.
Step S62: and identifying the equipment type field of the request message body in the target request.
Step S63: and when the device type field is vhostuser, determining that the block device type of the storage block device to be processed is the SPDK disk type.
In this embodiment, the device type field of the request message body in the target request is identified, and when the identified device type field is vhost, it is determined that the block device type of the to-be-processed storage block device is the SPDK disk type. It can be understood that, if the attribute _ dev _ protocol field in the request message body in the target request is set to vhost, the block device type of the storage block device to be currently processed is marked as the SPDK disk type.
Step S64: and calling a memory block device mounting flow corresponding to the block device type according to the received calling request.
Step S65: and judging whether the SPDK service is deployed on the current node where the virtual machine is located according to the storage block device mounting process.
In this embodiment, the determined block device type of the storage block device to be processed is an SPDK disk type, a storage block device mount process corresponding to the SPDK disk type is called, and in the storage block device mount process, it is first determined whether the SPDK service is deployed on a current node where the virtual machine is located.
Step S66: and if the SPDK service is deployed at the current node, converting the storage block equipment to be processed into socket-type bdev equipment by using the SPDK service, and mounting the bdev equipment.
In this embodiment, when determining whether the SPDK service is deployed on the current node where the virtual machine is located, if the SPDK service is deployed on the current node, the SPDK service is used to convert the to-be-processed storage block device into a socket-type bdev device, and mount the bdev device.
Step S67: and if the SPDK service is not deployed at the current node, returning corresponding error prompt information.
In this embodiment, when determining whether the SPDK service is deployed on the current node where the virtual machine is located, if the SPDK service is not deployed on the current node, the corresponding error prompt information is returned.
For example, as shown in fig. 10, an attach _ dev _ Protocol field in a request message body in a target request is vhost, the determined Block Device type is an SPDK disk type, a storage Block Device mount process corresponding to the SPDK disk type is called, that is, a Block _ Device _ Mapping data table is created for a disk of the SPDK type, and it is further determined whether a corresponding SPDK service is deployed on a node where a virtual machine is located, and if no SPDK service is deployed, an HTTP (hypertext Transfer Protocol ) collision error prompt is returned; if the SPDK service is deployed at the current node, the SPDK service is utilized to change a common disk into socket type bdev equipment, and then the socket type bdev equipment is mounted on the cloud host.
For the details of the steps S61 to S62 and S64, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
It can be seen that, in the embodiment of the present application, by receiving a target request for managing a storage block device to be processed, then identifying that a device type field of a request message body in the target request is vhost, determining that a block device type of the storage block device to be processed is an SPDK disk type based on the vhost, calling a storage block device mount flow corresponding to the SPDK disk type according to the received call request, and then mounting the SPDK storage disk under the storage block device mount flow.
Correspondingly, an embodiment of the present application further discloses a storage block device management apparatus, as shown in fig. 11, the apparatus includes:
a request receiving module 11, configured to receive a target request for managing a to-be-processed storage block device;
a field identification module 12, configured to identify a device type field of a request message body in the target request;
a device type determining module 13, configured to determine a block device type of the to-be-processed storage block device based on the device type field; the device type field is a field which is added in the target position in the request message body in advance and is used for marking the device type of the storage block;
a flow calling module 14, configured to call a storage block device mount flow or a storage block device unload flow corresponding to the block device type according to the received call request;
and the block device mounting or unloading module 15 is configured to mount or unload the storage block device to be processed according to the storage block device mounting process or the storage block device unloading process.
As can be seen from the above, in the embodiment of the present application, a target request for managing a storage block device to be processed is received, then a device type field of a request message body in the target request is identified, a block device type of the storage block device to be processed is determined based on the device type field, storage block device information of the storage block device to be processed, which corresponds to the block device type, in a data record table of the block device is read according to a received information query instruction, and the storage block device information is sent to a user interface for display, so that efficiency of querying the block device by a cloud host is improved, and unified management and scheduling of different types of disks can be realized.
In some specific embodiments, the device type determining module 13 may specifically include:
a first type determining unit, configured to determine that a block device type of the to-be-processed storage block device is a common storage block device type when the device type field is normal;
a second type determining unit, configured to determine that the block device type of the storage block device to be processed is a read-only disk type when the device type field is ISO;
a third type determining unit, configured to determine that a block device type of the to-be-processed storage block device is a local disk type when the device type field is local;
a fourth type determining unit, configured to determine that the block device type of the to-be-processed storage block device is an SPDK disk type when the device type field is vhost.
In some specific embodiments, the block device mounting or dismounting module 15 may specifically include:
a first information obtaining unit, configured to, when the block device type is the common storage block device type, obtain connection information of a storage back end, and determine the type of the storage back end to obtain a storage back end type;
a second information obtaining unit, configured to, when the storage back-end type is a ceph storage type, perform corresponding connection operation according to an rbd protocol and the connection information to obtain mapping information of the to-be-processed block device, and mount the to-be-processed block device by using the mapping information;
a third information obtaining unit, configured to, when the storage back-end type is a centralized storage type, perform a disk scanning operation according to the connection information to obtain the mapping information of the to-be-processed block device;
and the first mounting unit is used for mounting the current storage block device to be processed by utilizing the mapping information.
In some specific embodiments, the block device mounting or dismounting module 15 may specifically include:
a fourth information obtaining unit, configured to obtain storage block device information of the storage block device to be processed from a work service when the block device type is the rom type;
and the second mounting unit is used for mounting the current storage block device to be processed by using the storage block device information.
In some specific embodiments, the block device mounting or dismounting module 15 may specifically include:
a drive letter device obtaining unit, configured to obtain a drive letter device on the host computer when the block device type is the local disk type;
and the third mounting unit is used for mounting the current storage block device to be processed according to the drive symbol device.
In some specific embodiments, the block device mounting or dismounting module 15 may specifically include:
a judging unit, configured to judge whether an SPDK service is deployed on a current node where the virtual machine is located when the block device type is an SPDK disk type;
the device type conversion unit is used for converting the storage block device to be processed into socket type bdev equipment by using the SPDK service when the SPDK service is deployed at the current node;
a fourth mounting unit, configured to mount the bdev device;
and the error information returning unit is used for returning corresponding error prompt information when the SPDK service is not deployed at the current node.
In some specific embodiments, the storage block device management apparatus may further include:
a block device information reading module, configured to read, according to the received information query instruction, the storage block device information of the to-be-processed storage block device corresponding to the block device type in a block device data record table;
the block device information display module is used for sending the storage block device information to a user interface for display; the block device data record table is a data table for recording block device information of each storage block device corresponding to each block device type.
Furthermore, the embodiment of the application also provides electronic equipment. FIG. 12 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and the contents of the figure should not be construed as limiting the scope of the application in any way.
Fig. 12 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement relevant steps in the storage block device management method disclosed in any one of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage manner may be a transient storage manner or a permanent storage manner.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20 and the computer program 222, and may be Windows Server, netware, unix, linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the memory block device management method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, an embodiment of the present application also discloses a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is loaded by a processor and executed, the steps of the storage block device management method disclosed in any of the foregoing embodiments are implemented.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts between the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The foregoing describes in detail a method, an apparatus, a device, and a storage medium for managing a storage block device provided by the present invention, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the foregoing embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A storage block device management method, comprising:
receiving a target request for managing the storage block device to be processed;
identifying a device type field of a request message body in the target request, and determining a block device type of the storage block device to be processed based on the device type field; the device type field is a field which is added in a target position in the request message body in advance and is used for marking the device type of the storage block;
calling a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type according to the received calling request;
and mounting or unloading the storage block device to be processed according to the storage block device mounting flow or the storage block device unloading flow.
2. The storage block device management method according to claim 1, wherein said determining the block device type of the storage block device to be processed based on the device type field comprises:
when the device type field is normal, determining that the block device type of the storage block device to be processed is a common storage block device type;
when the device type field is ISO, determining that the block device type of the storage block device to be processed is a read-only optical disc type;
when the device type field is local, determining that the block device type of the storage block device to be processed is a local disk type;
and when the device type field is the vhostuser, determining that the block device type of the storage block device to be processed is the SPDK disk type.
3. The method for managing the storage block device according to claim 2, wherein the mounting the current storage block device to be processed according to the storage block device mounting process includes:
when the block device type is the common storage block device type, acquiring connection information of a storage back end, and determining the type of the storage back end to obtain the type of the storage back end;
when the storage back end type is a ceph storage type, executing corresponding connection operation according to an rbd protocol and the connection information to acquire mapping information of the to-be-processed block device, and mounting the to-be-processed storage block device by using the mapping information;
and when the storage back end type is a centralized storage type, performing a disk scanning operation according to the connection information to acquire the mapping information of the to-be-processed block device, and mounting the current to-be-processed storage block device by using the mapping information.
4. The method for managing the storage block device according to claim 2, wherein the mounting the current storage block device to be processed according to the storage block device mounting process includes:
and when the type of the block device is the read-only optical disk type, acquiring the storage block device information of the storage block device to be processed from the work service, and mounting the current storage block device to be processed by using the storage block device information.
5. The method for managing the storage block device according to claim 2, wherein the mounting the current storage block device to be processed according to the storage block device mounting process includes:
and when the block device type is the local disk type, acquiring a disk identifier device on the host machine, and mounting the current storage block device to be processed according to the disk identifier device.
6. The method for managing the storage block device according to claim 2, wherein the mounting the current storage block device to be processed according to the storage block device mounting process includes:
when the block device type is the SPDK disk type, judging whether the SPDK service is deployed on the current node where the virtual machine is located;
if the node is deployed with the SPDK service at present, converting the storage block device to be processed into socket-type bdev equipment by using the SPDK service, and mounting the bdev equipment;
and if the SPDK service is not deployed at the current node, returning corresponding error prompt information.
7. The memory block device management method according to any one of claims 1 to 6, characterized by further comprising:
reading the storage block device information of the storage block device to be processed corresponding to the type of the block device in a data record table of the block device according to the received information query instruction, and sending the storage block device information to a user interface for displaying; the block device data record table is a data table for recording block device information of each storage block device corresponding to each block device type.
8. A storage block device management apparatus, comprising:
the request receiving module is used for receiving a target request for managing the storage block device to be processed;
a field identification module, configured to identify a device type field of a request message body in the target request;
a device type determining module, configured to determine a block device type of the to-be-processed storage block device based on the device type field; the device type field is a field which is added in a target position in the request message body in advance and is used for marking the device type of the storage block;
the flow calling module is used for calling a storage block device mounting flow or a storage block device unloading flow corresponding to the block device type according to the received calling request;
and the block device mounting or unloading module is used for mounting or unloading the storage block device to be processed according to the storage block device mounting process or the storage block device unloading process.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the storage block device management method according to any of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program realizes the steps of the storage block device management method according to any one of claims 1 to 7 when executed by a processor.
CN202210895923.2A 2022-07-27 2022-07-27 Storage block equipment management method, device, equipment and storage medium Pending CN115185467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210895923.2A CN115185467A (en) 2022-07-27 2022-07-27 Storage block equipment management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210895923.2A CN115185467A (en) 2022-07-27 2022-07-27 Storage block equipment management method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115185467A true CN115185467A (en) 2022-10-14

Family

ID=83520819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210895923.2A Pending CN115185467A (en) 2022-07-27 2022-07-27 Storage block equipment management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115185467A (en)

Similar Documents

Publication Publication Date Title
US8069224B2 (en) Method, equipment and system for resource acquisition
US8176061B2 (en) Tracking digital assets on a distributed network
CA2428481A1 (en) Identity-based distributed computing for device resources
TW200818010A (en) System and method for managing objects according to the common information model
CN114385091B (en) Method and device for realizing network disk drive character, network disk and storage medium
WO2006005655A1 (en) Application splitting for network edge computing
US20080082690A1 (en) System and method for the dynamic loading of protocol adapters
CN111510330B (en) Interface management device, method and storage medium
CN110677307B (en) Service monitoring method, device, equipment and storage medium
CN114461691A (en) Control method and device of state machine, electronic equipment and storage medium
US20070038959A1 (en) Resource presentation convergence
CN115517009B (en) Cluster management method, cluster management device, storage medium and electronic equipment
WO2021197579A1 (en) Method for deploying application software in cloud environments
CN115185467A (en) Storage block equipment management method, device, equipment and storage medium
CN113835625B (en) Data storage method, device, equipment and storage medium based on sub-path
CN115586872A (en) Container mirror image management method, device, equipment and storage medium
CN111125257B (en) Dictionary updating method, device, equipment and storage medium
CN107357524B (en) File storage method, file reading method and electronic equipment
CN111414175A (en) Network installation method, system and device of operating system and readable storage medium
KR100764473B1 (en) System for searching and providing for file stored in computer device using wireless communication device and method for the same
CN117118962B (en) Method and system for deploying user methods across multiple cloud platforms
CN113377867B (en) Data synchronization method and device and electronic equipment
CN112612797B (en) Multi-source same-table data loading method, device, equipment and medium
CN111459613B (en) Method and device for dynamically expanding development environment
US11169864B2 (en) Systems, methods and computer program products for application environment synchronization between remote devices and on-premise devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination