An automated test method, system, device, and storage medium for scheduled snapshots
By automating snapshot testing through OSES, the problems of low efficiency, low reliability, and low security in existing technologies are solved. It realizes automated testing of timed snapshots, improves testing efficiency and quality, and protects the security of stored data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2022-08-29
- Publication Date
- 2026-07-17
AI Technical Summary
Existing snapshot testing methods are inefficient, unreliable, insecure, and difficult to use. Furthermore, there are security risks when conducting timed snapshot tests using external intelligent management software.
OSES enables automatic identification of snapshot tasks, scheduled creation, storage pool space monitoring, and automated reporting of test results. By utilizing the internal OSES functionality of the storage system, the entire testing process can be automated.
It improves testing efficiency and quality, reduces manpower input, saves costs, and protects the security of stored data.
Smart Images

Figure CN115373902B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of snapshot testing technology, and specifically relates to a method, system, device and storage medium for automatic timed snapshot testing. Background Technology
[0002] OSES, short for Organic SAS Enclosure Service, is a powerful module for managing storage devices. It provides real-time monitoring of device status and facilitates interaction and management between storage system modules. SAS, short for Serial Attached SCSI, stands for Reliability, Availability, and Serviceability. Storage machines are often used to store critical customer data; therefore, storage design must prioritize reliability and stability. Snapshots are a technology developed for this purpose. Similar to capturing a snapshot of nature at a specific point in time, file system snapshots preserve the content of a dataset at a particular point in time to prevent data loss due to system crashes, viruses, file corruption, etc. Users can restore the data to the state it was in when the snapshot was created through snapshot rollback. To facilitate timely backup of file system data, it is typically necessary to create scheduled snapshot tasks. These tasks automatically create snapshots at set intervals using user-defined timing policies, preventing significant data discrepancies before and after snapshot rollbacks due to prolonged periods without snapshot operations. OSES, as the overall chassis management module for storage devices, boasts powerful capabilities, enabling real-time monitoring of device operating status and facilitating interaction and management between various storage system modules.
[0003] Typically, snapshot testing requires testers to manually create snapshots via command line. To implement the scheduled snapshot function, external intelligent management software is necessary to issue snapshot tasks to the storage machine through a REST interface. The existing method of manually creating snapshots via command line is time-consuming and labor-intensive, and because it involves manual testing, the number of snapshots created is limited, resulting in low test reliability. Scheduled snapshots using external intelligent management software require the storage to have an open REST interface, which poses a significant security risk. Furthermore, the need to install additional intelligent management software can be cumbersome for customers, hindering customer acquisition. Therefore, existing snapshot testing methods suffer from multiple problems, including low efficiency, low reliability, low security, and low usability. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention proposes a method, system, device, and storage medium for automated timed snapshot testing. Timed snapshot testing can be achieved through OSES, and the entire testing process can be automated, which will greatly improve testing efficiency and quality.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] An automated testing method for scheduled snapshots includes the following steps:
[0007] After the scheduled snapshot task is started by recognizing it through OSES, OSES monitors whether the storage pool space is sufficient for the creation of the next snapshot. When the space is sufficient for the creation of the next snapshot, the snapshot is created.
[0008] OSES periodically queries whether the current round of snapshot tasks has been completed. When the snapshots are completed, OSES is used to collect all snapshot information.
[0009] The snapshot information is reported in the form of an event log.
[0010] Furthermore, the step of identifying the start of the scheduled snapshot task via OSES also includes powering on and starting the storage server.
[0011] Furthermore, the method for identifying the start of the scheduled snapshot task through OSES includes: OSES automatically obtaining the on / off status of the scheduled snapshot by accessing the RestAPI interface provided by the scheduled snapshot.
[0012] Furthermore, the process of monitoring whether the storage pool space is sufficient for the creation of the next snapshot via OSES, and completing the creation when the space is sufficient for the creation of the current snapshot, includes: OSES actively queries the storage pool through the storage CLI command to obtain the total space and used space, and then determines whether the remaining space is sufficient for the creation of the next snapshot; if the space is sufficient, the creation is automatically started; if the space is insufficient, the current snapshot task is completed.
[0013] Furthermore, the method for OSES to monitor whether the storage pool space is sufficient for the creation of the next snapshot can also obtain the storage pool space by accessing the RESTAPI interface provided by OSES for timed snapshots.
[0014] Furthermore, the process of periodically querying whether the current round of snapshot tasks has been created through OSES includes: OSES actively queries through stored CLI commands to obtain whether the mapping relationship between volumes in the current round of snapshots has been deleted. If it has been deleted, it proves that the creation has been completed; if it has not been deleted, it proves that the creation has not been completed.
[0015] Furthermore, the process of collecting all snapshot information through OSES includes: OSES acquiring the created snapshot information to form a data table; the snapshot information includes snapshot start time, completion time, snapshot volume name and size, snapshot volume health status, whether there is host mapping, and whether it can be rolled back.
[0016] This invention also proposes an automatic testing system for timed snapshots, including a creation module, a query module, and a reporting module;
[0017] The creation module is used to monitor whether the storage pool space is sufficient for the creation of the next snapshot after the scheduled snapshot task is identified and started through OSES, and to complete the creation when the space is sufficient for the creation of the next snapshot.
[0018] The query module is used to periodically query whether the current round of snapshot tasks has been created through OSES. When creation is complete, all snapshot information is collected through OSES.
[0019] The reporting module is used to report the snapshot information in the form of an event log.
[0020] The present invention also proposes an apparatus comprising:
[0021] Memory, used to store computer programs;
[0022] A processor for implementing the steps of the method when executing the computer program.
[0023] The present invention also proposes a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described.
[0024] The effects described in the invention are merely those of the embodiments, and not all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects:
[0025] This invention proposes an automated testing method, system, device, and storage medium for timed snapshots. The method includes the following steps: after identifying the start of a timed snapshot task via OSES, monitoring the storage pool space using OSES to ensure it is sufficient for the next snapshot creation; completing the creation when space is sufficient; periodically querying the current snapshot task via OSES to check if creation is complete; and statistically analyzing all snapshot information upon completion; and reporting the snapshot information as an event log. Based on this automated testing method for timed snapshots, an automated testing system, device, and storage medium for timed snapshots are also proposed. This invention achieves automated testing of timed snapshots through OSES's functions of identifying and stopping snapshot tasks, timed snapshot creation, monitoring storage pool space, monitoring the completion of timed snapshot creation, statistical analysis, and log reporting. Timed snapshot testing can be achieved through OSES, and the entire testing process can be automated, greatly improving testing efficiency and quality. Furthermore, since the OSES functionality is used within the storage, data security is significantly protected. This greatly improves testing efficiency, ensures testing quality, saves testing time, reduces manpower, improves product quality, and saves costs. Attached Figure Description
[0026] like Figure 1 This is a flowchart of an automatic timed snapshot testing method according to Embodiment 1 of the present invention;
[0027] like Figure 2 This is a schematic diagram of an automatic timed snapshot testing system according to Embodiment 2 of the present invention. Detailed Implementation
[0028] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.
[0029] Example 1
[0030] Embodiment 1 of this invention proposes an automated timed snapshot testing method. Addressing the issues of low efficiency, low reliability, low security, and low usability in current snapshot testing methods, this method utilizes the OSES module of the storage system to achieve timed snapshot creation, pool space monitoring and reporting, and outputs test results using the analytical and statistical capabilities of OSES. The entire process is fully automated, significantly improving testing efficiency, ensuring test quality, saving testing time, reducing manpower, improving product quality, and saving costs for the company. Furthermore, since the internal OSES of the storage system is used, data security is greatly protected.
[0031] In this application, OSES mainly plays the following roles:
[0032] OSES is used to identify whether the scheduled snapshot task is enabled. If it is not enabled, the task will be enabled automatically.
[0033] OSES is used to create snapshots on a regular schedule, so as to periodically save snapshot data.
[0034] By monitoring the storage pool space through OSES, if it is detected that there is insufficient space to create the next snapshot, the scheduled snapshot task is stopped and the test results are reported.
[0035] OSES is used to monitor whether timed snapshots have been created.
[0036] OSES is used to collect and analyze all snapshots, including their number, size, and creation time, and the snapshot information is reported as an event log. After testing, all event logs can be packaged into a zip file and downloaded.
[0037] like Figure 1 This is a flowchart of an automatic timed snapshot testing method according to Embodiment 1 of the present invention;
[0038] In step S100, the process begins.
[0039] In step S101, the storage server powers on and starts the timed snapshot test.
[0040] In step S102, OSES identifies whether the scheduled snapshot task is enabled. If it is not enabled, proceed to step S103; if it is enabled, proceed to the next step S104.
[0041] OSES is a powerful management system for storage devices, offering both hardware monitoring capabilities and the ability to establish connections with the OS or BIOS. In this invention, OSES can proactively and automatically acquire the on / off status of timed snapshots through the RESTAPI interface provided by timed snapshots, and can also control the switching on and off of timed snapshots.
[0042] In step S103, OSES automatically starts the scheduled snapshot task.
[0043] In step S104, OSES monitors whether the storage pool space is sufficient for the creation of the next snapshot. If the space is sufficient, step S106 is executed; otherwise, step S105 is executed.
[0044] There are two ways to obtain the storage pool space for SES monitoring: 1. Actively query the storage pool using the storage CLI command to obtain the total space and used space, and then determine whether the remaining space is sufficient for the creation of the next snapshot; 2. The storage pool space can also be obtained through the REST API interface provided by the storage. This application selects the first method in the automatic testing method for scheduled snapshots.
[0045] In step S105, after OSES stops the snapshot task, step S111 is then executed.
[0046] In step S106, OSES periodically creates the current round of timed snapshots.
[0047] OSES can proactively query via storage CLI commands to determine whether the mapping relationships between volumes in this snapshot have been deleted. If deleted, it proves that the creation is complete; if not deleted, it proves that the creation is incomplete.
[0048] In step S107, OSES queries whether the current round of timed snapshots has been created. If not, step S108 is executed, and then in step S109...
[0049] OSES can proactively query via storage CLI commands to determine whether the mapping relationships between volumes in this snapshot have been deleted. If deleted, it proves that the creation is complete; if not deleted, it proves that the creation is incomplete.
[0050] In step S108, wait for a preset time, and then return to step S107.
[0051] In step S109, OSES performs statistical analysis on all existing snapshots.
[0052] OSES can still actively and automatically obtain information about all created snapshots through CLI commands or the RestAPI interface. Methods for analyzing existing snapshot information: OSES has data filtering and analysis functions. After obtaining information about created snapshots (such as snapshot start time, completion time, snapshot volume name and size, snapshot volume health status, whether there is host mapping, whether it can be rolled back, etc.), a data table can be generated and reported to the user as an event log.
[0053] In step S110, OSES reports all snapshot information in the form of an event log, and then returns to step S104.
[0054] In step S111, OSES packages all event logs into a zip file for user download. Each snapshot volume information forms a data table, serving as one event log entry. OSES places all event logs in a single file, which is then packaged after testing.
[0055] In step S112, the process ends.
[0056] The present invention, in Embodiment 1, proposes an automated testing method for timed snapshots. This method utilizes OSES's functions for identifying and stopping snapshot tasks, creating snapshots on a timed basis, monitoring storage pool space, monitoring the completion of timed snapshot creation, statistical analysis, and log reporting. Compared to traditional snapshot testing methods, Embodiment 1 achieves automated timed snapshot testing through OSES, significantly improving testing efficiency and quality. Furthermore, by employing the internal OSES functionality of the storage system, it greatly enhances the protection of stored data security.
[0057] Example 2
[0058] Based on the automatic timed snapshot testing method proposed in Embodiment 1 of this invention, Embodiment 2 of this invention also proposes an automatic timed snapshot testing system, such as... Figure 2 This is a schematic diagram of an automatic timed snapshot testing system according to Embodiment 2 of the present invention. The system includes a creation module, a query module, and a reporting module.
[0059] The creation module is used to monitor whether the storage pool space is sufficient for the creation of the next snapshot after the scheduled snapshot task is started through OSES. When the space is sufficient for the creation of the next snapshot, the creation is completed.
[0060] The query module is used to periodically query whether the current round of snapshot tasks has been created through OSES. When creation is complete, it uses OSES to collect all snapshot information.
[0061] The reporting module is used to report the snapshot information in the form of an event log.
[0062] OSES is a powerful management system for storage devices, offering both hardware monitoring capabilities and the ability to establish communication with the OS or BIOS. In the creation module, OSES can actively and automatically obtain the on / off status of scheduled snapshots through the REST API interface provided by the snapshot service. It can also control the on / off state of scheduled snapshots. OSES automatically starts scheduled snapshot tasks. OSES monitors and obtains the storage pool space in two ways: 1. Actively querying the storage pool using CLI commands to obtain the total and used space, and then determining whether the remaining space is sufficient for the next snapshot creation; 2. Obtaining the storage pool space through the REST API interface provided by the storage service. This application selects the first method in an automatic scheduled snapshot testing method.
[0063] In the query module: OSES can actively query via the storage CLI command to obtain whether the mapping relationship between volumes in this snapshot has been deleted. If it has been deleted, it proves that the creation is complete; if it has not been deleted, it proves that the creation is incomplete.
[0064] OSES can still actively and automatically obtain information about all created snapshots through CLI commands or the RestAPI interface. Methods for analyzing existing snapshot information: OSES has data filtering and analysis functions. After obtaining information about created snapshots (such as snapshot start time, completion time, snapshot volume name and size, snapshot volume health status, whether there is host mapping, whether it can be rolled back, etc.), a data table can be generated and reported to the user as an event log.
[0065] The reporting module reports the data table to the user as an event log.
[0066] Embodiment 2 of this invention proposes an automated timed snapshot testing system. This system utilizes OSES's functions for identifying and stopping snapshot tasks, creating snapshots on a timed basis, monitoring storage pool space, monitoring the completion of timed snapshot creation, statistical analysis, and log reporting to achieve automated testing of timed snapshots. Compared to traditional snapshot testing methods, Embodiment 2 of this invention enables timed snapshot testing through OSES and achieves full automation of the testing process, significantly improving testing efficiency and quality. Furthermore, since it employs the functions of the storage's internal OSES, it greatly protects the data security of the storage.
[0067] Example 3
[0068] The present invention also proposes an apparatus comprising:
[0069] Memory, used to store computer programs;
[0070] When a processor executes the computer program, the method steps are as follows:
[0071] In this application, OSES mainly plays the following roles:
[0072] OSES is used to identify whether the scheduled snapshot task is enabled. If it is not enabled, the task will be enabled automatically.
[0073] OSES is used to create snapshots on a regular schedule, so as to periodically save snapshot data.
[0074] By monitoring the storage pool space through OSES, if it is detected that there is insufficient space to create the next snapshot, the scheduled snapshot task is stopped and the test results are reported.
[0075] OSES is used to monitor whether timed snapshots have been created.
[0076] OSES is used to collect and analyze all snapshots, including their number, size, and creation time, and the snapshot information is reported as an event log. After testing, all event logs can be packaged into a zip file and downloaded.
[0077] like Figure 1 This is a flowchart of an automatic timed snapshot testing method according to Embodiment 1 of the present invention;
[0078] In step S100, the process begins.
[0079] In step S101, the storage server powers on and starts the timed snapshot test.
[0080] In step S102, OSES identifies whether the scheduled snapshot task is enabled. If it is not enabled, proceed to step S103; if it is enabled, proceed to step S104.
[0081] OSES is a powerful management system for storage devices, offering both hardware monitoring capabilities and the ability to establish connections with the OS or BIOS. In this invention, OSES can proactively and automatically acquire the on / off status of timed snapshots through the RESTAPI interface provided by timed snapshots, and can also control the switching on and off of timed snapshots.
[0082] In step S103, OSES automatically starts the scheduled snapshot task.
[0083] In step S104, OSES monitors whether the storage pool space is sufficient for the creation of the next snapshot. If the space is sufficient, step S106 is executed; otherwise, step S105 is executed.
[0084] There are two ways to obtain the storage pool space for SES monitoring: 1. Actively query the storage pool using the storage CLI command to obtain the total space and used space, and then determine whether the remaining space is sufficient for the creation of the next snapshot; 2. The storage pool space can also be obtained through the REST API interface provided by the storage. This application selects the first method in the automatic testing method for scheduled snapshots.
[0085] In step S105, after OSES stops the snapshot task, step S111 is then executed.
[0086] In step S106, OSES periodically creates the current round of timed snapshots.
[0087] OSES can proactively query via storage CLI commands to determine whether the mapping relationships between volumes in this snapshot have been deleted. If deleted, it proves that the creation is complete; if not deleted, it proves that the creation is incomplete.
[0088] In step S107, OSES queries whether the current round of timed snapshots has been created. If not, step S108 is executed, and then in step S109...
[0089] OSES can proactively query via storage CLI commands to determine whether the mapping relationships between volumes in this snapshot have been deleted. If deleted, it proves that the creation is complete; if not deleted, it proves that the creation is incomplete.
[0090] In step S108, wait for a preset time, and then return to step S107.
[0091] In step S109, OSES performs statistics and analysis on all existing snapshots. OSES can also actively and automatically obtain information on all created snapshots through CLI commands or the RestAPI interface. The method for analyzing existing snapshot information is as follows: OSES has data filtering and analysis functions. After obtaining information on created snapshots (such as snapshot start time, completion time, snapshot volume name and size, snapshot volume health status, whether there is host mapping, whether it can be rolled back, etc.), it can form a data table and report the data table to the user in the form of an event log.
[0092] In step S110, OSES reports all snapshot information in the form of an event log, and then returns to step S104.
[0093] In step S111, OSES packages all event logs into a zip file for user download. Each snapshot volume information forms a data table, serving as one event log entry. OSES places all event logs in a single file, which is then packaged after testing.
[0094] In step S112, the process ends.
[0095] The device proposed in Embodiment 3 of this invention achieves automated testing of timed snapshots through the OSES's functions of identifying and stopping snapshot tasks, creating snapshots on a timed basis, monitoring storage pool space, monitoring whether timed snapshot creation is complete, and statistically analyzing and reporting logs. Compared to traditional snapshot testing methods, Embodiment 3 of this invention can achieve timed snapshot testing through OSES and automate the entire testing process, greatly improving testing efficiency and quality. In addition, since it uses the functions of the storage's internal OSES, it can greatly protect the data security of the storage.
[0096] It should be noted that the present invention also provides an electronic device, including: a communication interface capable of interacting with other devices such as network devices; and a processor connected to the communication interface to enable information interaction with other devices, used to execute a timed snapshot automatic testing method provided by one or more of the above technical solutions when running a computer program, wherein the computer program is stored in a memory. In practical applications, the various components of the electronic device are coupled together through a bus system. It is understood that the bus system is used to realize the connection and communication between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus. The memory in the embodiments of this application is used to store various types of data to support the operation of the electronic device. Examples of this data include any computer program used to operate on the electronic device. It is understood that the memory can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache.By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memory. The methods disclosed in the embodiments of this application can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by integrated logic circuits in the processor hardware or by instructions in software. The processor can be a general-purpose processor, a DSP (Digital Signal Processing, i.e., a chip capable of implementing digital signal processing technology), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, which is located in memory. The processor reads the program from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method. When the processor executes the program, it implements the corresponding processes in the various methods of the embodiments of this application; for simplicity, these will not be elaborated further here.
[0097] Example 4
[0098] The present invention also proposes a readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the following method steps:
[0099] In this application, OSES mainly plays the following roles:
[0100] OSES is used to identify whether the scheduled snapshot task is enabled. If it is not enabled, the task will be enabled automatically.
[0101] OSES is used to create snapshots on a regular schedule, so as to periodically save snapshot data.
[0102] By monitoring the storage pool space through OSES, if it is detected that there is insufficient space to create the next snapshot, the scheduled snapshot task is stopped and the test results are reported.
[0103] OSES is used to monitor whether timed snapshots have been created.
[0104] OSES is used to collect and analyze all snapshots, including their number, size, and creation time, and the snapshot information is reported as an event log. After testing, all event logs can be packaged into a zip file and downloaded.
[0105] like Figure 1 This is a flowchart of an automatic timed snapshot testing method according to Embodiment 1 of the present invention;
[0106] In step S100, the process begins.
[0107] In step S101, the storage server powers on and starts the timed snapshot test.
[0108] In step S102, OSES identifies whether the scheduled snapshot task is enabled. If it is not enabled, proceed to step S103; if it is enabled, proceed to step S104.
[0109] OSES is a powerful management system for storage devices, offering both hardware monitoring capabilities and the ability to establish connections with the OS or BIOS. In this invention, OSES can proactively and automatically acquire the on / off status of timed snapshots through the RESTAPI interface provided by timed snapshots, and can also control the switching on and off of timed snapshots.
[0110] In step S103, OSES automatically starts the scheduled snapshot task.
[0111] In step S104, OSES monitors whether the storage pool space is sufficient for the creation of the next snapshot. If the space is sufficient, step S106 is executed; otherwise, step S105 is executed.
[0112] There are two ways to obtain the storage pool space for SES monitoring: 1. Actively query the storage pool using the storage CLI command to obtain the total space and used space, and then determine whether the remaining space is sufficient for the creation of the next snapshot; 2. The storage pool space can also be obtained through the REST API interface provided by the storage. This application selects the first method in the automatic testing method for scheduled snapshots.
[0113] In step S105, after OSES stops the snapshot task, step S111 is then executed.
[0114] In step S106, OSES periodically creates the current round of timed snapshots.
[0115] OSES can proactively query via storage CLI commands to determine whether the mapping relationships between volumes in this snapshot have been deleted. If deleted, it proves that the creation is complete; if not deleted, it proves that the creation is incomplete.
[0116] In step S107, OSES queries whether the current round of timed snapshots has been created. If not, it proceeds to step S108, and then to step S109.
[0117] OSES can proactively query via storage CLI commands to determine whether the mapping relationships between volumes in this snapshot have been deleted. If deleted, it proves that the creation is complete; if not deleted, it proves that the creation is incomplete.
[0118] In step S108, wait for a preset time, and then return to step S107.
[0119] In step S109, OSES performs statistical analysis on all existing snapshots.
[0120] OSES can still actively and automatically obtain information about all created snapshots through CLI commands or the RestAPI interface. Methods for analyzing existing snapshot information: OSES has data filtering and analysis functions. After obtaining information about created snapshots (such as snapshot start time, completion time, snapshot volume name and size, snapshot volume health status, whether there is host mapping, whether it can be rolled back, etc.), a data table can be generated and reported to the user as an event log.
[0121] In step S110, OSES reports all snapshot information in the form of an event log, and then returns to step S104.
[0122] In step S111, OSES packages all event logs into a zip file for user download. Each snapshot volume information forms a data table, serving as one event log entry. OSES places all event logs in a single file, which is then packaged after testing.
[0123] In step S112, the process ends.
[0124] The storage medium proposed in Embodiment 4 of this invention achieves automated testing of timed snapshots through the OSES functions of identifying and stopping snapshot tasks, creating snapshots on a schedule, monitoring storage pool space, monitoring the completion of timed snapshot creation, and statistically analyzing and reporting logs. Compared to traditional snapshot testing methods, Embodiment 4 of this invention can achieve timed snapshot testing through OSES and automate the entire testing process, greatly improving testing efficiency and quality. In addition, since it uses the functions of the storage's internal OSES, it can greatly protect the data security of the storage.
[0125] This application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory that stores a computer program, which can be executed by a processor to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0126] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks. Alternatively, if the integrated units of this application are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0127] For a description of the relevant parts of the processing device and storage medium for automatic timed snapshot testing provided in this application embodiment, please refer to the detailed description of the corresponding parts in the automatic timed snapshot testing method provided in embodiment 1 of this application, and will not be repeated here.
[0128] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.
[0129] While specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art can make other modifications or variations based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for automatically testing timed snapshots, characterized in that, Includes the following steps: After the scheduled snapshot task is started by recognizing it through OSES, OSES monitors whether the storage pool space is sufficient for the creation of the next snapshot. When the space is sufficient for the creation of the next snapshot, the snapshot is created. The method for identifying the start of a scheduled snapshot task through OSES includes: OSES automatically obtaining the on / off status of the scheduled snapshot by accessing the RestAPI interface provided by the scheduled snapshot; OSES periodically queries whether the current snapshot task has been created. When creation is complete, OSES collects all snapshot information. The process of monitoring whether the storage pool space is sufficient for the creation of the next snapshot and completing the creation when the space is sufficient includes: OSES actively queries the storage pool through the CLI command to obtain the total space and used space, and then determines whether the remaining space is sufficient for the creation of the next snapshot; if the space is sufficient, creation is automatically started; if the space is insufficient, the current snapshot task is completed. The process of periodically querying OSES to see if the current round of snapshot tasks has been completed includes: OSES actively queries through stored CLI commands to obtain whether the mapping relationship between volumes in the current round of snapshots has been deleted. If it has been deleted, it proves that the creation is complete; if it has not been deleted, it proves that the creation is incomplete. The snapshot information is reported in the form of an event log.
2. The automatic testing method for timed snapshots according to claim 1, characterized in that, The process of identifying and initiating scheduled snapshot tasks via OSES also includes powering on and starting the storage server.
3. The automatic testing method for timed snapshots according to claim 1, characterized in that, The process of periodically querying OSES to see if the current round of snapshot tasks has been completed includes: OSES actively queries through stored CLI commands to obtain whether the mapping relationship between volumes in the current round of snapshots has been deleted. If it has been deleted, it proves that the creation is complete; if it has not been deleted, it proves that the creation is incomplete.
4. The automatic timed snapshot testing method according to claim 1, characterized in that, The process of collecting all snapshot information through OSES includes: OSES acquiring the created snapshot information to form a data table; the snapshot information includes snapshot start time, completion time, snapshot volume name and size, snapshot volume health status, whether there is host mapping, and whether it can be rolled back.
5. A timed snapshot automatic testing system, used to execute the timed snapshot automatic testing method according to any one of claims 1 to 4, characterized in that, This includes a creation module, a query module, and a reporting module; The creation module is used to monitor whether the storage pool space is sufficient for the creation of the next snapshot after the scheduled snapshot task is identified and started through OSES, and to complete the creation when the space is sufficient for the creation of the next snapshot. The query module is used to periodically query whether the current round of snapshot tasks has been created through OSES. When creation is completed, all snapshot information is collected through OSES. The reporting module is used to report the snapshot information in the form of an event log.
6. A device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 4.