The maintaining method of hard disk and deviceTechnical field
The present embodiments relate to communication technology, more particularly, to a kind of maintaining method of hard disk and device.
Background technology
With the continuous development of computer technology, increasing server can be built-in or plug-in manyIndividual hard disk, and for large-scale storage system, server needs to manage hundreds of thousands of pieces of hard disks, differentHard disk is distributed in the different frame being connected from server and the groove position of machine frame.When some hard disk needsWhen to be changed, need to find corresponding hard disk from many multi-grooves of server.
In order to accurately know hard disk be located in which groove position it is necessary first to overcome drive driftProblem, this drive refers to the mark of hard disk, and the distribution of system drive is to enter according to the order of detection hard diskRow distribution.Drive drift refers in system starting process, and kernel can be according to scanning hard diskThe drives such as order-assigned/dev/sda ,/dev/sdb ,/dev/sdc, if follow-up hot-plug hard disk,System meeting order-assigned drive, in same groove position, repeatedly after plug hard disk, may result in systemIn drive different, such as when inserting for the first time, drive may be/dev/sdb, and hard disk is pulled outAfterwards, again insertable into hard disk, drive may be changed into/dev/sde, drive drift.
In order to overcome drive to drift about, prior art adopts drive binding technology, that is, for having individual SASFor the server of card, systems soft ware can determine drive according to hardware address information in systems,And then the drive of the groove position on server and hard disk can be bound, a slot number can only correspond toOne drive.When server software detect the corresponding hard disk of some drive need change when, controlThe positioning light of this hard disk lights, so that operator can take off this from corresponding groove positionHard disk.
But, the drive binding technology of prior art may be only available for server have individual SAS card andThe situation that this SAS card is only connected with an expander, it cannot be applied to server and have multiple SASCard, or the situation that individual SAS card is connected with multiple expanders, that is, server software cannot know oftenEach hard disk under individual SAS card and the corresponding relation of groove position, such as server software knows some SASHard disk under card on earth should be corresponding with the groove position on the front panel on server, still should be with belowGroove position on plate corresponds to.If there are multiple SAS cards for server, or individual SAS card and multiple expansionsThe situation that exhibition device is connected, or (in each frame, it is provided with service when system includes many frames frameDevice), if it manages substantial amounts of hard disk, and these hard disks are arranged on the inside of frame, even if serviceDevice software detection needs to change to the corresponding hard disk of some drive, controls the positioning light of this hard diskLight, operator need to pull down all of frame manually, then look inside hard disk on earth whichIndividual positioning light lights, and then just can be replaced, thus wasting certain manpower and materials.Therefore,Prior art is when safeguarding hard disk it is impossible to be quickly found out the groove position at the hard disk place of this needs maintenance, shadowRing stability and the reliability of server.
Content of the invention
The present invention provides a kind of maintaining method of hard disk and device, cannot quickly look in order to solve prior artThe groove position being located to the hard disk of required maintenance, thus cannot Fast-Maintenance hard disk, impact the stablizing of serverProperty and the technical problem of reliability.
In a first aspect, the present invention provides a kind of maintaining method of hard disk, methods described is applied to physical servicesDevice, described physical server includes multiple physical hard disk groove positions, each described physical hard disk groove position corresponding oneIndividual physical hard disk;Methods described includes:
According to described physical server, each described physical hard disk groove position and each described physical hard disk, buildFound graphical server model and the first mapping relations;Wherein, described graphical server model includes figureShape server, graphical hard-disk slots and graphical hard disk, a graphical server corresponds to a thingReason server, a graphical hard disk corresponds to a physical hard disk, graphical hard-disk slots correspondingIndividual physical hard disk groove position;Described first mapping relations are drive and each institute of each described graphical hard diskState the corresponding relation between the information of graphical hard-disk slots;
Obtain the drive of the first graphical hard disk, and according to described first mapping relations and described first figureThe drive changing hard disk determines first graphical hard-disk slots corresponding with the drive of the described first graphical hard diskInformation;
The first physics that first physical hard disk is located is determined according to the information of the described first graphical hard-disk slotsHard-disk slots, and the first physical hard disk in described first physical hard disk groove position is safeguarded.
In conjunction with a first aspect, in the first possible embodiment of first aspect, described in described basisPhysical server, each described physical hard disk groove position, each described physical hard disk, set up the first mapping and closeSystem, specifically includes:
Correspondence according to described physical server, each described graphical hard disk and each described physical hard diskThe disk of the described physical hard disk associated by the described graphical hard-disk slots of each of relation and user inputSymbol, obtains described first mapping relations.
In conjunction with the first possible embodiment of first aspect or first aspect, the second of first aspectPlant in possible embodiment, described physical server includes multiple physical hard disk groove positions, specially:
Described physical server includes at least two SAS cards, and each described SAS card and a SAS extendDevice connects, and described SAS expander has multiple described physical hard disk groove positions.
In conjunction with the first possible embodiment of first aspect or first aspect, the 3rd of first aspect thePlant in possible embodiment, described physical server includes multiple physical hard disk groove positions, specially:
Described physical server includes a SAS card, and described SAS card is with least one SAS expander evenConnect, each described SAS expander has multiple described physical hard disk groove positions.
In conjunction with first aspect the first possible embodiment to first aspect the third possible enforcementAny one of mode, in the 4th kind of possible embodiment of first aspect, takes according to described physicsThe corresponding relation of business device, each described graphical hard disk and each described physical hard disk and user inputEach described physical hard disk associated by described graphical hard-disk slots drive, obtain and described first reflectPenetrate relation, including:
To each in described physical server, described physical hard disk carries out logical number, and for described in eachThe logical number of physical hard disk distributes the drive of described physical hard disk in order;
According to the lighting instruction of user, the corresponding physical hard disk of logical number to physical hard disk each describedDrive execution lighting operation, to be obtained according to the LED status of the physical hard disk on described physical serverTake the drive of the corresponding physical hard disk of logical number and each described physical hard disk groove position of each physical hard diskInformation between the second mapping relations;
According to described second mapping relations, each described graphical hard-disk slots and each described physical hard diskThe association instruction of the corresponding relation of groove position and described user, closes for hard-disk slots graphical each describedJoin the drive of described physical hard disk;
According to the corresponding relation of each described graphical hard disk and each described physical hard disk, and each instituteState the drive of the described physical hard disk associated by graphical hard-disk slots, obtain described first mapping relations.
Any one of the 4th kind of possible embodiment in conjunction with first aspect to first aspect, firstIn 5th kind of possible embodiment of aspect, methods described also includes:
According to the renewal of the physical hard disk on described physical server, update described graphical server modelIn graphical hard disk;The renewal of the physical hard disk on described physical server includes described physical serverOn the deletion of physical hard disk and newly-increased.
Any one of the 5th kind of possible embodiment in conjunction with first aspect to first aspect, firstIn 6th kind of possible embodiment of aspect, described first mapping relations also include:Each described figureChange the status information of hard disk, then methods described also includes:
Inquiry instruction according to user and described first mapping relations, determine the graphical hard disk of user's inquiryStatus information;
The status information of the graphical hard disk according to described user inquiry, determines the figure with described user's inquiryThe status information of the corresponding physical hard disk of shape hard disk.
Second aspect, the present invention provides a kind of attending device of hard disk, and described device is applied to physical servicesDevice, described physical server includes multiple physical hard disk groove positions, each described physical hard disk groove position corresponding oneIndividual physical hard disk;
Build module, for according to described physical server, each described physical hard disk groove position and each instituteState physical hard disk, set up graphical server model and the first mapping relations;Wherein, described graphical clothesBusiness device model includes graphical server, graphical hard-disk slots and graphical hard disk, graphical clothesBusiness device corresponds to a physical server, and a graphical hard disk corresponds to a physical hard disk, and one graphicalHard-disk slots correspond to a physical hard disk groove position;Described first mapping relations are each described graphical hard diskDrive and the information of each described graphical hard-disk slots between corresponding relation;
First determining module, for obtaining the drive of the first graphical hard disk, and according to described structure moduleDescribed first mapping relations obtaining and the drive of described first graphical hard disk determine and described first figureChange the information of the corresponding first graphical hard-disk slots of drive of hard disk;
HD management module, for the described first graphical hard disk being determined according to described first determining moduleThe information of groove position determines the first physical hard disk groove position that the first physical hard disk is located, and to described first physicsThe first physical hard disk in hard-disk slots is safeguarded.
In conjunction with second aspect, in the first possible embodiment of second aspect, described structure module,Specifically for according to described physical server, each described graphical hard disk and each described physical hard diskDescribed physical hard disk associated by the described graphical hard-disk slots of each of corresponding relation and user inputDrive, obtain described first mapping relations.
In conjunction with the first possible embodiment of second aspect or second aspect, the second of second aspectPlant in possible embodiment, described physical server includes multiple physical hard disk groove positions, specially:
Described physical server includes at least two SAS cards, and each described SAS card and a SAS extendDevice connects, and described SAS expander has multiple described physical hard disk groove positions.
In conjunction with the first possible embodiment of second aspect or second aspect, the 3rd of second aspect thePlant in possible embodiment, described physical server includes multiple physical hard disk groove positions, specially:
Described physical server includes a SAS card, and described SAS card is with least one SAS expander evenConnect, each described SAS expander has multiple described physical hard disk groove positions.
In conjunction with second aspect the first possible embodiment to second aspect the third possible enforcementAny one of mode, in the 4th kind of possible embodiment of second aspect, described structure module,Specifically include:
Drive allocation unit, carries out logic for physical hard disk described to each in described physical serverNumbering, and the drive of described physical hard disk is distributed in order for the logical number of each described physical hard disk;
Lighting unit, for the lighting instruction according to user, the logical number to physical hard disk each describedThe drive execution lighting operation of corresponding physical hard disk, with according to the physical hard disk on described physical serverLED status obtain the drive of the corresponding physical hard disk of logical number of each physical hard disk and each instituteState the second mapping relations between the information of physical hard disk groove position;
Associative cell, for obtained according to described lighting unit described second mapping relations, described in eachGraphical hard-disk slots and the corresponding relation of each described physical hard disk groove position and the association of described userInstruction, associates the drive of described physical hard disk for hard-disk slots graphical each described;
Acquiring unit, for the corresponding pass according to each described graphical hard disk and each described physical hard diskSystem, and the drive of each described physical hard disk associated by described graphical hard-disk slots, obtain describedFirst mapping relations.
Any one of the 4th kind of possible embodiment in conjunction with second aspect to second aspect, secondIn 5th kind of possible embodiment of aspect, described device also includes:
Update module, for the renewal according to the physical hard disk on described physical server, updates described figureGraphical hard disk in shape server model;The renewal of the physical hard disk on described physical server includesThe deletion of the physical hard disk on described physical server and newly-increased.
Any one of the 5th kind of possible embodiment in conjunction with second aspect to second aspect, secondIn 6th kind of possible embodiment of aspect, described first mapping relations also include:Each described figureChange the status information of hard disk, then described device also includes:
Second determining module, for the inquiry instruction according to user and described first mapping relations, determines and usesThe status information of the graphical hard disk of family inquiry, and the state of the graphical hard disk according to described user inquiryInformation, determines the status information with the corresponding physical hard disk of graphical hard disk of described user inquiry.
The maintaining method of hard disk and device that the present invention provides, by according to physical server, each physicsHard-disk slots and each physical hard disk, set up graphical server model and the first mapping relations, and are obtainingAfter getting the drive of the first graphical hard disk, according to the drive of the first mapping relations and the first graphical hard diskDetermine the information of first graphical hard-disk slots corresponding with the drive of the first graphical hard disk, thus according toThe information of the first graphical hard-disk slots determines the first physical hard disk groove position that the first physical hard disk is located, andThe first physical hard disk in first physical hard disk groove position is safeguarded.Therefore, the embodiment of the present invention providesMethod, when operator know the information of the first graphical hard-disk slots from graphical server modelWhen it is possible to know this first graphical hard-disk slots be located at graphical server model in which machineThe inside on which graphical server on frame, operator only need to pull down this graphical server pairThe physical server answered, need not dismantle all of frame or all physical servers, and then improvesSafeguard the efficiency of hard disk;And, method provided in an embodiment of the present invention, also achieves the solution of software and hardwareCoupling, improves the compatibility of the software of detection disk identifier of hard disk.
Brief description
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to realityThe accompanying drawing applying required use in example or description of the prior art be briefly described it should be apparent that, underAccompanying drawing in the description of face is some embodiments of the present invention, for those of ordinary skill in the art,On the premise of not paying creative labor, other accompanying drawings can also be obtained according to these accompanying drawings.
The schematic flow sheet of the maintaining method embodiment one of the hard disk that Fig. 1 provides for the present invention;
The schematic flow sheet of the maintaining method embodiment two of the hard disk that Fig. 2 provides for the present invention;
The schematic flow sheet of the maintaining method embodiment three of the hard disk that Fig. 3 provides for the present invention;
The schematic flow sheet of the maintaining method example IV of the hard disk that Fig. 4 provides for the present invention;
The schematic flow sheet of the maintaining method embodiment five of the hard disk that Fig. 5 provides for the present invention;
The graphical server model schematic diagram that Fig. 6 provides for the present invention;
Operation associated schematic diagram is executed in the graphical server model that Fig. 7 provides for the present invention;
The structural representation of the attending device embodiment one of the hard disk that Fig. 8 provides for the present invention;
The structural representation of the attending device embodiment two of the hard disk that Fig. 9 provides for the present invention;
The structural representation of the attending device embodiment three of the hard disk that Figure 10 provides for the present invention;
The structural representation of the attending device example IV of the hard disk that Figure 11 provides for the present invention.
Specific embodiment
Purpose, technical scheme and advantage for making the embodiment of the present invention are clearer, below in conjunction with thisAccompanying drawing in bright embodiment, is clearly and completely described to the technical scheme in the embodiment of the present invention,Obviously, described embodiment is a part of embodiment of the present invention, rather than whole embodiments.It is based onEmbodiment in the present invention, those of ordinary skill in the art are obtained under the premise of not making creative workThe every other embodiment obtaining, broadly falls into the scope of protection of the invention.
Method provided in an embodiment of the present invention, goes for thering is the one or more of arbitrary hardware arrangementIn frame, in this frame, it is provided with physical server, it is hard that described physical server can include multiple physicsDish groove position, each described physical hard disk groove position corresponds to a physical hard disk, that is, on each physical hard disk groove positionOne physical hard disk of insertion.Method involved by the embodiment of the present invention, its executive agent can take for physicsBusiness device, can also be for being integrated in the device in physical server with hard disk maintenance functions or system, thisBright embodiment does not limit to the way of realization of executive agent, and it can be realized for pure software, acceptableRealize for software and hardware combining.
The maintaining method of hard disk provided in an embodiment of the present invention and device are it is intended to solution prior art cannot be fastSpeed finds the groove position that the hard disk of required maintenance is located, thus cannot Fast-Maintenance hard disk, impact serverStability and the technical problem of reliability.
With specifically embodiment, how technical scheme and technical scheme are solved belowCertainly above-mentioned technical problem is described in detail.These specific embodiments can be combined with each other below, rightMay repeat no more in certain embodiments in same or analogous concept or process.
The schematic flow sheet of the maintaining method embodiment one of the hard disk that Fig. 1 provides for the present invention.The present embodimentBe related to by constructed graphical server and the first mapping relations, determine the required hard disk institute safeguardingPhysical hard disk groove position, the detailed process then hard disk in this physical hard disk groove position safeguarded.In the present embodiment, the hard disk of required maintenance is referred to as the first physical hard disk.As shown in figure 1, the method bagInclude:
S101:Hard according to described physical server, each described physical hard disk groove position and each described physicsDisk, sets up graphical server model and the first mapping relations;Wherein, described graphical server modelIncluding graphical server, graphical hard-disk slots and graphical hard disk, a graphical server corresponds toOne physical server, a graphical hard disk corresponds to a physical hard disk, graphical hard-disk slotsA corresponding physical hard disk groove position;Described first mapping relations be each described graphical hard disk drive andCorresponding relation between the information of each described graphical hard-disk slots.
In the present embodiment, it is to illustrate as a example the system with hard disk maintenance functions by executive agent,In order to describe aspect, " will have the system of hard disk maintenance functions " and be referred to as HD management system.Here instituteThe maintenance said, can be the maintenance to faulty hard disk, replacement, and the hard disk that can also be little to capacity is carried outChange etc..
Specifically, the physical server in the present embodiment can be multiple, and that is, the embodiment of the present invention can be fittedFor including the hardware arrangement of multiple frames, each frame can include one or more physical servers,Each physical server can include multiple physical hard disk groove positions, and these physical hard disk groove positions can be built inThe inside of physical server it is also possible to by the SCSI of serial (Serial Attached SCSI, referred to asSAS) hang over the outside of physical server outside expander, the front panel of physical server can also be arranged onOn rearmounted panel, in a word, the embodiment of the present invention is closed to the connection of physical server and physical hard disk groove positionIt is not limit, as long as it can manage substantial amounts of hard disk.Wherein, SCSI is minicomputerSystem interface (Small Computer System Interface, abbreviation SCSI).
When operator by substantial amounts of physical hard disk be entirely insertable physical hard disk groove position on physical server itAfterwards, HD management system according to each the physical hard disk groove position on physical server, physical server andPhysical hard disk in each physical hard disk groove position, sets up graphical server model and the first mapping relations.Optionally, HD management system can be according to the hardware arrangement information of physical server, physical hard disk groove positionHardware arrangement information, physical hard disk information etc. build graphical server model.It should be noted thatThe hardware arrangement information of above-mentioned physical server can be the number of physical server, physical server placeThe number of frame, the size dimension of physical server, position in frame for the physical server andThe information such as part basis panel figure, the hardware arrangement information of above-mentioned physical hard disk groove position can be hard for physicsDish groove position be horizontal insert or perpendicular insert, physical hard disk groove position is located at the front panel of physical server or rearmountedPanel or be built in the medium information of physical server, above-mentioned physical hard disk information can be physical hard diskCapacity, physical hard disk be located slot number, the information such as the drive of physical hard disk.Sum it up, thisBright embodiment graphically services to how to be built according to physical server, physical hard disk groove position and physical hard diskDevice model does not limit, if constructed go out graphical server model and actual physical serverHardware arrangement identical.It should be noted that in graphical server model, physics clothesBusiness device corresponds to a graphical server, and a physical hard disk groove position corresponds to graphical hard-disk slots,One physical hard disk corresponds to a graphical hard disk, and the drive of graphical hard disk is i.e. corresponding with itThe drive of physical hard disk.
Further, HD management system can also according to physical server, each physical hard disk groove position,Each physical hard disk, obtains the first mapping relations, this first mapping relations is the disk of each graphical hard diskCorresponding relation between symbol and the information of each graphical hard-disk slots.Optionally, this first mapping relationsCan be determined according to actual physical server, each physical hard disk groove position, each physical hard disk for userThe drive of each graphical hard disk and the information of each graphical hard-disk slots between corresponding relation, soInput to afterwards HD management system or HD management system directly according to actual physical server,The drive of each graphical hard disk and each figure that each physical hard disk groove position, each physical hard disk are inputtedCorresponding relation between the information of shape hard-disk slots.
Cite a plain example to illustrate it is assumed that 3 physical hard disk groove positions are had on physical server hereinWith 3 physical hard disks, be respectively groove position A, groove position B, groove position C, physical hard disk 1, physical hard disk 2,Physical hard disk 3, wherein, the drive of physical hard disk 1 is sda, and the drive of physical hard disk 2 is sdb, thingThe drive of reason hard disk 3 is sdc, and in actual insertion, physical hard disk 1 inserts groove position 2, and physics is hardDisk 2 inserts groove position 3, and physical hard disk 3 inserts groove position 1, due to drive and the physics of graphical hard diskThe drive of hard disk corresponds to, and therefore, HD management system can be by the drive to the physical hard disk detectingExecute corresponding lighting and operate to determine the corresponding pass between the drive of this physical hard disk and physical hard disk groove positionSystem, and then obtain the corresponding relation between the drive of graphical hard disk and graphical hard-disk slots.For example,HD management system detectio controls the drive of this sda to the drive of a sda, then HD management systemThe positioning light of corresponding physical hard disk lights, and refers to finally according to the positioning being lighted on physical serverShow that lamp knows that this sda is corresponding with groove position 2, thus knowing graphical hard disk 1 corresponding with the drive of sda,With, the corresponding relation between graphical hard-disk slots 2 corresponding with groove position 2, in this manner, justThe corresponding relation between each graphical hard disk and graphical hard-disk slots can be obtained.
S102:Obtain the drive of the first graphical hard disk, and according to described first mapping relations and describedThe drive of one graphical hard disk determines that corresponding with the drive of the described first graphical hard disk first is graphically hardThe information of dish groove position.
Specifically, the drive of the first graphical hard disk that HD management system obtains, this is first graphically hardDisk is the corresponding graphical hard disk of the first physical hard disk needing to safeguard, this first graphical hard disk is exactlyThe drive of the first physical hard disk.Optionally, HD management system can pass through the appearance of test pattern hard diskAmount knows which graphical hard disk needs to safeguard, can also be by test pattern hard disk whether faultTo know which hard disk needs to safeguard.When HD management system gets the drive of the first graphical hard diskAfterwards, first mapping relations according to determined by above-mentioned, determine that the drive institute of this first graphical hard disk is rightThe information of the first graphical hard-disk slots on the graphical server model answered, optionally, this first figureThe information of shape hard-disk slots can be the slot number of this first graphical hard-disk slots, can also be figureChange the position with the first graphical hard-disk slots described by line information in server model, for example, shouldThe information of the first graphical hard-disk slots can be for " this first graphical hard-disk slots is located at graphical serviceThe first row first row of the front panel of device model ".
S103:Determine that the first physical hard disk is located according to the information of the described first graphical hard-disk slots theOne physical hard disk groove position, and the first physical hard disk in described first physical hard disk groove position is safeguarded.
Specifically, because the graphical hard-disk slots constructed by physical hard disk groove position and HD management system areCorrespondingly, therefore when HD management system determines that in graphical server model first is graphicalAfter the information of hard-disk slots, according to the corresponding relation of physical hard disk groove position and graphical hard-disk slots, determineGo out the first physical hard disk groove position that the first physical hard disk is located, then in this first physical hard disk groove positionFirst physical hard disk is safeguarded.
In prior art, for the hardware arrangement managing a large amount of hard disks, and hard disk is located at physical serverInside, needs to change when server software detects some corresponding physical hard disk of physical hard disk drive,The positioning light controlling this physical hard disk lights, and operator need to pull down all of frame manually, soCheck which positioning light lights internal physical hard disk on earth afterwards, then just can be replaced, behaviourMake sufficiently complex, safeguard that hard disk is inefficient;But, in embodiments of the present invention, HD management systemGraphical server model and graphical can be constructed for the hardware arrangement of actual physical serverCorrespondence between the drive of graphical hard disk in server model and the information of each graphical hard-disk slotsRelation (i.e. the first mapping relations), and then when HD management system detectio needs to the first graphical hard diskWhen safeguarding, directly can check that this first graphical hard disk services graphical according to this first mapping relationsThe information of the first graphical hard-disk slots being located in device model, finally according to this first graphical hdd slotThe information of position determines the physical location of the first physical hard disk groove position, that is, when operator service from graphicalKnow in device model the first graphical hard-disk slots information when it is possible to know this first graphical hard diskIt is interior that groove position is located on which the graphical server in which frame in graphical server modelPortion, operator only need to pull down the corresponding physical server of this graphical server, need not dismantle instituteSome frames or all physical servers, and then improve the efficiency safeguarding hard disk.
On the other hand, method provided in an embodiment of the present invention, can also realize the decoupling of software and hardware, that is, existingThe software having the drive detecting physical hard disk in technology can only adapt to a kind of hardware of layout, with other layoutsHardware incompatibility;But, in embodiments of the present invention, the software of the drive of detection physical hard disk only needsThe drive of graphical hard disk accordingly is detected, then directly determine corresponding figure according to the first mapping relationsShape hard-disk slots, that is, the software of the drive of this detection physical hard disk need not be hard with any one layoutPart contacts, its corresponding simply graphical server model, and the hardware of any one layout all can be built intoGraphical server model, the software of the drive of detection physical hard disk therefore provided in an embodiment of the present invention canTo be adapted to the hardware of multiple layouts.
The maintaining method of the hard disk that the present invention provides, by according to physical server, each physical hard disk groovePosition and each physical hard disk, set up graphical server model and the first mapping relations, and are getting theAfter the drive of one graphical hard disk, according to the drive of the first mapping relations and the first graphical hard disk determine withThe information of the corresponding first graphical hard-disk slots of drive of the first graphical hard disk, thus according to the first figureThe information of shape hard-disk slots determines the first physical hard disk groove position that the first physical hard disk is located, and to firstThe first physical hard disk in physical hard disk groove position is safeguarded.Therefore, method provided in an embodiment of the present invention,When operator know the information of the first graphical hard-disk slots from graphical server model so that it mayWith know this first graphical hard-disk slots be located at graphical server model in which frame on whichInside on one graphical server, operator only need to pull down the corresponding physics of this graphical serverServer, need not dismantle all of frame or all physical servers, and then it is hard to improve maintenanceThe efficiency of disk;And, method provided in an embodiment of the present invention, also achieves the decoupling of software and hardware, improveThe compatibility of the software of detection disk identifier of hard disk.
On the basis of above-described embodiment, method provided in an embodiment of the present invention goes for following twoScene, i.e. method provided in an embodiment of the present invention, the large-scale hardware arrangement for a large amount of hard disks that are stored with is comeSay, it remains able to guarantee the maintenance of the hard disk in this large-scale hardware arrangement.But, prior art cannotIt is applied to following two kinds of scenes, respectively:
The first scene:In above-described embodiment one, physical server includes multiple physical hard disk groove positions, specificallyCan be:Described physical server includes at least two SAS cards, each described SAS card and a SASExpander connects, and described SAS expander has multiple described physical hard disk groove positions.
Second scene:In above-described embodiment one, physical server includes multiple physical hard disk groove positions, specificallyCan be:Described physical server includes a SAS card, and described SAS card is extended with least one SASDevice connects, and each described SAS expander has multiple described physical hard disk groove positions.
On the basis of above-described embodiment, as a kind of possible embodiment of the embodiment of the present invention one,HD management system sets up the first mapping relations, is specifically as follows:According to described physical server, eachDescribed in each of the corresponding relation of described graphical hard disk and each described physical hard disk and user inputThe drive of graphical described physical hard disk associated by hard-disk slots, obtains described first mapping relations.
Specifically, in the present embodiment, when HD management system establish graphical server model itAfterwards, HD management system can provide a user with an input interface, and user can pass through this input interfaceThe drive of the physical hard disk associated by its each acquired graphical hard-disk slots is inputed to graphical clothesGraphical hard disk in business device model, and then HD management system just can know each graphical hdd slotCorresponding relation between position and each graphical hard disk.This process specifically may refer to shown in following Fig. 2Embodiment two, specially:
S201:To each in described physical server, described physical hard disk carries out logical number, and is everyThe logical number of individual described physical hard disk distributes the drive of described physical hard disk in order.
Specifically, HD management system carries out logic coding to the physical hard disk in physical server, andLogical number for each physical hard disk is distributed the drive of physical hard disk in order and be may refer to prior art,Will not be described here.
S202:According to the lighting instruction of user, the corresponding thing of logical number to physical hard disk each describedThe drive execution lighting operation of reason hard disk, with the display lamp according to the physical hard disk on described physical serverThe drive that state obtains the corresponding physical hard disk of logical number of each physical hard disk is hard with physics each describedThe second mapping relations between the information of dish groove position.
Specifically, when HD management system is assigned with accordingly in order to the logical number of each physical hard diskThe drive of physical hard disk after, the lighting of receive user instruction, optionally, the lighting instruction of this user isThe drive of the corresponding physical hard disk of some logical number is indicated.For example, it is assumed that physical servicesThere are two SAS cards (SAS1 and SAS2), every SAS card 2 physical hard disks of lower connection, hard disk in deviceMaintenance system carries out the numbering of the hard disk under logical number, SAS1 respectively to the hard disk under this two SAS cardsNumbering for the hard disk under 1# and 2#, SAS2 is also 1# and 2#, and then HD management system is to SAS1Under 1# distribution drive be sda, be under SAS1 2# distribution drive be sdb, be under SAS21# distribution drive be sdc, be under SAS2 2# distribution drive be sdd.Then user sends out to sdaGo out lighting instruction, HD management system just operates to sda execution lighting according to this lighting instruction, controlsThe positioning light of the corresponding physical hard disk of this sda lights, and then operator are according to this positioning lightState determine physical hard disk groove position that this physical hard disk is located it is assumed that being physical slot position 1, and by this thingTo HD management system, therefore HD management system just can record sda to the information input of reason hard-disk slotsRelation and physical slot position 1 between.Similar, HD management system equally can record sdb and thingBetween relation between relation between reason groove position 2, sdc and physical slot position 3, sdd and physical slot position 4Relation, and then obtain the second mapping relations.Optionally, above-mentioned lighting operation can pass through SCSI enclosureService (SCSI Enclosure Service, abbreviation SES) agreement to complete.
S203:According to described second mapping relations, each described graphical hard-disk slots and each described thingThe association instruction of the corresponding relation of reason hard-disk slots and described user, for hard disk graphical each describedGroove position associates the drive of described physical hard disk.
Specifically, due in the graphical hard-disk slots in graphical server model and physical serverPhysical hard disk groove position corresponds to, therefore, HD management system just can according to above-mentioned second mapping relations,Under the control of association instruction of user, in each graphical hard-disk slots association and the second mapping relations withThe drive of the corresponding physical hard disk of this graphical hard-disk slots.It should be noted that the association of above-mentioned userInstruction is also to send for some graphical hard-disk slots.
S204:According to the corresponding relation of each described graphical hard disk and each described physical hard disk, andThe drive of each described physical hard disk associated by described graphical hard-disk slots, obtains described first mappingRelation.
Specifically, when above-mentioned HD management system is associated with corresponding physics to each graphical hard-disk slotsAfter the drive of hard disk, because physical hard disk is one-to-one with graphical hard disk, therefore above-mentioned for everyThe drive of the physical hard disk of logical number distribution of individual physical hard disk is it is simply that the corresponding figure of this physical hard diskChange the drive of hard disk, therefore, HD management system just can above-mentioned graphical hard-disk slots and graphicallyThe drive of hard disk associates, thus obtaining the first mapping relations, and then when HD management system detectio arrivesIt is possible to determine that first is graphical according to this first mapping relations after the drive of the first graphical hard diskHard-disk slots, finally determine the first physical hard disk groove position, then in the first physical hard disk groove positionOne physical hard disk is safeguarded.
The maintaining method of the hard disk that the present invention provides, after establishing graphical server model, to thingEach physical hard disk of reason server carries out logical number, and the logical number of each physical hard disk is pressed suitableSequence distributes the drive of described physical hard disk, then obtains each physical hard disk by the lighting instruction of userThe second mapping between the information of the drive of the corresponding physical hard disk of logical number and each physical hard disk groove positionRelation, and the drive that each graphical hard-disk slots associates physical hard disk is designated as according to the association of user,And then the corresponding relation according to each graphical hard disk and each physical hard disk, obtain the first mapping relations,And after the drive getting the first graphical hard disk, according to the first mapping relations and the first graphical hard diskDrive determine the information of the first graphical hard-disk slots, thus the letter according to the first graphical hard-disk slotsBreath determines the first physical hard disk groove position that the first physical hard disk is located, and in the first physical hard disk groove positionFirst physical hard disk is safeguarded.Therefore, method provided in an embodiment of the present invention, when operator are from figureKnow in shape server model the first graphical hard-disk slots information when it is possible to know this first figureShape hard-disk slots be located at graphical server model in which frame on which graphically serviceInside on device, operator only need to pull down the corresponding physical server of this graphical server, noAll of frame or all physical servers need to be dismantled, and then improve the efficiency safeguarding hard disk;And,Method provided in an embodiment of the present invention, also achieves the decoupling of software and hardware, improves detection disk identifier of hard diskThe compatibility of software.
The schematic flow sheet of the maintaining method embodiment three of the hard disk that Fig. 3 provides for the present invention.At above-mentionedOn the basis of one embodiment, the present embodiment refers to graphical server model can be with physical servicesThe renewal of the physical hard disk in device and the process that is updated.Further, the method also includes:
S301:According to the renewal of the physical hard disk on described physical server, update described graphical serviceGraphical hard disk in device model;The renewal of the physical hard disk on described physical server includes described physicsThe deletion of the physical hard disk on server and newly-increased.
It should be noted that this S301 can execute it is also possible to execute after S103 after S101,The present invention does not limit to the sequential of S301.
Specifically, in the present embodiment, when operator are updated to the physical hard disk on physical serverAfterwards, HD management system also can upgrade in time the graphical hard disk in graphical server model, hereThe renewal of physical hard disk includes the deletion of the physical hard disk on physical server and increases newly, that is, work as physical servicesWhen certain physical hard disk on device is deleted, corresponding graphical server also phase on graphical server modelThe deletion answered, when certain physical hard disk is increased on physical server, also phase on graphical server modelThe graphical hard disk of increase answered.
When the graphical hard disk on graphical server model with the physical hard disk on physical server moreAfter being newly updated, the first mapping relations also can accordingly update therewith, specially:When on physical serverCertain physical hard disk groove position on physical hard disk delete when, determine that this physics is hard according to the first mapping relationsThe corresponding graphical hard-disk slots in dish groove position, then delete this graphical hdd slot from the first mapping relationsCorresponding relation between the corresponding drive of graphical hard disk in position, to save corresponding storage resource;WhenOne piece of physical hard disk A is increased on physical server newly, then HD management system remains unchanged meeting according to above-mentioned enforcementThe mode of example two redefines the first mapping relations.
That is, method provided in an embodiment of the present invention, the drive information of graphical hard disk and graphicalThe corresponding relation of hard-disk slots is just to set up in later stage software deployment, after therefore it supports that hardware is marched into the arenaThe binding carrying out software management and hardware in real time is that is to say, that after hardware arrangement changes, above-mentionedFirst mapping relations can also carry out real-time update according to the change of hardware arrangement, further increases hard diskMaintenance efficiency.
The schematic flow sheet of the maintaining method example IV of the hard disk that Fig. 4 provides for the present invention.At above-mentionedOn the basis of one embodiment, the present embodiment refers to HD management system by above-mentioned first mapping relationsDetermine the detailed process of the status information of physical hard disk.In the present embodiment, above-mentioned first mapping relations are also wrappedInclude:The status information of each graphical hard disk.As shown in figure 4, the method includes:
S401:Inquiry instruction according to user and described first mapping relations, determine the figure of user's inquiryChange the status information of hard disk.
It should be noted that this S401 can execute it is also possible to execute after S103 after S101,The present invention does not limit to the sequential of S401.
Specifically, HD management system has provided a user with input interface, and user can be connect by this inputMouth input inquiry instruction, after HD management system receives the inquiry instruction of user, can be according to this inquiryIndicate the status information of the graphical hard disk determining user's inquiry.
S402:The status information of the graphical hard disk according to described user inquiry, is determined and is looked into described userThe status information of the corresponding physical hard disk of graphical hard disk ask.
The schematic flow sheet of the maintaining method embodiment five of the hard disk that Fig. 5 provides for the present invention.The present embodimentRefer to the example process that HD management system is safeguarded for hard disk.As shown in figure 5, the partyMethod includes:
S501:According to physical server, each physical hard disk groove position and each physical hard disk, set up figureChange server model.
Specifically, this process is specifically referred to the description of above-mentioned S101, will not be described here.Set upGraphical server model be referred to shown in Fig. 6.
S502:Logical number is carried out to each physical hard disk in physical server, and hard for each physicsThe logical number of disk distributes the drive of described physical hard disk in order.
Specifically, this process is specifically referred to the description of above-mentioned S201, will not be described here.In Fig. 6,Assume each physical hard disk the corresponding physical hard disk of logical number drive successively can for sda, sdb,sdc、sdd、sde、sdf.
S503:According to the lighting instruction of user, the corresponding thing of logical number to physical hard disk each describedThe drive execution lighting operation of reason hard disk, with the display lamp according to the physical hard disk on described physical serverThe drive that state obtains the corresponding physical hard disk of logical number of each physical hard disk is hard with physics each describedThe second mapping relations between the information of dish groove position.
S504:According to described second mapping relations, each described graphical hard-disk slots and each described thingThe association instruction of the corresponding relation of reason hard-disk slots and described user, for hard disk graphical each describedGroove position associates the drive of described physical hard disk.
Specifically, this process is specifically referred to the description of above-mentioned S203, will not be described here.User'sAssociation instruction is referred to " association drive " control shown in Fig. 7.Certainly, Fig. 7 is to user'sA kind of example of association instruction.
After HD management system receives the association instruction of user, an association interface, instruction can be ejectedThe drive of the physical hard disk that the pointed graphical hard-disk slots of this association of user input instruction should associate.Shown in Fig. 7 is that user have issued association instruction, then to the graphical hard-disk slots of the first row first rowAfter ejecting association interface, user will input this first row first row according to above-mentioned second mapping relationsThe drive of the graphical corresponding physical hard disk of hard-disk slots.
S505:According to the corresponding relation of each described graphical hard disk and each described physical hard disk, andThe drive of each described physical hard disk associated by described graphical hard-disk slots, obtains described first mappingRelation.
Specifically, due to the corresponding relation of graphical hard disk and described physical hard disk, it is associated with S504After the drive of graphical hard-disk slots and corresponding physical hard disk, actually it is equal to graphical hdd slotPosition is associated with the drive of graphical hard disk, thus HD management system is through above-mentioned S504 justThe first mapping relations are constructed.
That is, cut-off S505, above-mentioned graphical server model and the first mapping relations all generate.
S506:Obtain the drive of the first graphical hard disk, and according to described first mapping relations and describedThe drive of one graphical hard disk determines that corresponding with the drive of the described first graphical hard disk first is graphically hardThe information of dish groove position.
S507:Determine that the first physical hard disk is located according to the information of the described first graphical hard-disk slots theOne physical hard disk groove position, and the first physical hard disk in described first physical hard disk groove position is safeguarded.
Specifically, above-mentioned S507 and S508 may refer to the description in embodiment one, will not be described here.
One of ordinary skill in the art will appreciate that:Realize all or part step of above-mentioned each method embodimentSuddenly can be completed by the related hardware of programmed instruction.Aforesaid program can be stored in a computer canRead in storage medium.This program upon execution, executes the step including above-mentioned each method embodiment;AndAforesaid storage medium includes:ROM, RAM, magnetic disc or CD etc. are various can be with store program codesMedium.
The structural representation of the attending device embodiment one of the hard disk that Fig. 8 provides for the present invention.This device is fittedFor physical server, described physical server includes multiple physical hard disk groove positions, and each described physics is hardDish groove position corresponds to a physical hard disk.This device can be integrated in physical server.As shown in figure 8,This device includes:Build module 11, the first determining module 12 and HD management module 13.
Wherein, build module 11, for according to described physical server, each described physical hard disk groove position,Each described physical hard disk, sets up graphical server model and the first mapping relations;Wherein, described figureShape server model includes graphical server, graphical hard-disk slots and graphical hard disk, a figureShape server one physical server of correspondence, graphical hard disk one physical hard disk of correspondence, oneGraphical hard-disk slots correspond to a physical hard disk groove position;Described first mapping relations are each described figureChange the corresponding relation between the drive of hard disk and the information of each described graphical hard-disk slots;
First determining module 12, for obtaining the drive of the first graphical hard disk, and according to described structure mouldDescribed first mapping relations that block 11 obtains and the drive of described first graphical hard disk determine and described theThe information of the corresponding first graphical hard-disk slots of drive of one graphical hard disk;
HD management module 13, for described first figure being determined according to described first determining module 12The information changing hard-disk slots determines the first physical hard disk groove position that the first physical hard disk is located, and to described theThe first physical hard disk in one physical hard disk groove position is safeguarded.
The attending device of hard disk provided in an embodiment of the present invention, it is real that its implementation procedure may refer to said methodApply example, it is similar with technique effect that it realizes principle, will not be described here.
Further, described structure module 11, specifically for according to described physical server, described in eachGraphical hard disk and the corresponding relation of each described physical hard disk and each described figure of user inputChange the drive of the described physical hard disk associated by hard-disk slots, obtain described first mapping relations.
Optionally, above-mentioned physical server includes multiple physical hard disk groove positions, Ke Yiwei:Described physics clothesBusiness device includes at least two SAS cards, and each described SAS card is connected with a SAS expander, described SASMultiple described physical hard disk groove positions are had on expander.
Optionally, above-mentioned physical server includes multiple physical hard disk groove positions, can also be:Described physicsServer includes a SAS card, and described SAS card is connected with least one SAS expander, described in eachMultiple described physical hard disk groove positions are had on SAS expander.
The structural representation of the attending device embodiment two of the hard disk that Fig. 9 provides for the present invention.In above-mentioned figureOn the basis of 8 illustrated embodiments, further, described structure module 11, specifically includes:
Drive allocation unit 111, is carried out for physical hard disk described to each in described physical serverLogical number, and the disk of described physical hard disk is distributed in order for the logical number of each described physical hard diskSymbol;
Lighting unit 112, for the lighting instruction according to user, the logic to physical hard disk each describedNumber the drive execution lighting operation of corresponding physical hard disk, with according to the physics on described physical serverThe LED status of hard disk obtain the drive of the corresponding physical hard disk of logical number of each physical hard disk with everyThe second mapping relations between individual described physical hard disk groove position;
Associative cell 113, for obtained according to described lighting unit 112 described second mapping relations,The corresponding relation of each described graphical hard-disk slots and each described physical hard disk groove position and described useThe association instruction at family, associates the drive of described physical hard disk for hard-disk slots graphical each described;
Acquiring unit 114, for right according to each described graphical hard disk and each described physical hard diskShould be related to, and the drive of each described physical hard disk associated by described graphical hard-disk slots, obtainDescribed first mapping relations.
The attending device of hard disk provided in an embodiment of the present invention, it is real that its implementation procedure may refer to said methodApply example, it is similar with technique effect that it realizes principle, will not be described here.
The structural representation of the attending device embodiment three of the hard disk that Figure 10 provides for the present invention.In above-mentioned figure8 or embodiment illustrated in fig. 9 on the basis of, further, described device also includes:
Update module 14, for the renewal according to the physical hard disk on described physical server, updates describedGraphical hard disk in graphical server model;The renewal bag of the physical hard disk on described physical serverInclude the deletion of physical hard disk on described physical server and increase newly.
It should be noted that the structure of the attending device of the hard disk shown in Figure 10 is based on the reality shown in Fig. 9Apply and exemplify, certainly, Figure 10 can also be illustrated based on the structure of Fig. 8.
The structural representation of the attending device example IV of the hard disk that Figure 11 provides for the present invention.In above-mentioned figureOn the basis of 8 to Figure 10 any embodiment, described first mapping relations also include:Each is described graphicalThe status information of hard disk, further, described device also includes:
Second determining module 15, for the inquiry instruction according to user and described first mapping relations, determinesThe status information of the graphical hard disk of user's inquiry, and the shape of the graphical hard disk according to described user inquiryState information, determines the status information with the corresponding physical hard disk of graphical hard disk of described user inquiry.
It should be noted that the structure of the attending device of the hard disk shown in Figure 11 is based on shown in Figure 10Enforcement exemplifies, and certainly, Figure 11 can also be illustrated based on the structure of Fig. 8 or Fig. 9.
The attending device of hard disk provided in an embodiment of the present invention, it is real that its implementation procedure may refer to said methodApply example, it is similar with technique effect that it realizes principle, will not be described here.
Finally it should be noted that:Various embodiments above is only in order to illustrating technical scheme rather than rightIt limits;Although being described in detail to the present invention with reference to foregoing embodiments, this area commonTechnical staff should be understood:It still can be modified to the technical scheme described in foregoing embodiments,Or equivalent is carried out to wherein some or all of technical characteristic;And these modifications or replacement, andDo not make the scope of the essence disengaging various embodiments of the present invention technical scheme of appropriate technical solution.