CN116339633A - Method, system, equipment and storage medium for setting virtual slot address of magnetic disk - Google Patents

Method, system, equipment and storage medium for setting virtual slot address of magnetic disk Download PDF

Info

Publication number
CN116339633A
CN116339633A CN202310322859.3A CN202310322859A CN116339633A CN 116339633 A CN116339633 A CN 116339633A CN 202310322859 A CN202310322859 A CN 202310322859A CN 116339633 A CN116339633 A CN 116339633A
Authority
CN
China
Prior art keywords
disk
address
virtual slot
controller
sequence
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
CN202310322859.3A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310322859.3A priority Critical patent/CN116339633A/en
Publication of CN116339633A publication Critical patent/CN116339633A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides a method, a system, equipment and a storage medium for setting a virtual slot address of a disk, and relates to the technical field of computers. The method comprises the steps of obtaining a boot sequence number of a controller connected with each disk expander; acquiring the address of a first port of the controller connected with each disk expander; sequentially setting a first serial number of each disk expander according to the guide serial number and the first port address; acquiring the SAS address of each disk; and setting virtual slot addresses of all the disks in sequence according to the first serial number and the SAS address. Thus, the virtual slot addresses of the disks are sequentially arranged, the virtual slot addresses of the disks cannot be repeated, the virtual slot addresses can be used as unique identifications of the disks, the SAS addresses are related to the positions of the disks on the disk expander, the virtual slot addresses of the disks cannot be changed, and the problems of disorder of the disks or drifting of the disks can be avoided.

Description

Method, system, equipment and storage medium for setting virtual slot address of magnetic disk
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, a system, an apparatus, and a storage medium for setting a virtual slot address of a disk.
Background
Storage servers are designed for specific purposes and therefore are configured differently. The number of disks within many storage servers has reached 60 to 108, and in order to manage more disks, the storage servers need to be collocated with more controllers.
The problem that the disorder of the magnetic disk or the drift of the magnetic disk symbols is easily caused by the simultaneous use of a plurality of controllers is solved, in the prior art, the storage server additionally sets aliases for each magnetic disk, the aliases are required to be in one-to-one correspondence with the magnetic disk, the setting is required to be carried out again each time when the magnetic disk is replaced in the later period, and the operation and maintenance operability of the magnetic disk is poor.
Disclosure of Invention
The embodiment of the application provides a method for setting a virtual slot address of a disk, which can avoid the problem of disorder of the disk and improve the operation and maintenance efficiency of the disk.
The embodiment of the application adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for setting a virtual slot address of a disk, where the method includes:
acquiring a guide sequence number of a controller connected with each disk expander;
acquiring the address of a first port of the controller connected with each disk expander;
sequentially setting a first serial number of each disk expander according to the guide serial number and the address of the first port;
Acquiring the SAS address of each disk;
and setting virtual slot addresses of the disks in sequence according to the first serial number and the SAS address.
Optionally, the step of obtaining the boot sequence number of the controller connected to each disk extender includes:
acquiring a guide serial number of the controller determined by the main board;
the boot sequence number is determined according to the boot sequence and the PCIE port address of the controller.
Optionally, the step of sequentially setting the first serial number of each disk expander according to the boot serial number and the address of the first port includes:
determining a first ordering sequence of the disk expanders connected with the controllers according to the guide sequence numbers;
and according to the first ordering sequence, the first serial numbers of the disk expanders connected with the same controller are sequentially set according to the addresses of the first ports.
Optionally, the step of sequentially setting the virtual slot address of each disk according to the first sequence number and the SAS address includes:
determining a second ordering sequence of the magnetic disks connected by the magnetic disk expanders according to the first sequence number;
And according to the second ordering sequence, sequentially setting the virtual slot addresses of the disks connected with the same disk expander according to the SAS address.
Optionally, the boot sequence is consistent with the sequence of physical slot addresses of the disk.
Optionally, the step of sequentially setting the virtual slot address of each disk according to the first sequence number and the SAS address includes:
acquiring an initial slot address of the physical slot address;
and sequentially setting the virtual slot address of each disk from the initial slot address according to the first serial number and the SAS address.
Optionally, the method further comprises:
under the condition that a storage server requests to allocate disk characters, loading each disk according to the sequence of the virtual slot addresses;
the order of the virtual slot addresses is used to allocate the disk drive.
In a second aspect, embodiments of the present application provide a disk virtual slot address setting system, including:
the guide sequence number acquisition module is used for acquiring the guide sequence number of the controller connected with each disk expander;
the first port address acquisition module is used for acquiring the address of the first port of each disk expander;
The first serial number acquisition module is used for sequentially setting the first serial numbers of the disk expanders according to the guide serial numbers and the addresses of the first ports;
the disk SAS address acquisition module is used for acquiring the SAS address of each disk;
and the virtual slot address setting module is used for sequentially setting the virtual slot address of each disk according to the first serial number and the SAS address.
In a third aspect, embodiments of the present application provide a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of the first aspects when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer storage medium having a program stored thereon, which when executed by a processor, implements the steps of the method according to any of the first aspects.
The embodiment of the application provides a method, a system, equipment and a storage medium for setting a virtual slot address of a disk, wherein the method is realized by acquiring a guide sequence number of a controller connected with each disk expander; acquiring an address of a first port of a controller connected with each disk expander; sequentially setting a first serial number of each disk expander according to the guide serial number and the address of the first port; acquiring the SAS address of each disk; and setting virtual slot addresses of all the disks in sequence according to the first serial number and the SAS address. Thus, the first serial numbers of the plurality of disk expanders are sequentially arranged, the first serial numbers of the disk expanders are not repeated, the virtual slot addresses of the disks are sequentially arranged according to the first serial numbers and the SAS addresses, the virtual slot addresses of the disks are not repeated, the virtual slot addresses can be used as unique identifications of the disks, and the SAS addresses are related to the positions of the disks on the disk expanders.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a method for setting a virtual slot address of a disk according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a virtual slot address of a disk according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a virtual slot address setting system for a disk according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In the embodiments of the present application, the words "first," "second," and the like are used to distinguish between the same item or similar items that have substantially the same function and function, and are merely used to clearly describe the technical solutions of the embodiments of the present application, and are not to be construed as indicating or implying relative importance or implying an indication of the number of technical features indicated.
In the embodiments of the present application, the meaning of "a plurality of" means two or more, and the meaning of "at least one" means one or more, unless specifically defined otherwise.
In the related art, the parallel use of a plurality of controllers easily causes the problem of disk disorder or disk symbol drift; for example: the onboard controller and the extrapolation controller have the problem of disordered magnetic disk when being mixed and overlapped.
Wherein, the disk drive is the relative identifier of the system to the disk storage device, and disk disorder or disk drive drift can cause damage to the disk system files and even system crash; in addition, when the disk needs to be replaced, if the disk character drifts, the position of the disk needing to be replaced cannot be directly determined, and the maintenance difficulty is increased.
In a Redhat 6 (Linux System) series Operating System (OS), the drivers are loaded serially, and the loading sequence of the drivers can be adjusted by adjusting PCIE slots (Peripheral Component Interconnect Express, fast peripheral device component interconnection) of the extrapolation controller, so as to avoid disorder of disk loading; in the Redhat 7 series and subsequent operating systems, in order to accelerate system start, a drive loading mode is adjusted, serial is changed into parallel, and the problem of disc character drift cannot be avoided by adjusting PCIE slots.
The magnetic disk connected with the system has a unique identification name SERIAL_ID/WWID/PATH, wherein SERIAL_ID is the SERIAL number of the magnetic disk, WWID is a global unique identification number, and PATH is the PATH of the magnetic disk; related art an alias is set on a disk in a Linux operating system using an Udev rule (a Linux system file management rule), specifically, udev is a mechanism for creating and naming a/dev device node corresponding to a device existing in the system, udev dynamically adds a required device node using matching information provided by sysfs (a Linux file system) and a rule provided by a user, and sets an alias on a serial_id/WWID/PATH of a unique identification name of the disk using the Udev rule.
The problem of disorder of the magnetic disk is not solved by the aliases in the related art, the actual use needs to correspond to the sequence of the magnetic disk one by one, the setting is complex, the magnetic disk and the aliases need to be bound one by one again after the magnetic disk is replaced, and the operability of operation and maintenance is poor.
Based on this, the embodiment of the application provides a method for setting a virtual slot address of a disk, referring to fig. 1, the method includes:
step S101, obtaining a guide sequence number of a controller connected with each disk expander;
The method for setting the virtual slot address of the disk can be applied to Firmware (FW) of a disk expander.
The firmware is a driver of the disk extender, and an operating system of the storage server drives the disk extender through the firmware.
In this embodiment of the present application, a plurality of disk expanders share one firmware, and the firmware controls all the disk controllers, so that virtual slot addresses of the disks connected to all the disk controllers may be set.
The disk virtual slot address storage server set by the firmware cannot be modified, and the disk virtual slot address cannot be changed due to operations such as starting of the storage server.
In this embodiment, the storage server may be connected to at least one controller, where the controller is configured to manage a plurality of disks.
The main board of the storage server is connected with the controller through PCIE ports, wherein PCIE is a high-speed serial computer expansion bus standard, PCIE ports are ports using PCIE standards, and the main board of the storage server and the controller transmit data through the PCIE ports.
The main board comprises a CPLD (Complex Programming Logic Device, complex programmable logic device) main board, wherein the CPLD main board is a digital integrated circuit which is self-structured by users according to respective needs.
The controller may be a SAS card (Serial Attached SCSI ) that supports a variety of disks. Among them, SCSI (Small Computer System Interface ) is an interface standard between a computer and an external device.
Under the condition that the storage server is connected with at least two controllers, the storage server needs to guide the controllers according to a certain sequence, and the storage server is connected with the two controllers, namely a controller A and a controller B respectively, and guide serial numbers are set for the two controllers;
for example, the boot sequence number of the controller a is set to be 1, the boot sequence number of the controller B is set to be 2, the controller a is booted first, and then the controller B is booted, the controller a may be referred to as the controller 1, and the controller B may be referred to as the controller 2;
for another example, the boot number of the controller a is set to 2, the boot number of the controller B is set to 1, the controller B is booted first, and then the controller a is booted, the controller B may be referred to as the controller 1, and the controller a may be referred to as the controller 2.
The boot is a loaded controller, the controller is firstly booted, the storage server loads the controller firstly, and each controller is automatically booted in the starting process of the storage server.
In some embodiments, the CPLD motherboard of the storage server is used to set a boot sequence number for the controller.
In the embodiment of the application, the firmware of the disk extender acquires the boot sequence number of the controller from the storage server.
The controller has at least one first Port (Port), one of which is connected to one of the disk expanders by a connection line. For example, a controller has two first ports, C0 Port and C1Port, each connected to a disk expander.
In this embodiment, the disk extender (expdaner) includes at least one disk slot, and the disk extender defines or manages the slot through the virtual slot address;
for example, the disk expander includes 15 disk slots, the virtual slot addresses may be sequentially 0-14, or the virtual slot addresses may be modified to be 1-15 or 16-30;
for another example, the disk expander includes 10 disk slots, and the virtual slot addresses may be sequentially 0-9.
Step S102, the address of a first port of a controller connected with each disk expander is obtained.
In this embodiment of the present application, the first port is a port of a controller, and the controller is connected to the disk extender through the first port.
The firmware may obtain an address of a first port of a controller to which the disk expander is connected.
In some embodiments, a controller has two first ports, C0 Port and C1Port, respectively, each Port being connected to a disk extender; in other embodiments, one controller has four first ports, C0 Port, C1Port, C2 Port, and C3 Port, respectively.
By way of example, disk expander A is connected to a C0 Port and disk expander B is connected to a C1 Port; the firmware obtains the address of the C0 Port connected with the disk expander A and obtains the address of the C1Port connected with the disk expander B.
Step S103, according to the guide serial number and the address of the first port, the first serial numbers of the disk expanders are set in sequence.
In this embodiment, each disk expander connected to the controller for sorting is first determined according to the boot sequence number, for example, the boot sequence number of the controller a is 1, the boot sequence number of the controller B is 2, and the disk expanders connected to the controller a are first sorted, and then the disk expanders connected to the controller B are sorted, so that the first sequence number of the disk expander connected to the controller a is in front of the first sequence number of the disk expander connected to the controller B.
For example, the controller a and the controller B are respectively connected with 2 disk expanders, the disk expanders connected with the controller a are sequenced first, the serial numbers of the disk expanders connected with the controller a are 1 and 2, then the disk expanders connected with the controller B are sequenced, and the serial numbers of the disk expanders connected with the controller B are 3 and 4.
In this embodiment, the disk expanders connected to the same controller are ordered by the address of the first port.
For example, the controller a is first ordered, where the first serial number of the C0 Port connected disk expander a of the controller a is 1, referred to as disk expander 1, and the first serial number of the C1 Port connected disk expander B of the controller a is 2, referred to as disk expander 2.
After the disk expander a and the disk expander B connected to the controller a are sequenced, the disk expander C and the disk expander D connected to the controller B corresponding to the next boot sequence number are sequenced according to the first sequencing order, where the first sequence number of the disk expander C connected to the C0 Port of the controller B is 3, called the disk expander 3, and the first sequence number of the disk expander D connected to the C1 Port of the controller B is 4, called the disk expander 4.
Step S104, acquiring the SAS address of each disk.
In the embodiment of the application, the Disk includes a Hard Disk, and examples of the Hard Disk include a solid state Disk (Solid State Drive, SSD), a hybrid Hard Disk (Hybrid Hard Drive, HHD), and a conventional Hard Disk (Hard Disk Drive, HDD).
In this embodiment, the disk is connected to the disk slot of the disk expander, and the SAS (Serial Attached SCSI ) address of the disk indicates the position of the disk on the disk expander, and in the case where the position of the disk is unchanged, the SAS address of the disk is unchanged.
In this embodiment of the present application, the disk expander has an initial virtual slot address, taking the disk expander includes 15 slots as an example, the initial virtual slot address of each disk controller is 0-14, and one SAS address corresponds to one initial virtual slot address, but when the initial virtual slot address is changed, the SAS address of the disk will not change, so that the position of the disk in the disk expander can be accurately obtained through the SAS address of the disk.
The SAS address of the disk may be queried by a SAS address query command, for example, by a sg_ses command.
Step 105, according to the first serial number and the SAS address, virtual slot addresses of the disks are set in sequence.
In this embodiment, each disk connected to the disk expander that is first sequenced is first determined according to the first sequence number, in this embodiment, the second sequencing order is first determined according to the first sequence number, for example, the first sequence number of the disk expander 1 is 1, the first sequence number of the disk expander 2 is 2, the disks connected to the disk expander 1 are sequenced first, and then the disks connected to the disk expander 2 are sequenced, so that the virtual slot address of the disk connected to the disk expander 1 is in front of the virtual slot address of the disk connected to the disk expander 2.
For example, 15 disks are respectively connected to the disk expander 1, the disk expander 2, the disk expander 3 and the disk expander 4, the disk expander connected to the disk expander 1 is first ordered, the virtual slot address of the disk connected to the disk expander 1 is 1-15, then the disk expander connected to the disk expander 2, the disk expander 3 and the disk expander 4 is ordered, the virtual slot address of the disk connected to the disk expander 2 is 16-30, the virtual slot address of the disk connected to the disk expander 3 is 31-45, and the virtual slot address of the disk connected to the disk expander 4 is 46-60.
In the embodiment of the application, the disks connected with the same disk expander are ordered through the SAS address.
For example, referring to fig. 2, the virtual slot addresses of the disks connected to the disk expander 1 are sequentially set to 1-15, the virtual slot addresses of the disks connected to the disk expander 2 are sequentially set to 16-30, the virtual slot addresses of the disks connected to the disk expander 3 are sequentially set to 31-45, and the virtual slot addresses of the disks connected to the disk expander 4 are sequentially set to 46-60.
In this embodiment of the present application, the virtual slot address of the disk is determined according to the first sequence number and the SAS address, where the SAS address is related to the position of the disk on the disk expander, so that the virtual slot address of the disk is not changed when the position of the disk is not changed.
When the disk needs to be replaced, for example, the disk with the virtual slot address of 4 is replaced, the SAS address of the replaced disk is consistent with the SAS address of the disk before replacement, the virtual slot address of the replaced disk is still 4, and the virtual slot address of the replaced disk is unchanged.
In some embodiments, all disk expanders are disposed on a chassis, serial numbers are marked on the chassis for disk slots of all disk controllers according to a certain sequence, for example, serial numbers are marked beside the disk slots by a physical manner such as silk screen printing or inscription, and marks of the disk slots can be obtained by a visual manner, and the marked serial numbers are called physical slot addresses. For example, for 4 disk expanders, each disk expander includes 15 slots, and the physical slot addresses are typically labeled sequentially from 1-60 next to the disk slots.
The physical slot address and the virtual slot address are different: the virtual slot address is set by firmware of the disk controller, the virtual slot address can be changed by the firmware, and the virtual slot address storage server can be directly obtained by a command; the physical slot address is a fixed serial number arranged on the case, and cannot be changed due to movement of firmware or a magnetic disk, and the storage server cannot directly acquire the physical slot address.
The kernel device manager (Udev) is a function in the Linux system, and is a default device management tool of the current Linux system. The kernel device manager (Udev) allocates disk tokens to the disks according to the loading order of the disks, typically the order in which the kernel allocates the tokens is SDA, SDB, SDC … …
The disk loading is performed by the firmware of the disk extender, and the firmware of the disk extender can load the disks sequentially according to the sequence of the virtual slot addresses, so that the disk loading sequence of the kernel device manager (Udev) is the sequence of the virtual slot addresses, the kernel device manager (Udev) allocates the disk drive according to the sequence of the virtual slot addresses, for example, the disk drive with the virtual slot address of 1 is SDA, the disk drive with the virtual slot address of 2 is SDB … …, and the disk drive cannot change under the condition that the virtual slot addresses are unchanged.
In the embodiment of the application, the disk virtual slot address storage server set by the firmware cannot be modified, the disk virtual slot address cannot be changed due to operations such as starting of the storage server, further disk symbols distributed according to the sequence of the virtual slot address cannot be changed due to operations of the storage server, and the problem of disk symbol drift caused by closing or starting operations of the storage server is avoided.
According to the method for setting the virtual slot address of the disk, the guide serial numbers of the controllers connected with the disk expanders are obtained; sequentially setting addresses of first ports connected with all disk expanders; acquiring a first serial number of each disk expander according to the guide serial number and the address of the first port; acquiring the SAS address of each disk; and setting the virtual slot address of each disk in sequence according to the first serial number and the SAS address. Thus, the first serial numbers of the plurality of disk expanders are sequentially arranged, the first serial numbers of the disk expanders are not repeated, the virtual slot addresses of the disks are sequentially arranged according to the first serial numbers and the SAS addresses, the virtual slot addresses of the disks are not repeated, the virtual slot addresses can be used as unique identifications of the disks, and the SAS addresses are related to the positions of the disks on the disk expanders.
Optionally, step S101, obtaining a boot sequence number of a controller connected to each disk extender, includes:
acquiring a guide sequence number of a controller determined by a main board according to a guide sequence;
The boot sequence number is determined according to the boot sequence and the PCIE port address of the controller.
In the embodiment of the application, the motherboard includes a CPLD (Complex Programming Logic Device, complex programmable logic device) motherboard.
The CPLD motherboard is a digital integrated circuit with logic functions which are automatically constructed by users according to respective needs.
The main board of the storage server is connected with the controller through PCIE ports, wherein PCIE is a high-speed serial computer expansion bus standard, PCIE ports are ports using PCIE standards, and the main board of the storage server and the controller transmit data through the PCIE ports.
Each PCIE port has a unique address, and a connection location of the controller may be determined according to the PCIE port address of the controller. For example, the PCIE port address may be a PCIE port number, for example, the controller a connects to a PCIE C0 port, the controller B connects to a PCIE C1 port, the PCIE port address of the controller a may be C0, and the controller B connects to a PCIE C1 port may be C1.
The default boot sequence is the sequence in which the port addresses increase, for example, boot the controller a connected to the PCIE C0 port first, and then boot the controller B connected to the PCIE C1 port; the guide serial number of the controller A is 1, and the guide serial number of the controller B is 2;
Alternatively, the boot sequence may be changed, for example, the boot sequence is changed to a serial number with reduced port addresses, for example, the controller B connected to the PCIE C1 port is booted first, and then the controller a connected to the PCIE C0 port is booted; the boot number of the controller B is 1, and the boot number of the controller a is 2.
In some embodiments, the boot sequence is consistent with the physical sequence of the disk slots connected to the controller, and, for example, the physical slot sequence number of the slot connected to the controller a is 1-30, the physical slot sequence number of the slot connected to the controller B is 31-60, and the boot sequence number of the controller a is 1 and the boot sequence number of the controller B is 2 may be set in the motherboard, so that the virtual slot sequence number of the disk connected to the controller a is between the virtual slot sequence numbers of the disk connected to the controller B, and the consistency of the sequence of the virtual slot sequence numbers and the sequence of the physical slot sequence numbers may be ensured.
The method for setting the virtual slot address of the disk provided by the embodiment of the application, for obtaining the guide serial number of the controller connected with each disk expander, comprises the following steps: acquiring a guide serial number of a controller determined by a main board; the boot sequence number is determined according to the PCIE port address of the controller. Therefore, the controllers can be ordered, the serial numbers of the virtual slots of the plurality of magnetic disks connected by the controllers are prevented from being consistent, and the virtual slot addresses of the magnetic disks are ensured to be used as unique identifiers of the magnetic disks.
Optionally, step S103 sequentially sets a first serial number of the disk expander according to the boot serial number and the address of the first port, including:
s1031, determining a first ordering sequence of each disk expander connected with the controllers according to the guide serial numbers;
in this embodiment, each disk expander connected to the controller for sorting is first determined according to the boot sequence number, for example, the boot sequence number of the controller a is 1, the boot sequence number of the controller B is 2, and the disk expanders connected to the controller a are first sorted, and then the disk expanders connected to the controller B are sorted, so that the first sequence number of the disk expander connected to the controller a is in front of the first sequence number of the disk expander connected to the controller B.
Specifically, the first ordering sequence is an ordering sequence of a plurality of disk expanders connected by a controller, for example, the controller A is connected with the disk expander A and the disk expander B, the controller B is connected with the disk expander C and the disk expander D, the first serial number of the controller A is 1, the first serial number of the controller B is 2, and the first ordering sequence is to order the disk expander A and the disk expander B first and then order the disk expander C and the disk expander D.
S1032, according to the first ordering sequence, the first serial numbers of the disk expanders connected with the same controller are sequentially set according to the addresses of the first ports.
For example, the controller a is first ordered, where the first serial number of the C0 Port connected disk expander a of the controller a is 1, referred to as disk expander 1, and the first serial number of the C1 Port connected disk expander B of the controller a is 2, referred to as disk expander 2.
After the disk expander a and the disk expander B connected to the controller a are sequenced, the disk expander C and the disk expander D connected to the controller B corresponding to the next boot sequence number are sequenced according to the first sequencing order, where the first sequence number of the disk expander C connected to the C0 Port of the controller B is 3, called the disk expander 3, and the first sequence number of the disk expander D connected to the C1 Port of the controller B is 4, called the disk expander 4.
According to the method for setting the virtual slot address of the disk, the first serial number of the disk expander is set in sequence according to the guide serial number and the address of the first port, and the method comprises the following steps: determining a first ordering sequence of each disk expander connected with the controllers according to the guide sequence numbers; and according to the first ordering sequence, sequentially setting the first serial numbers of all disk expanders connected with the same controller according to the addresses of the first ports. Thus, according to the first ordering sequence, the first serial numbers of the disk expanders with the leading serial numbers are in front, the first serial numbers of the disk expanders with the trailing serial numbers are behind, the first serial numbers of the plurality of disk expanders connected by the plurality of controllers are avoided to be consistent, further, the repetition of virtual slot addresses of the plurality of disks is avoided, and the virtual slot addresses of the disks are ensured to be used as unique identifiers of the disks.
Optionally, step S105 sequentially sets a virtual slot address of each disk according to the first serial number and the SAS address, including:
s1051, determining a second ordering sequence of the magnetic disks connected by the plurality of magnetic disk expanders according to the first sequence number.
In this embodiment of the present application, the second ordering order is first determined according to the first sequence number, for example, the first sequence number of the disk expander 1 is 1, the first sequence number of the disk expander 2 is 2, the disks connected to the disk expander 1 are ordered first, and then the disks connected to the disk expander 2 are ordered, so that the virtual slot address of the disk connected to the disk expander 1 is in front of the virtual slot address of the disk connected to the disk expander 2.
For example, 15 disks are respectively connected to the disk expander 1, the disk expander 2, the disk expander 3 and the disk expander 4, the disk expander connected to the disk expander 1 is first ordered, the virtual slot address of the disk connected to the disk expander 1 is 1-15, then the disk expander connected to the disk expander 2, the disk expander 3 and the disk expander 4 is ordered, the virtual slot address of the disk connected to the disk expander 2 is 16-30, the virtual slot address of the disk connected to the disk expander 3 is 31-45, and the virtual slot address of the disk connected to the disk expander 4 is 46-60.
S1052, according to the second ordering sequence, setting the virtual slot addresses of the discs connected with the same disc expander according to the SAS address.
For example, referring to fig. 2, the virtual slot addresses of the disks connected to the disk expander 1 are sequentially set to 1-15, the virtual slot addresses of the disks connected to the disk expander 2 are sequentially set to 16-30, the virtual slot addresses of the disks connected to the disk expander 3 are sequentially set to 31-45, and the virtual slot addresses of the disks connected to the disk expander 4 are sequentially set to 46-60.
Optionally, setting virtual slot addresses of each disk sequentially according to the first serial number and the SAS address, including: determining a second ordering sequence of each disk connected with the plurality of disk expanders according to the first sequence number; and sequentially setting virtual slot addresses of all the disks connected with the same disk expander according to the SAS address according to the second ordering order. Thus, the virtual slot address of the disk with the first serial number in front is in front, and the virtual slot address of the disk with the first serial number in front is behind, so that the consistency of the virtual slot addresses of a plurality of disks connected by a plurality of disk expanders is avoided, and the virtual slot address of the disk is ensured to be used as the unique identifier of the disk.
Optionally, the boot sequence and the sequence of physical slot addresses are consistent with the sequence of the disk.
The guiding sequence is consistent with the physical sequence of the disk slot connected with the controller, for example, the physical slot serial number of the slot connected with the controller A is 1-30, the physical slot serial number of the slot connected with the controller B is 31-60, the guiding sequence is PCIE address sequence from the controller A to the controller B, and the guiding serial number of the controller A is 1 and the guiding serial number of the controller B is 2 can be set in the main board;
for another example, the physical slot number of the slot connected to the controller a is 31-60, the physical slot number of the slot connected to the controller B is 1-30, the boot sequence is the PCIE address sequence from the controller B to the controller a, and the boot sequence of the controller a is 2 and the boot sequence of the controller B is 1 may be set in the motherboard.
Therefore, the sequence of the virtual slot serial numbers of the magnetic disks connected with the controller A is consistent with the sequence of the physical slot serial numbers between the virtual slot serial numbers of the magnetic disks connected with the controller B, and the subsequent magnetic disk maintenance is convenient.
Optionally, step S105 sequentially sets a virtual slot address of each disk according to the first serial number and the SAS address, including:
acquiring an initial slot address of a physical slot;
and sequentially setting virtual slot addresses of all the disks from the initial slot address according to the first serial number and the SAS address.
Wherein the initial slot address of the physical slot address is the first slot address in the order, in some embodiments the initial slot address is 1, and in other embodiments the initial slot address is 0.
In this embodiment, the virtual slot addresses of the disks are sequentially set from the initial slot address, so that the initial slot address of the virtual slot address is the same as the initial slot address of the physical slot address, and the virtual slot address is consistent with the physical slot address because the guiding sequence is consistent with the physical slot sequence number sequence of the disk connected with the controller.
According to the method for setting the virtual slot address of the disk, the virtual slot address of each disk is set in sequence according to the first serial number and the SAS address, and the method comprises the following steps: acquiring an initial slot address of a physical slot; and sequentially setting virtual slot addresses of all the disks from the initial slot address according to the first serial number and the SAS address. Therefore, the initial slot address of the virtual slot address is the same as the initial slot address of the physical slot address, and the virtual slot address is consistent with the physical slot sequence number of the disk connected with the controller due to the fact that the guiding sequence is consistent with the physical slot sequence number of the disk, the virtual slot address of the disk to be maintained can be inquired through the system, the disk to be maintained on the disk slot of the physical slot address can be directly determined according to the virtual slot address, and the efficiency and operability of disk maintenance are improved.
Optionally, the method further comprises:
under the condition that the storage server requests to allocate disk characters, loading each disk according to the sequence of virtual slot addresses;
the order of virtual slot addresses is used to allocate disk drives.
The kernel device manager (Udev) is a function in the Linux system, and is a default device management tool of the current Linux system. The kernel device manager (Udev) allocates disk tokens to the disks according to the loading order of the disks, typically the order in which the kernel allocates the tokens is SDA, SDB, SDC … …
The disk loading is performed by the firmware of the disk extender, and the firmware of the disk extender can load the disks sequentially according to the sequence of the virtual slot addresses, so that the disk loading sequence of the kernel device manager (Udev) is the sequence of the virtual slot addresses, the kernel device manager (Udev) allocates the disk drive according to the sequence of the virtual slot addresses, for example, the disk drive with the virtual slot address of 1 is SDA, the disk drive with the virtual slot address of 2 is SDB … …, and the disk drive cannot change under the condition that the virtual slot addresses are unchanged.
In the embodiment of the application, the disk virtual slot address storage server set by the firmware cannot be modified, the disk virtual slot address cannot be changed due to operations such as starting of the storage server, further disk symbols distributed according to the sequence of the virtual slot address cannot be changed due to operations of the storage server, and the problem of disk symbol drift caused by closing or starting operations of the storage server is avoided.
According to the method for setting the virtual slot address of the disk, under the condition that the storage server requests to allocate disk characters, all disks are loaded according to the sequence of the virtual slot addresses; the order of virtual slot addresses is used to allocate disk drives. Thus, the virtual slot address of each disk is not repeated and can be used as a unique identification of the disk, the virtual slot address of the disk is not changed, and the disk symbols allocated according to the virtual slot address of the disk are not drifted.
The embodiment of the application provides a disk virtual slot address setting system, referring to fig. 3, including:
a boot sequence number acquisition module 301, configured to acquire a boot sequence number of a controller connected to each disk expander;
a first port address obtaining module 302, configured to obtain an address of a first port of a controller connected to each disk expander;
a first serial number obtaining module 303, configured to sequentially set a first serial number of each disk expander according to the boot serial number and an address of the first port;
a disk SAS address acquisition module 304, configured to acquire an SAS address of each disk;
the virtual slot address setting module 305 is configured to sequentially set the virtual slot addresses of the disks according to the first sequence number and the SAS address.
According to the disk virtual slot address setting system, the guide serial numbers of the controllers connected with the disk expanders are obtained; acquiring an address of a first port of a controller connected with each disk expander; acquiring an address of a first port of a controller connected with each disk expander; sequentially setting a first serial number of each disk expander according to the guide serial number and the address of the first port; acquiring the SAS address of each disk; and setting the virtual slot address of each disk in sequence according to the first serial number and the SAS address. Thus, the first serial numbers of the plurality of disk expanders are sequentially arranged, the first serial numbers of the disk expanders are not repeated, the virtual slot addresses of the disks are sequentially arranged according to the first serial numbers and the SAS addresses, the virtual slot addresses of the disks are not repeated, the virtual slot addresses can be used as unique identifications of the disks, and the SAS addresses are related to the positions of the disks on the disk expanders.
Optionally, the boot sequence number acquisition module 301 includes:
The guide sequence number receiving sub-module is used for acquiring the guide sequence number of the controller determined by the main board;
the boot sequence number is determined according to the boot sequence and the PCIE port address of the controller.
The first sequence number acquisition module 303 includes:
the first sequencing sub-module is used for determining a first sequencing sequence of each disk expander connected with the plurality of controllers according to the guide sequence number;
and the second sequencing sub-module is used for sequentially setting the first serial numbers of all disk expanders connected with the same controller according to the address of the first port according to the first sequencing order.
The virtual slot address setting module 305 includes:
the third sequencing sub-module is used for determining a second sequencing sequence of each disk connected with the plurality of disk expanders according to the first sequence number;
and the fourth sequencing submodule is used for sequentially setting virtual slot addresses of all the disks connected with the same disk expander according to the second sequencing order and the SAS address.
Optionally, the boot sequence and the sequence of physical slot addresses are consistent with the sequence of the disk.
Optionally, the virtual slot address setting module 305 includes:
an initial slot address obtaining sub-module, configured to obtain an initial slot address of a physical slot address;
The virtual slot address setting sub-module is used for sequentially setting the virtual slot addresses of all the magnetic disks from the initial slot address according to the first serial number and the SAS address.
Optionally, the system further comprises:
the virtual slot address sending module is used for loading each disk according to the sequence of the virtual slot addresses under the condition that the storage server requests to allocate disk characters;
the order of virtual slot addresses is used to allocate disk drives.
The embodiment of the application provides a computer device, referring to fig. 4, including a memory 401, a processor 402, and a computer program stored in the memory and capable of running on the processor, where the processor 402 implements the steps of any one of the above-mentioned method for setting a virtual slot address of a disk when executing the computer program.
The computer device provided by the embodiment of the application executes the steps of obtaining the guide sequence number of the controller connected with each disk expander through the processor 402; acquiring an address of a first port of a controller connected with each disk expander; acquiring a first serial number of each disk expander according to the guide serial number and the first port address; acquiring the SAS address of each disk; and setting the virtual slot address of each disk in sequence according to the first serial number and the SAS address. Thus, the first serial numbers of the plurality of disk expanders are sequentially arranged, the first serial numbers of the disk expanders are not repeated, the virtual slot addresses of the disks are sequentially arranged according to the first serial numbers and the SAS addresses, the virtual slot addresses of the disks are not repeated, the virtual slot addresses can be used as unique identifications of the disks, and the SAS addresses are related to the positions of the disks on the disk expanders.
The embodiments of the present application provide a computer-readable storage medium storing a program that, when executed by the processor 402, performs the steps of any one of the above-described disk virtual slot address setting methods.
The computer readable storage medium provided in the embodiments of the present application performs, by the processor 402, obtaining a boot sequence number of a controller connected to each disk expander; acquiring an address of a first port of a controller connected with each disk expander; sequentially setting a first serial number of each disk expander according to the guide serial number and the first port address; acquiring the SAS address of each disk; and setting the virtual slot address of each disk in sequence according to the first serial number and the SAS address. Thus, the first serial numbers of the plurality of disk expanders are sequentially arranged, the first serial numbers of the disk expanders are not repeated, the virtual slot addresses of the disks are sequentially arranged according to the first serial numbers and the SAS addresses, the virtual slot addresses of the disks are not repeated, the virtual slot addresses can be used as unique identifications of the disks, and the SAS addresses are related to the positions of the disks on the disk expanders.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as static RAM (SRAM, dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM, enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The method for setting the virtual slot address of the magnetic disk is characterized by comprising the following steps:
acquiring a guide sequence number of a controller connected with each disk expander;
acquiring the address of a first port of the controller connected with each disk expander;
sequentially setting a first serial number of each disk expander according to the guide serial number and the address of the first port;
acquiring the SAS address of each disk;
and setting virtual slot addresses of the disks in sequence according to the first serial number and the SAS address.
2. The method of claim 1, wherein the step of obtaining a boot sequence number of a controller coupled to each disk extender comprises:
acquiring a guide serial number of the controller determined by the main board;
the boot sequence number is determined according to the boot sequence and the PCIE port address of the controller.
3. The method of claim 1, wherein the step of sequentially setting the first sequence number of each disk expander according to the boot sequence number and the address of the first port comprises:
determining a first ordering sequence of the disk expanders connected with the controllers according to the guide sequence numbers;
and according to the first ordering sequence, the first serial numbers of the disk expanders connected with the same controller are sequentially set according to the addresses of the first ports.
4. The method of claim 1, wherein the step of sequentially setting the virtual slot address of each disk according to the first sequence number and the SAS address comprises:
determining a second ordering sequence of the magnetic disks connected by the magnetic disk expanders according to the first sequence number;
and according to the second ordering sequence, sequentially setting the virtual slot addresses of the disks connected with the same disk expander according to the SAS address.
5. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the boot sequence is consistent with the sequence of physical slot addresses of the disk.
6. The method of claim 5, wherein the step of sequentially setting the virtual slot address of each disk according to the first sequence number and the SAS address comprises:
acquiring an initial slot address of the physical slot address;
and sequentially setting the virtual slot address of each disk from the initial slot address according to the first serial number and the SAS address.
7. The method according to claim 1, wherein the method further comprises:
under the condition that a storage server requests to allocate disk characters, loading each disk according to the sequence of the virtual slot addresses;
the order of the virtual slot addresses is used to allocate the disk drive.
8. A disk virtual slot address setting system, comprising:
the guide sequence number acquisition module is used for acquiring the guide sequence number of the controller connected with each disk expander;
the first port address acquisition module is used for acquiring the address of the first port of the controller connected with each disk expander;
the first serial number acquisition module is used for sequentially setting the first serial numbers of the disk expanders according to the guide serial numbers and the addresses of the first ports;
The disk SAS address acquisition module is used for acquiring the SAS address of each disk;
and the virtual slot address setting module is used for sequentially setting the virtual slot address of each disk according to the first serial number and the SAS address.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1-7 when the computer program is executed by the processor.
10. A computer-readable storage medium, characterized by: the computer readable storage medium has stored thereon a program which when executed by a processor performs the steps of the method according to any of claims 1 to 7.
CN202310322859.3A 2023-03-29 2023-03-29 Method, system, equipment and storage medium for setting virtual slot address of magnetic disk Pending CN116339633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310322859.3A CN116339633A (en) 2023-03-29 2023-03-29 Method, system, equipment and storage medium for setting virtual slot address of magnetic disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310322859.3A CN116339633A (en) 2023-03-29 2023-03-29 Method, system, equipment and storage medium for setting virtual slot address of magnetic disk

Publications (1)

Publication Number Publication Date
CN116339633A true CN116339633A (en) 2023-06-27

Family

ID=86892706

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310322859.3A Pending CN116339633A (en) 2023-03-29 2023-03-29 Method, system, equipment and storage medium for setting virtual slot address of magnetic disk

Country Status (1)

Country Link
CN (1) CN116339633A (en)

Similar Documents

Publication Publication Date Title
US20240256184A1 (en) Memory system and method for controlling nonvolatile memory
US9021178B2 (en) High performance path for command processing
US10607714B2 (en) Verification of storage media upon deployment
US11237756B2 (en) System and method of writing to nonvolatile memory using write buffers
CN106648463B (en) Nand Flash block management method and system
US10789167B2 (en) Information processing apparatus and method for controlling storage device
US9772937B2 (en) Data processing method, memory controller and memory storage apparatus
CN104951249A (en) Memory control apparatus, information processing apparatus and control method thereof
CN106104515A (en) Utilize File system design and the fault recovery method of nonvolatile memory
CN104133640B (en) From the fast quick-recovery of dormancy
CN114924923A (en) Method, system, equipment and medium for verifying correctness of hard disk write-in point
CN107430546B (en) File updating method and storage device
US20220382668A1 (en) Systems and methods for concurrent and automated testing of zoned namespace solid state drives
CN104216834A (en) Internal storage assess method, buffering scheduler and internal storage module
CN116339633A (en) Method, system, equipment and storage medium for setting virtual slot address of magnetic disk
CN116483745A (en) Data transmission method, device, power module and storage medium
CN109800110A (en) Data back up method, system and electronic equipment, storage medium and back-up device
CN116302720A (en) Slot binding method, slot binding system, terminal equipment and storage medium
CN110327626B (en) Virtual server creation method and device
CN112148220A (en) Method and device for realizing data processing, computer storage medium and terminal
US10223195B2 (en) Counter in a flash memory
US20200057576A1 (en) Method and system for input/output processing for write through to enable hardware acceleration
CN110471801A (en) A kind of management method and device and equipment of the volume production procedural information storing equipment
US11928360B2 (en) Command slot management for memory devices
US20240004811A1 (en) Memory controller, storage device, and method of operating the same

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