Faulty disk repair method, device, electronic device and readable storage medium
By deleting the SPDK components related to the failed disk hardware in the virtual machine and mounting the user-state driver for the target disk hardware, the problem of the repair of the failed disk hardware in the existing technology requires stopping the operation of the virtual machine and the physical machine, achieving a lower unavailability time and impact range.
Patent Information
- Application Number
- CN202310574204.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-05-19
AI Technical Summary
The prior art requires stopping the operation of virtual machines and physical machines during the repair of failed disk hardware, resulting in an increase in the impact range and an increase in unavailability time.
The maintenance process is completed by determining the first disk simulation device corresponding to the failed disk hardware in the virtual machine, and deleting the relevant SPDK components in sequence, then mounting the user-state driver for the target disk hardware, and creating the corresponding second disk simulation device.
It realizes that there is no need to stop the virtual machine and physical machine during the repair of the failed disk hardware, reducing the unavailability time and impact range of the virtual machine.
Smart Images

Figure CN116775353B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence technologies such as cloud computing, big data, and cloud services, and provides a method, device, electronic device, and readable storage medium for repairing a faulty disk. Background Art
[0002] In the prior art, if the disk hardware used by a virtual machine fails, it is necessary to first shut down the virtual machine according to the user's authorization, and then shut down the physical machine where the virtual machine is located after all virtual machines are shut down, replace the failed disk hardware, restart the physical machine, and finally restore the storage development performance kit SPDK service and restart the virtual machine. Therefore, the prior art will cause the virtual machine and the physical machine where the virtual machine is located to stop running during the repair process of the failed disk, which expands the scope of impact. Summary of the invention
[0003] According to a first aspect of the present disclosure, a method for repairing a faulty disk is provided, comprising: in the case of determining that a disk hardware fault occurs, determining a first disk simulation device corresponding to the faulty disk hardware in a virtual machine; deleting the first disk simulation device, a virtual host user-mode block controller Ctrlr component corresponding to the first disk simulation device in a storage development performance kit SPDK, and a block device Bdev component corresponding to the faulty disk hardware in the SPDK in sequence, wherein the SPDK is a proxy layer between the virtual machine and the disk hardware; in the case of determining that the faulty disk hardware is replaced by a target disk hardware, mounting a user-mode driver for the target disk hardware; creating a second disk simulation device corresponding to the target disk hardware, creating a Bdev component corresponding to the target disk hardware in the SPDK, creating a Ctrlr component corresponding to the second disk simulation device in the SPDK, and adding the second disk simulation device in the virtual machine in sequence.
[0004] According to a second aspect of the present disclosure, a repair device for a faulty disk is provided, comprising: a processing unit, for determining a first disk simulation device corresponding to the faulty disk hardware in a virtual machine when it is determined that the disk hardware has failed; a deleting unit, for deleting the first disk simulation device, a virtual host user-mode block controller Ctrlr component corresponding to the first disk simulation device in a storage development performance kit SPDK, and a block device Bdev component corresponding to the faulty disk hardware in the SPDK in sequence, wherein the SPDK is a proxy layer between the virtual machine and the disk hardware; a mounting unit, for mounting a user-mode driver for the target disk hardware when it is determined that the faulty disk hardware has been replaced by a target disk hardware; a creating unit, for creating a second disk simulation device corresponding to the target disk hardware, creating a Bdev component corresponding to the target disk hardware in the SPDK, creating a Ctrlr component corresponding to the second disk simulation device in the SPDK, and adding the second disk simulation device in the virtual machine in sequence.
[0005] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0006] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.
[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.
[0008] It can be seen from the above technical solutions that the present disclosure is used to repair faulty disk hardware used by virtual machines that rely on SPDK (Storage Performance Development Kit) for IO acceleration. During the repair process of the faulty disk hardware, there is no need to stop the operation of the virtual machine and the physical machine where the virtual machine is located, and there is no need to restart the SPDK service, thereby greatly reducing the unavailability time and impact scope of the virtual machine during the disk hardware repair process, and will not affect the operation of other virtual machines located on the physical machine.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0012] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0013] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;
[0014] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0015] Figure 5 The block diagram of an electronic device used to implement the method for repairing a faulty disk according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0016] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.
[0017] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the method for repairing a faulty disk in this embodiment specifically includes the following steps:
[0018] S101, when it is determined that the disk hardware fails, determining a first disk simulation device corresponding to the failed disk hardware in the virtual machine;
[0019] S102, sequentially deleting the first disk simulation device, the virtual host user state block controller Ctrlr component corresponding to the first disk simulation device in the storage development performance kit SPDK, and the block device Bdev component corresponding to the faulty disk hardware in the SPDK, wherein the SPDK is a proxy layer between the virtual machine and the disk hardware;
[0020] S103, when it is determined that the failed disk hardware is replaced by the target disk hardware, mounting a user-mode driver for the target disk hardware;
[0021] S104, creating a second disk simulation device corresponding to the target disk hardware, sequentially creating a Bdev component corresponding to the target disk hardware in the SPDK, creating a Ctrlr component corresponding to the second disk simulation device in the SPDK, and adding the second disk simulation device in the virtual machine.
[0022] The method for repairing a faulty disk in this embodiment is used to repair faulty disk hardware used by a virtual machine that relies on SPDK (Storage Performance Development Kit) for IO acceleration. During the repair of the faulty disk hardware, there is no need to stop the operation of the virtual machine and the physical machine where the virtual machine is located, and there is no need to restart the SPDK service, thereby greatly reducing the unavailable time of the virtual machine during the disk hardware repair process and will not affect the operation of other virtual machines located on the physical machine.
[0023] In this embodiment, SPDK is a proxy layer between the virtual machine (or the disk simulation device located in the virtual machine) and the disk hardware, which is used to build a virtual IO queue backend to connect the disk simulation device and provide a user-mode driver to manage the disk hardware. It processes the requests on the IO queue and the responses of the disk hardware in a polling manner, thereby reducing the loss on the virtual machine IO path.
[0024] The Bdev (BlockDevice, block device) component is a component in SPDK used to manage disk hardware. In this embodiment, it is used to manage the disk hardware that loads user-mode drivers; the Ctrlr (Vhostuser-blkController, virtual host user-mode block controller) component is a component in SDPK used to build a virtual IO queue backend. In this embodiment, it is used to connect to the disk simulation device, thereby realizing the sending and receiving of IO requests through the virtual machine.
[0025] Qemu is a virtual machine simulator. After starting, Qemu is a user process running on a physical machine, which is used to simulate various disk hardware, network cards and other external devices of the virtual machine. KVM is a kernel module used to implement virtualization technology, which realizes the CPU instructions and memory access simulation of the virtual machine. Qemu and KVM work together to create a disk simulation device in the virtual machine. The created disk simulation device appears as a virtioblk type device in the virtual machine. Virtioblk is a general disk simulation device driver.
[0026] In addition, the disk hardware in this embodiment is an SSD (Solid State Disk) based on NVMe (NonVolatile Memory Express); the executor of the repair method of the faulty disk in this embodiment can be a virtual machine, or a repair management module additionally set up in the virtual machine.
[0027] When executing S101 to determine whether the disk hardware fails, this embodiment can determine that the disk hardware fails if it is determined that the virtual machine cannot process the IO request through the disk hardware; specifically, obtain the processing time of the IO request being processed by the disk hardware, and if it is determined that the obtained processing time is greater than or equal to the preset time, determine that the virtual machine cannot process the IO request, and thus determine that the disk hardware used by the virtual machine fails; this embodiment can also abandon the IO request being processed to avoid long-term congestion.
[0028] This embodiment may also obtain the operation attributes of the disk simulation device corresponding to the disk hardware when executing S101 to determine whether the disk hardware fails, and then determine that the disk hardware fails when it is determined that the obtained operation attributes are inconsistent with the standard attributes.
[0029] When executing S101, this embodiment can determine the first disk simulation device corresponding to the faulty disk hardware according to a preset correspondence table, in which different disk hardware and their corresponding disk simulation devices are recorded; the first disk simulation device is located in the virtual machine.
[0030] After determining that the disk hardware has failed, the present embodiment may also include the following contents: obtaining identification information of the failed disk hardware, where the identification information may be the drive letter, serial number (Serial Number, SN), etc. of the disk hardware; determining the target slot corresponding to the failed disk hardware based on the obtained identification information, where the slot where the target slot is located in the present embodiment may be a PCIe (Peripheral Component Interconnect Express) slot, and the target slot is the slot where the failed disk hardware is installed; setting the state of the indicator light corresponding to the determined target slot to a fault display state, where the fault display state may be setting the status indicator light to a flashing state or a red light state.
[0031] That is to say, this embodiment sets the indicator light corresponding to the slot where the faulty disk hardware is installed to a fault display state, so that on-site maintenance personnel can more quickly and accurately determine the slot where the faulty disk hardware is installed, and then replace the disk hardware in the slot. In some scenarios where the identification information of the disk hardware cannot be viewed (for example, the identification information is blocked by the slot), the purpose of quickly and accurately replacing the faulty disk hardware can also be achieved.
[0032] In addition, after determining that the disk hardware has failed in step S101, this embodiment may first obtain identification information of the failed disk hardware, and then send the identification information to on-site maintenance personnel, so that the on-site maintenance personnel can determine in which slot of the slot the disk hardware has failed based on the received identification information.
[0033] In this embodiment, after executing S101 to determine the first disk simulation device corresponding to the faulty disk hardware in the virtual machine, executing S102, in sequence, deletes the first disk simulation device in the virtual machine, the Ctrlr component in the SPDK, and the Bdev component in the SPDK.
[0034] Among them, this embodiment executes S102 to delete the Ctrlr component corresponding to the first disk simulation device in the SPDK, thereby disconnecting the connection between the SPDK and the first disk simulation device; and deletes the Bdev component corresponding to the faulty disk hardware in the SPDK, thereby disconnecting the connection between the SPDK and the faulty disk hardware.
[0035] Since the storage architecture in this embodiment is a virtual machine, SPDK and disk hardware from top to bottom, when unplugging the faulty disk hardware from the storage architecture, this embodiment needs to delete the first disk simulation device in the virtual machine, the Ctrlr component in the SPDK, and the Bdev component in the SPDK in order from top to bottom.
[0036] In this embodiment, when executing S102 to delete the first disk simulation device in the virtual machine, the first disk simulation device can be deleted through the Qemu hot plug interface.
[0037] After executing S102 to sequentially delete the first disk simulation device, the Ctrlr component in the SPDK, and the Bdev component in the SPDK, this embodiment executes S103 to mount a user-mode driver for the target disk hardware when it is determined that the faulty disk hardware is replaced by the target disk hardware; wherein the target disk hardware in this embodiment is non-faulty disk hardware that is reinserted into the storage architecture.
[0038] In this embodiment, when executing S103 to determine whether the failed disk hardware is replaced by the target disk hardware, an optional implementation method that can be adopted is: after receiving a preset signal, determining that the failed disk hardware is replaced by the target disk hardware.
[0039] Among them, the preset signal of this embodiment can be sent in the following manner: a signal sending button is pre-set on the slot where the disk hardware is installed. After the on-site maintenance personnel pull out the faulty disk hardware from the slot and insert the target disk hardware into the slot, the on-site maintenance personnel manually triggers the signal sending button or the slot automatically triggers the signal sending button to send the preset signal.
[0040] That is to say, this embodiment determines whether the disk hardware is replaced by determining whether a preset signal is received, thereby shortening the maintenance time of the disk hardware and improving the maintenance efficiency of the disk hardware.
[0041] Since the target disk hardware that is reinserted into the slot mounts the kernel-mode driver by default, in order to enable SPDK to manage the target disk hardware, it is necessary to mount the user-mode driver for the target disk hardware. Therefore, after executing S103 to determine that the faulty disk hardware is replaced by the target disk hardware, this embodiment mounts the user-mode driver for the replaced target disk hardware.
[0042] After executing S103 to mount the user-mode driver for the target disk hardware, this embodiment executes S104 to create a second disk simulation device corresponding to the target disk hardware, and sequentially creates a Bdev component corresponding to the target disk hardware in SPDK, creates a Ctrlr component corresponding to the second disk simulation device in SPDK, and adds the second disk simulation device in the virtual machine.
[0043] Among them, this embodiment executes S103 to create a Bdev component corresponding to the target disk hardware in SPDK, thereby establishing a connection between SPDK and the target disk hardware; create a Ctrlr component corresponding to the second disk simulation device in SPDK, thereby establishing a connection between SPDK and the second disk simulation device; add the second disk simulation device in the virtual machine, so that the virtual machine can use the target disk hardware.
[0044] Since the storage architecture in this embodiment is a virtual machine, SPDK and disk hardware from top to bottom, when inserting the target disk hardware into the storage architecture, this embodiment needs to create the Bdev component in SPDK, the Ctrlr component in SPDK, and add a second disk simulation device in the virtual machine in order from bottom to top.
[0045] In this embodiment, when performing S104 to add the second disk simulation device in the virtual machine, the second disk simulation device can be added in the virtual machine through the Qemu hot plug interface.
[0046] After executing S104 to create the Bdev component and the Ctrlr component in the SPDK and add the second disk simulation device in the virtual machine, this embodiment completes the repair of the faulty disk hardware; because this embodiment does not stop the operation of the virtual machine and the physical machine, nor restart the SPDK service during the repair of the faulty disk, the entire repair process does not affect other virtual machines on the same physical machine.
[0047] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure. Figure 2 , a structural diagram of the SPDK-based storage architecture of this embodiment is shown in FIG. 1 : in this storage architecture, from top to bottom are the virtual machine, SPDK and disk hardware, the Ctrlr component in the SPDK is connected to the disk simulation device in the virtual machine, and the Bdev component in the SPDK is connected to the disk hardware.
[0048] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure. Figure 3 The repair flow chart of the faulty disk of this embodiment is shown in the figure: S301, a fault in the disk hardware is detected; S302, the IO request being processed by the faulty disk hardware is discarded; S303, the first disk simulation device corresponding to the faulty disk hardware in the virtual machine is deleted through the Qemu hot-plug interface; S304, the Ctrlr component corresponding to the first disk simulation device in SPDK is deleted; S305, the Bdev component corresponding to the faulty disk hardware in SPDK is deleted; S306, the indicator light of the PCIe slot where the faulty disk hardware is located is set to a fault display state (e.g., a flashing state) to mark the fault. The location of the disk hardware enables on-site maintenance personnel to determine the slot where the faulty disk hardware is located according to the flashing indicator light, and then remove the faulty disk hardware and insert the target disk hardware; S307, when it is detected that the faulty disk hardware is replaced by the target disk hardware, mount the user-mode driver for the target disk hardware; S308, establish a Bdev component corresponding to the target disk hardware in SPDK; S309, establish a Ctrlr component corresponding to the second disk simulation device in SPDK; S310, add a second disk simulation device in the virtual machine through the Qemu hot-plug interface; S311, the faulty disk hardware is repaired.
[0049] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure. Figure 4 As shown, the repair device for a faulty disk in this embodiment includes:
[0050] The processing unit 401 is used to determine a first disk simulation device corresponding to the failed disk hardware in the virtual machine when it is determined that the disk hardware fails;
[0051] The deleting unit 402 is used to sequentially delete the first disk simulation device, the virtual host user state block controller Ctrlr component corresponding to the first disk simulation device in the storage development performance kit SPDK, and the block device Bdev component corresponding to the faulty disk hardware in the SPDK, wherein the SPDK is a proxy layer between the virtual machine and the disk hardware;
[0052] The mounting unit 403 is used to mount a user-mode driver for the target disk hardware when it is determined that the failed disk hardware is replaced by the target disk hardware;
[0053] The creation unit 404 is used to create a second disk simulation device corresponding to the target disk hardware, and sequentially create a Bdev component corresponding to the target disk hardware in the SPDK, create a Ctrlr component corresponding to the second disk simulation device in the SPDK, and add the second disk simulation device in the virtual machine.
[0054] When determining whether the disk hardware fails, the processing unit 401 may determine that the disk hardware fails if it determines that the virtual machine cannot process the IO request through the disk hardware; specifically, obtain the processing time of the IO request being processed by the disk hardware, and if it is determined that the obtained processing time is greater than or equal to the preset time, determine that the virtual machine cannot process the IO request, thereby determining that the disk hardware used by the virtual machine fails; this embodiment may also abandon the IO request being processed to avoid long-term congestion.
[0055] When determining whether the disk hardware fails, the processing unit 401 may also obtain the operation attributes of the disk simulation device corresponding to the disk hardware, and then determine that the disk hardware fails when it is determined that the obtained operation attributes are inconsistent with the standard attributes.
[0056] The processing unit 401 can determine the first disk simulation device corresponding to the faulty disk hardware according to a preset correspondence table, wherein the preset correspondence table records different disk hardware and their corresponding disk simulation devices; the first disk simulation device is located in the virtual machine.
[0057] The faulty disk repair device 400 of this embodiment may also include a display unit 405, which is used to perform the following operations: after the processing unit 401 determines that the disk hardware has failed, obtain identification information of the faulty disk hardware; determine a target slot corresponding to the faulty disk hardware based on the obtained identification information; and set the state of the indicator light corresponding to the determined target slot to a fault display state, which may be to set the status indicator light to a flashing state or a red light state.
[0058] That is to say, the display unit 405 sets the indicator light corresponding to the slot where the faulty disk hardware is installed to a fault display state, so that on-site maintenance personnel can more quickly and accurately determine the slot where the faulty disk hardware is installed, and then replace the disk hardware in the slot. In some scenarios where the identification information of the disk hardware cannot be viewed (for example, the identification information is blocked by the slot), the purpose of quickly and accurately replacing the faulty disk hardware can also be achieved.
[0059] In addition, after determining that the disk hardware has failed, the processing unit 401 can first obtain identification information of the failed disk hardware, and then send the identification information to on-site maintenance personnel, so that the on-site maintenance personnel can determine which slot in the slot has the disk hardware failed based on the received identification information.
[0060] In this embodiment, after the processing unit 401 determines the first disk simulation device corresponding to the faulty disk hardware in the virtual machine, the deleting unit 402 sequentially deletes the first disk simulation device in the virtual machine, the Ctrlr component in the SPDK, and the Bdev component in the SPDK.
[0061] Among them, the deletion unit 402 deletes the Ctrlr component corresponding to the first disk simulation device in the SPDK, thereby disconnecting the connection between the SPDK and the first disk simulation device; and deletes the Bdev component corresponding to the faulty disk hardware in the SPDK, thereby disconnecting the connection between the SPDK and the faulty disk hardware.
[0062] Since the storage architecture in this embodiment is a virtual machine, SPDK and disk hardware from top to bottom, when the faulty disk hardware is unplugged from the storage architecture, the deletion unit 402 of this embodiment needs to delete the first disk simulation device in the virtual machine, the Ctrlr component in the SPDK, and the Bdev component in the SPDK in order from top to bottom.
[0063] When deleting the first disk simulation device in the virtual machine, the deleting unit 402 may delete the first disk simulation device through the Qemu hot-plug interface.
[0064] In this embodiment, after the deletion unit 402 deletes the first disk simulation device, the Ctrlr component in the SPDK, and the Bdev component in the SPDK in sequence, the mounting unit 403 mounts the user-mode driver for the target disk hardware when it is determined that the faulty disk hardware is replaced by the target disk hardware; wherein the target disk hardware in this embodiment is the non-faulty disk hardware that is reinserted into the storage architecture.
[0065] When the mounting unit 403 determines whether the failed disk hardware is replaced by the target disk hardware, an optional implementation method that can be adopted is: after receiving a preset signal, determining that the failed disk hardware is replaced by the target disk hardware.
[0066] Among them, the preset signal of this embodiment can be sent in the following manner: a signal sending button is pre-set on the slot where the disk hardware is installed. After the on-site maintenance personnel pull out the faulty disk hardware from the slot and insert the target disk hardware into the slot, the on-site maintenance personnel manually triggers the signal sending button or the slot automatically triggers the signal sending button to send the preset signal.
[0067] That is to say, this embodiment determines whether the disk hardware is replaced by determining whether a preset signal is received, thereby shortening the maintenance time of the disk hardware and improving the maintenance efficiency of the disk hardware.
[0068] Since the target disk hardware that is reinserted into the slot mounts the kernel-mode driver by default, in order for SPDK to manage the target disk hardware, it is necessary to mount the user-mode driver for the target disk hardware. Therefore, after determining that the failed disk hardware has been replaced by the target disk hardware, the mounting unit 403 mounts the user-mode driver for the replaced target disk hardware.
[0069] In this embodiment, after the mounting unit 403 mounts the user-mode driver for the target disk hardware, the creation unit 404 creates a second disk simulation device corresponding to the target disk hardware, and sequentially creates a Bdev component corresponding to the target disk hardware in SPDK, creates a Ctrlr component corresponding to the second disk simulation device in SPDK, and adds the second disk simulation device in the virtual machine.
[0070] Among them, the creation unit 404 creates a Bdev component corresponding to the target disk hardware in the SPDK, thereby establishing a connection between the SPDK and the target disk hardware; creates a Ctrlr component corresponding to the second disk simulation device in the SPDK, thereby establishing a connection between the SPDK and the second disk simulation device; and adds the second disk simulation device in the virtual machine, so that the virtual machine can use the target disk hardware.
[0071] Since the storage architecture in this embodiment is a virtual machine, SPDK and disk hardware from top to bottom, when inserting the target disk hardware into the storage architecture, the creation unit 404 needs to create the Bdev component in the SPDK, the Ctrlr component in the SPDK, and add a second disk simulation device in the virtual machine in order from bottom to top.
[0072] When the creating unit 404 adds the second disk simulation device in the virtual machine, the second disk simulation device can be added in the virtual machine through the Qemu hot plug interface.
[0073] After the creation unit 404 creates the Bdev component and the Ctrlr component in the SPDK and adds the second disk simulation device in the virtual machine, the repair of the faulty disk hardware is completed; since this embodiment does not stop the operation of the virtual machine and the physical machine, nor restart the SPDK service during the repair of the faulty disk, the entire repair process does not affect other virtual machines on the same physical machine.
[0074] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0075] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0076] like Figure 5 , is a block diagram of an electronic device according to a method for repairing a failed disk in accordance with an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0077] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0078] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0079] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a method for repairing a faulty disk. For example, in some embodiments, the method for repairing a faulty disk may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508.
[0080] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the above-described method for repairing a faulty disk may be executed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the method for repairing a faulty disk in any other appropriate manner (e.g., by means of firmware).
[0081] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable fault disk repair device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0083] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0084] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0085] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0086] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.
[0087] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0088] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for repairing a faulty disk, comprising: In the case where it is determined that the disk hardware fails according to the processing time of the IO request being processed by the disk hardware or the operation attribute of the first disk simulation device corresponding to the disk hardware, determining the first disk simulation device corresponding to the failed disk hardware in the virtual machine, and discarding the input / output IO request being processed by the failed disk hardware, the first disk simulation device being located in the virtual machine; Deleting the first disk simulation device, the virtual host user state block controller Ctrlr component corresponding to the first disk simulation device in the storage development performance kit SPDK, and the block device Bdev component corresponding to the faulty disk hardware in the SPDK in order, wherein the SPDK is a proxy layer between the virtual machine and the disk hardware; When it is determined that the failed disk hardware is replaced by the target disk hardware, mounting a user-mode driver for the target disk hardware; Creating a second disk simulation device corresponding to the target disk hardware, sequentially creating a Bdev component corresponding to the target disk hardware in the SPDK, creating a Ctrlr component corresponding to the second disk simulation device in the SPDK, and adding the second disk simulation device in the virtual machine, wherein the second disk simulation device is located in the virtual machine; Determining that the failed disk hardware is replaced by the target disk hardware includes: After receiving a preset signal, determining that the failed disk hardware is replaced by the target disk hardware; Wherein, the preset signal is sent through a signal sending button located on the target slot.
2. The method according to claim 1, wherein: Determining that the disk hardware fails according to the processing time of the IO request being processed by the disk hardware includes: Get the processing time of the IO request being processed by the disk hardware; When it is determined that the processing time is greater than or equal to the preset time, it is determined that the disk hardware fails.
3. The method according to claim 1, wherein: Determining that the disk hardware fails according to the operation attribute of the first disk simulation device corresponding to the disk hardware includes: Determining a first disk emulation device corresponding to the disk hardware; Obtaining the operation properties of the first disk simulation device; When it is determined that the operation attribute is inconsistent with the standard attribute, it is determined that the disk hardware fails.
4. The method according to claim 1, further comprising: After determining that the disk hardware fails, obtaining identification information of the failed disk hardware; Determining, according to the identification information, a target slot corresponding to the faulty disk hardware; The state of the indicator light corresponding to the target slot is set to a fault display state.
5. A device for repairing a faulty disk, comprising: The processing unit is used to determine the first disk simulation device corresponding to the failed disk hardware in the virtual machine, and discard the input / output IO request being processed by the failed disk hardware, when it is determined that the disk hardware fails according to the processing time of the IO request being processed by the disk hardware or the operation attribute of the first disk simulation device corresponding to the disk hardware, and the first disk simulation device is located in the virtual machine; A deleting unit, used to sequentially delete the first disk simulation device, the virtual host user state block controller Ctrlr component corresponding to the first disk simulation device in the storage development performance kit SPDK, and the block device Bdev component corresponding to the faulty disk hardware in the SPDK, wherein the SPDK is a proxy layer between the virtual machine and the disk hardware; A mounting unit, configured to mount a user-mode driver for the target disk hardware when it is determined that the failed disk hardware is replaced by the target disk hardware; A creating unit, configured to create a second disk simulation device corresponding to the target disk hardware, sequentially creating a Bdev component corresponding to the target disk hardware in the SPDK, creating a Ctrlr component corresponding to the second disk simulation device in the SPDK, and adding the second disk simulation device in the virtual machine, wherein the second disk simulation device is located in the virtual machine; When the mounting unit determines that the failed disk hardware is replaced by the target disk hardware, the mounting unit specifically performs: After receiving a preset signal, determining that the failed disk hardware is replaced by the target disk hardware; Wherein, the preset signal is sent through a signal sending button located on the target slot.
6. The device according to claim 5, wherein: When the processing unit determines that the disk hardware fails according to the processing time of the IO request being processed by the disk hardware, the processing unit specifically performs: Get the processing time of the IO request being processed by the disk hardware; When it is determined that the processing time is greater than or equal to the preset time, it is determined that the disk hardware fails.
7. The device according to claim 5, wherein: When the processing unit determines that the disk hardware fails according to the operation attribute of the first disk simulation device corresponding to the disk hardware, the processing unit specifically executes: Determining a first disk emulation device corresponding to the disk hardware; Obtaining the operation properties of the first disk simulation device; When it is determined that the operation attribute is inconsistent with the standard attribute, it is determined that the disk hardware fails.
8. The apparatus according to claim 5, further comprising a display unit, configured to perform: After the processing unit determines that the disk hardware fails, obtaining identification information of the failed disk hardware; Determining, according to the identification information, a target slot corresponding to the faulty disk hardware; The state of the indicator light corresponding to the target slot is set to a fault display state.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.
11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Virtual machine-based equipment heat replacing method and device
CN105279010A
Method and device for positioning hard disk fault, electronic equipment and storage medium
CN114064401A
Data processing method and device and electronic equipment
CN115774596A