Storage system volume accidental deletion prevention method, device, electronic device and storage medium
By comparing the access time difference of the storage volume with the preset protection time, the operation of the storage system is controlled, which solves the business interruption problem caused by the user's accidental deletion of the volume and ensures data integrity and system stability.
Patent Information
- Application Number
- CN202411215506.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In existing storage systems, users accidentally delete storage volumes, causing business interruptions. Especially in a multi-controller cluster architecture, how can we better prevent accidental volume deletion operations from affecting system stability and data integrity?
By obtaining the latest access time of the storage volume, calculating the relationship between the time difference and the preset interval protection time, the execution of the target operation is controlled to ensure that deletion or unmapping operations are allowed only when the volume is inactive, preventing accidental deletion.
This effectively prevents accidental deletion or unmapping of volumes while they are still in use, avoiding data loss and service interruption, and enhancing system stability and data security.
Smart Images

Figure CN119127079B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for preventing accidental deletion of a storage system volume. Background Art
[0002] Storage systems in related technologies utilize a multi-controller cluster architecture, ensuring continued service even if some controllers fail. Hosts can operate independently or in clusters, integrating resources through software. Users typically create logical unit numbers (LUNs) in the storage system and map them to hosts. Advanced users also create volume groups and map them to host clusters. Hosts can be physical or virtual entities, supporting multiple hosts or port configurations.
[0003] In related technologies, most storage systems support volume-host mapping and volume group-host group mapping. If a user mistakenly deletes an object or releases the mapping, it will cause business disconnection and affect the normal operation of the business.
[0004] Therefore, how to better prevent accidental deletion of storage system volumes has become an urgent problem to be solved in the industry. Summary of the Invention
[0005] The present invention provides a method, device, electronic device and storage medium for preventing accidental deletion of storage system volumes, which are used to solve the problem of how to better prevent accidental deletion of storage system volumes in the prior art.
[0006] The present invention provides a method for preventing accidental deletion of a storage system volume, comprising:
[0007] Upon receiving a target operation on a target storage volume in the storage system from a user, obtaining the latest access time of each storage volume; wherein the target operation includes at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of the host corresponding to the target storage volume, and an operation of removing the host corresponding to the target storage volume from a host group;
[0008] A time difference between the latest access time of the target storage volume and a current timestamp is obtained, and based on a magnitude relationship between the time difference and a preset interval protection time, processing of the target operation is controlled.
[0009] According to a storage system volume accidental deletion prevention method provided by the present invention, when a target operation is a delete port operation of a host corresponding to the target storage volume, controlling the processing of the target operation based on the relationship between the time difference and a preset interval protection time includes:
[0010] If the port to be deleted is not the last port of the host corresponding to the target storage volume, the port is allowed to be deleted;
[0011] In a case where the deleted port is the last port of the host corresponding to the target storage volume, comparing the time difference with a preset interval protection time;
[0012] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0013] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0014] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, the port is allowed to be deleted;
[0015] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the port is not allowed.
[0016] According to a method for preventing accidental deletion of a storage system volume provided by the present invention, when the target operation is an operation of unmapping a target storage volume, deleting the target storage volume, or removing the target storage volume from a target storage volume group of the target storage volume, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes:
[0017] If the time difference is less than or equal to the preset interval protection time, not performing the target operation;
[0018] In a case where the time difference is greater than the preset interval protection time, the target operation is allowed to be performed.
[0019] According to a method for preventing accidental deletion of a storage system volume provided by the present invention, when the target operation is a deletion operation of the target storage volume corresponding to the host, the processing of the target operation is controlled based on the relationship between the time difference and the preset interval protection time, including:
[0020] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0021] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0022] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, deleting the host corresponding to the target storage volume;
[0023] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the host corresponding to the target storage volume is not allowed.
[0024] According to a method for preventing accidental deletion of a storage system volume provided by the present invention, when the target operation is an operation by a host group to remove a host corresponding to the target storage volume, controlling the processing of the target operation based on the relationship between the time difference and a preset interval protection time includes:
[0025] If the host corresponding to the target storage volume is not the last host in the host group, allowing the host corresponding to the target storage volume to be removed;
[0026] When the host corresponding to the target storage volume is the last host in the host group, comparing the time difference with a preset interval protection time;
[0027] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0028] If the target storage volume is offline and mapped to another host, continue traversing other storage volumes mapped to the host corresponding to the target storage volume, and compare the time difference between the other storage volumes and the preset interval protection time;
[0029] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, it is allowed to remove the host corresponding to the target storage volume from the host group;
[0030] When the target storage volume is online or the target storage volume is not mapped to other hosts, it is not allowed to remove the host corresponding to the target storage volume from the host group.
[0031] According to a method for preventing accidental deletion of a storage system volume provided by the present invention, when the target operation is an operation of unmapping a host group corresponding to the target storage volume group, controlling the processing of the target operation based on a relationship between the time difference and a preset interval protection time includes:
[0032] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0033] When the time difference is greater than the preset interval protection time, comparing the time difference with the preset interval protection time;
[0034] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0035] If the time difference is greater than the preset interval protection time, traverse other storage volumes mapped by the host corresponding to the target storage volume, and compare the time difference of the other storage volumes with the preset interval protection time;
[0036] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if the time differences corresponding to all other storage volumes are greater than the preset interval protection time, the host group corresponding to the target storage volume group is unmapped.
[0037] According to a storage system volume accidental deletion prevention method provided by the present invention, upon receiving a target operation of a user on a target storage volume in the storage system, obtaining the latest access time of each storage volume includes:
[0038] After the preset time is reached, the timer traverses each storage volume and obtains the working status of each storage volume;
[0039] The latest access time of each storage volume in a busy working state is updated according to the current time period and the preset time length.
[0040] The present invention also provides a storage system volume accidental deletion prevention device, comprising:
[0041] an acquisition module, configured to acquire the latest access time of each storage volume upon receiving a target operation on a target storage volume in the storage system from a user; wherein the target operation includes at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of a host corresponding to the target storage volume, and an operation of removing a host corresponding to the target storage volume from a host group;
[0042] The control module is configured to obtain a time difference between the latest access time of the target storage volume and a current timestamp, and control processing of the target operation based on a size relationship between the time difference and a preset interval protection time.
[0043] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is a deletion port operation of the host corresponding to the target storage volume, the device is further configured to:
[0044] If the port to be deleted is not the last port of the host corresponding to the target storage volume, the port is allowed to be deleted;
[0045] In a case where the deleted port is the last port of the host corresponding to the target storage volume, comparing the time difference with a preset interval protection time;
[0046] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0047] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0048] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, the port is allowed to be deleted;
[0049] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the port is not allowed.
[0050] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is an operation of unmapping the target storage volume, deleting the target storage volume, or removing the target storage volume from the target storage volume group, the device is further configured to:
[0051] If the time difference is less than or equal to the preset interval protection time, not performing the target operation;
[0052] In a case where the time difference is greater than the preset interval protection time, the target operation is allowed to be performed.
[0053] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is a deletion operation of the target storage volume corresponding to the host, the device is further configured to:
[0054] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0055] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0056] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, deleting the host corresponding to the target storage volume;
[0057] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the host corresponding to the target storage volume is not allowed.
[0058] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is an operation of a host group removing a host corresponding to the target storage volume, the device is further configured to:
[0059] If the host corresponding to the target storage volume is not the last host in the host group, allowing the host corresponding to the target storage volume to be removed;
[0060] When the host corresponding to the target storage volume is the last host in the host group, comparing the time difference with a preset interval protection time;
[0061] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0062] If the target storage volume is offline and mapped to another host, continue traversing other storage volumes mapped to the host corresponding to the target storage volume, and compare the time difference between the other storage volumes and the preset interval protection time;
[0063] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, it is allowed to remove the host corresponding to the target storage volume from the host group;
[0064] When the target storage volume is online or the target storage volume is not mapped to other hosts, it is not allowed to remove the host corresponding to the target storage volume from the host group.
[0065] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is an operation of unmapping a host group corresponding to the target storage volume group, the device is further configured to:
[0066] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0067] When the time difference is greater than the preset interval protection time, comparing the time difference with the preset interval protection time;
[0068] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0069] If the time difference is greater than the preset interval protection time, traverse other storage volumes mapped by the host corresponding to the target storage volume, and compare the time difference of the other storage volumes with the preset interval protection time;
[0070] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if the time differences corresponding to all other storage volumes are greater than the preset interval protection time, the host group corresponding to the target storage volume group is unmapped.
[0071] According to a storage system volume accidental deletion prevention device provided by the present invention, the device is further used for:
[0072] After the preset time is reached, the timer traverses each storage volume and obtains the working status of each storage volume;
[0073] The latest access time of each storage volume in a busy working state is updated according to the current time period and the preset time length.
[0074] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for preventing accidental deletion of a storage system volume as described above is implemented.
[0075] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for preventing accidental deletion of a storage system volume as described above is implemented.
[0076] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for preventing accidental deletion of storage system volumes.
[0077] The present invention provides a method, device, electronic device, and storage medium for preventing accidental deletion of storage system volumes. If the time difference is greater than the protection time interval, it indicates that the volume has not been accessed within the set time, and the security of executing the target operation is relatively high. If the time difference is less than or equal to the protection time interval, it indicates that the volume may still be in use, and executing the target operation may affect the integrity or availability of the data. The system will block the operation or request user confirmation. By comparing the access time and the protection time interval, the system can effectively prevent users from accidentally deleting or unmapping the volume while it is still in use, thereby avoiding data loss or service interruption. Furthermore, by avoiding deletion or unmapping operations while the volume is active, system stability is enhanced, reducing system failures caused by improper operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0079] Figure 1 A flowchart of a method for preventing accidental deletion of a storage system volume provided in an embodiment of the present application;
[0080] Figure 2 One of the processing flow diagrams provided in the embodiment of the present application;
[0081] Figure 3 The second processing flow diagram provided in the embodiment of the present application;
[0082] Figure 4 The third processing flow diagram provided in the embodiment of the present application;
[0083] Figure 5The fourth processing flow diagram provided in the embodiment of the present application;
[0084] Figure 6 The fifth processing flow diagram provided in the embodiment of the present application;
[0085] Figure 7 The sixth processing flow diagram provided in the embodiment of the present application;
[0086] Figure 8 The seventh processing flow diagram provided in the embodiment of the present application;
[0087] Figure 9 The eighth processing flow diagram provided in the embodiment of the present application;
[0088] Figure 10 A storage system volume accidental deletion prevention device provided in an embodiment of the present application;
[0089] Figure 11 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0090] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some 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 creative efforts shall fall within the scope of protection of the present invention.
[0091] Figure 1 A flowchart of a method for preventing accidental deletion of a storage system volume provided in an embodiment of the present application is shown in FIG. Figure 1 Shown, including:
[0092] Step 110: Upon receiving a target operation on a target storage volume in the storage system from a user, obtain the latest access time of each storage volume; wherein the target operation includes at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of a host corresponding to the target storage volume, and an operation of removing a host corresponding to the target storage volume from a host group;
[0093] In an embodiment of the present application, the system first identifies the type of operation requested by the user, which may include unmapping and deletion of volumes, removal of volumes from volume groups, unmapping of volume groups from host groups, deletion of hosts, deletion of host ports, and removal of hosts from host groups.
[0094] More specifically, volume unmapping refers to canceling the mapping relationship between a volume and a host or host group.
[0095] Deleting a volume means completely deleting a volume from the storage system; removing a volume from a volume group means removing a specific volume from the volume group.
[0096] Unmapping a volume group from a host group may refer to canceling the mapping relationship between the volume group and the host group; and deleting a host may refer to deleting the configuration of the host from the storage system.
[0097] Deleting a host port may refer to deleting a host's network ports, which are used to communicate with the storage system. Removing a host from a host group may refer to removing a specific host from the host group.
[0098] More specifically, for each storage volume, the system obtains its latest access time. This timestamp records the exact moment when the volume was last accessed by an I / O operation.
[0099] Step 120: Obtain the time difference between the latest access time of the target storage volume and the current timestamp, and control the processing of the target operation based on the relationship between the time difference and the preset interval protection time.
[0100] In this embodiment of the present application, the system calculates the time difference between the last access time of the volume and the current time, and uses this time difference to evaluate the activity status of the volume.
[0101] The system compares the calculated time difference with the user-preset guard interval, a threshold that defines how long a volume is considered active and therefore should not be deleted or unmapped during this time.
[0102] Based on the comparison between the time difference and the protection time interval, the system decides whether to perform the target operation:
[0103] If the time difference is greater than the protection time interval, it indicates that the volume has not been accessed within the set time and it is safe to perform the target operation.
[0104] If the time difference is less than or equal to the protection interval, the volume may still be in use and performing the target operation may affect data integrity or availability. The system will block the operation or request user confirmation.
[0105] In this embodiment of the present application, if the time difference is greater than the protection interval, it indicates that the volume has not been accessed within the set time period, making the target operation more secure. If the time difference is less than or equal to the protection interval, it indicates that the volume may still be in use, and executing the target operation may affect data integrity or availability. The system will block the operation or request user confirmation. By comparing the access time and the protection interval, the system can effectively prevent users from accidentally deleting or unmapping a volume while it is still in use, thereby avoiding data loss or service interruption. Furthermore, by avoiding deletion or unmapping operations while the volume is active, system stability is enhanced, reducing system failures caused by improper operation.
[0106] Optionally, when the target operation is a port deletion operation of the host corresponding to the target storage volume, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes:
[0107] If the port to be deleted is not the last port of the host corresponding to the target storage volume, the port is allowed to be deleted;
[0108] In a case where the deleted port is the last port of the host corresponding to the target storage volume, comparing the time difference with a preset interval protection time;
[0109] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0110] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0111] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, the port is allowed to be deleted;
[0112] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the port is not allowed.
[0113] Figure 2 This is one of the processing flow diagrams provided in the embodiment of the present application, such as Figure 2 Shown, including:
[0114] Execute the host port deletion operation;
[0115] If the port being deleted is not the last port on the host corresponding to the target storage volume, the system will allow the port to be deleted because it will not affect the host's access to other ports. If the port being deleted is the last port on the host, the system will initiate a more stringent check. First, the system will compare the difference between the volume's most recent access time and the current time with the preset protection interval.
[0116] Therefore, it is possible to determine whether the port is the last port of the host, or to delete all remaining ports of the host at the same time. If not, deletion is allowed; otherwise, proceed to the next step.
[0117] Calculate whether the difference between the current timestamp and the latest access time of the volume mapped by the current host is greater than the set protection interval.
[0118] If the time difference is less than or equal to the protection interval, it indicates that the volume may still be in use, and the system will further check the status of the host.
[0119] If it is greater than the protection interval, continue to traverse other mapped volumes; otherwise, determine whether the host is offline and whether the volume is mapped to other hosts. This is to ensure that the port deletion operation does not affect volume access.
[0120] If these two conditions are not met, the host port cannot be deleted. Otherwise, the system continues to traverse other mapped volumes and storage volumes, and compares the time difference between these volumes with the protection time interval.
[0121] During the traversal, if all other storage volumes are offline and they are mapped to other hosts, this indicates that removing the port does not affect access to those volumes.
[0122] If the above conditions are met, that is, all other storage volumes are offline and mapped to other hosts, the system will allow the target port to be deleted.
[0123] If the target volume is online, or not mapped to another host, this indicates that deleting the port may affect access to the volume, and the system will not allow you to delete the port.
[0124] In this embodiment of the present application, the system ensures that even if a host port is deleted, access to the storage volume will not be accidentally interrupted, thereby maintaining the stability of the storage system and the security of the data. At the same time, this also provides users with a flexible mechanism to adapt to different business needs and operating scenarios.
[0125] Optionally, when the target operation is an operation of unmapping the target storage volume, deleting the target storage volume, or removing the target storage volume from the target storage volume group, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes:
[0126] If the time difference is less than or equal to the preset interval protection time, not performing the target operation;
[0127] In a case where the time difference is greater than the preset interval protection time, the target operation is allowed to be performed.
[0128] Figure 3 The second processing flow diagram provided in the embodiment of the present application is as follows: Figure 3 Shown, including:
[0129] A user or system requests to unmap a storage volume from the host or host group to which it is currently mapped.
[0130] The system calculates the difference between the current timestamp (the current precise time) and the time when the volume was last accessed (the latest access time). The system compares the calculated time difference with the protection interval set by the user:
[0131] If the time difference is greater than the protection interval, it means that the volume has not been accessed within the set time, so it can be safely unmapped. The operation will be allowed and the command will be executed successfully. If the time difference is less than or equal to the protection interval, it means that the volume may still be in use. Unmapping may cause data access problems, so unmapping is not allowed and the operation will return failure.
[0132] Through this process, the storage system ensures that unmapping operations are performed only when the volume is inactive, thereby protecting the data security of the storage volume and system stability. At the same time, it also provides users with a mechanism to prevent potential problems caused by incorrect operations.
[0133] Figure 4 The third processing flow diagram provided in the embodiment of this application is as follows: Figure 4 Shown, including:
[0134] Performing a volume deletion operation may refer to a user or system sending a request to completely delete a storage volume from the storage system.
[0135] If volume deletion protection is enabled, the system calculates the difference between the current timestamp (that is, the current precise point in time) and the last access time of the volume.
[0136] The system compares the calculated time difference with the protection interval set by the user:
[0137] If the time difference is greater than the protection interval, it means that the safety threshold has been exceeded since the volume was last accessed, and the volume is therefore considered no longer active and can be safely deleted. At this point, the volume deletion operation will be allowed to proceed, and the command will be executed successfully.
[0138] If the time difference is less than or equal to the protection interval, this means the volume may still be in use or within the protection period. Deleting the volume may result in data loss or service interruption. Therefore, the deletion operation is not allowed and the system returns a failure prompt.
[0139] If volume deletion succeeds, the volume will be completely removed from the storage system and all data will be lost. If volume deletion fails, the user needs to take appropriate measures based on the failure prompt, which may require waiting longer or checking whether there are any active I / O operations in progress.
[0140] Through this process, the storage system provides a method for controlling volume deletion while ensuring data security. This mechanism helps prevent data loss due to accidental operations and allows for safe cleanup of storage space when a volume is no longer needed.
[0141] Figure 5 The fourth processing flow diagram provided in the embodiment of the present application is as follows: Figure 5 Shown, including:
[0142] The target storage volume group of the target storage volume removes the target storage volume operation specifically by a user initiating an operation request, the purpose of which is to remove a specific storage volume from the volume group.
[0143] If volume deletion protection is enabled, the system calculates the difference between the current timestamp (the exact time at the moment) and the time the volume was last accessed.
[0144] The system compares the calculated time difference with the protection interval set by the user:
[0145] If the time difference is greater than the protection interval, this indicates that the volume has not been accessed within the set protection interval, so the system will allow the volume group to remove the volume. If the operation is successful, the volume will be removed from the volume group.
[0146] If the time difference is less than or equal to the protection interval, this indicates that the volume may still be in use or within the protection period. Removing the volume may result in data loss or access interruption. Therefore, the system will not allow the removal operation and the operation will return a failure.
[0147] If the volume is successfully removed from the volume group, the user will receive a successful response. If the operation fails, the user will receive a failure notification and may need to take further action based on the prompt, such as waiting longer or checking the volume's usage status. This effectively ensures the security and accuracy of volume group management operations and prevents potential data risks caused by incorrect operations.
[0148] Optionally, when the target operation is a deletion operation of the host corresponding to the target storage volume, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes:
[0149] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0150] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0151] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, deleting the host corresponding to the target storage volume;
[0152] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the host corresponding to the target storage volume is not allowed.
[0153] Figure 6 The fifth processing flow diagram provided in the embodiment of the present application is as follows: Figure 6 As shown, in this embodiment of the present application, the target operation is to delete the host corresponding to the target storage volume. This usually means completely removing the configuration and association of the host from the storage system.
[0154] Before performing a deletion operation, the system checks whether the volume deletion protection mechanism is enabled to prevent data loss or service interruption. The system calculates the time difference between the current timestamp and the last access time of the target storage volume.
[0155] If the time difference is less than or equal to the preset protection interval, it indicates that the volume may still be in use, and the system will proceed to a further check to determine whether the host corresponding to the target storage volume is offline and whether the volume is still mapped to other hosts.
[0156] If the target storage volume is offline and mapped to another host, the system will traverse all other storage volumes mapped by the host and compare the time difference between these volumes and the protection interval.
[0157] After traversing all other storage volumes, if all volumes are offline and mapped to other hosts, this indicates that deleting the host will not affect access to other volumes. At this point, the system will allow deletion of the host corresponding to the target storage volume.
[0158] If the target storage volume is online or not mapped to another host, this indicates that deleting the host may affect volume access or data security. In this case, the system will not allow you to delete the host.
[0159] If deletion is allowed, the host will be removed from the storage system and all configurations and mappings associated with it will be cleared. If deletion is not allowed, the system will return a failure prompt and the user will need to take appropriate measures based on the prompt, which may include waiting longer or re-evaluating the necessity of the deletion operation.
[0160] In an embodiment of the present application, the storage system provides a method for controlling host deletion operations while ensuring data security and system stability. This mechanism helps prevent data loss or service interruption caused by misoperation, while allowing storage resources to be safely cleared when no longer needed by the host.
[0161] Optionally, when the target operation is an operation of the host group removing the host corresponding to the target storage volume, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes:
[0162] If the host corresponding to the target storage volume is not the last host in the host group, allowing the host corresponding to the target storage volume to be removed;
[0163] When the host corresponding to the target storage volume is the last host in the host group, comparing the time difference with a preset interval protection time;
[0164] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0165] If the target storage volume is offline and mapped to another host, continue traversing other storage volumes mapped to the host corresponding to the target storage volume, and compare the time difference between the other storage volumes and the preset interval protection time;
[0166] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, it is allowed to remove the host corresponding to the target storage volume from the host group;
[0167] When the target storage volume is online or the target storage volume is not mapped to other hosts, it is not allowed to remove the host corresponding to the target storage volume from the host group.
[0168] Figure 7 The sixth processing flow diagram provided in the embodiment of the present application is as follows: Figure 7 As shown, the removal operation of a host in a host group may refer to a user or system requesting to remove a host corresponding to a target storage volume from the host group.
[0169] If the host is not the last host in the host group, the system will allow the host to be removed directly. If the host is the last host in the host group, the system will enter a more stringent check process.
[0170] The system calculates the time difference between the current timestamp and the last access time of the target storage volume and compares it with the preset protection interval. If the time difference is less than or equal to the protection interval,
[0171] The system will further determine whether the host is offline and whether the target storage volume is mapped to another host.
[0172] If the target storage volume is offline and mapped to another host, the system will traverse all other storage volumes mapped to the host and compare the time difference of these volumes with the protection interval.
[0173] After traversing all other storage volumes, if all other storage volumes are offline and mapped to other hosts, the system will allow the host corresponding to the target storage volume to be removed from the host group.
[0174] If the target storage volume is still online or is not mapped to another host, the system will not allow you to remove the host from the host group.
[0175] If the removal is allowed, the host will be removed from the host group and its associated configuration and mappings will be adjusted as needed.
[0176] If removal is not allowed, the system will return a failure prompt and the user will need to take appropriate measures based on the prompt, which may include waiting longer or re-evaluating the necessity of the removal operation.
[0177] In the embodiment of the present application, it is ensured that in the host group management, the host removal operation is both safe and meets business needs, and data access interruption or data loss caused by misoperation or improper operation is prevented.
[0178] Optionally, when the target operation is an operation of unmapping a host group corresponding to the target storage volume group, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes:
[0179] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0180] When the time difference is greater than the preset interval protection time, comparing the time difference with the preset interval protection time;
[0181] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0182] If the time difference is greater than the preset interval protection time, traverse other storage volumes mapped by the host corresponding to the target storage volume, and compare the time difference of the other storage volumes with the preset interval protection time;
[0183] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if the time differences corresponding to all other storage volumes are greater than the preset interval protection time, the host group corresponding to the target storage volume group is unmapped.
[0184] Figure 8 The seventh processing flow diagram provided in the embodiment of the present application is as follows: Figure 8 As shown, the system calculates the time difference between the current timestamp and the last access time of the target storage volume.
[0185] If the time difference is less than or equal to the preset protection interval, the volume may still be in use, so unmapping is not allowed to prevent potential data access interruption or loss. If the time difference is greater than the preset protection interval, it means that the volume has not been accessed within the set protection period and can be safely considered for unmapping.
[0186] If the time difference allows unmapping, the system will further check all other storage volumes mapped to the host corresponding to the target storage volume:
[0187] Traverse these storage volumes and calculate the relationship between their time differences and protection time intervals respectively.
[0188] After traversing all other storage volumes, if the time difference of all storage volumes is greater than the preset protection interval, it means that all these volumes have not been accessed within the protection time, so the mapping relationship between the target storage volume group and the host group can be safely released.
[0189] If the unmap operation is allowed, the mapping relationship between the storage volume group and the host group will be officially removed. If the unmap operation is not allowed, the system will retain the existing mapping relationship and may notify the user why the operation failed. This effectively ensures the security and accuracy of unmapping the storage volume group and host group, preventing data loss or service interruption caused by incorrect operations, while allowing storage resources to be safely reconfigured after confirming that the volume is no longer active.
[0190] Optionally, upon receiving a target operation on a target storage volume in the storage system, obtaining the latest access time of each storage volume includes:
[0191] After the preset time is reached, the timer traverses each storage volume and obtains the working status of each storage volume;
[0192] The latest access time of each storage volume in a busy working state is updated according to the current time period and the preset time length.
[0193] Figure 9 The eighth processing flow diagram provided in the embodiment of the present application is as follows: Figure 9 As shown, it includes: the system sets a timer, and when the preset time period is met, the timer will be triggered and start the traversal check of each storage volume in the storage system.
[0194] When the timer is triggered, the system checks the working status of each storage volume to determine whether they are busy, that is, whether there are any I / O operations in progress.
[0195] If a storage volume is busy, the system updates the volume's latest access time based on the current time period. This operation records the time of the volume's last activity. If the volume is not busy, the access time may not be updated, as it is only updated when the volume is accessed.
[0196] In this way, the system can track the access patterns and frequency of each storage volume, which is very important for implementing some advanced functions, such as automated storage optimization and data lifecycle management.
[0197] The preset duration is a key parameter that determines how often the timer fires. Shorter durations provide finer-grained access time logging but may increase the computational burden on the system; longer durations reduce the computational burden but reduce the accuracy of access time.
[0198] This time management mechanism supports various operations that users can perform on storage volumes, such as volume unmapping and volume deletion, ensuring that the system can accurately determine the usage status and security of the volume before performing these operations.
[0199] In the embodiment of the present application, the storage system can efficiently manage the access time of the storage volume, providing guarantees for data security and system stability. At the same time, it also provides storage administrators with insights into the usage of storage resources.
[0200] The storage system volume anti-accidental deletion device provided by the present invention is described below. The storage system volume anti-accidental deletion device described below and the storage system volume anti-accidental deletion method described above can be referenced to each other.
[0201] Figure 10 The storage system volume anti-accidental deletion device provided in the embodiment of the present application is as follows Figure 10 Shown, including:
[0202] The acquisition module 1010 is configured to acquire the latest access time of each storage volume upon receiving a target operation on a target storage volume in the storage system from a user; wherein the target operation includes at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of a host corresponding to the target storage volume, and an operation of removing a host corresponding to the target storage volume from a host group;
[0203] The control module 1020 is configured to obtain a time difference between the latest access time of the target storage volume and a current timestamp, and control processing of the target operation based on a size relationship between the time difference and a preset interval protection time.
[0204] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is a deletion port operation of the host corresponding to the target storage volume, the device is further configured to:
[0205] If the port to be deleted is not the last port of the host corresponding to the target storage volume, the port is allowed to be deleted;
[0206] In a case where the deleted port is the last port of the host corresponding to the target storage volume, comparing the time difference with a preset interval protection time;
[0207] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0208] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0209] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, the port is allowed to be deleted;
[0210] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the port is not allowed.
[0211] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is an operation of unmapping the target storage volume, deleting the target storage volume, or removing the target storage volume from the target storage volume group, the device is further configured to:
[0212] If the time difference is less than or equal to the preset interval protection time, not performing the target operation;
[0213] In a case where the time difference is greater than the preset interval protection time, the target operation is allowed to be performed.
[0214] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is a deletion operation of the target storage volume corresponding to the host, the device is further configured to:
[0215] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0216] When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time;
[0217] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, deleting the host corresponding to the target storage volume;
[0218] When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the host corresponding to the target storage volume is not allowed.
[0219] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is an operation of a host group removing a host corresponding to the target storage volume, the device is further configured to:
[0220] If the host corresponding to the target storage volume is not the last host in the host group, allowing the host corresponding to the target storage volume to be removed;
[0221] When the host corresponding to the target storage volume is the last host in the host group, comparing the time difference with a preset interval protection time;
[0222] If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts;
[0223] If the target storage volume is offline and mapped to another host, continue traversing other storage volumes mapped to the host corresponding to the target storage volume, and compare the time difference between the other storage volumes and the preset interval protection time;
[0224] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, it is allowed to remove the host corresponding to the target storage volume from the host group;
[0225] When the target storage volume is online or the target storage volume is not mapped to other hosts, it is not allowed to remove the host corresponding to the target storage volume from the host group.
[0226] According to a storage system volume accidental deletion prevention device provided by the present invention, when the target operation is an operation of unmapping a host group corresponding to the target storage volume group, the device is further configured to:
[0227] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0228] When the time difference is greater than the preset interval protection time, comparing the time difference with the preset interval protection time;
[0229] If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped;
[0230] If the time difference is greater than the preset interval protection time, traverse other storage volumes mapped by the host corresponding to the target storage volume, and compare the time difference of the other storage volumes with the preset interval protection time;
[0231] After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if the time differences corresponding to all other storage volumes are greater than the preset interval protection time, the host group corresponding to the target storage volume group is unmapped.
[0232] According to a storage system volume accidental deletion prevention device provided by the present invention, the device is further used for:
[0233] After the preset time is reached, the timer traverses each storage volume and obtains the working status of each storage volume;
[0234] The latest access time of each storage volume in a busy working state is updated according to the current time period and the preset time length.
[0235] In this embodiment of the present application, if the time difference is greater than the protection interval, it indicates that the volume has not been accessed within the set time period, making the target operation more secure. If the time difference is less than or equal to the protection interval, it indicates that the volume may still be in use, and executing the target operation may affect data integrity or availability. The system will block the operation or request user confirmation. By comparing the access time and the protection interval, the system can effectively prevent users from accidentally deleting or unmapping a volume while it is still in use, thereby avoiding data loss or service interruption. Furthermore, by avoiding deletion or unmapping operations while the volume is active, system stability is enhanced, reducing system failures caused by improper operation.
[0236] Figure 11 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 11As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other via the communication bus 1140. The processor 1110 may call the logic instructions in the memory 1130 to execute a method for preventing accidental deletion of storage system volumes, the method comprising: upon receiving a target operation of a user on a target storage volume in the storage system, obtaining the latest access time of each storage volume; wherein the target operation comprises at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of a host corresponding to the target storage volume, and an operation of removing a host corresponding to the target storage volume from a host group;
[0237] A time difference between the latest access time of the target storage volume and a current timestamp is obtained, and based on a magnitude relationship between the time difference and a preset interval protection time, processing of the target operation is controlled.
[0238] Furthermore, the logic instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0239] On the other hand, the present invention further provides a computer program product, the computer program product including a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the storage system volume accidental deletion prevention method provided by the above methods, the method including: upon receiving a target operation of a user on a target storage volume in the storage system, obtaining the latest access time of each storage volume; wherein the target operation includes at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of a host corresponding to the target storage volume, and an operation of removing a host corresponding to the target storage volume from a host group;
[0240] A time difference between the latest access time of the target storage volume and a current timestamp is obtained, and based on a magnitude relationship between the time difference and a preset interval protection time, processing of the target operation is controlled.
[0241] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the storage system volume accidental deletion prevention method provided by the above methods, the method comprising: upon receiving a target operation on a target storage volume in the storage system by a user, obtaining the latest access time of each storage volume; wherein the target operation comprises at least one of the following: an operation of unmapping the target storage volume, an operation of deleting the target storage volume, an operation of removing the target storage volume from a target storage volume group containing the target storage volume, an operation of unmapping a host group corresponding to the target storage volume group, an operation of deleting a host corresponding to the target storage volume, an operation of deleting a port of a host corresponding to the target storage volume, and an operation of removing a host corresponding to the target storage volume from a host group;
[0242] A time difference between the latest access time of the target storage volume and a current timestamp is obtained, and based on a magnitude relationship between the time difference and a preset interval protection time, processing of the target operation is controlled.
[0243] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0244] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0245] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for preventing accidental deletion of storage system volumes, characterized in that: include: When receiving a target operation on a target storage volume in the storage system from a user, obtaining the latest access time of each storage volume; Obtaining a time difference between the latest access time of the target storage volume and a current timestamp, and controlling processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time; Wherein, when the target operation is a port deletion operation of the host corresponding to the target storage volume, controlling the processing of the target operation based on the relationship between the time difference and the preset interval protection time includes: If the port to be deleted is not the last port of the host corresponding to the target storage volume, the port is allowed to be deleted; In a case where the deleted port is the last port of the host corresponding to the target storage volume, comparing the time difference with a preset interval protection time; If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts; When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time; After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, the port is allowed to be deleted; When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the port is not allowed.
2. The storage system volume accidental deletion prevention method according to claim 1, characterized in that: When the target operation is an operation of unmapping the target storage volume, an operation of deleting the target storage volume, or an operation of removing the target storage volume from the target storage volume group, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes: If the time difference is less than or equal to the preset interval protection time, not performing the target operation; In a case where the time difference is greater than the preset interval protection time, the target operation is allowed to be performed.
3. The storage system volume accidental deletion prevention method according to claim 1, characterized in that: When the target operation is a deletion operation of the host corresponding to the target storage volume, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes: If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts; When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time; After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, deleting the host corresponding to the target storage volume; When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the host corresponding to the target storage volume is not allowed.
4. The storage system volume accidental deletion prevention method according to claim 1, characterized in that: When the target operation is an operation of the host group removing the host corresponding to the target storage volume, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes: If the host corresponding to the target storage volume is not the last host in the host group, allowing the host corresponding to the target storage volume to be removed; When the host corresponding to the target storage volume is the last host in the host group, comparing the time difference with a preset interval protection time; If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts; If the target storage volume is offline and mapped to another host, continue traversing other storage volumes mapped to the host corresponding to the target storage volume, and compare the time difference between the other storage volumes and the preset interval protection time; After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, it is allowed to remove the host corresponding to the target storage volume from the host group; When the target storage volume is online or the target storage volume is not mapped to other hosts, it is not allowed to remove the host corresponding to the target storage volume from the host group.
5. The storage system volume accidental deletion prevention method according to claim 1, characterized in that: When the target operation is an operation of unmapping a host group corresponding to a target storage volume group, controlling the processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time includes: If the time difference is less than or equal to the preset interval protection time, the host group corresponding to the target storage volume group is not allowed to be unmapped; If the time difference is greater than the preset interval protection time, traverse other storage volumes mapped by the host corresponding to the target storage volume, and compare the time difference of the other storage volumes with the preset interval protection time; After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if the time differences corresponding to all other storage volumes are greater than the preset interval protection time, the host group corresponding to the target storage volume group is unmapped.
6. The storage system volume accidental deletion prevention method according to claim 1, characterized in that: When a target operation is received from a user on a target storage volume in the storage system, the latest access time of each storage volume is obtained, including: After the preset time is reached, the timer traverses each storage volume and obtains the working status of each storage volume; The latest access time of each storage volume in a busy working state is updated according to the current time period and the preset time length.
7. A storage system volume accidental deletion prevention device, characterized in that: include: An acquisition module, configured to acquire the latest access time of each storage volume upon receiving a target operation of a user on a target storage volume in the storage system; a control module configured to obtain a time difference between the latest access time of the target storage volume and a current timestamp, and control processing of the target operation based on a magnitude relationship between the time difference and a preset interval protection time; Wherein, when the target operation is a port deletion operation of the host corresponding to the target storage volume, the device is further configured to: If the port to be deleted is not the last port of the host corresponding to the target storage volume, the port is allowed to be deleted; In a case where the deleted port is the last port of the host corresponding to the target storage volume, comparing the time difference with a preset interval protection time; If the time difference is less than or equal to the preset interval protection time, determining whether the host corresponding to the target storage volume is offline and whether the target storage volume is mapped to other hosts; When the target storage volume is offline and mapped to another host, traverse other storage volumes mapped to the host corresponding to the target storage volume and compare the time difference between the other storage volumes and the preset interval protection time; After traversing all other storage volumes mapped to the host corresponding to the target storage volume, if all other storage volumes are offline and the other storage volumes are mapped to other hosts, the port is allowed to be deleted; When the target storage volume is online or the target storage volume is not mapped to other hosts, deletion of the port is not allowed.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the storage system volume anti-accidental deletion method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for preventing accidental deletion of a storage system volume as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Logical volume deleting method and device
CN109491598A
Distributed cluster logical volume data management method, system, equipment and medium
CN114443224A