Disclosure of Invention
In view of the above, the present invention provides a disk management method, system, storage medium and device, so as to solve the problem that the disk that cannot be identified by the storage system cannot be screened and managed in the prior art.
Based on the above purpose, the present invention provides a disk management method, which comprises the following steps:
acquiring drive letters and corresponding serial numbers of all disks in a storage system, and storing the drive letters and the corresponding serial numbers in a first query list;
respectively acquiring the names and corresponding serial numbers of all SAS cards and the names and corresponding serial numbers of all RAID cards in the storage system, sequentially acquiring the drive letter and the corresponding serial number of each disk in each SAS card according to the serial number of each SAS card, and storing the drive letter and the corresponding serial number into a second query list;
sequentially acquiring the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card and storing the drive letter and the corresponding serial number into a third query list;
integrating the information in the second query list and the third query list into the first query list according to the serial numbers, finding out the unidentified disks of the storage system based on the integrated first query list, and marking the serial numbers of the unidentified disks to distinguish the unidentified disks from the rest identifiable disks in the integrated first query list;
and respectively setting different patterns for the distinguished unidentified disk and the identifiable disk on an interface of the storage system for management.
In some embodiments, integrating information in the second query list and the third query list into the first query list according to the sequence number comprises:
searching the same serial number in the second query list and the first query list, and adding information which is not in the first query list and corresponds to the serial number in the second query list to the first query list;
and searching the same serial number in the third query list and the first query list, and adding information which is not in the first query list and corresponds to the serial number in the third query list to the first query list.
In some embodiments, finding disks not identified by the storage system based on the integrated first query list comprises:
and taking the disk corresponding to the serial number which does not exist in the second query list and the third query list as the disk which is not identified by the storage system.
In some embodiments, obtaining drive signatures and corresponding serial numbers of all disks in the storage system comprises:
and acquiring the drive letter and the corresponding serial number of all the disks in the storage system by using the ls tool and the smartcll tool.
In some embodiments, the obtaining the names and corresponding serial numbers of all SAS cards and the names and corresponding serial numbers of all RAID cards in the storage system respectively includes:
and respectively acquiring the names and corresponding serial numbers of all SAS cards and the names and corresponding serial numbers of all RAID cards in the storage system by using an lspci tool.
In some embodiments, sequentially obtaining the drive letter and the corresponding serial number of each disk in each SAS card according to the serial number of each SAS card and storing the drive letter and the corresponding serial number in the second query list includes:
and sequentially acquiring the drive letter and the corresponding serial number of each disk in each SAS card according to the serial number of each SAS card by using the SAS2IRCU tool or the SAS3IRCU tool, and storing the drive letter and the corresponding serial number into a second query list.
In some embodiments, sequentially obtaining the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card and storing them in the third query list includes:
and sequentially acquiring the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card by using a storcli64 tool, and storing the drive letter and the corresponding serial number into a third query list.
In another aspect of the present invention, a disk management system is further provided, including:
the first query list module is configured to acquire the drive identifiers and corresponding serial numbers of all the disks in the storage system and store the drive identifiers and the corresponding serial numbers in a first query list;
the second query list module is configured to respectively acquire names and corresponding serial numbers of all SAS cards and names and corresponding serial numbers of all RAID cards in the storage system, sequentially acquire drive symbols and corresponding serial numbers of all disks in each SAS card according to the serial numbers of all SAS cards and store the drive symbols and the corresponding serial numbers in a second query list;
the third query list module is configured and used for sequentially acquiring the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card and storing the drive letter and the corresponding serial number into a third query list;
the integration module is configured to integrate information in the second query list and the third query list into the first query list according to the serial numbers, to find out the unidentified disks of the storage system based on the integrated first query list, and to distinguish the unidentified disks from the rest identifiable disks in the integrated first query list by marking the serial numbers of the unidentified disks; and
and the disk management module is configured to set different styles for the distinguished unidentified disk and the distinguished disk respectively on an interface of the storage system so as to manage the identified disk and the distinguished disk.
In yet another aspect of the present invention, a computer-readable storage medium is also provided, storing computer program instructions, which when executed by a processor, implement the above-described method.
In yet another aspect of the present invention, a computer device is further provided, which includes a memory and a processor, the memory storing a computer program, which when executed by the processor performs the above method.
The invention has at least the following beneficial technical effects:
the method comprises the steps of obtaining the drive symbols and the serial numbers of all disks in a storage system, storing the drive symbols and the serial numbers of the disks belonging to an SAS card in the storage system into a first query list, obtaining the drive symbols and the serial numbers of the disks belonging to an RAID card in the storage system, storing the drive symbols and the serial numbers of the disks belonging to the SAS card into a second query list, obtaining the drive symbols and the serial numbers of the disks belonging to the RAID card, and storing the drive symbols and the serial numbers of the disks belonging to the RAID card into a third query list, so that identifiable disks and unidentifiable disks in the storage system are completely obtained; the second query list and the third query list are integrated into the first query list according to the serial number of the disk, so that the disk which cannot be identified by the storage system can be found out; the recognizable disk and the unrecognizable disk of the storage system can be directly distinguished conveniently by marking the serial number of the unrecognizable disk; the identifiable disks and the unidentifiable disks are classified, arranged and displayed on the storage system interface, so that the disks can be comprehensively managed.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two non-identical entities with the same name or different parameters, and it is understood that "first" and "second" are only used for convenience of expression and should not be construed as limiting the embodiments of the present invention. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements does not include all of the other steps or elements inherent in the list.
In view of the foregoing, a first aspect of the embodiments of the present invention provides an embodiment of a disk management method. Fig. 1 is a schematic diagram illustrating an embodiment of a disk management method provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
step S10, acquiring drive symbols and corresponding serial numbers of all disks in the storage system, and storing the drive symbols and the corresponding serial numbers in a first query list;
step S20, respectively acquiring names and corresponding serial numbers of all SAS cards and names and corresponding serial numbers of all RAID cards in the storage system, and sequentially acquiring drive symbols and corresponding serial numbers of all disks in each SAS card according to the serial numbers of all SAS cards and storing the drive symbols and the corresponding serial numbers in a second query list;
step S30, acquiring the drive letter and the corresponding serial number of each disk in each RAID card in turn according to the serial number of each RAID card, and storing the drive letter and the corresponding serial number into a third query list;
step S40, information in the second query list and the third query list is integrated into the first query list according to the serial numbers, discs which are not identified by the storage system are found out based on the integrated first query list, and the serial numbers of the discs which are not identified are marked to be distinguished from other identifiable discs in the integrated first query list;
and step S50, setting different styles for the distinguished unidentified disk and the identifiable disk on the interface of the storage system for management.
In the embodiment of the present invention, different patterns are respectively set for the distinguished unidentified disk and the distinguished disk on the interface of the storage system for management, and specifically, the method includes: two information interface display modes are constructed in an interface, the first mode is that a system cluster diagram with an equipment physical view is constructed aiming at an identifiable disk of a storage system, and functions of disk replacement, capacity expansion and contraction, disk positioning and the like are integrated in the interface to form an integrated disk management interface; and another loose interface display form is constructed aiming at the unidentifiable disk (namely the unidentified disk) of the storage system, and is displayed from the topological form of cluster-node-disk information, and the loose disk information display interface does not support the functions of disk replacement, capacity expansion, disk positioning and the like. The cluster disk information can be comprehensively classified and displayed by setting two different forms of reconstructed disk information interface display, so that the defect of the conventional classification management of unrecognizable disks in a storage system is overcome; the functions of disk management are integrated according to the characteristics of the identifiable disks and the unrecognizable disks, so that the functions are not influenced mutually, and the centralized classified management of the disks is realized.
RAID (Redundant Array of Independent Disks) is a technique that combines a plurality of Independent hard Disks (physical hard Disks) in different ways to form a hard disk group (logical hard disk), thereby providing higher storage performance than a single hard disk and providing data redundancy. The RAID card can support SAS and SATA hard disks to form RAID6\5\3\1\0\10 and the like.
SAS cards, also known as disk array cards, are used for RAID. The system is generally supported to be RAID0\1\10\1E or directly identify SAS hard disks, and is compatible with SATA hard disks (serial hard disks). Sas (serial Attached SCSI), which is a serial Attached SCSI, is a new generation of SCSI technology, and like the popular SATA hard disk, serial technology is used to obtain higher transmission speed and improve internal space by shortening connection lines. SAS is a completely new interface developed after parallel SCSI interfaces, which are designed to improve the performance, availability and scalability of storage systems and to provide compatibility with SATA hard disks.
In the embodiment of the invention, the drive symbols and the serial numbers of all the disks in the storage system are obtained and stored in the first query list, the drive symbols and the serial numbers of the disks belonging to the SAS card in the storage system are obtained and stored in the second query list, and the drive symbols and the serial numbers of the disks belonging to the RAID card are obtained and stored in the third query list, so that the identifiable disks and the unidentifiable disks in the storage system are completely obtained; the second query list and the third query list are integrated into the first query list according to the serial number of the disk, so that the disk which cannot be identified by the storage system can be found out; the recognizable disk and the unrecognizable disk of the storage system can be directly distinguished conveniently by marking the serial number of the unrecognizable disk; the identifiable disks and the unidentifiable disks are classified, arranged and displayed on the storage system interface, so that the disks can be comprehensively managed.
In some embodiments, integrating information in the second query list and the third query list into the first query list according to the sequence number comprises: searching the same serial number in the second query list and the first query list, and adding information which is not in the first query list and corresponds to the serial number in the second query list to the first query list; and searching the same serial number in the third query list and the first query list, and adding information which is not in the first query list and corresponds to the serial number in the third query list to the first query list.
In some embodiments, finding disks not identified by the storage system based on the integrated first query list comprises: and taking the disk corresponding to the serial number which does not exist in the second query list and the third query list as the disk which is not identified by the storage system.
In the above embodiment, after the second query list and the third query list are integrated into the first query list according to the serial number, the recognizable disk and the unrecognizable disk of the storage system may be distinguished by querying the slot information. Specifically, if the serial number does not have corresponding slot position information in the integrated first query list, the disk corresponding to the serial number is an unidentifiable disk of the storage system; correspondingly, if some serial numbers in the integrated first query list have corresponding slot position information, the disks corresponding to the serial numbers are identifiable disks of the storage system. For the unidentifiable disk without the slot position information, the functions of disk replacement, capacity expansion, disk positioning and the like are not arranged on the system interface.
In some embodiments, obtaining drive signatures and corresponding serial numbers of all disks in the storage system comprises: and acquiring the drive letter and the corresponding serial number of all the disks in the storage system by using the ls tool and the smartcll tool.
In this embodiment, ls represents a file list generator, and is an auxiliary tool for generating a file list, which can help a user to easily and conveniently generate a file list, and files on a disk can be organized into a web list by using the tool.
Smartctl (s.m.a.r.t. self-monitoring, analysis and reporting technology) is a suite or tool of command lines implementing SMART tasks under Unix-like systems that is used to print SMART self-tests and error logs, enable and disable SMART automatic detection, and initialize device self-tests. Smartctl is useful for Linux physical servers where intelligent disks can be error checked and disk information related to hardware RAID extracted.
In some embodiments, the obtaining the names and corresponding serial numbers of all SAS cards and the names and corresponding serial numbers of all RAID cards in the storage system respectively includes: and respectively acquiring the names and corresponding serial numbers of all SAS cards and the names and corresponding serial numbers of all RAID cards in the storage system by using an lspci tool.
In this embodiment, the lspci (list all PCI devices in the machine) tool may assist in listing RAID cards, SAS cards, sound cards, video cards, modems, network cards, USB, motherboard integrated devices, and the like in the machine. PCI devices refer to devices that are plugged into these PCI slots. The PCI slot is an expansion slot based on a PCI local bus (Peripheral Component interface).
In some embodiments, sequentially obtaining the drive letter and the corresponding serial number of each disk in each SAS card according to the serial number of each SAS card and storing the drive letter and the corresponding serial number in the second query list includes: and sequentially acquiring the drive letter and the corresponding serial number of each disk in each SAS card according to the serial number of each SAS card by using the SAS2IRCU tool or the SAS3IRCU tool, and storing the drive letter and the corresponding serial number into a second query list.
In this embodiment, both the SAS2IRCU tool and the SAS3IRCU tool are SAS card management tools provided by LSI corporation officially, and acquire information of a required SAS card in a command line control manner.
In some embodiments, sequentially obtaining the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card and storing them in the third query list includes: and sequentially acquiring the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card by using a storcli64 tool, and storing the drive letter and the corresponding serial number into a third query list.
In this embodiment, storcli64 is a RAID card management tool provided by an LSI company official, and information of a required RAID card can be acquired by a different command.
In a second aspect of the embodiments of the present invention, a disk management system is further provided. Fig. 2 is a schematic diagram illustrating an embodiment of a disk management system provided in the present invention. As shown in fig. 2, a disk management system includes: a first query list module 10 configured to obtain drive identifiers and corresponding serial numbers of all disks in the storage system, and store the drive identifiers and the corresponding serial numbers in a first query list; the second query list module 20 is configured to obtain names and corresponding serial numbers of all SAS cards and names and corresponding serial numbers of all RAID cards in the storage system, and sequentially obtain drive symbols and corresponding serial numbers of each disk in each SAS card according to the serial numbers of each SAS card and store the drive symbols and the corresponding serial numbers in the second query list; the third query list module 30 is configured to sequentially obtain the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card, and store the drive letter and the corresponding serial number in the third query list; the integration module 40 is configured to integrate information in the second query list and the third query list into the first query list according to the serial number, to find out the disk that is not identified by the storage system based on the integrated first query list, and to distinguish the disk from the remaining identifiable disks in the integrated first query list by marking the serial number of the disk that is not identified; and a disk management module 50 configured to set different patterns for the distinguished unrecognized disk and the distinguished disk on an interface of the storage system, respectively, to perform management.
In some embodiments, the integration module 40 includes an information integration module configured to search for the same serial number in the second query list as in the first query list, and add information that does not exist in the first query list corresponding to the serial number in the second query list to the first query list; and searching the same serial number in the third query list and the first query list, and adding information which is not in the first query list and corresponds to the serial number in the third query list to the first query list.
In some embodiments, the integration module 40 further includes an identification module configured to use the disk corresponding to the serial number that is not present in the second query list and the third query list as the disk that is not identified by the storage system.
In some embodiments, the first query list module 10 includes a first obtaining module configured to obtain drive letters and corresponding serial numbers of all disks in the storage system by using the ls tool and the smartclt tool.
In some embodiments, the second lookup list module 20 includes a second obtaining module configured to obtain names and corresponding serial numbers of all SAS cards and names and corresponding serial numbers of all RAID cards in the storage system, respectively, using an lspci tool.
In some embodiments, the second query list module 20 further includes a third obtaining module configured to sequentially obtain, by using the SAS2IRCU tool or the SAS3IRCU tool, the drive letter and the corresponding serial number of each disk in each SAS card according to the serial number of each SAS card, and store the drive letter and the corresponding serial number in the second query list.
In some embodiments, the third query list module 30 includes a fourth obtaining module configured to sequentially obtain the drive letter and the corresponding serial number of each disk in each RAID card according to the serial number of each RAID card by using the storcli64 tool, and store the drive letter and the corresponding serial number in the third query list.
In a third aspect of the embodiment of the present invention, a computer-readable storage medium is further provided, and fig. 3 illustrates a schematic diagram of a computer-readable storage medium implementing a disk management method according to an embodiment of the present invention. As shown in fig. 3, the computer-readable storage medium 3 stores computer program instructions 31. The computer program instructions 31, when executed by a processor, implement the method of any of the embodiments described above.
It is to be understood that all embodiments, features and advantages set forth above with respect to the disk management method according to the present invention apply equally, without conflict with one another, to the disk management system and to the storage medium according to the present invention.
In a fourth aspect of the embodiments of the present invention, there is further provided a computer device, including a memory 402 and a processor 401 as shown in fig. 4, where the memory 402 stores therein a computer program, and the computer program, when executed by the processor 401, implements the method of any one of the above embodiments.
Fig. 4 is a schematic hardware structure diagram of an embodiment of a computer device for executing a disk management method according to the present invention. Taking the computer device shown in fig. 4 as an example, the computer device includes a processor 401 and a memory 402, and may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected by a bus or other means, and fig. 4 illustrates an example of a connection by a bus. The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the disk management system. The output device 404 may include a display device such as a display screen.
The memory 402, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the disk management method in the embodiment of the present application. The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of a disk management method, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 402 may optionally include memory located remotely from processor 401, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor 401 executes various functional applications of the server and data processing by running nonvolatile software programs, instructions, and modules stored in the memory 402, that is, implements the disk management method of the above-described method embodiment.
Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.