Method, device, equipment and medium for preventing accidental deletion of storage logical volumes
By receiving the instruction to start the anti-accidental deletion function, monitoring the logical volume status and judging whether it is within the protection time, the problem of logical volumes being easily deleted by mistake is solved, an intelligent and automated anti-accidental deletion method is implemented, and the security of data storage is improved.
Patent Information
- Application Number
- CN202411216969.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In the existing technology, logical volumes are easily accidentally deleted due to human error, software defects or malicious attacks, resulting in data loss and system failure. There is a lack of intelligent and automated measures to prevent accidental deletion.
A method for preventing accidental deletion of storage logical volumes is provided. The method receives an instruction to enable the anti-accidental deletion function, monitors the status of the logical volume, and determines whether it is within the protection time. If it is within the protection time, deletion is prohibited and a prompt is given; otherwise, deletion is allowed. The method includes reading input and output logs and access record information, monitoring the active status in real time or at regular intervals, and adding tags or extending the time within the protection time to prevent accidental deletion.
It implements an intelligent and automated method to prevent accidental deletion, effectively preventing logical volumes from being accidentally deleted within a specified time, avoiding data loss and system failures, and improving the security of logical volume management in the storage system.
Smart Images

Figure CN119002823B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a method, device, equipment and medium for preventing accidental deletion of a storage logical volume. Background Art
[0002] In data centers and cloud storage environments, logical volumes, as the fundamental unit of data storage, are crucial to their management and protection. Accidentally deleting a logical volume is a common operational error that can lead to the loss or corruption of important data, causing immeasurable losses to business operations.
[0003] In relevant technical solutions, there are already some basic security measures in the storage system, such as permission control and confirmation prompts. However, in actual operation, logical volumes may still be accidentally deleted due to human errors, software defects or malicious attacks.
[0004] Therefore, how to develop a more intelligent and automated method for preventing accidental deletion of storage logical volumes is a technical problem that those skilled in the art urgently need to solve. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, device, equipment and medium for preventing accidental deletion of storage logical volumes, which can realize an intelligent and automated anti-accidental deletion method, effectively prevent logical volumes from being accidentally deleted within a specified time, avoid data loss and system failure caused by accidental deletion operations, and improve management security.
[0006] In order to solve the above technical problems, the present invention provides a method for preventing accidental deletion of a storage logical volume, the method comprising:
[0007] Receive the instruction to enable the anti-accidental deletion function;
[0008] In response to the instruction to start the anti-accidental deletion function, extracting a preset protection time;
[0009] monitoring the state of the logical volume, and when the logical volume is monitored to be in an active state, determining whether the logical volume is within the protection time;
[0010] If the logical volume is within the protection time, the operation of deleting the logical volume is prohibited and a corresponding prompt message is returned;
[0011] If the logical volume is not within the protection time, the operation of deleting the logical volume is allowed.
[0012] In a first aspect, in the above-mentioned storage logical volume accidental deletion prevention method provided by the present invention, monitoring the status of the logical volume includes:
[0013] Read the input and output logs and access record information of the storage device;
[0014] Monitoring the status of the logical volume in real time or periodically based on the read input and output logs and access record information;
[0015] When it is monitored that there is a read / write operation or data change on the logical volume, the logical volume is marked as active.
[0016] On the other hand, in the above-mentioned storage logical volume anti-accidental deletion method provided by the present invention, when the protection time is a set time period, a label of the protection time is added to the logical volume, and the start time and end time of the set time period are recorded;
[0017] When the protection time is a set time length, the timer starts counting when the logical volume enters the active state, and the operation of deleting the logical volume is prohibited during the set time length.
[0018] On the other hand, in the above-mentioned storage logical volume accidental deletion prevention method provided by the present invention, if the logical volume is not within the protection time, the operation of allowing the logical volume to be deleted includes:
[0019] When the protection time is a set time period, if the logical volume is not within the protection time, determining that the logical volume is after the end time of the set time period;
[0020] At this time, if the logical volume is still in an active state, determining whether the active time of the logical volume in a unit time exceeds a set time threshold;
[0021] If the active time of the logical volume in a unit time exceeds the set time threshold, the end time of the set time period is automatically extended;
[0022] If the active time of the logical volume within a unit time does not exceed the set time threshold, the operation of deleting the logical volume is allowed;
[0023] or, determining whether the input and output traffic of the logical volume within a unit time exceeds a set traffic threshold;
[0024] If the input and output traffic of the logical volume within a unit time exceeds the set traffic threshold, the end time of the set time period is automatically extended;
[0025] If the input and output traffic of the logical volume within a unit time does not exceed the set traffic threshold, the operation of deleting the logical volume is allowed;
[0026] Correspondingly, when the protection time is a set time length, upon receiving a deletion operation request, it is determined whether the logical volume has been active for the set time length before the current moment;
[0027] If there is an active state, the operation of deleting the logical volume is prohibited and a corresponding prompt message is returned;
[0028] If there is no active state, the operation of deleting the logical volume is allowed.
[0029] On the other hand, in the above-mentioned storage logical volume accidental deletion prevention method provided by the present invention, determining whether the logical volume is within the protection time includes:
[0030] Traversing the active state of the logical volume, reading and counting the latest access time of the logical volume;
[0031] Determine whether the latest access time exceeds the protection time;
[0032] If so, determining that the logical volume is not within the protection time;
[0033] If not, it is determined that the logical volume is within the protection time.
[0034] On the other hand, in the above-mentioned storage logical volume accidental deletion prevention method provided by the present invention, while prohibiting the operation of deleting the logical volume, it also includes:
[0035] The logical volume is prohibited from releasing the host mapping relationship, deleting the active host, deleting the mapped port of the active host, and deleting the input and output group to which the active host belongs.
[0036] On the other hand, in the storage logical volume accidental deletion prevention method provided by the present invention, receiving an instruction to enable the accidental deletion prevention function includes:
[0037] Receive an instruction to enable the anti-accidental deletion function from a visual management interface or a command line interface;
[0038] The method further comprises:
[0039] Receive instructions to disable the anti-accidental deletion function from the visual management interface or command line interface;
[0040] The step of stopping monitoring the status of the logical volume.
[0041] In order to solve the above technical problems, the present invention further provides a storage logical volume anti-accidental deletion device, the device comprising:
[0042] A command receiving module, used for receiving a command to enable the anti-accidental deletion function;
[0043] A protection time extraction module, configured to extract a preset protection time in response to the anti-accidental deletion function activation instruction;
[0044] Volume status monitoring module, used to monitor the status of logical volumes;
[0045] a time judgment module, configured to judge whether the logical volume is within the protection time when monitoring that the logical volume is in an active state;
[0046] The deletion operation restriction module is used to prohibit the operation of deleting the logical volume if the logical volume is within the protection time and return corresponding prompt information; if the logical volume is not within the protection time, allow the operation of deleting the logical volume.
[0047] In order to solve the above technical problems, the present invention further provides a storage logical volume anti-accidental deletion device, the device comprising:
[0048] Memory for storing computer programs;
[0049] The processor is used to implement the steps of the above-mentioned storage logical volume anti-accidental deletion method when executing the computer program.
[0050] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for preventing accidental deletion of storage logical volumes are implemented.
[0051] It can be seen from the above technical solution that the present invention provides a method for preventing accidental deletion of a storage logical volume, which includes: receiving an instruction to enable the anti-accidental deletion function; extracting a pre-set protection time in response to the instruction to enable the anti-accidental deletion function; monitoring the status of the logical volume, and when monitoring that the logical volume is in an active state, determining whether the logical volume is within the protection time; if the logical volume is within the protection time, prohibiting the operation of deleting the logical volume and returning a corresponding prompt message; if the logical volume is not within the protection time, allowing the operation of deleting the logical volume.
[0052] The beneficial effect of the present invention is that the above-mentioned storage logical volume anti-accidental deletion method provided by the present invention, after receiving the anti-accidental deletion function activation instruction, turns on the anti-accidental deletion function, extracts the pre-set protection time, and prohibits the deletion of the logical volume within the protection time by monitoring the active status of the logical volume, and returns the corresponding prompt information, thereby realizing an intelligent and automatic anti-accidental deletion method, which can effectively prevent the logical volume from being accidentally deleted within the specified time, thereby avoiding data loss and system failure caused by accidental deletion operations, timely discovering and processing possible accidental deletion operations, and improving the security of logical volume management in the storage system.
[0053] In addition, the present invention also provides a corresponding storage logical volume anti-accidental deletion device, a storage logical volume anti-accidental deletion device and a computer-readable storage medium for the storage logical volume anti-accidental deletion method, which have the same or corresponding technical features as the above-mentioned storage logical volume anti-accidental deletion method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0055] Figure 1 A flowchart of a method for preventing accidental deletion of a storage logical volume provided by an embodiment of the present invention;
[0056] Figure 2 A schematic diagram of the structure of a storage logical volume anti-accidental deletion device provided by an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of the structure of a storage logical volume anti-accidental deletion device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] The core of the present invention is to provide a method, device, equipment and medium for preventing accidental deletion of storage logical volumes, so as to solve the technical problem of accidental deletion of logical volumes.
[0060] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods. Figure 1 The flowchart of the storage logical volume anti-accidental deletion method provided by the embodiment of the present invention is as follows: Figure 1 As shown, the method includes the following steps:
[0061] S101: Receive an instruction to enable an anti-accidental deletion function.
[0062] S102: In response to the instruction to start the anti-accidental deletion function, extract the preset protection time.
[0063] It should be noted that the instructions for enabling the accidental deletion prevention function of the present invention can be specific to different types of logical volumes. These types of logical volumes can include standard volumes, compressed volumes, thin volumes, active-active volumes, local replicated volumes, remote replicated volumes, and the like. The instructions for enabling the accidental deletion prevention function can include the type of logical volume and a pre-set protection period. Different types of logical volumes have different accidental deletion prevention policies, which determine whether the accidental deletion prevention function is enabled for that type of logical volume and configure the corresponding protection period. This allows for effective and flexible protection of different types of volumes against accidental deletion.
[0064] The protection period can be pre-set by the administrator or user. It can be a fixed duration, such as 24 hours or 48 hours, or a fixed time period, such as from 8:00 AM to 8:00 PM on a particular day, or from 12:00 AM on the 1st to 12:00 PM on the 5th day. This allows for more refined configuration of the protection period based on actual conditions, adapting to various application scenarios and providing a wide range of applicability.
[0065] S103: Monitor the status of the logical volume.
[0066] In practice, the present invention can integrate a volume status monitoring module into a storage management system. The system uses the volume status monitoring module to monitor the status of logical volumes, including checking whether the logical volumes are active. Active logical volume status indicates that the logical volume has been activated and is accessible, allowing system administrators to operate the logical volume as needed and providing the basis for flexible management and dynamic adjustment of storage resources.
[0067] S104: When the logical volume is monitored to be in an active state, determine whether the logical volume is within the protection time.
[0068] If the logical volume is within the protection time, step S105 is executed; if the logical volume is not within the protection time, step S106 is executed.
[0069] S105: prohibit the operation of deleting the logical volume, and return corresponding prompt information.
[0070] In implementation, when an active logical volume is within the protection time, for example, the active logical volume is within a set time length or within a set time period, the deletion operation can be prohibited and the corresponding prompt information will be returned. This effectively prevents the logical volume from being accidentally deleted within the protection time, and reminds the system administrator that the logical volume is at risk of being deleted externally during the protection time, so that the administrator can promptly discover and handle possible erroneous operations, further improving the security of data storage.
[0071] S106: Allow the operation of deleting the logical volume.
[0072] In implementation, when the active logical volume is not within the protection time, for example, the active logical volume has exceeded a set time length or is not within a set time period, it may be allowed to be deleted.
[0073] In the above-mentioned storage logical volume anti-accidental deletion method provided by an embodiment of the present invention, after receiving the anti-accidental deletion function activation instruction, the anti-accidental deletion function is activated, the pre-set protection time is extracted, and by monitoring the active status of the logical volume, the logical volume is prohibited from being deleted within the protection time, and the corresponding prompt information is returned. In this way, an intelligent and automated anti-accidental deletion method is implemented, which can effectively prevent the logical volume from being accidentally deleted within the specified time, thereby avoiding data loss and system failure caused by accidental deletion operations, timely discovering and processing possible accidental deletion operations, and improving the security of logical volume management in the storage system.
[0074] Furthermore, in a specific implementation, in the above-mentioned storage logical volume anti-accidental deletion method provided in an embodiment of the present invention, step S103 monitors the status of the logical volume, which may specifically include: reading the input and output logs and access record information of the storage device; monitoring the status of the logical volume in real time or periodically based on the read input and output logs and access record information; and marking the logical volume as active when it is monitored that there are read and write operations or data changes on the logical volume.
[0075] In practice, the present invention can read the input / output (IO) logs and access records of storage devices in real time. Using these logs and access records, the status of logical volumes can be monitored in real time or periodically, including read and write operations, access frequency, and data changes. When read and write operations or data changes are detected on a logical volume, the logical volume can be marked as active.
[0076] Furthermore, in specific implementation, in the above-mentioned storage logical volume anti-accidental deletion method provided in an embodiment of the present invention, when the protection time is a set time period, a protection time label is added to the logical volume, and the start time and end time of the set time period are recorded; when the protection time is a set time length, when the logical volume enters an active state, the timing starts, and during the set time length, the operation of deleting the logical volume is prohibited.
[0077] In practice, the set time period has a start time and an end time. When the protection time is a set time period, it means that the protection time has a start time and an end time. The present invention can add a protection time tag to the logical volume according to the management settings to accurately determine whether the active logical volume is within the protection time. As long as the active logical volume is within the set time period, the operation of deleting the logical volume is prohibited. When the protection time is a set time length, the logical volume enters the active state and the timer of the set time length can be started. After the set time length, such as 24 hours or 48 hours, the operation of deleting the logical volume is prohibited.
[0078] Furthermore, in a specific implementation, in the above-mentioned storage logical volume accidental deletion prevention method provided by an embodiment of the present invention, if the logical volume is not within the protection time, the operation of allowing the logical volume to be deleted in step S106 may specifically include:
[0079] When the protection time is a set time period, if the logical volume is not within the protection time, the time at which the logical volume is after the end time of the set time period is determined; at this time, if the logical volume is still active, whether the active time of the logical volume per unit time exceeds the set time threshold is determined; if the active time of the logical volume per unit time exceeds the set time threshold, the end time of the set time period is automatically extended; if the active time of the logical volume per unit time does not exceed the set time threshold, the operation of deleting the logical volume is allowed; or, whether the input and output traffic of the logical volume per unit time exceeds the set traffic threshold is determined; if the input and output traffic of the logical volume per unit time exceeds the set traffic threshold, the end time of the set time period is automatically extended; if the input and output traffic of the logical volume per unit time does not exceed the set traffic threshold, the operation of deleting the logical volume is allowed.
[0080] Correspondingly, when the protection time is a set time length, upon receiving a deletion operation request, it is determined whether the logical volume has been in an active state for the set time length before the current moment; if there is an active state, the operation of deleting the logical volume is prohibited, and a corresponding prompt message is returned; if there is no active state, the operation of deleting the logical volume is allowed.
[0081] During implementation, when the protection time is a set time period, the threshold judgment method can be selected. When the threshold judgment is selected, it can be judged whether the volume activity level in unit time reaches the threshold, such as the volume activity time in unit time, the volume input and output traffic in unit time (that is, the access traffic of the host to the logical volume in the storage system), etc. If the set threshold is reached (if the default threshold in the program is not set), the end time can be automatically extended. This automatic adjustment of the protection time makes the anti-accidental deletion method more flexible and convenient.
[0082] When the protection time is a set length of time, for example, 12 hours, the protection time starts counting when the logical volume enters the active state. After 12 hours, if the logical volume is no longer in the protection time, the logical volume deletion operation can be allowed regardless of whether it is in the active state. However, when receiving a deletion operation request, the present invention can only consider whether there is an active state within 12 hours before executing the volume deletion operation. If so, the deletion operation is not allowed; otherwise, the deletion operation is allowed.
[0083] Furthermore, in a specific implementation, in the above-mentioned storage logical volume anti-accidental deletion method provided in an embodiment of the present invention, step S104 determines whether the logical volume is within the protection time, which may specifically include: traversing the active state of the logical volume, reading and counting the latest access time of the logical volume; determining whether the latest access time exceeds the protection time; if so, determining that the logical volume is not within the protection time; if not, determining that the logical volume is within the protection time.
[0084] In practice, after the accidental deletion prevention function is enabled, the storage system can automatically read and count the latest access time of the logical volume from the background and save the data. Based on the comparison result of the latest access time and the protection time, it is determined whether the logical volume is in the protection time, which can further ensure the accuracy of accidental deletion. The latest access time of the logical volume counted by the present invention can include the latest access time of the specified volume, the latest access time of the host-mapped volume, the latest access time of the mapped volume within the input and output group, the latest access time of the mapped volume within the volume group, and the latest access time of the mapped volume within the host group.
[0085] Furthermore, in specific implementation, in the above-mentioned storage logical volume anti-accidental deletion method provided in an embodiment of the present invention, while prohibiting the operation of deleting the logical volume, it can also include: prohibiting the logical volume from releasing the host mapping relationship, prohibiting the deletion of active hosts, prohibiting active hosts from deleting mapped ports, and prohibiting active hosts from deleting the input and output groups to which they belong.
[0086] In practice, in addition to providing deletion protection for protected logical volumes, the present invention can also provide deletion protection for the storage-related modules involved, including preventing active volumes from releasing host mapping relationships, preventing active hosts from accidentally deleting volumes, preventing active hosts from deleting mapped ports, preventing active hosts from deleting their assigned input and output groups, and preventing related host-combined volume groups from accidentally being deleted.
[0087] Furthermore, in specific implementation, in the above-mentioned storage logical volume anti-accidental deletion method provided in an embodiment of the present invention, receiving an anti-accidental deletion function activation instruction may specifically include: receiving an anti-accidental deletion function activation instruction from a visual management interface or a command line interface (CLI).
[0088] Similarly, the method may further include the steps of: receiving an instruction to turn off the anti-accidental deletion function from a visual management interface or a command line interface; and stopping monitoring the status of the logical volume.
[0089] During implementation, the system provides a visual management interface or command line interface to facilitate administrators in setting and viewing information such as the active status and protection time of logical volumes. Administrators can use this interface or command line interface to easily set protection time for logical volumes, view the active status of logical volumes, and enable or disable the volume's accidental deletion protection feature. This allows for personalized customization, with the ability to set global or customized configurations. Code logic is implemented through environment variables, improving management efficiency and reducing operational difficulty and complexity. The command line interface allows users to enter commands to enable or disable the accidental deletion protection feature via the keyboard, and the computer executes the commands upon receiving them.
[0090] In the above embodiments, a method for preventing accidental deletion of a storage logical volume is described in detail. The present invention also provides corresponding embodiments of a storage logical volume accidental deletion prevention apparatus and a storage logical volume accidental deletion prevention device. It should be noted that the present invention describes embodiments of the apparatus from two perspectives: one based on functional modules and the other based on hardware.
[0091] Figure 2 This is a schematic diagram of the structure of the storage logical volume anti-accidental deletion device provided by an embodiment of the present invention. This embodiment is based on the perspective of functional modules, such as Figure 2 As shown, the device includes:
[0092] The instruction receiving module 10 is used to receive an instruction to enable the anti-accidental deletion function;
[0093] A protection time extraction module 11 is configured to extract a preset protection time in response to an instruction to enable the anti-accidental deletion function;
[0094] Volume status monitoring module 12, used to monitor the status of the logical volume;
[0095] A time determination module 13 is used to determine whether the logical volume is within the protection time when the logical volume is monitored to be in an active state;
[0096] The deletion operation restriction module 14 is used to prohibit the operation of deleting the logical volume and return a corresponding prompt message if the logical volume is within the protection time; and to allow the operation of deleting the logical volume if the logical volume is not within the protection time.
[0097] In the above-mentioned storage logical volume anti-accidental deletion device provided in an embodiment of the present invention, the above-mentioned five modules can interact with each other, and after receiving the anti-accidental deletion function activation instruction, the anti-accidental deletion function can be activated, the pre-set protection time can be extracted, and the deletion of the logical volume can be prohibited within the protection time by monitoring the active status of the logical volume, and corresponding prompt information can be returned. In this way, an intelligent and automated anti-accidental deletion method is implemented, which can effectively prevent the logical volume from being accidentally deleted within the specified time, thereby avoiding data loss and system failure caused by accidental deletion operations, timely discovering and processing possible accidental deletion operations, and improving the security of logical volume management in the storage system.
[0098] Since the embodiments of the apparatus part correspond to the embodiments of the method part, the embodiments of the apparatus part refer to the description of the embodiments of the method part and are not described here in detail. The invention has the same beneficial effects as the above-mentioned storage logical volume accidental deletion prevention method.
[0099] Furthermore, in a specific implementation, in the storage logical volume anti-accidental deletion device provided in an embodiment of the present invention, the instruction receiving module 10 can be specifically used to receive an anti-accidental deletion function activation instruction from a visual management interface or a command line interface.
[0100] Correspondingly, the instruction receiving module 10 can also be used to receive an instruction to disable the anti-accidental deletion function from the visual management interface or command line interface. After the instruction receiving module 10 receives the instruction to disable the anti-accidental deletion function, the volume status monitoring module 12 can stop monitoring the status of the logical volume.
[0101] Furthermore, in a specific implementation, in the above-mentioned storage logical volume anti-erroneous deletion device provided in an embodiment of the present invention, the volume status monitoring module 12 can be specifically used to read the input and output logs and access record information of the storage device; based on the read input and output logs and access record information, the status of the logical volume is monitored in real time or periodically; when it is monitored that there are read and write operations or data changes on the logical volume, the logical volume is marked as active.
[0102] Furthermore, in specific implementation, in the above-mentioned storage logical volume anti-accidental deletion device provided in the embodiment of the present invention, the protection time can be a set time period or a set time length; when the protection time is a set time period, a protection time label is added to the logical volume, and the start time and end time of the set time period are recorded; when the protection time is a set time length, the timing starts when the logical volume enters the active state, and the operation of deleting the logical volume is prohibited during the set time length.
[0103] Furthermore, in a specific implementation, in the above-mentioned storage logical volume anti-accidental deletion device provided in an embodiment of the present invention, the time judgment module 13 can be specifically used to traverse the active state of the logical volume, read and count the latest access time of the logical volume; judge whether the latest access time exceeds the protection time; if so, judge that the logical volume is not within the protection time; if not, judge that the logical volume is within the protection time.
[0104] Furthermore, in a specific implementation, in the storage logical volume accidental deletion prevention device provided in an embodiment of the present invention, the deletion operation restriction module 14 may specifically include:
[0105] The first restriction unit is used to, when the protection time is a set time period, if the logical volume is not within the protection time, determine the time when the logical volume is after the end time of the set time period; at this time, if the logical volume is still in an active state, determine whether the active time of the logical volume per unit time exceeds the set time threshold; if the active time of the logical volume per unit time exceeds the set time threshold, automatically extend the end time of the set time period; if the active time of the logical volume per unit time does not exceed the set time threshold, allow the operation of deleting the logical volume; or, determine whether the input and output traffic of the logical volume per unit time exceeds the set traffic threshold; if the input and output traffic of the logical volume per unit time exceeds the set traffic threshold, automatically extend the end time of the set time period; if the input and output traffic of the logical volume per unit time does not exceed the set traffic threshold, allow the operation of deleting the logical volume.
[0106] The second restriction unit is used to determine whether the logical volume has been in an active state for the set time length before the current moment when a deletion operation request is received when the protection time is the set time length; if the active state exists, the operation of deleting the logical volume is prohibited and a corresponding prompt message is returned; if the active state does not exist, the operation of deleting the logical volume is allowed.
[0107] Furthermore, in a specific implementation, in the storage logical volume accidental deletion prevention device provided in the embodiment of the present invention, the deletion operation restriction module 14 may further include:
[0108] The third restriction unit is used to prohibit the logical volume from releasing the host mapping relationship, prohibit deleting the active host, prohibit the active host from deleting the mapped port, and prohibit the active host from deleting the input and output group to which it belongs.
[0109] Figure 3 This is a schematic diagram of the structure of the storage logical volume anti-accidental deletion device provided by the embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 3 As shown in the figure, the storage logical volume protection device includes:
[0110] Memory 20, for storing computer programs;
[0111] The processor 21 is configured to implement the steps of the method for preventing accidental deletion of a storage logical volume as described in the above embodiment when executing a computer program.
[0112] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented in at least one of the following hardware forms: a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the awake state, also known as a CPU; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a graphics processing unit (GPU), which is responsible for rendering and drawing content required to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0113] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the storage logical volume anti-accidental deletion method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to the data involved in the above-mentioned storage logical volume anti-accidental deletion method, etc.
[0114] In some embodiments, the storage logical volume accidental deletion prevention device may further include a display screen 22, an input and output interface 23, a communication interface 24, a power supply 25, and a communication bus 26. Those skilled in the art will appreciate that Figure 3The structure shown in the figure does not constitute a limitation on the storage logical volume accidental deletion protection device, and may include more or fewer components than shown. The storage logical volume accidental deletion protection device provided in an embodiment of the present invention includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the storage logical volume accidental deletion protection method mentioned above, with the same effect as above.
[0115] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiment.
[0116] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. Various media that can store program code. The computer-readable storage medium provided by the present invention can implement the above-mentioned storage logical volume anti-accidental deletion method, and the effect is the same as above.
[0117] Finally, the present invention also provides a corresponding embodiment of a computer program product. The computer program product includes a computer program / instructions that, when executed by a processor, implement the steps described in the embodiment of the storage logical volume accidental deletion prevention method. The computer program product provided by the present invention can implement the aforementioned storage logical volume accidental deletion prevention method, achieving the same effects as described above.
[0118] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0119] The above is a detailed introduction to the storage logical volume anti-accidental deletion method, device, equipment and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A method for preventing accidental deletion of a storage logical volume, characterized in that: The method comprises: Receive the instruction to enable the anti-accidental deletion function; In response to the instruction to start the anti-accidental deletion function, extracting a preset protection time; monitoring the state of the logical volume, and when the logical volume is monitored to be in an active state, determining whether the logical volume is within the protection time; If the logical volume is within the protection time, the operation of deleting the logical volume is prohibited and a corresponding prompt message is returned; If the logical volume is not within the protection time, the operation of deleting the logical volume is allowed.
2. The storage logical volume anti-accidental deletion method according to claim 1, characterized in that: Monitor the status of logical volumes, including: Read the input and output logs and access record information of the storage device; Monitoring the status of the logical volume in real time or periodically based on the read input and output logs and access record information; When it is monitored that there is a read / write operation or data change on the logical volume, the logical volume is marked as active.
3. The storage logical volume anti-accidental deletion method according to claim 1, characterized in that: When the protection time is a set time period, a label of the protection time is added to the logical volume, and the start time and end time of the set time period are recorded; When the protection time is a set time length, the timer starts counting when the logical volume enters the active state, and the operation of deleting the logical volume is prohibited during the set time length.
4. The method for preventing accidental deletion of a storage logical volume according to claim 3, wherein: If the logical volume is not within the protection time, the operation of deleting the logical volume is allowed, including: When the protection time is a set time period, if the logical volume is not within the protection time, determining that the logical volume is after the end time of the set time period; At this time, if the logical volume is still in an active state, determining whether the active time of the logical volume in a unit time exceeds a set time threshold; If the active time of the logical volume in a unit time exceeds the set time threshold, the end time of the set time period is automatically extended; If the active time of the logical volume within a unit time does not exceed the set time threshold, the operation of deleting the logical volume is allowed; or, determining whether the input and output traffic of the logical volume within a unit time exceeds a set traffic threshold; If the input and output traffic of the logical volume exceeds the set traffic threshold within a unit time, the end time of the set time period is automatically extended; If the input and output traffic of the logical volume within a unit time does not exceed the set traffic threshold, the operation of deleting the logical volume is allowed; Correspondingly, when the protection time is a set time length, upon receiving a deletion operation request, it is determined whether the logical volume has been active for the set time length before the current moment; If there is an active state, the operation of deleting the logical volume is prohibited and a corresponding prompt message is returned; If there is no active state, the operation of deleting the logical volume is allowed.
5. The method for preventing accidental deletion of a storage logical volume according to claim 1, wherein: Determining whether the logical volume is within the protection time includes: Traversing the active state of the logical volume, reading and counting the latest access time of the logical volume; Determine whether the latest access time exceeds the protection time; If so, determining that the logical volume is not within the protection time; If not, it is determined that the logical volume is within the protection time.
6. The method for preventing accidental deletion of a storage logical volume according to claim 1, wherein: While prohibiting the operation of deleting the logical volume, the method further includes: The logical volume is prohibited from releasing the host mapping relationship, deleting the active host, deleting the mapped port of the active host, and deleting the input and output group to which the active host belongs.
7. The method for preventing accidental deletion of a storage logical volume according to claim 1, wherein: Receive the command to enable the anti-accidental deletion function, including: Receive an instruction to enable the anti-accidental deletion function from a visual management interface or a command line interface; The method further comprises: Receive instructions to disable the anti-accidental deletion function from the visual management interface or command line interface; The step of stopping monitoring the status of the logical volume.
8. A device for preventing accidental deletion of a storage logical volume, characterized in that: The device comprises: A command receiving module, used for receiving a command to enable the anti-accidental deletion function; A protection time extraction module, configured to extract a preset protection time in response to the anti-accidental deletion function activation instruction; Volume status monitoring module, used to monitor the status of logical volumes; a time judgment module, configured to judge whether the logical volume is within the protection time when monitoring that the logical volume is in an active state; The deletion operation restriction module is used to prohibit the operation of deleting the logical volume if the logical volume is within the protection time and return corresponding prompt information; if the logical volume is not within the protection time, allow the operation of deleting the logical volume.
9. A device for preventing accidental deletion of storage logical volumes, characterized in that: The device comprises: memory for storing computer programs; A processor is configured to implement the steps of the method for preventing accidental deletion of a storage logical volume as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for preventing accidental deletion of a storage logical volume are implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Logical volume deleting method and device
CN109491598A
Distributed cluster logical volume data management method, system, equipment and medium
CN114443224A