CN115454341A - Method and server for associating logical disk identifier with hard disk slot - Google Patents

Method and server for associating logical disk identifier with hard disk slot Download PDF

Info

Publication number
CN115454341A
CN115454341A CN202211099604.7A CN202211099604A CN115454341A CN 115454341 A CN115454341 A CN 115454341A CN 202211099604 A CN202211099604 A CN 202211099604A CN 115454341 A CN115454341 A CN 115454341A
Authority
CN
China
Prior art keywords
hard disk
target
relative position
position number
logical
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
CN202211099604.7A
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.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies 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 XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202211099604.7A priority Critical patent/CN115454341A/en
Publication of CN115454341A publication Critical patent/CN115454341A/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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0026PCI express

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a server for associating logical disk symbols with hard disk slots. In an embodiment, the method comprises: the processor acquires hardware configuration relation information sent by the out-of-band controller; the hardware configuration relation information is used for expressing the address of the storage controller, the relative position number of a first hard disk slot used by the storage controller for managing the hard disk and the absolute position number of the hard disk slot corresponding to the relative position number of the first hard disk slot; the processor determines a target logical drive letter corresponding to the address of the target storage controller; the processor determines the relative position number of a target hard disk slot of a target logical disk character in a target storage controller; and the CPU of the processor determines the absolute position number of the target hard disk slot corresponding to the relative position number of the target hard disk slot based on the hardware configuration relation information and the address of the target storage controller. Therefore, the hard disk slot on the server is positioned without depending on lighting of each hard disk positioning lamp, and the positioning efficiency and accuracy are improved.

Description

Method and server for associating logical disk identifier with hard disk slot
Technical Field
The present application relates to the technical field of servers, and in particular, to a method for associating logical disk identifiers with hard disk slots and a server.
Background
In the large-scale production stage of the current server, because the hard disks are assembled manually, the situations of wrong insertion, missed insertion, virtual connection and the like cannot be avoided, particularly for a storage type server, the number of the hard disks reaches dozens or even hundreds, and the hard disk slot position verification is a necessary testing link. Hard disk management in the server field has been a difficult matter, especially the association management of out-of-band management and in-band management. The hard disk failure is often shown on the operating system side, and how to locate the hard disk is a difficult thing.
Therefore, how to determine the correspondence between the logical disk identifier of the operating system and the hard disk slot on the server becomes a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a method and a server for associating a logical disk identifier with a hard disk slot, and the corresponding relation between the logical disk identifier of an operating system and a hard disk node on the server can be determined through information exchange between in-band management software and out-of-band management software, so that subsequent hard disk fault location is facilitated.
In a first aspect, an embodiment of the present application provides a method for associating a logical disk identifier with a hard disk slot, where a processor acquires hardware configuration relationship information sent by an out-of-band controller; the hardware configuration relationship information is used for representing the address of a storage controller, the relative position number of a hard disk slot used by the storage controller for managing a hard disk, and the absolute position number of the hard disk slot corresponding to the relative position number of the hard disk slot; the processor determines a target logical drive letter corresponding to the address of the target storage controller; the processor determines the relative position number of the target hard disk slot of the target logical disk identifier in the target storage controller; and the processor determines the absolute position number of the target hard disk slot corresponding to the relative position number of the target hard disk slot based on the hardware configuration relation information and the address of the target storage controller.
In the scheme, the information of the in-band management software acquired by the processor is combined with the information of the out-of-band management software in the out-of-band controller, so that the corresponding relation between the logical disk identifier of the operating system and the hard disk slot on the server can be determined, and the subsequent hard disk fault location is facilitated.
In a possible implementation manner, the determining, by the processor, a relative position number of a target hard disk slot of the target logical disk identifier in the target storage controller includes: the processor determines the number of a target drive hard disk slot corresponding to the target logical disk identifier; the target drive hard disk slot number is a number distributed by the device drive of the target memory based on the hard disk slot relative position number in the target memory controller; and the processor determines a target hard disk slot relative position number corresponding to the target drive hard disk slot number based on the target drive hard disk slot number.
In the scheme, when the target storage controller is a SATA controller or a SAS controller, the device driver of the SATA controller or the SAS controller may be combined to drive the hard disk slot number allocated based on the relative position number of the hard disk slot, and the relative position number of the target hard disk slot is reversely deduced. In essence, the in-band management software uses the relationship between the hard disk slot relative position number and the logical drive signature to infer the hard disk slot relative position number.
In one possible implementation, the target storage controller is a RAID card.
Optionally, the target logical drive letter corresponds to a hard disk; the processor determines the relative position number of the target logical drive letter in the target hard disk slot of the target storage controller, and the method comprises the following steps: the processor looks up first information of the target storage controller based on the number of the target storage controller; the first information comprises relative position numbers of hard disk slots; and the processor determines the relative position number of the target hard disk slot based on the first information.
In the scheme, when the target storage controller is a RAID card, the information of the target storage controller under in-band management software can be directly combined, and the information indicates the relative position number of the hard disk slot and other corresponding information, so that the relative position number of the target hard disk slot is deduced.
In one example, the processor determines a target hard disk slot relative position number based on the first information, including: the processor determines a target hard disk serial number corresponding to the target logical disk identifier; the processor selects a reference hard disk slot relative position number from the first information; the processor determines a reference hard disk serial number based on the number of the target storage controller and the reference hard disk slot relative position number; when the target hard disk serial number is matched with the reference hard disk serial number, the processor takes the reference hard disk slot relative position number as the target hard disk slot relative position number; .
In the scheme, the hard disk slot relative position serial numbers corresponding to the logical disk symbols can be accurately obtained through comparison of the hard disk serial numbers.
In one example, the first information includes a drive hard disk number corresponding to a hard disk slot relative position number; the drive hard disk number is a number distributed by the device drive of the target memory to the hard disk under the relative position number of the hard disk slot in the target memory controller; the processor determines a relative position number of a target hard disk slot based on the first information, and the method comprises the following steps: the processor determines a target drive hard disk number corresponding to the target logical disk identifier; and the processor takes the relative position number of the hard disk slot corresponding to the target drive hard disk number in the first information as the relative position number of the target hard disk slot.
In the scheme, the first information of the in-band management software management RAID card indicates the drive hard disk number corresponding to the relative position number of the hard disk slot, so that the relative position number of the target hard disk slot corresponding to the drive hard disk number corresponding to the target logical drive letter can be determined from the first information of the in-band management software management RAID card through the number distributed by the equipment drive of the RAID card for the hard disk indicated by the relative position number of the hard disk slot.
Optionally, the target logical drive letter corresponds to at least one hard disk; the processor determines the relative position number of the target logical drive letter in the target hard disk slot of the target storage controller, and the method comprises the following steps: the processor determines a target logical disk number corresponding to the target logical disk identifier; the target logical disk number is the number of the logical disk allocated by the hard disk group obtained by grouping the hard disks managed by the device driver of the target storage based on the target storage controller; and the processor determines and determines the relative position number of the target hard disk slot based on the target logical disk number.
In the scheme, the device driver of the RAID card is used for grouping the hard disks managed by the device driver based on the RAID card to obtain the serial numbers of the logical disks allocated to the hard disk groups, so that the relative position serial numbers of the target hard disk slots corresponding to the serial numbers of the drive hard disks corresponding to the target logical disk identifiers can be determined.
In one example, the processor determines a target hard disk slot relative position number based on the target logical disk number, including: the processor determines a target logical disk identifier corresponding to the target logical disk identifier; the processor checks second information under the target storage controller based on the number of the target logical disk and the number of the target storage controller; the second information comprises a reference hard disk slot relative position number, a reference logical disk corresponding to the reference hard disk slot relative position number and a reference logical disk identifier; and when the target logical disk identifier is matched with the reference logical disk identifier and the target logical disk identifier is matched with the reference logical disk identifier, the processor takes the reference hard disk slot relative position number as the target hard disk slot relative position number.
In the scheme, the hard disk slot relative position number corresponding to the logical disk identifier is accurately obtained through comparison of the logical disk identifier and the logical disk identifier.
In one example, the target hard disk slot relative position number indicates the number of the hard disk backplane connected by the storage controller and the number of the hard disk slot connected by the hard disk backplane.
In one example, the processor determines a target hard disk slot relative position number based on the target logical disk number, including: the processor looks up third information of the target storage controller based on the number of the target storage controller; the third information comprises a relative position number of a hard disk slot and a corresponding logical disk number; and the processor takes the relative position number of the hard disk slot corresponding to the target logical disk number in the third information as the relative position number of the target hard disk slot.
In the scheme, when the target storage controller is a RAID card, the information of the target storage controller under in-band management software can be directly combined, and the information indicates the relative position number of the hard disk slot and the corresponding logical disk number, so that the relative position number of the hard disk slot is reversely deduced through the logical disk number of the logical disk symbol.
In a second aspect, an embodiment of the present application provides a method for associating a logical drive letter with a hard disk slot, where the method includes: the method comprises the steps that an out-of-band controller obtains a target logical disk character corresponding to an address of a target storage controller sent by a processor, and the target logical disk character is numbered in the relative position of a target hard disk slot in the target storage controller; the out-of-band controller determines a target hard disk slot absolute position number corresponding to the target hard disk slot relative position number based on hardware configuration relation information and the address of the target storage controller; the hardware configuration relationship information is used for representing the address of a storage controller, the relative position number of a hard disk slot used by the storage controller for managing a hard disk, and the absolute position number of the hard disk slot corresponding to the relative position number of the hard disk slot.
In the scheme, the information of the in-band management software acquired by the processor is combined with the information of the out-of-band management software in the out-of-band controller, so that the corresponding relation between the logical disk identifier of the operating system and the hard disk slot on the server can be determined, and the subsequent hard disk fault location is facilitated.
In a third aspect, an embodiment of the present application provides a method for associating a logical drive letter with a hard disk slot, where the method is applied to a server, where the server includes a processor and an out-of-band controller, and the method includes: the processor determines a target logical disk identifier corresponding to a target storage controller; the processor determines the relative position number of the target hard disk slot of the target logical disk identifier in the target storage controller; the out-of-band controller determines a target hard disk slot absolute position number corresponding to the target hard disk slot relative position number based on hardware configuration relation information and the address of the target storage controller; the hardware configuration relationship information is used for representing addresses of a storage controller, relative position numbers of hard disk slots used by the storage controller for managing hard disks, and absolute position numbers of the hard disk slots corresponding to the relative position numbers of the hard disk slots.
In the scheme, the information of the in-band management software acquired by the processor is combined with the information of the out-of-band management software in the out-of-band controller, so that the corresponding relation between the logical disk identifier of the operating system and the hard disk slot on the server can be determined, and the subsequent hard disk fault location is facilitated.
In a fourth aspect, an embodiment of the present application provides a server, including a processor and an out-of-band controller, where the processor is configured to execute a program of in-band management software to perform the method provided in the first aspect, or the out-of-band controller is configured to perform the method provided in the second aspect, or the processor and the out-of-band controller are configured to perform the method provided in the third aspect.
In a fifth aspect, an embodiment of the present application provides an apparatus for associating a logical drive letter with a hard disk slot, including: at least one memory for storing a program; at least one processor for executing the memory-stored program, the processor being configured to perform the method provided in the first aspect when the memory-stored program is executed; an out-of-band controller for executing the memory stored program, the processor being adapted to perform the method provided in the second aspect when the memory stored program is executed.
In a sixth aspect, an embodiment of the present application provides an apparatus for associating a logical drive letter with a hard disk slot, where the apparatus executes computer program instructions to perform the method provided in the first aspect, or to perform the method provided in the second aspect. Illustratively, the device may be a processor or an out-of-band controller.
In one example, the apparatus may include a processor, which may be coupled with a memory, read instructions in the memory and execute the method provided in the first aspect according to the instructions. The memory may be integrated in the chip or the processor, or may be independent of the chip or the processor.
In one example, the apparatus may include an out-of-band controller, which may be coupled with the memory, read the instructions in the memory and execute the method provided in the second aspect in accordance with the instructions. The memory may be integrated in a chip or an out-of-band controller, or may be independent of the out-of-band controller.
In a seventh aspect, an embodiment of the present application provides a computer storage medium, in which instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to perform the method provided in the first aspect, or perform the method provided in the second aspect.
In an eighth aspect, embodiments of the present application provide a computer program product comprising instructions which, when executed on a computer, cause the computer to perform the method provided in the first aspect, or to perform the method provided in the second aspect.
Drawings
Fig. 1 is a schematic structural diagram of a server provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of the connection relationship between the storage controller, the hard disk backplane and the hard disk shown in FIG. 1;
FIG. 3 is a flowchart illustrating a method for associating logical drive identifiers with hard disk slots according to an embodiment of the present disclosure;
fig. 4a is a first flowchart illustrating step 320 in fig. 3.
Fig. 4b is a schematic flow chart of step 320 in fig. 3.
Fig. 4c is a third schematic flowchart of step 320 in fig. 3.
FIG. 5a is a first schematic flowchart of step 3222 in FIG. 4 b;
FIG. 5b is a second flowchart of step 3222 in FIG. 4 b;
FIG. 5c is a schematic flow diagram of an arrangement for associating logical drive characters with hard disk slots as provided in FIG. 4 b;
FIG. 6a is a first schematic flow chart of step 3232 in FIG. 4 c;
FIG. 6b is a second flowchart illustration of step 3232 of FIG. 4 c;
FIG. 6c is a schematic flow diagram of an arrangement for associating logical drives and hard disk slots as provided in FIG. 4 c;
fig. 7 is a flowchart illustrating another method for associating a logical drive letter with a hard disk slot according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be described below with reference to the accompanying drawings.
In the description of the embodiments of the present application, the words "exemplary," "for example," or "for instance" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary," "e.g.," or "e.g.," is not to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary," "e.g.," or "exemplary" is intended to present relevant concepts in a concrete fashion.
In the description of the embodiments of the present application, the term "and/or" is only one kind of association relationship describing an association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, B exists alone, and A and B exist at the same time. In addition, the term "plurality" means two or more unless otherwise specified. For example, a plurality of systems refers to two or more systems, and a plurality of terminals refers to two or more terminals.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit indication of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
Hereinafter, some terms in the present embodiment will be explained. It should be noted that these explanations are for the convenience of those skilled in the art, and do not limit the scope of protection claimed in the present application.
In-band management (in-band): the management information of the network and the service information carried by the network are transmitted through the same physical channel. When the management information is more, the performance of the whole network is affected; the flow of management information is less, the influence on the performance of the whole network is not obvious, and in-band management can be adopted. The biggest drawbacks of in-band management are: when the network is interrupted due to a fault, the service information transmission \ and the management information can not be normally transmitted. Here, the Management information includes SNMP (Simple Network Management Protocol), netflow (a Network monitoring function that can collect the number and information of IP packets entering and leaving a Network interface), radius (Remote access Dial-up User Service), charging, and the like. For example: the network management realized by the HP Openview network management software is in-band management, and management information and service information are transmitted through an Ethernet port.
In-band management software (iBMA): software for implementing in-band management (in-band) is located within the operating system.
Out-of-band management (out-of-band): the management information of the network and the service information carried by the network are transmitted through a physical channel. The separation of the management information and the service information can improve the efficiency and the reliability of the network management and is beneficial to improving the security of the management data.
Out-of-band management software (iBMC): software for implementing out-of-band management (out-of-band).
BIOS (Basic Input Output System ): the system is a set of programs solidified on a ROM chip on a computer mainboard, and can provide more simple and easy-to-use functions for the computer as a manager of the most direct hardware setting and control of the computer mainboard. The BIOS stores the most important basic input and output programs of the computer, a self-test program after power-on and a system self-starting program. Its primary function is to provide the lowest level, most direct hardware setup and control for the computer. The change of system hardware is hidden by BIOS, and programs use BIOS functions rather than directly control the hardware.
PCIe (peripheral component interconnect express, a high speed serial computer expansion bus standard): is a peripheral component interconnect standard. The Bus support 256 buses, each Bus supports 32 devices at most, and each Device supports 8 functions at most, so that BDFs (buses, devices, functions) form the identity numbers of devices (referred to as PCIE devices for convenience of description and distinction) hung under the PCIE Bus. Specifically, when a PCIE protocol is used, a plurality of PCIE devices may be hung under a PCIE bus in the server, including a hard disk, a network card, an SAS controller, an SATA controller, and a RAID card. PCIe bus belongs to high-speed serial point-to-point double-channel high-bandwidth transmission, and connected PCIE equipment distributes independent channel bandwidth and does not share bus bandwidth. In the actual board design, the bandwidth required by the device needs to be determined, and the PCIe device can be normally used only by correctly setting the bandwidth under the BIOS. PCIe addresses may be composed of bus number, device number, and function number, such as: 0000; wherein, 01 is bus number; 00 is device number; 0 is the function number.
Hard disk backboard: the hard disk drive comprises a frame for supporting connection between a main board and hard disks, wherein each hard disk back plate can be inserted with a plurality of hard disks through slots (for convenience of description and distinction, referred to as hard disk slots), for example, the hard disks 0 to 7 are inserted on the hard disk back plates through slots slot0 to slot7, each hard disk can correspond to an indicator light correspondingly, and the indicator light can be an LED light.
RAID (Redundant Array of Independent disks, or simply Disk Array): as a key component in the computer, the data security of the user can be effectively protected.
RAID card: the board card for implementing the RAID function is generally composed of a series of components such as an I/O processor, a storage controller, a hard disk connector, and a cache. Briefly, a RAID card is a technology that combines a plurality of independent hard disks (physical hard disks) in different ways to form one logical hard disk, thereby providing higher storage performance than a single hard disk and providing data redundancy. In practical application, one RAID card may be connected to one hard disk backplane, or may be connected to multiple hard disk backplanes.
JBOD (Just Bundle Of Disks, also commonly known as Span): several physical hard disks are logically concatenated one after the other to provide a large logical disk. The data on the Span is stored from the first hard disk simply, and when the storage space of the first hard disk is used up, the data are stored from the following hard disks in sequence. The access performance is completely equivalent to the access operation of a single hard disk.
SATA (Serial Advanced Technology Attachment, an industry standard based Serial hardware driver interface): is a hard disk slot specification commonly proposed by Intel, IBM, dell, APT, maxtor, and Seage corporation.
The SATA controller: and the device is used for connecting the hard disk backboard and controlling the hard disk on the connected hard disk backboard. In practical application, one SATA controller can only be connected to one hard disk backplane, or the SATA controller is connected to a plurality of hard disk backplanes through RAID cards.
Serial Attached SCSI (SAS), which is a new generation of SCSI technology, employs Serial technology to achieve higher transmission speed, and improves internal space by shortening connection lines, and the like.
An SAS controller: and the device is used for connecting the hard disk backboard and controlling the hard disk on the connected hard disk backboard. It is noted that the SATA standard is actually a subset of the SAS standard, and thus, the SAS controller may directly operate the hard disk to which the SATA controller is connected. But the SATA controller cannot control the hard disk to which the SAS controller is connected. In practical application, one SAS controller can only be connected to one hard disk backplane, or the SAS controller is connected to a plurality of hard disk backplanes through RAID cards.
Driver (Device Driver): is a special program that makes it possible for a computer and a device to communicate with each other. The driver is mainly used for completing the function of data transmission between the computer system and the hardware equipment, and only by means of the driver, the computer system and the hardware equipment can communicate and complete specific functions. The driver is a medium between the operating system and the hardware, and realizes bidirectional communication, and transmits the functions of the hardware device to the operating system, and transmits the standard instructions of the operating system to the hardware device.
Hard Disk Serial Number (SN): the number is set by the manufacturer for distinguishing the products when leaving the factory, is unique and is read only. The hard disk serial number is the same as the identity card number of each person.
OS (operation system): the system is arranged on a mainboard of the server, and the OS is provided with a driver of the hard disk, and the driver can acquire the information of the hard disk. The OS program may be loaded to the server operating environment, and the motherboard may communicate with the controller of the backplane through the I2C bus. The motherboard communicates with the hard disk connected to the hard disk backplane via a PCIE (Peripheral Component Interconnect Express). Each mainboard can be in communication connection with a plurality of hard disk backplanes. In view of the current development, the operating systems mainly used at present are the Linux system and the Windows system, and the method provided by the present application is mainly described around the Linux system, but the present application does not limit the specific type of the operating system in consideration of the diversity of the operating systems and the possibility of more new operating systems appearing in the future.
And (3) logical drive symbol: relative identifier of the operating system OS to the hard disk. On the Linux system, the logical drive characters of the hard disk can be represented by sda, sdb and the like; in a Windows system, logical drive letters of a hard Disk may be represented by Disk0, disk1, and the like.
In the large-scale production stage of the current server, because the hard disks are assembled manually, the situations of wrong insertion, missing insertion, virtual connection and the like cannot be avoided, particularly for a storage type server, the number of the hard disks reaches dozens or even hundreds, and the hard disk slot position verification is a necessary testing link. Hard disk management in the field of servers has been a difficult thing all the time, and particularly, the management of the association of out-of-band management and in-band management is difficult. The hard disk failure is often shown on the operating system side, and how to locate the hard disk is a difficult thing. It should be noted that, in the server, the server assigns an absolutely invariable number (called hard disk slot absolute position number for convenience of description and distinction) to each hard disk slot, and usually identifies the periphery of the hard disk slot on the server, and the location of the hard disk refers to determining the hard disk slot absolute position number.
Currently, the absolute position number of a hard disk slot is determined by lighting. Specifically, by lighting, the hard disk position lamps are sequentially lighted, and by sensing of a CPLD (Complex Programmable Logic Device), the iBMC obtains specific position information (indicating the relationship between the hard disk position lamps and the absolute position numbers of the hard disk slots) by the CPLD (digital integrated circuit) and then feeds back the position information to the operating system, and the operating system can obtain the position information of the hard disk (i.e. the absolute position numbers of the hard disk slots corresponding to the hard disk) based on the relationship between the hard disk position lamps and the hard disk.
For the above scheme, on one hand, the RAID card is used as a tool interface, or an interface when the SATA controller and the SAS controller are directly connected to the hard disk backplane. On the other hand, depending on the operating system, the current operating system such as Windows does not provide a lighting interface for directly connecting the SATA controller and the SAS controller to the hard disk backplane. On the other hand, the time is too long, and the error rate is high as the manual confirmation is required.
Therefore, how to determine the corresponding relationship between the logical disk identifier of the operating system and the hard disk slot on the server becomes a technical problem to be solved urgently.
The server includes a storage controller (a controller that controls a hard disk, for example, the SAS controller, the SATA controller, or the RAID card), and the storage controller assigns a number to a hard disk slot into which the hard disk is inserted in order to manage the hard disk connected to the storage controller, where the number indicates a position of the hard disk slot with respect to the storage controller (for convenience of description and distinction, referred to as a hard disk slot relative position number). In addition, the corresponding relation between the relative position number of the hard disk slot and the absolute position number of the hard disk slot is stored through hardware configuration relation information, and the information is stored and maintained by out-of-band management software iBMC. It should be noted that the absolute position number of the hard disk slot is unique, and is usually marked around the hard disk slot on the server and can be seen by the user, for example, when the hard disk fails, the user can find the hard disk slot with the number on the server and replace the failed hard disk of the slot by only informing the absolute position number of the hard disk slot where the failed hard disk is located. In practical application, a plurality of hard disk slots on a server may be arranged on one hard disk backplane or a plurality of hard disk backplanes, the storage controllers connected to each hard disk backplane are different, and the relative position number of the hard disk slot may be understood as the position number of the hard disk slot relative to the storage controller connected to the hard disk backplane where the hard disk slot is located, in other words, the storage controller assigns a number to the connected hard disk slot, so as to implement management; thus, the hard disk slot may vary from one storage controller to another.
In addition, the operating system OS in the server stores logical drive symbol information indicating the storage controller and the logical drive symbol thereunder. The in-band management software iBMA is a part of the operating system, and can acquire the logical disk symbol information of the operating system OS, and in addition, the in-band management software iBMA can derive the relative position number of the hard disk slot corresponding to the logical disk symbol under the storage controller, and obtain a logical disk symbol relationship table, which indicates the correspondence relationship between the storage controller, the logical disk symbol, and the relative position number of the hard disk slot.
Based on this, in order to solve the above technical problem, in the embodiment of the present application, a logical disk identifier relationship table based on the in-band management software iBMA is provided, and the hardware configuration relationship information of the out-of-band management software ibca is combined to obtain the absolute position number of the hard disk slot corresponding to the logical disk identifier. The method can be realized by the following two technical schemes:
the technical scheme 1: the in-band management software iBMA acquires the hardware configuration relationship information from the out-of-band management software iBMC, and further deduces the absolute position number of the hard disk slot corresponding to the logical disk character by combining the logical disk character relationship table.
The technical scheme 2 is as follows: the out-of-band management software iBMC acquires the logical disk character relation table from the in-band management software iBMA, and further deduces the absolute position number of the hard disk slot corresponding to the logical disk character by combining the hardware configuration relation information.
Illustratively, the hardware configuration relationship information is as follows:
Figure BDA0003839703630000071
Figure BDA0003839703630000081
illustratively, the logical drive relationship table is as follows:
Figure BDA0003839703630000082
after the summary:
Figure BDA0003839703630000083
the embodiment of the application provides a server for realizing the technical scheme. Fig. 1 is a schematic structural diagram of a server according to an embodiment of the present application. As shown in fig. 1, the server 100 includes a processor 101, a memory 102, a storage controller 103, a hard disk backplane 104, a hard disk 105, and a BMC chip 106 (a chip for out-of-band management, which may also be referred to as an out-of-band controller). The processor 101 is connected with the memory 102, the storage controller 103 and the BMC chip 106, the storage controller 103 is connected with the hard disk backboard 104, the hard disk backboard 104 is connected with the hard disk 105, and the BMC chip 106 is connected with the storage controller 103 and the hard disk backboard 104. In practical applications, the hard disk backplane 104 may be provided with a plurality of hard disk slots, and each hard disk slot is connected to one hard disk 105. Each hard disk slot is associated with a label, which is typically displayed on the hard disk slot (server) to indicate the corresponding hard disk slot. In this embodiment, this reference number may be referred to as an absolute position number of the hard disk slot.
As shown in fig. 1, the storage controller 103 is connected to a hard disk backplane 104, and the hard disk backplane 104 is connected to a plurality of hard disks 105.
Fig. 2 is a schematic diagram illustrating a connection relationship among the storage controller, the hard disk backplane, and the hard disk shown in fig. 1. As shown in fig. 2, the storage controller 103 is connected to a plurality of hard disk backplanes 104, and each hard disk backplane 104 is connected to a plurality of hard disks 105.
In addition, an operating system OS including a driver of the storage controller 103, in-band management software iBMA, and a vendor tool that manages the storage controller 103 is run in the memory 102. The driver is used for driving the storage controller 103, and implements control of the storage controller 103 by the operating system OS, and generally includes a driver of the storage controller 103 (for convenience of description and distinction, referred to as a device driver) and a driver of a logical disk indicated by a logical disk indicator (for convenience of description and distinction, referred to as a system driver); the vendor tool is used to view information stored by the storage controller 103. Illustratively, the operating system OS is a Linux system and the vendor tool is storcli64.
In addition, the BMC chip 106 stores the out-of-band management software iBMC, and the BMC chip 106 interacts with the storage controller 103, so that the above-mentioned hardware configuration relationship information can be obtained, and in addition, the BMC chip 106 may interact with the hard disk backplane 104 to obtain information of the hard disk backplane 104.
Alternatively, the storage controller may be a SAS controller or a SATA controller. Here, one logical drive letter corresponds to one hard disk. Suitable for the scenario shown in fig. 1.
Optionally, the storage controller is a RAID card. When the RAID card supports multiple hard disk backplane connections, the scenario shown in fig. 1 or fig. 2 may be applicable. When the RAID card does not support multi-hard disk backplane connection, it may be applied to the scenario shown in fig. 1.
In addition, when the storage controller is a RAID card. RAID may have multiple modes. Illustratively, the 1 st mode is a JBOD mode, and one logical drive letter corresponds to one hard disk. Exemplarily, the second mode is a pass-through mode, and one logical drive letter corresponds to one hard disk; illustratively, the third mode is a group RAID, which is to combine a plurality of independent hard disks into a single logic array, and use the single logic array as a whole to achieve functions of improving transmission speed and security. Therefore, the logical drive letter corresponds to several hard disks.
Next, a method for associating a logical drive letter with a hard disk slot according to an embodiment of the present application will be described. The method may be executed by any device having computing and processing capabilities, for example, the server 100 shown in fig. 1, and the server 100 is taken as an example for description below.
Fig. 3 is a flowchart illustrating a method for associating a logical drive letter with a hard disk slot according to an embodiment of the present application. The method comprises the following steps:
in step 310, the processor 101 determines a target logical drive identifier corresponding to the address of the target storage controller.
Wherein the target logical disk indicator indicates an identification of the hard disk allocation managed by the target storage controller by the operating system. The target logical drive identifier may be understood as an identifier of the hard disk by the operating system OS, and is used for distinguishing different hard disks. Illustratively, the operating system OS is a Linux system, and the first logical drive may be represented by sda, sdb, or the like. Illustratively, the operating system OS is a Windows system, and the target logical drive characters may be represented by Disk0, disk1, etc.
The address of the target memory controller is a PCIe address, that is, an address formed by the bus number, the device number, and the function number described above.
The target storage controller may be an SAS controller, an SATA controller, or a RAID card. It should be noted that currently, the mainstream storage controllers are SAS controllers, SATA controllers, and RAID cards, and the embodiments of the present application mainly use SAS controllers, SATA controllers, and RAID cards to exemplarily describe the method provided by the embodiments of the present application, but the present application does not specifically limit the types of the storage controllers in consideration of the diversity of the storage controllers and the storage controllers that may be trusted in the future.
In practical applications, the logical drive letter information may be viewed by instructions, and the list includes the address of the storage controller and its corresponding first logical drive letter. Illustratively, the OS is a Linux system, and the instruction may be [ root @ localhost ] - ] # ll/sys/block/.
For example, suppose [ root @ localhost ] # ll/sys/block/this instruction queries the following query results:
lrwxrwxrwx.1root root 0Mar 26 12:53sda->../devices/pci0000:00/0000:00:1f.2/ata7/host6/target6:0:0/6:0:0:0/b lock/sda
lrwxrwxrwx.1root root 0Mar 26 12:53sdb->../devices/pci0000:00/0000:00:1f.2/ata8/host7/target7:0:0/7:0:0:0/block/sdb
this code specification 0000.
For example, suppose [ root @ localhost ] # ll/sys/block/this instruction queries the following query results:
lrwxrwxrwx.1 root root 0May 14 01:57sda->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:0/end_device-1:0:0/target 1:0:0/1:0:0:0/block/sda
lrwxrwxrwx.1 root root 0May 14 01:57sdb->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:1/end_device-1:0:1/target 1:0:2/1:0:2:0/block/sdb
lrwxrwxrwx.1 root root 0May 14 01:57sdc->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:2/end_device-1:0:2/target 1:0:3/1:0:3:0/block/sdc
lrwxrwxrwx.1root root 0May 14 01:57sdd->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:3/end_device-1:0:3/target 1:0:4/1:0:4:0/block/sdd
this code specification 0000 represents the number of 4 logical drives under the memory controller represented by 31.0, sda, sdb, scdc, sdd, respectively.
In step 320, the processor 101 determines the relative position number of the target hard disk slot of the target logical disk identifier in the target storage controller.
In some embodiments, when the target storage controller is a SATA controller, considering that the target storage controller is connected to a hard disk backplane 104, the relative position number of the hard disk slot is the number of the hard disk slot relative to the SATA controller. For example, suppose that a hard disk backplane is connected to 5 hard disks, and each of the 5 hard disks is connected to the SATA controller through a hard disk slot, and the SATA controller numbers the 5 hard disk slots, which may be 0, 1,2,3, and 4.
In some embodiments, when the target storage controller is a SAS controller, the SAS controller and the SATA controller are similar and will not be described again.
In some embodiments, the target storage controller is a RAID card. When the RAID card supports the connection of a plurality of hard disk backplanes, at the moment, the relative position serial number of the hard disk slot is EID: slotID; the EID represents the position number of the hard disk backplane relative to the storage controller, and the SIOTID represents the number of the hard disk slot relative to the RAID card. Specifically, the RAID card allocates an EID to a connected hard disk backplane, and the hard disk backplane allocates a SlotID to a hard disk slot managed by the RAID card, so that the RAID card can determine a unique hard disk slot by the EID and the SlotID. For example, if the EID allocated by the Raid card to the hard disk backplane is E1, the hard disk backplane is connected to 8 hard disks, and the Slot ids allocated by the hard disk backplane to the 8 hard disk slots of the hard disk backplane are Slot0 to Slot7, the relative positions of the hard disk slots of the 8 hard disk slots are numbered as E1+ Slot0, E1+ Slot1, …, and E1+ Slot7. When the RAID card does not support the connection of the back plates of the plurality of hard disks, the number of the relative position of the hard disk slot is SlotID.
In other words, when the RAID card supports multiple hard disk backplanes, the relative position number of the target hard disk slot is EID: and SIotID, wherein when the RAID card does not support a plurality of hard disk backplanes, the relative position number of the target hard disk slot is SIotID.
Step 330, the BMC chip 106 sends hardware configuration relationship information to the processor 101; the hardware configuration relation information is used for expressing the address of the storage controller, the relative position number of the hard disk slot used by the storage controller for managing the hard disk and the absolute position number of the hard disk slot corresponding to the relative position number of the hard disk slot.
In step 340, the processor 101 determines the absolute position number of the target hard disk slot corresponding to the relative position number of the target hard disk slot based on the hardware configuration relationship information and the address of the target storage controller.
Specifically, determining target information corresponding to an address of a target storage controller from the hardware configuration relationship information, wherein the target information includes relative position numbers of all hard disk slots under the address of the target storage controller and absolute position numbers of the hard disk slots corresponding to the relative position numbers; and then, determining a hard disk slot relative position number which is the same as the target hard disk slot relative position number from the target information, and taking the hard disk slot absolute position number corresponding to the number as a target hard disk slot absolute position number, thereby establishing the corresponding relation among the address of the target storage controller, the target logical disk character, the target hard disk slot relative position number and the target hard disk slot absolute position number. Subsequently, if the target logical drive letter is found to have a problem, the user can find out the hard disk slot with the absolute position number of the target hard disk slot from the server, so as to detect the fault of the hard disk in the hard disk slot.
It should be noted that there may be one or more target hard disk slot relative position numbers corresponding to the target logical disk identifier, which specifically needs to be determined by combining with actual situations.
In the embodiment of the application, through information exchange between the operating system and the BMC chip, the corresponding relation between the logical disk identifier of the operating system and the hard disk slot on the server can be determined, and subsequent hard disk fault location is facilitated.
According to one possible implementation, the target storage controller is a SATA controller or a SAS controller. Here, one logical drive letter corresponds to one hard disk. Suitable for the scenario shown in fig. 1.
Fig. 4a shows a schematic flow chart of step 320 in the embodiment shown in fig. 3.
As shown in fig. 4a, on the basis of the embodiment shown in fig. 3, in the embodiment of the present application, the step 320 may specifically include the following steps:
step 3211, the processor 101 determines a drive hard disk slot number corresponding to the target logical disk identifier; the drive hard disk slot number is a number allocated to the hard disk slot relative position number in the target storage controller by the device drive of the target storage controller.
Specifically, the operating system includes drivers including a system driver and a device driver of the target storage controller. The device driver assigns a number (referred to as a drive hard disk slot number for convenience of description and distinction) based on the hard disk slot relative position number in the target storage controller, and the system driver assigns a target logical disk character number to the target logical disk character based on the device driver number. Specifically, the device-driven encoding rule is an encoding rule A1, and the system-driven encoding rule is an encoding rule A2.
Encoding rule A1: based on the relative position numbers of the hard disk slots in all the SAS controllers and the SATA controllers, numbering the relative position numbers of the hard disk slots of all the SAS controllers and the SATA controllers again according to own logic, and obtaining the numbers of the hard disk slots managed by all the SAS controllers and the SATA controllers (for convenience of description and distinction, the numbers are called as the drive hard disk slot numbers). In addition, the corresponding relation between the drive hard disk slot number and the hard disk slot relative position number is stored.
Encoding rule A2: the logical disk signature is assigned based on the drive hard disk slot number, and therefore, the correspondence between the drive hard disk slot number and the logical disk signature is preserved. The following is an example of how to determine the drive hard disk slot number corresponding to the target logical disk identifier.
Illustratively, for the query result of the query instruction [ root @ localhost ] # ll/sys/block ]:
lrwxrwxrwx.1root root 0Mar 26 12:53sda->../devices/pci0000:00/0000:00:1f.2/ata7/host6/target6:0:0/6:0:0:0/block/sda
lrwxrwxrwx.1root root 0Mar 26 12:53sdb->../devices/pci0000:00/0000:00:1f.2/ata8/host7/target7:0:0/7:0:0:0/block/sdb
here, the drive hard disk slot number of sda is ata7. The drive hard disk slot number of sdb is ata8.
In step 3212, the processor 102 determines the relative position number of the target hard disk slot corresponding to the target logical disk identifier based on the drive hard disk slot number.
Specifically, the processor 101 determines a target hard disk slot relative position number corresponding to the target logical disk identifier based on the drive hard disk slot number and the encoding rule of the device driver. It should be noted that, considering that the coding rules of the device drivers of different operating systems OS are different, the target logical disk identifier number can be combined with the coding rule of the device driver to reversely infer the relative position number of the target hard disk slot corresponding to the target logical disk identifier number, thereby adapting to different scene needs.
Specifically, if the device driver assigns the drive hard disk slot number based on the hard disk slot relative position number under the storage controller, the device driver may reversely infer the target hard disk slot relative position number based on the drive hard disk slot number corresponding to the target logical disk identifier and the coding rule of the device driver.
Assuming that the encoding rule between the relative position number of the hard disk slot and the drive hard disk slot number is rule a, rule a is as follows:
and numbering the storage controllers in sequence, and numbering each storage controller in sequence according to the relative position number of the hard disk slot under the storage controller to obtain the number of the hard disk slot.
Determining the smallest drive hard disk slot number allocated to the storage controller by the device driver based on the address of the storage controller; and determining the relative position number of the target hard disk slot based on the difference between the minimum drive hard disk slot number and the drive hard disk slot number corresponding to the target logical disk character.
For example, if a SATA controller is connected to 4 hard disks, the SATA controller numbers 4 hard disk slots, assuming the controller hard disk slot numbers are ata1, ata2, ata3, and ata4, and the driver numbers the controller hard disk slot numbers, assuming the respective driver hard disk slot numbers of the 4 hard disk slots are ata5, ata6, ata7, ata8, and ata9, respectively, if the number ata7 corresponds to a target logical disk identifier, the location of the logical disk identifier relative to the SATA controller (i.e., the target hard disk slot relative location number) is 7-5=2.
Here, in the embodiment of the present application, the drive hard disk slot number allocated to the hard disk slot relative position number by the device driver in the operating system is used, and in combination with the drive hard disk slot number corresponding to the logical disk identifier, the information corresponding to the logical disk identifier in the target storage controller is reversely deduced, so as to obtain the target hard disk slot relative position number.
In order to facilitate understanding of the technical solution shown in fig. 4a provided in the embodiment of the present application, a Linux system is taken as an example to describe how to determine the relative position number of the target hard disk slot of the target logical disk identifier when the target storage controller is a SATA controller or a SAS controller. The specific process is as follows.
1) The processor 101 queries the SATA controller of the server for information.
And (3) query instructions: [ root @ localhost ] # lspci | grep-i sata
The information obtained is as follows:
00:11.4SATA controller:Intel Corporation C610/X99 series chipset sSATA Controller[AHCI mode](rev 05)
00:1f.2SATA controller:Intel Corporation C610/X99 series chipset 6-Port SATA Controller[AHCI mode](rev 05)
the code specification 00.
2) The processor 101 queries the server for information on all logical drives.
And (3) query instructions: [ root @ localhost ] # ll/sys/block-
total 0
The obtained logical drive letter information is as follows:
lrwxrwxrwx.1 root root 0Mar 26 12:53sda->../devices/pci0000:00/0000:00:1f.2/ata7/host6/target6:0:0/6:0:0:0/block/sda
lrwxrwxrwx.1 root root 0Mar 26 12:53sdb->../devices/pci0000:00/0000:00:1f.2/ata8/host7/target7:0:0/7:0:0:0/block/sdb
this code states that the logical drives of the SATA controller denoted 0000. Further, it can be inferred that no logical drive exists under the SATA controller denoted by 0000 00. And the drive hard disk slots based on sda and sdb are numbered ata7 and ata8.
At this time, 0000.
3) The processor 101 queries all ata numbers (drive hard slot numbers) under the SATA controller based on the address 0000 00 of the SATA controller.
And (3) query instructions: [ root @ localhost 0000 00
total 0
The resulting list:
drwxr-xr-x.6 root root 0 Apr 3 20:44 ata10
drwxr-xr-x.6 root root 0 Apr 3 20:44 ata5
drwxr-xr-x.6 root root 0 Apr 3 20:44 ata6
drwxr-xr-x.6 root root 0 Apr 3 20:44 ata7
drwxr-xr-x.6 root root 0 Apr 3 20:44 ata8
drwxr-xr-x.6 root root 0 Apr 3 20:44 ata9
this code description 0000. The smallest drive hard disk slot is numbered ata5.
Assuming that the encoding rule of the device driver is the rule B, the relative positions of sda and sdb with respect to the hard disk slot of the SATA controller are numbered 2 (ata 7-ata 5), 3 (ata 8-ata 5).
Next, how to determine the relative position number of the target hard disk slot of the target logical disk identifier is described with reference to the out-of-band management software iBMC and the in-band management software iBMA.
For out-of-band management software iBMC (BMC chip 106 running the software): the addresses of two SATA controllers 0000.
For the in-band management software iBMA (the processor 101 runs the software): looking at the following logical disk characters sda, sdb disk of 0000.
And combining the relative position number of the hard disk slot corresponding to the logical disk identifier under the SATA controller of the iBMA and the hardware configuration relationship information under the SATA controller of the iBMC to obtain the corresponding relationship between the logical disk identifier and the absolute position number of the hard disk slot.
According to one possible implementation, the target storage controller is a RAID card.
In one possible implementation, the target logical drive letter corresponds to a hard disk.
Fig. 4b shows a schematic flow chart of step 320 in the embodiment shown in fig. 3.
As shown in fig. 4b, on the basis of the embodiment shown in fig. 3, in the embodiment of the present application, the step 320 may specifically include the following steps:
step 3221, the processor 101 checks first information of the target storage controller based on the number of the target storage controller; the first information comprises relative position numbers of the hard disk slots.
Wherein the number of the storage controller indicates the number assigned to the storage controller by the vendor tool. In specific implementation, a vendor tool may be called to view information under a target storage controller based on the number of the target storage controller, where the information includes the relative position numbers of all hard disk slots under the target storage controller and the corresponding information. Wherein the number of the target storage controller indicates the number assigned by the vendor tool to the target storage controller. Illustratively, the operating system OS is a Linux system, the vendor tool is storcli64, and the number of the storage controller may be 0, 1,2, … ….
Example a, the target storage controller is a RAID card, and RAID is in JBOD mode, assuming that, based on number 0 of the RAID card indicated by 0000 31, the first information of the RAID card indicated by address 0000 31 is queried by the vendor tool storcli64 (only information related to the embodiments of the present application is shown here.
And (3) query instructions: [ root @ linux- ] #/storcli 64/c0show
Here, c0 denotes a Raid card numbered 0.
The first information obtained is as follows:
Product Name=SAS3408-IT
Figure BDA0003839703630000141
wherein, the relative position number of the hard disk slot is EID: let Sit, DID denote the number assigned by the device driver to the hard disk indicated by the hard disk slot relative position number, i.e. the drive hard disk number.
Example B, when the storage controller is a RAID card, and the RAID card is in the pass-through mode, assuming that the number of the RAID card indicated by 0000.
And (3) query instructions: [ root @ linux- ] #/storcli 64/c0show
Here, c0 denotes a RAID card numbered 1.
The first information obtained is as follows:
Product Name=SAS3508
Figure BDA0003839703630000142
step 3222, the processor 101 determines the relative position number of the target hard disk slot based on the first information.
In the embodiment of the application, the relative position number of the hard disk slot used by the storage controller for managing the hard disk can be reversely deduced through the information corresponding to the logical disk identifier in the operating system.
Fig. 5a shows a schematic flow chart of step 3222 in the embodiment shown in fig. 4 b.
As shown in fig. 5a, on the basis of the embodiment shown in fig. 4b, in the embodiment of the present application, step 3222 may specifically include the following steps:
a11, the processor 101 determines a target hard disk serial number corresponding to a target logical disk identifier;
a12, the processor 101 selects a reference hard disk slot relative position number from the first information;
a13, the processor 101 determines a reference hard disk serial number based on the number of the target storage controller and the reference hard disk slot relative position number;
and A14, when the target hard disk serial number is matched with the reference hard disk serial number, the processor 101 takes the reference hard disk slot relative position number as the target hard disk slot relative position number.
It should be noted that, in practical applications, when the target hard disk serial number does not match the reference hard disk serial number, an unselected hard disk slot relative position number is selected from the firmware information as a reference hard disk slot relative position number, and a13 and a14 are continuously performed until the target hard disk slot relative position number is determined.
In order to facilitate understanding of the technical solution of fig. 5a provided in the embodiment of the present application, a Linux system is used as an example of the relative position number of the target hard disk slot of the target logical disk identifier. The specific process is as follows.
1) The processor 101 queries the information of all the logical drives of the server, and assumes that the address 0000 of the target logical drive sdb and its corresponding Raid card is queried.
2) The processor 101 queries the information of the target logical disk character sdb.
And (3) query instructions: localhost: # smartcll-i/dev/sdb
The information obtained is as follows:
===START OF INFORMATION SECTION===
Serial Number:Z302XG0N
here, Z302XG0N denotes the target hard disk serial number.
3) The processor 101 determines the number 0 of the Raid card corresponding to the target logical drive letter sdb based on the address 0000 31 of the Raid card corresponding to the target logical drive letter sdb.
4) The processor 101 looks up first information under the Raid card based on the serial number 0 of the Raid card corresponding to the target logical disk identifier sdb, and assumes that only one hard disk slot relative position number EID: slt in the first information is 69.
5) The processor 101 queries, based on the serial number 0 of the Raid card and the hard disk slot relative position serial number EID: slt69:1 corresponding to the target logical disk identifier sdb, information of the Raid card indicated by the address 0000 31 (only information related to the embodiment of the present application is shown here).
And (3) query instructions: localhost: - #/opt/Uniantos/bin/storcli 64/c0/e69/s1 show all
Here, c0 denotes a Raid card No. 1, e69 denotes a hard disk backplane No. 69, and s1 denotes a hard disk slot No. 1.
The information obtained is as follows:
Drive/c0/e69/s1 Device attributes:
==================================
SN=Z302XG0N
wherein Z302XG0N denotes a reference hard disk serial number.
Further, the processor 101 considers that the target hard disk serial number SN under sdb is the same as the reference hard disk serial number SN under the relative position number EID: slt69:1 of the hard disk slot, so that sdb corresponds to the relative position number EID: slt of the hard disk slot being 69.
Next, how to determine the relative position number of the target hard disk slot of the target logical disk identifier is described with reference to the out-of-band management software iBMC and the in-band management software iBMA.
For out-of-band management software iBMC (BMC chip 106 running this software): the address 0000 31 of the RAID card and the hardware configuration relationship information corresponding to the address may be obtained by the BIOS.
For the in-band management software iBMA (the processor 101 runs the software): the sdb disk under the address 0000 31 of the RAID card can be viewed, and the target hard disk serial number SN under sdb can be viewed: z302XG0N; looking further at the number 0 of the RAID card under 0000 31.00.0, looking at the first information based on the number, assuming that the first information has only 1 disk slot relative position number EID: slt =69, looking up the reference disk serial number SN based on the number 0 and EID: slt =69 of the RAID card under 0000 31: and Z302XG0N, wherein the target hard disk serial number SN under sdb is the same as the reference hard disk serial number SN under the hard disk slot relative position number 69, and the target hard disk slot relative position number EID: slt corresponding to sdb is 69. It should be noted that, assuming that the first information only has a plurality of relative position numbers EID: slt of hard disk slots, the reference hard disk serial number SN under different EIDs: slt needs to be checked based on the serial numbers 0 and EID: slt of the RAID card under 0000. And selecting one of the EIDs Slt as a relative position number EID Slt of the target hard disk slot.
And obtaining the corresponding relation between the logical drive letter and the absolute position number of the hard disk slot by combining the relative position number of the hard disk slot corresponding to the logical drive letter under the RAID card of the iBMA and the hardware configuration relation information under the RAID card of the iBMC.
The first information comprises a drive hard disk number corresponding to the relative position number of the hard disk slot; the drive hard disk number is a number allocated by the device driver to the hard disk indicated by the hard disk slot relative position number in the target storage controller. Specifically, the encoding rule of the device driver of the RAID card is an encoding rule B1, and the encoding rule of the system driver is an encoding rule B2.
Encoding rule B1: the equipment drive of the RAID card interacts with the RAID card, and after the relative position number of the hard disk slot stored in the RAID card is taken, the relative position number of the hard disk slot is numbered according to the logic of the equipment drive to obtain the number of each hard disk connected with the RAID card (for convenience of description and distinction, the number is called as the drive hard disk number). In addition, the corresponding relation between the hard disk drive number and the relative position number of the hard disk slot is stored.
Encoding rule B2: the system hard disk management number is allocated based on the drive hard disk number, the system logical disk management number is allocated based on the system logical disk management number, and therefore, the logical disk symbol corresponds to the drive hard disk number. In addition, the correspondence relationship among the logical disk identifier, the system hard disk management number, and the logical disk management number is stored.
Illustratively, for the query result of the query instruction [ root @ localhost ] # ll/sys/block ]:
lrwxrwxrwx.1root root 0May 14 01:57sda->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:0/end_device-1:0:0/target 1:0:0/1:0:0:0/block/sda
lrwxrwxrwx.1root root 0May 14 01:57sdb->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:1/end_device-1:0:1/target 1:0:2/1:0:2:0/block/sdb
lrwxrwxrwx.1root root 0May 14 01:57sdc->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:2/end_device-1:0:2/target 1:0:3/1:0:3:0/block/sdc
lrwxrwxrwx.1root root 0May 14 01:57sdd->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:3/end_device-1:0:3/target 1:0:4/1:0:4:0/block/sdd
here, the system hard disk management numbers corresponding to sda, sdb, scd, and sdd are port-1, port-1. Here, the last bit (representing ID) plus 1 in the system hard disk management number represents drive hard disk number DID, in other words, port-1; accordingly, the drive hard disk numbers DID corresponding to sda, sdb, scdc, sdd are 1,2,3, 4. Here, target1:0:0, target1:0:2, target1:0:3, and target1:0:4 are system logical disk management numbers.
Fig. 5b shows a schematic flow chart of step 3222 in the embodiment shown in fig. 4 b.
As shown in fig. 5b, on the basis of the embodiment shown in fig. 4b, in the embodiment of the present application, the step 3222 may specifically include the following steps:
a21, the processor 101 determines the number of the target drive hard disk corresponding to the target logical disk identifier.
Specifically, the system hard disk management number corresponding to the target logical disk identifier may be determined, and the target drive hard disk number may be reversely deduced based on the system hard disk management number. In practical application, the ID number in the drive hard disk number in the target information can be checked, and if the drive hard disk number in the target information is numbered from 1 and the ID in the system hard disk management number is numbered from 0, the drive hard disk number can be obtained by the number +1 of the ID in the system hard disk management number.
And A22, the processor 101 takes the relative position number of the hard disk slot corresponding to the target drive hard disk number in the first information as the relative position number of the target hard disk slot.
In addition, in order to ensure the accuracy of the relative position number of the target hard disk slot, the accuracy of the relative position number of the target hard disk slot can be ensured by adopting a hard disk serial number SN matching mode, and the reference value of the corresponding relation of the absolute position number of the hard disk slot corresponding to the target logical disk identifier is further ensured.
Based on this, step a22 specifically includes the following:
the processor 101 uses the relative position number of the hard disk slot corresponding to the target position number in the first information as a reference relative position number of the hard disk slot, and executes a13 and a14.
In order to facilitate understanding of the technical solution of fig. 5b provided in the embodiment of the present application, a Linux system is used as an example of the relative position number of the target hard disk slot of the target logical disk identifier. The specific process is as follows.
Example 1, the storage controller is a RAID card, RAID is in JBOD mode, and the specific query process is as follows.
1) The processor 101 queries the server for information on all logical drives.
And (3) query instructions: [ root @ linux- ] # ll/sys/block
total 0
The obtained logical drive letter information is as follows:
lrwxrwxrwx.1root root 0May 14 01:57sda->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:0/end_device-1:0:0/target 1:0:0/1:0:0:0/block/sda
lrwxrwxrwx.1root root 0May 14 01:57sdb->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:1/end_device-1:0:1/target 1:0:2/1:0:2:0/block/sdb
lrwxrwxrwx.1root root 0May 14 01:57sdc->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:2/end_device-1:0:2/target 1:0:3/1:0:3:0/block/sdc
lrwxrwxrwx.1root root 0May 14 01:57sdd->../devices/pci0000:30/0000:30:02.0/0000:31:00.0/host1/port-1:0/expander-1:0/port-1:0:3/end_device-1:0:3/target 1:0:4/1:0:4:0/block/sdd
this code specification 0000 represents the number of 4 logical drives under the memory controller represented by 31.0, sda, sdb, scdc, sdd, respectively. The system hard disk management numbers of sda, sdb, scdc and sdd are port-1. port-1; accordingly, sda, sdb, scdc, sdd correspond to drive hard disk numbers DID of 1,2,3, 4.
2) The processor 101 determines that the storage controller indicated by 0000.
3) The processor 101 inquires of the number 0 of the RAID card indicated by 0000 31.
4) The processor 101 queries, based on number 0 of the RAID card indicated by 0000.
And (3) query instructions: [ root @ linux- ] #/storcli 64/c0show
Here, c0 denotes a Raid card numbered 0.
The first information obtained is as follows:
Product Name=SAS3408-IT
Figure BDA0003839703630000181
4) The processor 101 numbers the EIDs Slt =5:0,5:1, 5.
Next, how to determine the relative position number of the target hard disk slot of the target logical disk identifier is described with reference to the out-of-band management software iBMC and the in-band management software iBMA.
For out-of-band management software iBMC (BMC chip 106 running the software): the address of the RAID card 0000.
For the in-band management software iBMA (the processor 101 runs the software): looking at the following logical disk characters sda, sdb, scd, and sdd disk of 0000 31.0, based on ID +1 of sda, sdb, scd, and sdd in the system hard disk management number port under the RAID card, it can be found that sda, sdb, sdc, and sdd are 1,2,3,4 at the drive hard disk number DID of the controller, and further, by accessing first information under the device drive of the RAID card indicated by 0000 31 by a vendor tool, it is determined from the first information that the target hard disk slot relative position number EID: slo tID (EID: slt) =5 corresponding to the drive hard disk number DID of 1,2,3,4.
And combining the relative position number of the hard disk slot corresponding to the logical drive letter under the RAID card of the iBMA and the hardware configuration relationship information under the RAID card of the iBMC to obtain the corresponding relationship between the logical drive letter and the absolute position number of the hard disk slot.
Example 2, the storage controller is a RAID card, the RAID is in JBOD mode, and the specific query process is as follows.
1) The processor 101 queries the server for information on all logical drives.
And (3) query instructions: [ root @ linux- ] # ll/sys/block
total 0
The obtained logical drive letter information is as follows:
lrwxrwxrwx 1root root 0May 11 10:08sdc
->../devices/pci0000:24/0000:24:00.0/0000:25:00.0/host7/target7:0:18/7:0:18:0/block/sda
lrwxrwxrwx 1root root 0May 11 10:07sda
->../devices/pci0000:24/0000:24:00.0/0000:25:00.0/host7/target7:0:19/7:0:19:0/block/sdb
this code specification 0000. The system hard disk management numbers of sda and sdb are respectively target7: 0. When 18 and 19 of target7:0 and target7: 0.
2) The processor 101 determines that the storage controller indicated by 0000.
3) The processor 101 queries for a number 0 of a RAID card indicated by 0000.
4) The processor 101 queries, based on the serial number 0 of the RAID card indicated by 0000 25.
And (3) query instructions: [ root @ linux- ] #/storcli 64/c0show
Here, c0 denotes a Raid card numbered 0.
The first information obtained is as follows:
Product Name=SAS3508
Figure BDA0003839703630000191
4) The processor 101 numbers the EIDs Slt = 134.
Next, how to determine the relative position number of the target hard disk slot of the target logical disk identifier is described with reference to the out-of-band management software iBMC and the in-band management software iBMA.
For out-of-band management software iBMC (processor 101 runs the software): the address of the RAID card 0000.00.0 and the hardware configuration relationship information corresponding to the address can be obtained by the BIOS.
For the in-band management software iBMA (the processor 101 runs the software): looking at the following logical disk characters sda, sdb of 0000.00, based on ID of sda, sdb, scd, and sdd in system hard disk management number target under RAID card, sda, sdb can be obtained, drive hard disk number DID of 18,19 of the controller, further, by accessing first information under device drive of RAID card indicated by 0000.00.0 by vendor tool, determining target hard disk slot relative position number EID: slotID (EID: slt) =134 corresponding to drive hard disk number DID of 18,19 from the first information.
And combining the relative position number of the hard disk slot corresponding to the logical drive letter under the RAID card of the iBMA and the hardware configuration relationship information under the RAID card of the iBMC to obtain the corresponding relationship between the logical drive letter and the absolute position number of the hard disk slot.
Fig. 5c is a technical solution for associating logical drive letters with hard disk slots on a server according to an embodiment of the present application. The scheme is applied to the scene that the storage controller is a Raid card, and the Raid card mode is a JBOD mode or a direct mode. The details are as follows.
Step 501, the processor 101 obtains the logical drive letter information under the system drive.
Here, the logical drive letter information describes information related to a logical drive letter under system drive, and includes at least the logical drive letter and an address of a storage controller corresponding to the logical drive letter. In practical application, the query instruction can be used for querying. For example, if the operating system is a Linux system, the logical drive identifier information is a query instruction: [ root @ linux- ] # ll/sys/block/query. Detailed examples see example 1 and example 2 above for fig. 5 b.
Step 502, the processor 101 obtains the address of the target storage controller in the logical drive letter information and the target logical drive letter corresponding to the address.
For details, refer to the above description of step 310, and are not repeated.
Step 503, the processor 101 determines whether the target storage controller is a RAID card in the direct mode or the JBOS mode, and if so, executes step 504.
Specifically, the information about the target storage can be queried based on the address of the target storage, so as to know whether the storage controller is a RAID card in a pass-through mode or a JBOS mode.
Step 504, the processor 101 determines the system hard disk management number corresponding to the target logical disk identifier in the logical disk identifier information; the system hard disk management number is a number assigned by a system drive based on a drive hard disk number of a device drive of the target storage controller.
For details, refer to the above description of step A21 in FIG. 5b, and are not repeated.
And 505, the processor 101 determines the target drive hard disk number of the target logical disk identifier relative to the target storage controller based on the system hard disk management number corresponding to the target logical disk identifier.
For details, refer to the above description of step A21 in FIG. 5b, and are not repeated.
Step 506, the processor 101 determines the number of the target storage controller based on the address of the target storage controller, and determines the first information under the target storage controller under the device driver based on the number of the target storage controller.
For details, refer to the above description of step 3221 in fig. 4b, and are not repeated.
And step 507, the processor 101 determines a reference hard disk slot relative position number corresponding to the target drive hard disk number from the first information.
Here, the hard disk slot relative position number corresponding to the target drive hard disk number in the first information may be taken as the reference hard disk slot relative position number.
And step 508, the processor 101 obtains a reference hard disk serial number SN corresponding to the reference hard disk slot relative position number based on the number of the target storage controller and the reference hard disk slot relative position number.
See the description of fig. 5a above for details.
And 509, the processor 101 determines a target hard disk serial number SN corresponding to the target logical disk identifier.
See the description of fig. 5a above for details.
And 510, when the target hard disk serial number SN is the same as the reference hard disk serial number SN, the processor 101 determines the reference hard disk slot absolute position number as the target hard disk slot absolute position number.
Step 511, the processor 101 determines, based on the hardware configuration relationship information, that the address of the target storage controller and the absolute position number of the hard disk slot under the relative position number of the target hard disk slot are used as the absolute position number of the target hard disk slot corresponding to the target logical disk identifier.
Here, when the target hard disk serial number SN is the same as the reference hard disk serial number SN, it is described that the correspondence between the hard disk slot relative position number corresponding to the target drive hard disk number in the first information and the logical disk identifier is relatively reliable.
In a possible implementation manner, one logical drive letter corresponds to several hard disks, and is suitable for the scenario shown in fig. 2. Illustratively, the RAID card is a group RAID.
The target information includes a target logical drive number assigned by the driver of the operating system for the target logical drive based on the management number in the target storage controller. The encoding rule of the RAID card device drive is encoding rule C1, and the encoding rule of the system drive is encoding rule C2.
The RAID card performs numbering after grouping for all the hard disks managed by the RAID card, and obtains the number of the hard disk group after grouping (for convenience of description and distinction, referred to as a controller hard disk group number).
Encoding rule C1: interacting with the RAID card, and numbering the relative position of the hard disk slot under the RAID card and the controller hard disk group; then, the hard disks indicated by the relative position numbers of the hard disk slots are numbered, the drive hard disk numbers are determined, the controller hard disk groups are numbered according to the own logic, the hard disk group numbers are determined (for convenience of description and distinction, the drive hard disk group numbers are called), and then the logic disk numbers are distributed based on the drive hard disk group numbers, wherein one logic disk number can correspond to one drive hard disk group number or a plurality of drive hard disk group numbers. And storing the corresponding relation among the relative position number of the hard disk slot, the number of the drive hard disk group and the number of the logic disk.
For the encoding rule C1, it is assumed that information under the Raid card corresponding to the logical disk identifier sda is queried by the vendor tool storcli64 based on the serial number 0 of the Raid card corresponding to the logical disk identifier sda and the serial number 0 of the logical disk.
And (3) query instructions: localhost: - #/opt/Uniantos/bin/storcli 64/c0/v 0show all
Here, c0 denotes a Raid card numbered 0, and v0 denotes a logical disk numbered 0.
List obtained:
/c0/v0:
Figure BDA0003839703630000211
PDs for VD 0:
============
Figure BDA0003839703630000212
the relative position number of the hard disk slot is (EID: slt), the number of the drive hard disk (DID), the number of the drive hard Disk Group (DG) and the number of the logical disk (VD).
Encoding rule C2: and allocating system logical disk management numbers based on the logical disk numbers, allocating logical disk symbols based on the system logical disk management numbers, and then storing the corresponding relation between the logical disk symbols and the logical disk management numbers.
By way of example, assume that the query instruction is: [ root @ linux- ] # ll/sys/block
total 0
The obtained logical drive letter information is:
lrwxrwxrwx.1root root 0May 11 12:18sda->../devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/host0/target0:2:0/0:2:0:0/block/sda
2:0 represents a system logical disk management number, where the last bit in the system logical disk management number represents a logical disk number; the logical disc number is 0.
Fig. 4c shows a schematic flow chart of step 320 in the embodiment shown in fig. 3.
As shown in fig. 4c, on the basis of the embodiment shown in fig. 3, in the embodiment of the present application, the step 320 may specifically include the following steps:
step 3231, the processor 101 determines a target logical disk number corresponding to the target logical disk identifier; the target logical disk number is the number of the logical disk allocated by at least one hard disk group obtained by grouping the multiple hard disks managed by the device driver of the target storage controller based on the target storage controller.
Here, one logical disk may correspond to one hard disk group, and may also correspond to a plurality of hard disk groups, which is specifically determined by combining actual conditions.
In practical applications, the target logical disk number may be determined based on the logical disk management number (assigned by the system drive) corresponding to the target logical disk identifier. Details are not repeated with reference to the above description.
Step 3232, the processor 101 determines, based on the target logical disk number, a relative position number of the target hard disk slot.
In the embodiment of the application, the relative position number of the hard disk slot corresponding to the target logical disk number can be reversely deduced through the target logical disk number corresponding to the logical disk symbol in the operating system.
Fig. 6a shows a schematic flow chart of step 3222 in the embodiment shown in fig. 4 c.
As shown in fig. 6a, on the basis of the embodiment shown in fig. 4c, in the embodiment of the present application, step 3232 may specifically include the following steps:
and step B11, the processor 101 determines the target logical disk identifier corresponding to the target logical disk identifier.
Step B12, the processor 101 checks second information under the target storage controller based on the number of the target logical disk and the number of the target storage controller; the second information comprises a reference hard disk slot relative position number, a reference logical disk corresponding to the reference hard disk slot relative position number and a reference logical disk identifier.
And step B13, when the target logical disk character is matched with the reference logical disk character and the target logical disk identification is matched with the reference logical disk identification, the processor 101 takes the corresponding reference hard disk slot relative position number as the target hard disk slot relative position number.
In order to facilitate understanding of the technical solution of fig. 6a provided in the embodiment of the present application, a Linux system is used as an example of a target hard disk slot relative position number of a target logical disk identifier. The specific process is as follows.
1) The processor 101 queries the server for information on all logical drives.
Assume that based on the query instruction: [ root @ linux- ] # ll/sys/block/, obtaining a target logical disk symbol sda, the address of the corresponding Raid card and a logical disk management number target0:2:0, and analyzing to obtain that the target logical disk number corresponding to the target logical disk symbol sda is 0.
2) The information of the target logical drive sda is queried.
And (3) query instructions: localhost: # smartcll-i/dev/sda
The obtained information list is:
===START OF INFORMATION SECTION===
Logical Unit id:0x68ce5ef243e470002a56d02f15eb9a7d
wherein 0x68ce5ef243e470002a56d02f15eb9a7d represents the target logical disk identification.
4) And determining the serial number 0 of the Raid card corresponding to the logical drive sda based on the address of the Raid card corresponding to the logical drive sda.
5) Based on the serial number 0 of the Raid card corresponding to the logical drive sda and the target logical drive serial number 0, the information under the Raid card corresponding to the logical drive sda is queried by the vendor tool stor cli64.
And (3) query instructions: localhost: - #/opt/Uniantos/bin/storcli 64/c0/v 0show all
Here, c0 denotes a Raid card numbered 0, and v0 denotes a logical disk numbered 0.
The resulting list:
/c0/v0:
Figure BDA0003839703630000221
PDs for VD 0:
============
Figure BDA0003839703630000222
VD0 Properties:
==============
OS Drive Name=/dev/sda
SCSI NAA Id=68ce5ef243e470002a56d02f15eb9a7d
wherein 68ce5ef243e470002a56d02f15eb9a7d represents the reference logical disk identification.
Further, in consideration that the target logical disk identification under sda matches the reference logical disk identification, the hard disk slot relative position number EID: slt corresponding to the target logical disk number VD =0 and DG =0 corresponding to the target logical disk number VD =0 is 69, so that the target hard disk slot relative position number EID: slt corresponding to sda is 69.
Next, how to determine the relative position number of the target hard disk slot of the target logical disk identifier is described with reference to the out-of-band management software iBMC and the in-band management software iBMA.
For out-of-band management software iBMC (BMC chip 106 running this software): the address of the RAID card and the hardware configuration relationship information corresponding to the address may be obtained by the BIOS.
For the in-band management software iBMA (the processor 101 runs the software): the sda disk below the address of the RAID card can be viewed, the Logical Unit Id (corresponding to the target Logical disk identifier) under sda can be viewed, further, the relative position number 69 of the hard disk slot under c0 and v0, the SCSI NAA Id (corresponding to the reference Logical disk identifier), and the OS Drive Name (corresponding to the reference Logical disk identifier) are viewed, the Logical Unit Id and the SCSI NAA Id match, the OS Drive Name and the Logical disk identifier sda match, and the relative position number of the target hard disk slot corresponding to sda is 69.
Fig. 6b shows a schematic flow chart of step 3222 in the embodiment shown in fig. 4 c.
As shown in fig. 6b, on the basis of the embodiment shown in fig. 4c, in the embodiment of the present application, step 3232 may specifically include the following steps:
step B21, the processor 101 checks third information of the target storage controller based on the number of the target storage controller; the third information includes the relative position number of the hard disk slot and the corresponding logical disk number.
Here, the third information indicates related information under a target storage controller stored by the device driver.
For example, assuming that the address of the Raid card is 0000 3b, 00.0, and the number is 0, the third information of the Raid card indicated by 0000 3b, 00.0 is queried by the vendor tool storcli64 (only information related to the embodiment of the present application is shown here).
And (3) query instructions: [ root @ linux- ] #/storcli 64/c0show
The obtained third information:
Product Name=AVAGO MegaRAID SAS 9440-8i
VD LIST:
Figure BDA0003839703630000231
PD LIST:
Figure BDA0003839703630000232
and step B22, the processor 101 takes the relative position number of the hard disk slot corresponding to the target logical disk number in the third information as the relative position number of the target hard disk slot.
On the basis of the above example, assuming that the target logical disk number VD is 0, DG corresponding to VD is 0, DG =0 and hard disk slot relative position numbers EID: slt corresponding to 0 are 69, the target hard disk slot relative position numbers are 69 and 69.
In addition, in order to ensure the accuracy of the relative position number of the target hard disk slot, the accuracy of the relative position number of the target hard disk slot can be ensured by adopting a logic disk identifier matching mode, and the reference value of the corresponding relation of the absolute position number of the hard disk slot corresponding to the target logic disk identifier is further ensured. Based on this, step B22 also includes the following steps:
the processor 101 executes B12, and when the target logical disc character matches the reference logical disc character and the target logical disc identification matches the reference logical disc identification, B13.
In addition, after the processor executes B12, when the target logical disk identifier does not match the reference logical disk identifier and/or the target logical disk identifier does not match the reference logical disk identifier, B12 is executed with a logical disk number other than the target logical disk number in the third information as the target logical disk number, and when the target logical disk identifier matches the reference logical disk identifier and the target logical disk identifier matches the reference logical disk identifier, B13 is executed.
In order to facilitate understanding of the technical solution of fig. 6b provided in the embodiment of the present application, a Linux system is used as an example of a target hard disk slot relative position number of a target logical disk identifier. The specific process is as follows. .
1) The processor 101 queries the server for information on all logical drives.
And (3) query instructions: [ root @ linux- ] # ll/sys/block
total 0
The obtained logical drive letter information is as follows:
lrwxrwxrwx.1root root 0May 11 12:18sda->../devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/host0/target0:2:0/0:2:0:0/block/sda
this code specification 0000. The system logical disk management number corresponding to sda is target0:2:0. the last of target0:2:0 is representing ID, then sda corresponds to the target logical disk number of 0.
2) The number of the Raid card indicated by query 0000.
3) Based on the number 0 of the Raid card corresponding to 0000.
And (3) query instructions: [ root @ linux- ] #/storcli 64/c0show
The obtained third information:
Product Name=AVAGO MegaRAID SAS 9440-8i
VD LIST:
Figure BDA0003839703630000241
PD LIST:
Figure BDA0003839703630000242
the processor 101 compares the drive hard disk group number DG =0 corresponding to the target logical disk number VD =0, and the EID: slotID (EID: slt) =69 corresponding to DG =0d in the third information with 1.
Next, how to determine the relative position number of the target hard disk slot of the target logical disk identifier is described with reference to the out-of-band management software iBMC and the in-band management software iBMA.
For out-of-band management software iBMC (BMC chip 106 running the software): the RAID card address of 0000.
For the in-band management software iBMA (the processor 101 runs the software): the following logical disk identifier information sda disk of 0000, 3b, 00.0 can be obtained by looking up the target number (system logical disk management number) under the RAID card, and further, the drive hard disk group number DG =0 corresponding to the logical disk number VD =0 can be obtained by querying, so as to obtain the corresponding EID: slot id (EID: slt): 69, 69.
And combining the relative position number of the hard disk slot corresponding to the logical drive letter under the RAID card of the iBMA and the hardware configuration relationship information under the RAID card of the iBMC to obtain the corresponding relationship between the logical drive letter and the absolute position number of the hard disk slot.
Fig. 6c is a technical solution for associating logical drive letters with hard disk slots on a server according to an embodiment of the present application. The scheme is applied to the storage controller which is a RAID card, and the mode of the RAID card is a group RAID mode. The details are as follows.
Step 601, the processor 101 acquires the logical drive letter information under the system drive.
For details, refer to the above description of step 501, and are not repeated. For example, if the operating system is a Linux system, the logical drive letter information is a query instruction: [ root @ linux- ] # ll/sys/block/query. Detailed examples see the example above for fig. 6 b.
Step 602, the processor 101 obtains the address of the storage controller in the logical drive letter information and the logical drive letter corresponding to the address.
For details, refer to the above description of step 310, and are not repeated.
Step 603, the processor 101 determines whether the storage controller is a Raid card in the group Raid mode, and if yes, executes step 604.
Specifically, the relevant information of the target memory can be queried based on the address of the target memory, so that whether the storage controller is a RAID card in a group Raid mode or not is known.
Step 604, the processor 101 determines the number of the memory controller based on the address of the target memory controller.
For details, refer to the above description of step 3221 in fig. 4b, and are not repeated.
Step 605, the processor 101 determines a system logical disk management number corresponding to the target logical disk identifier in the logical disk identifier information; wherein the system logical disk management number is a number assigned by a logical disk number assigned by the system drive based on the device drive of the target storage controller.
Details are referred to the above description of fig. 4c and will not be repeated.
And step 606, the processor 101 determines the target logical disk number of the target logical disk identifier relative to the target storage controller based on the system logical disk management number corresponding to the target logical disk identifier.
Details are referred to the above description of fig. 4c and will not be repeated.
And step 607, the processor 101 determines second information corresponding to the target logical disk number based on the target logical disk number and the number of the target storage controller.
Details are referred to the above description of fig. 6a and will not be repeated.
Step 608, the processor 101 determines whether the relative position number of the hard disk slot included in the second information corresponds to a logical disk identifier and a logical disk identifier, if yes, step 609 is executed, otherwise, step 612 is executed.
In step 609, the processor 101 determines the relative position number of the reference hard disk slot and the corresponding reference logical disk identifier and reference logical disk identifier from the second information.
Step 610, the processor 101 determines the target logical disc id corresponding to the target logical disc id.
For details, reference is made to the above description of the example of fig. 6a, which is not repeated.
And 611, when the target logical disk identifier is matched with the reference logical disk identifier and the target logical disk identifier is matched, the processor 101 determines the reference hard disk slot relative position number corresponding to the reference logical disk identifier as the target hard disk slot relative position number.
And step 612, the processor 101 determines third information corresponding to the target logical disk number based on the number of the target storage controller.
For details, refer to the above description of step B21 in fig. 6B, and are not repeated.
Step 613, the processor 101 uses the relative position number of the hard disk slot corresponding to the target logical disk number in the third information as the relative position number of the target hard disk slot.
Step 614, the processor 101 determines, based on the hardware configuration relationship information, the address of the target storage controller and the absolute position number of the hard disk slot under the relative position number of the target hard disk slot as the absolute position number of the target hard disk slot corresponding to the target logical disk identifier.
Next, another method for associating a logical drive letter with a hard disk slot provided in the embodiment of the present application will be described. The method may be executed by any device having computing and processing capabilities, for example, the server 100 shown in fig. 1, and the server 100 is taken as an example for description below.
Fig. 7 is a flowchart illustrating another method for associating logical drive letters with hard disk slots according to an embodiment of the present application. The method comprises the following steps:
in step 710, the processor 101 determines the target logical drive letter corresponding to the address of the target storage controller.
The details are referred to the above description and will not be repeated.
At step 720, the processor 101 determines the relative position number of the target hard disk slot of the target logical disk identifier in the target storage controller.
The details are referred to the above description and will not be repeated.
Step 730, the processor 101 sends the address of the target storage controller and the relative position number of the target hard disk slot to the BMC chip 106.
740, the BMC chip 106 determines the absolute position number of the target hard disk slot corresponding to the relative position number of the target hard disk slot based on the hardware configuration relationship information and the address of the target storage controller; the hardware configuration relationship information is used for representing the address of a storage controller, the relative position number of a hard disk slot used by the storage controller for managing a hard disk, and the absolute position number of the hard disk slot corresponding to the relative position number of the hard disk slot.
The details are described above and will not be repeated.
It is understood that the processor in the embodiments of the present application may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general purpose processor may be a microprocessor, but may be any conventional processor. The out-of-band controller has a separate processor, which may be a processor other than the central processing unit, and the out-of-band controller may execute instructions in a separate processing program.
The method steps in the embodiments of the present application may be implemented by hardware, or may be implemented by software instructions executed by a processor or a management controller. The software instructions may consist of corresponding software modules that may be stored in Random Access Memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), registers, a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the application are generated in whole or in part when the computer program instructions are loaded and executed on a processor or an out-of-band controller. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure will be described in detail with reference to specific details.
It should also be noted that in the apparatus and methods of the present application, the components or steps may be disassembled and/or reassembled. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.
It is to be understood that the various numerical references referred to in the embodiments of the present application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of the present application.

Claims (10)

1. A method for associating logical drive characters with hard disk slots, the method comprising:
the processor acquires hardware configuration relation information sent by the out-of-band controller; the hardware configuration relationship information is used for representing an address of a storage controller, a relative position number of a hard disk slot used by the storage controller for managing a hard disk, and an absolute position number of the hard disk slot corresponding to the relative position number of the hard disk slot;
the processor determines a target logical drive letter corresponding to the address of the target storage controller;
the processor determines the relative position number of the target hard disk slot of the target logical disk identifier in the target storage controller;
and the processor determines the absolute position number of the target hard disk slot corresponding to the relative position number of the target hard disk slot based on the hardware configuration relation information and the address of the target storage controller.
2. The method of claim 1, wherein the target storage controller is a SATA controller or a SA S controller, and the determining, by the processor, a target hard disk slot relative position number of the target logical drive letter in the target storage controller comprises:
the processor determines the number of a target drive hard disk slot corresponding to the target logical disk identifier; the target drive hard disk slot number is a number distributed by the device drive of the target memory based on the hard disk slot relative position number in the target memory controller;
and the processor determines the relative position number of the target hard disk slot corresponding to the target hard disk slot number based on the target hard disk slot number.
3. The method of claim 1, wherein the target storage controller is a RAID controller.
4. The method of claim 3, wherein the target logical drive letter corresponds to a hard disk;
the processor determines the relative position number of the target logical drive letter in the target hard disk slot of the target storage controller, and the method comprises the following steps:
the processor looks up first information of the target storage controller based on the number of the target storage controller; the first information comprises a relative position number of a hard disk slot;
and the processor determines the relative position number of the target hard disk slot based on the first information.
5. The method of claim 4, wherein the processor determines a target hard disk slot relative position number based on the first information, comprising:
the processor determines a target hard disk serial number corresponding to the target logical disk identifier;
the processor selects a reference hard disk slot relative position number from the first information;
the processor determines a reference hard disk serial number based on the number of the target storage controller and the reference hard disk slot relative position number;
when the target hard disk serial number is matched with the reference hard disk serial number, the processor takes the reference hard disk slot relative position number as the target hard disk slot relative position number;
alternatively, the first and second electrodes may be,
the first information comprises a drive hard disk number corresponding to the relative position number of the hard disk slot; the drive hard disk number is a number distributed by the device drive of the target memory to the hard disk under the relative position number of the hard disk slot in the target memory controller; the processor determines a relative position number of a target hard disk slot based on the first information, and the method comprises the following steps:
the processor determines a target drive hard disk number corresponding to the target logical disk identifier;
and the processor takes the relative position number of the hard disk slot corresponding to the target drive hard disk number in the first information as the relative position number of the target hard disk slot.
6. The method of claim 3, wherein the target logical drive letter corresponds to at least one hard disk;
the processor determines the relative position number of the target hard disk slot of the target logical disk character in the target storage controller, and the method comprises the following steps:
the processor determines a target logical disk number corresponding to the target logical disk identifier; the target logical disk number is the number of the logical disk allocated by the hard disk group obtained by grouping the hard disks managed by the device driver of the target storage based on the target storage controller;
and the processor determines and determines the relative position number of the target hard disk slot based on the target logical disk number.
7. The method of claim 6, wherein the processor determining a target hard disk slot relative position number based on the target logical disk number comprises:
the processor determines a target logical disk identifier corresponding to the target logical disk identifier;
the processor checks second information under the target storage controller based on the number of the target logical disk and the number of the target storage controller; the second information comprises a reference hard disk slot relative position number, a reference logical disk corresponding to the reference hard disk slot relative position number and a reference logical disk identifier;
when the target logical disk identifier is matched with the reference logical disk identifier and the target logical disk identifier is matched with the reference logical disk identifier, the processor takes the reference hard disk slot relative position number as the target hard disk slot relative position number;
alternatively, the first and second liquid crystal display panels may be,
the processor determines a relative position number of a target hard disk slot based on the target logical disk number, and the method comprises the following steps:
the processor looks up third information of the target storage controller based on the number of the target storage controller; the third information comprises a relative position number of a hard disk slot and a corresponding logical disk number;
and the processor takes the relative position number of the hard disk slot corresponding to the target logical disk number in the third information as the relative position number of the target hard disk slot.
8. A method of associating a logical drive letter with a hard disk slot, the method comprising:
the method comprises the steps that an out-of-band controller obtains a target logical disk character corresponding to an address of a target storage controller sent by a processor, and the target logical disk character is numbered in the relative position of a target hard disk slot in the target storage controller;
the out-of-band controller determines a target hard disk slot absolute position number corresponding to the target hard disk slot relative position number based on hardware configuration relation information and the address of the target storage controller; the hardware configuration relationship information is used for representing the address of a storage controller, the relative position number of a hard disk slot used by the storage controller for managing a hard disk, and the absolute position number of the hard disk slot corresponding to the relative position number of the hard disk slot.
9. A method for associating logical drive characters with hard disk slots, the method being applied to a server, the server including a processor and an out-of-band controller, the method comprising:
the processor determines a target logical disk identifier corresponding to a target storage controller;
the processor determines the relative position number of the target hard disk slot of the target logical disk identifier in the target storage controller;
the out-of-band controller determines a target hard disk slot absolute position number corresponding to the target hard disk slot relative position number based on hardware configuration relation information and the address of the target storage controller; the hardware configuration relationship information is used for representing addresses of a storage controller, relative position numbers of hard disk slots used by the storage controller for managing hard disks, and absolute position numbers of the hard disk slots corresponding to the relative position numbers of the hard disk slots.
10. A server, comprising a processor and an out-of-band controller, the processor being configured to perform the method of any one of claims 1-7, or the out-of-band controller being configured to perform the method of claim 8, or the processor and the out-of-band controller being configured to perform the method of claim 9.
CN202211099604.7A 2022-09-09 2022-09-09 Method and server for associating logical disk identifier with hard disk slot Pending CN115454341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211099604.7A CN115454341A (en) 2022-09-09 2022-09-09 Method and server for associating logical disk identifier with hard disk slot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211099604.7A CN115454341A (en) 2022-09-09 2022-09-09 Method and server for associating logical disk identifier with hard disk slot

Publications (1)

Publication Number Publication Date
CN115454341A true CN115454341A (en) 2022-12-09

Family

ID=84302518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211099604.7A Pending CN115454341A (en) 2022-09-09 2022-09-09 Method and server for associating logical disk identifier with hard disk slot

Country Status (1)

Country Link
CN (1) CN115454341A (en)

Similar Documents

Publication Publication Date Title
CN110427308B (en) Hard disk positioning method and device, electronic equipment and storage medium
US7676694B2 (en) Managing system components
US9471126B2 (en) Power management for PCIE switches and devices in a multi-root input-output virtualization blade chassis
US9684575B2 (en) Failover handling in modular switched fabric for data storage systems
US7549076B2 (en) Fail over method through disk take over and computer system having fail over function
US9367510B2 (en) Backplane controller for handling two SES sidebands using one SMBUS controller and handler controls blinking of LEDs of drives installed on backplane
US20130073110A1 (en) Diagnostic and managing distributed processor system
US9164861B2 (en) Drive mapping using a plurality of connected enclosure management controllers
US8051216B2 (en) Method and integrated circuit for providing enclosure management services utilizing multiple interfaces and protocols
US9762682B2 (en) Methods and systems for managing network attached storage (NAS) within a management subsystem
CN110618918A (en) Control method, control device and control equipment for hard disk status lamp in PCH
EP3547149B1 (en) Method and system for checking errors on cables
US10536329B2 (en) Assisted configuration of data center infrastructure
CN111400121A (en) Server hard disk slot positioning and maintaining method
US8990443B2 (en) Computer system and management server
US9747032B2 (en) System and method for location-based device naming
CN113360437A (en) Disk sequence adjusting device, method, equipment and storage medium of hard disk
CN115454341A (en) Method and server for associating logical disk identifier with hard disk slot
US9921926B2 (en) Management system of server system including a plurality of servers
US6351831B1 (en) Storage network cabling verification system
US11907058B2 (en) Method and device for positioning faulty disk
US20190213147A1 (en) Storage system and mapping method
CN116959549B (en) Automatic hard disk group array method, equipment and medium
TWI816476B (en) Hard disk positioning system, method,server and storage medium
US20230334184A1 (en) Data center security control module and control method thereof

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