CN111221691B - Test method for automatic snapshot data recovery of disk - Google Patents

Test method for automatic snapshot data recovery of disk Download PDF

Info

Publication number
CN111221691B
CN111221691B CN201911379833.2A CN201911379833A CN111221691B CN 111221691 B CN111221691 B CN 111221691B CN 201911379833 A CN201911379833 A CN 201911379833A CN 111221691 B CN111221691 B CN 111221691B
Authority
CN
China
Prior art keywords
disk
folder
copy
new folder
automatic snapshot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911379833.2A
Other languages
Chinese (zh)
Other versions
CN111221691A (en
Inventor
梁徽
杨燕清
曾伟文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Eflycloud Computing Co Ltd
Original Assignee
Guangdong Eflycloud Computing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Eflycloud Computing Co Ltd filed Critical Guangdong Eflycloud Computing Co Ltd
Priority to CN201911379833.2A priority Critical patent/CN111221691B/en
Publication of CN111221691A publication Critical patent/CN111221691A/en
Application granted granted Critical
Publication of CN111221691B publication Critical patent/CN111221691B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a test method for automatic snapshot data recovery of a disk, which comprises the following steps: generating a specified folder in a disc to be tested, and randomly generating files in the specified folder; creating a new folder on the cloud host, and transferring the designated folder and the files thereof into the new folder; the new folder is packaged and uploaded to a server, and is named as a copy 1; the cloud platform generates an automatic snapshot, generates another designated folder and randomly generates a file in the designated folder; performing recovery operation on the automatic snapshot, and recovering the automatic snapshot to a disk to be detected; creating another new folder, and transferring the designated folder and the files thereof into the new folder; the new folder is packaged and uploaded to a server, and is named as a copy 2; and if the contents of the copy 1 and the copy 2 are consistent, judging that the automatic snapshot of the disk is restored to be successful. The application can test the data recovery function of the automatic snapshot of the disk at any time point in an automatic mode, and solves the problem that the disk is difficult to test manually.

Description

Test method for automatic snapshot data recovery of disk
Technical Field
The application relates to the technical field of cloud host snapshot of cloud computing, in particular to a test method for automatic snapshot data recovery of a disk.
Background
The cloud computing concept is popular, and more companies develop a cloud computing management platform to uniformly manage contents such as a cloud host, a disk, a snapshot, an IP and the like. The snapshot is a data state file stored by a cloud disk or a shared block at a certain time point, and the automatic snapshot can periodically create the snapshot at a preset time point, so that a more flexible strategy is provided for disk backup.
The test of the data recovery function of the automatic snapshot of the disk is generally performed manually, and files are manually created and compared with the login host computer one by one. The settable time points of the automatic snapshot are generally covered for 24 hours, and the test can only select a few time points for testing, so that the full coverage cannot be realized.
In addition, the current test of the data recovery function of the automatic snapshot of the disk is also manually compared, which is tedious and time-consuming, and the automatic snapshot generation and data recovery functions can be ensured to be correctly executed at any time point, so that the automatic snapshot generation and data recovery functions are difficult to realize manually. What is needed is a way to fully compare the content before and after snapshot restoration in an automated manner.
Disclosure of Invention
The application aims to solve the technical problem of providing a test method for automatic snapshot data recovery of a disk, which can test the data recovery function of automatic snapshot of the disk at any time point in an automatic mode, solves the problem that the disk is difficult to test manually, and greatly reduces the time of manual operation and comparison and improves the test efficiency by automatically comparing the file information in folders before and after data recovery with the file information in the folders.
In order to solve the technical problems, the application provides the following technical scheme: a test method for automatic snapshot data recovery of a disk comprises the following steps:
s1, uploading a test script to a disk to be tested, executing the test script, generating a specified folder on the disk to be tested, and randomly generating a file in the specified folder;
s2, creating a new folder on the cloud host, and transferring the designated folder and the files thereof in the step S2 into the new folder; packing and uploading the new folder to a server, naming the new folder as a copy 1, and deleting the new folder of the cloud host;
s3, the cloud platform for managing the cloud host carries out automatic snapshot generation, and after a period of time, the step S1 is executed again to generate another designated folder and randomly generate files in the designated folder;
s4, recovering the automatic snapshot generated by the cloud platform in the step S3, and recovering the automatic snapshot to the disk to be detected;
s5, creating another new folder on the cloud host, and transferring the designated folder and the files thereof in the step S3 into the new folder; packing and uploading the new folder to a server, naming the new folder as a copy 2, and deleting the new folder of the cloud host;
s6, comparing the copy 1 with the copy 2 on the server, and judging that the automatic snapshot of the disk to be tested is recovered successfully if the contents of the copy 1 and the copy 2 are consistent; if the contents of the copy 1 and the copy 2 are inconsistent, judging that the automatic snapshot of the disk to be tested is recovered to failure.
Preferably, the step S1 is preceded by a step S0 of selecting a cloud host to mount the disk to be tested, and configuring time for generating automatic snapshot of the disk to be tested; writing test scripts of the disk to be tested.
Preferably, in step S2, the new folder is packaged and uploaded to the server and named as a copy 1, where the new folder needs to be marked with cloud host information and to-be-detected disk information, the cloud host information includes an ID number or a name, and the to-be-detected disk information includes the ID number or the name.
Preferably, the specific time period of the step S3 is set to 5 minutes after the interval time.
Preferably, the step S6 further includes a step S7, and if the automatic snapshot is restored to be successful, the steps S1-S6 are circularly executed; under the condition that the automatic snapshot is recovered to be failed, the server records abnormal information and feeds the information back to the testers as the basis for the follow-up troubleshooting. After the technical scheme is adopted, the application has at least the following beneficial effects: according to the application, the folder, namely the random file, is automatically generated, and is automatically compared by the server, so that the automatic snapshot data recovery function result of the disk to be tested can be obtained through testing, time and labor are saved, all-weather operation can be realized, and corresponding time points can be set according to actual conditions.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for testing automatic snapshot data recovery of a disk according to the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other, and the present application will be further described in detail with reference to the drawings and the specific embodiments.
The application provides a test method for automatic snapshot data recovery of a disk, which is mainly characterized in that automatic snapshots of the disk to be tested are configured, before the disk generates the automatic snapshots, folders and file contents are randomly created in designated folders of the disk, and then directory information and file contents of the folders are recorded and uploaded to a server. After the cloud platform automatically generates the snapshot, the catalog and the file content in the appointed folder are randomly changed again, then the current generated automatic snapshot is called in a mode of the public API of the cloud platform to execute data recovery operation, after the disk recovery is successful, the catalog information and the file content of the appointed folder are recorded again and are sent to the server, the folder information sent twice is compared, the information is consistent, the data recovery is judged to be successful, snapshot test at the next time point can be continued, otherwise, the data recovery is judged to be failed, and error information is recorded and is used as subsequent obstacle removing.
Example 1
As shown in fig. 1, the present embodiment provides a method for testing automatic snapshot data recovery of a disk, which includes the following steps:
s11, selecting a cloud host to mount a disk to be tested on a cloud computing management platform (namely a cloud platform), and configuring time for automatic snapshot generation of the disk to be tested; test personnel need to write test scripts of the disk to be tested; the time points can be selected and configured arbitrarily according to the test requirements;
s12, uploading a test script for timing test to the magnetic disks to be tested, and executing the test script, wherein the execution time is set to be a period of time before an automatic snapshot generation time point of each magnetic disk to be tested, such as 5 minutes before the automatic snapshot generation time point; generating a specified folder on a disk to be tested, and randomly generating files in the specified folder; wherein, the highest file hierarchy can be provided with 3-5 layers, the file can be empty or can contain readable and writable files, and the content is randomly written into the readable and writable files;
s13, creating a new folder on the cloud host, and transferring the designated folder and the files thereof in the step S12 into the new folder, wherein the designated folder and the files thereof can be stored in a temporary file in the form of a dictionary, the files are moved into the new folder just before, and then each file written with data is copied into the new folder; after data are collected, the new folder is packaged and then uploaded to a server and named as a copy 1, wherein the new folder uploaded to the server needs to be marked with cloud host information and to-be-detected disk information, the cloud host information comprises ID number or name and other information capable of indicating identity, and the to-be-detected disk information comprises ID number or name and other information capable of indicating identity; after the uploading is successful, a new folder on the cloud host needs to be deleted;
s14, waiting for the cloud platform to come at the automatic snapshot time point, when the time point is reached, the cloud platform of the management cloud host machine generates an automatic snapshot, and after a period of time, for example, after 5 minutes, re-executing the step S12 to generate another designated folder and randomly generating a file in the designated folder;
s15, calling a snapshot data recovery API interface disclosed by the cloud platform, recovering the automatic snapshot generated by the cloud platform in the step S14, and recovering the automatic snapshot to a disk to be tested according to a backup time point;
s16, the step S13 can be re-executed, another new folder is created on the cloud host, and the designated folder and the file thereof in the step S14 are transferred into the new folder; packing and uploading the new folder to a server, naming the new folder as a copy 2, and deleting the new folder of the cloud host;
s17, comparing the copy 1 with the copy 2 on the server, and judging that the automatic snapshot of the disk to be tested is recovered successfully if the contents of the copy 1 and the copy 2 are consistent; if the contents of the copy 1 and the copy 2 are inconsistent, judging that the automatic snapshot of the disk to be tested is recovered to failure;
s18, under the condition that the automatic snapshot is recovered to be successful, circularly executing the steps S12-S17; under the condition that the automatic snapshot is recovered to be failed, the server records abnormal information and feeds the information back to the testers as the basis for the follow-up troubleshooting.
Although embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the application, the scope of which is defined in the appended claims and their equivalents.

Claims (1)

1. The test method for automatic snapshot data recovery of the disk is characterized by comprising the following steps:
s0, selecting a cloud host to mount a disk to be tested, and configuring the time for generating automatic snapshots of the disk to be tested; writing a test script of a disk to be tested;
s1, uploading a test script to a disk to be tested, executing the test script, generating a specified folder on the disk to be tested, and randomly generating a file in the specified folder;
s2, creating a new folder on the cloud host, and transferring the designated folder and the files thereof in the step S2 into the new folder; packing and uploading the new folder to a server, naming the new folder as a copy 1, and deleting the new folder of the cloud host; the new folder is required to mark cloud host information and to-be-detected disk information, wherein the cloud host information comprises an ID number or a name, and the to-be-detected disk information comprises the ID number or the name;
s3, the cloud platform for managing the cloud host carries out automatic snapshot generation, after 5 minutes, the step S1 is executed again, another designated folder is generated, and files are randomly generated in the designated folder;
s4, recovering the automatic snapshot generated by the cloud platform in the step S3, and recovering the automatic snapshot to the disk to be detected;
s5, creating another new folder on the cloud host, and transferring the designated folder and the files thereof in the step S3 into the new folder; packing and uploading the new folder to a server, naming the new folder as a copy 2, and deleting the new folder of the cloud host;
s6, comparing the copy 1 with the copy 2 on the server, and judging that the automatic snapshot of the disk to be tested is recovered successfully if the contents of the copy 1 and the copy 2 are consistent; if the contents of the copy 1 and the copy 2 are inconsistent, judging that the automatic snapshot of the disk to be tested is recovered to failure;
s7, under the condition that the automatic snapshot is recovered to be successful, circularly executing the steps S1-S6; under the condition that the automatic snapshot is recovered to be failed, the server records abnormal information and feeds the information back to the testers as the basis for the follow-up troubleshooting.
CN201911379833.2A 2019-12-27 2019-12-27 Test method for automatic snapshot data recovery of disk Active CN111221691B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911379833.2A CN111221691B (en) 2019-12-27 2019-12-27 Test method for automatic snapshot data recovery of disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911379833.2A CN111221691B (en) 2019-12-27 2019-12-27 Test method for automatic snapshot data recovery of disk

Publications (2)

Publication Number Publication Date
CN111221691A CN111221691A (en) 2020-06-02
CN111221691B true CN111221691B (en) 2023-09-01

Family

ID=70811299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911379833.2A Active CN111221691B (en) 2019-12-27 2019-12-27 Test method for automatic snapshot data recovery of disk

Country Status (1)

Country Link
CN (1) CN111221691B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868910A (en) * 2012-10-19 2013-01-09 上海大亚科技有限公司 Cloud platform based video-on-demand system and video-on-demand expanding control method
CN107391307A (en) * 2017-07-27 2017-11-24 郑州云海信息技术有限公司 The method of testing and device of storage area network storage device snapshot functions
CN107562554A (en) * 2017-08-25 2018-01-09 郑州云海信息技术有限公司 A kind of memory reliability method of testing and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8495019B2 (en) * 2011-03-08 2013-07-23 Ca, Inc. System and method for providing assured recovery and replication

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868910A (en) * 2012-10-19 2013-01-09 上海大亚科技有限公司 Cloud platform based video-on-demand system and video-on-demand expanding control method
CN107391307A (en) * 2017-07-27 2017-11-24 郑州云海信息技术有限公司 The method of testing and device of storage area network storage device snapshot functions
CN107562554A (en) * 2017-08-25 2018-01-09 郑州云海信息技术有限公司 A kind of memory reliability method of testing and server

Also Published As

Publication number Publication date
CN111221691A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
US8495019B2 (en) System and method for providing assured recovery and replication
US7634679B2 (en) Remote location failover server application
US11741046B2 (en) Method and apparatus for creating system disk snapshot of virtual machine
CN106951345B (en) Consistency test method and device for disk data of virtual machine
US8856592B2 (en) Mechanism to provide assured recovery for distributed application
US20150261619A1 (en) Cascade ordering
JP2014520344A (en) Managing replicated virtual storage at the recovery site
CN110008129B (en) Reliability test method, device and equipment for storage timing snapshot
CN102193841B (en) Backup method and device of Subversion configuration database
US11093380B1 (en) Automated testing of backup component upgrades within a data protection environment
CN106326041A (en) Second-level recovery method for database
CN111221691B (en) Test method for automatic snapshot data recovery of disk
CN105653718A (en) Method for ensuring data consistence of database after snapshot in disk snapshot storing environment
US10228879B1 (en) System and method for backup and restore of offline disks in mainframe computers
EP2313829A1 (en) Recovery control in mirrored disks
CN115878386A (en) Disaster recovery method and device, electronic equipment and storage medium
CN106484312A (en) A kind of magnetic disk of virtual machine data migration method and device
JP2004259130A (en) Alteration verifying device and alteration verifying program
CN110471796B (en) File directory-oriented full and incremental backup recovery method
CN112256481A (en) Data recovery method and system in agile development
CN110008064A (en) A kind of RAID restoration methods, device, equipment and medium
US20240095011A1 (en) State machine operation for non-disruptive update of a data management system
US20180232393A1 (en) Storage system, file replication system, file replication method and non-transitory computer-readable medium
CN113821176B (en) Data migration processing method, device and storage medium
US20240095021A1 (en) Quiescent operation of non-disruptive update of a data management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant