A snapshot data backup method and device, an electronic device, and a storage medium
Patent Information
- Application Number
- CN202311434712.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-10-31
AI Technical Summary
然而,目前对NAS(Network Attached Storage,网络附属存储)集群进行灾备数据备份时备份的数据并不全面,导致在NAS集群恢复之后集群中的快照数据并不能得以恢复
[0044]首先,在进行统一存储时,获取网络附属存储虚拟机中的快照卷,并确定目标快照卷;然后,获取目标快照卷的配置信息以及目标快照卷与目标源卷的映射关系,配置信息包括目标快照卷与文件系统的对应关系、目标快照卷与目标快照卷对应的文件系统所创建的共享数据文件的对应关系、目标快照卷的名称、目标快照卷的生成策略中的至少一种;最后,对目标源卷备份时,对目标快照卷的配置信息以及目标快照卷与目标源卷的映射关系进行备份。则当网络附属存储虚拟机出现故障需要进行恢复时,根据备份的目标源卷、目标快照卷的配置信息以及目标快照卷与目标源卷的映射关系,可以对网络附属存储虚拟机中的快照卷进行恢复。
Smart Images

Figure CN117667509B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data backup technology, and in particular to a snapshot data backup method, apparatus, electronic device, and storage medium. Background Technology
[0002] Disaster recovery capability is crucial for any storage system. For centralized storage, both software and hardware failures can lead to cluster loss. To address this, centralized storage systems back up disaster recovery data overnight and perform T3 recovery to restore the cluster and data in the event of a failure, significantly improving their disaster recovery capabilities. However, current disaster recovery backups for NAS (Network Attached Storage) clusters are often incomplete, meaning that snapshot data within the cluster cannot be recovered after the NAS cluster is restored. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a snapshot data backup method, apparatus, electronic device and storage medium that overcomes or at least partially solves the above problems.
[0004] In a first aspect, embodiments of the present invention disclose a snapshot data backup method, comprising:
[0005] When performing unified storage, the snapshot volume in the network-attached storage virtual machine is obtained, and the target snapshot volume is determined; the snapshot volume in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system;
[0006] Obtain the configuration information of the target snapshot volume; the configuration information of the target snapshot volume includes at least one of the following: the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume;
[0007] Obtain the mapping relationship between the target snapshot volume and the target source volume; the target source volume is the physical snapshot data file corresponding to the target snapshot volume;
[0008] When backing up the target source volume, the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume are also backed up.
[0009] Optionally, the snapshot volume includes a timed snapshot volume, and the step of acquiring the snapshot volume in the network attached storage virtual machine and determining the target snapshot volume includes:
[0010] Query whether a snapshot volume exists in the network-attached storage virtual machine;
[0011] If the snapshot volume exists in the network-attached storage virtual machine, then query whether a timed snapshot volume exists in the snapshot volume;
[0012] If the timed snapshot volume exists in the snapshot volume, then the generation time of the timed snapshot volume is obtained, and the timed snapshot volume with the latest generation time is taken as the target snapshot volume according to the generation time.
[0013] If the scheduled snapshot volume does not exist in the snapshot volume, then all the snapshot volumes obtained from the query will be used as the target snapshot volume;
[0014] The step of obtaining the configuration information of the target snapshot volume includes:
[0015] When the target snapshot volume is a timed snapshot volume, the configuration information of the target snapshot volume is determined to include the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume;
[0016] When the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume is determined to include the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
[0017] Optionally, obtaining the generation time of the timed snapshot volume includes:
[0018] Obtain the name of the timed snapshot volume; the name includes the generation time of the timed snapshot.
[0019] Optionally, when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume may also include the number of target snapshot volumes.
[0020] Optionally, the target source volume is a file in a multi-controller system. When backing up the target source volume, the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume are backed up, including:
[0021] The multi-controller system and the network-attached storage virtual machine are backed up according to a preset time.
[0022] When backing up the multi-controller system, the target source volume and the mapping relationship between the target snapshot volume and the target source volume are backed up, and a first backup file is generated;
[0023] When backing up the network-attached storage virtual machine, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
[0024] Optionally, the first backup file is the mcsconfig.crom.xml file, and the second backup file is the cib.xml file.
[0025] Optionally, backing up the multi-controller system includes:
[0026] The multi-controller system is backed up by executing the mcsconfig-backup command;
[0027] The backup of the network-attached storage virtual machine includes:
[0028] The network-attached storage virtual machine is backed up by executing the backupnasconfig command.
[0029] Secondly, embodiments of the present invention disclose a snapshot data backup device, comprising:
[0030] The target snapshot volume determination module is used to obtain snapshot volumes in network-attached storage virtual machines and determine target snapshot volumes when performing unified storage; the snapshot volume in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system;
[0031] The configuration information acquisition module is used to acquire the configuration information of the target snapshot volume; the configuration information of the target snapshot volume includes at least one of the following: the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume.
[0032] The mapping relationship acquisition module is used to acquire the mapping relationship between the target snapshot volume and the target source volume; the target source volume is the physical snapshot data file corresponding to the target snapshot volume;
[0033] The backup module is used to back up the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume when backing up the target source volume.
[0034] Optionally, the snapshot volume includes a timed snapshot volume, and the target snapshot volume determination module is specifically used for: querying whether a snapshot volume exists in the network attached storage virtual machine; if the snapshot volume exists in the network attached storage virtual machine, then querying whether a timed snapshot volume exists in the snapshot volume; if the timed snapshot volume exists in the snapshot volume, then obtaining the generation time of the timed snapshot volume, and based on the generation time, using the timed snapshot volume with the latest generation time as the target snapshot volume; if the timed snapshot volume does not exist in the snapshot volume, then using all the snapshot volumes obtained from the query as the target snapshot volume;
[0035] The configuration information acquisition module is specifically used for: when the target snapshot volume is a timed snapshot volume, determining the configuration information of the target snapshot volume, including the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume; when the target snapshot volume is not a timed snapshot volume, determining the configuration information of the target snapshot volume, including the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
[0036] Optionally, the target snapshot volume determination module is specifically used to: obtain the name of the timed snapshot volume; the name includes the generation time of the timed snapshot.
[0037] Optionally, when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume may also include the number of target snapshot volumes.
[0038] Optionally, the target source volume is a file in the multi-controller system, and the backup module is specifically used to: back up the multi-controller system and the network-attached storage virtual machine according to a preset time; when backing up the multi-controller system, back up the target source volume and the mapping relationship between the target snapshot volume and the target source volume, and generate a first backup file; when backing up the network-attached storage virtual machine, back up the configuration information of the target snapshot volume, and generate a second backup file.
[0039] Optionally, the first backup file is the mcsconfig.crom.xml file, and the second backup file is the cib.xml file.
[0040] Optionally, the backup module is specifically used to: back up the multi-controller system by executing the mcsconfig-backup command; and back up the network-attached storage virtual machine by executing the backupnasconfig command.
[0041] Thirdly, embodiments of the present invention disclose an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the snapshot data backup method as described above.
[0042] Fourthly, embodiments of the present invention disclose a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the snapshot data backup method as described above.
[0043] The embodiments of the present invention have the following advantages:
[0044] First, during unified storage, snapshot volumes in the network-attached storage virtual machine are acquired, and the target snapshot volume is determined. Then, the configuration information of the target snapshot volume and its mapping relationship with the target source volume are obtained. The configuration information includes at least one of the following: the mapping relationship between the target snapshot volume and the file system; the mapping relationship between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume; the name of the target snapshot volume; and the generation strategy of the target snapshot volume. Finally, when backing up the target source volume, the configuration information of the target snapshot volume and its mapping relationship with the target source volume are backed up. Therefore, when the network-attached storage virtual machine fails and needs to be restored, the snapshot volume in the network-attached storage virtual machine can be restored based on the backed-up target source volume, the configuration information of the target snapshot volume, and the mapping relationship between the target snapshot volume and the target source volume. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating the steps of a snapshot data backup method provided in an embodiment of the present invention;
[0046] Figure 2 This is a flowchart of another snapshot data backup method provided in an embodiment of the present invention;
[0047] Figure 3 This is a flowchart of a snapshot data backup process provided by an embodiment of the present invention;
[0048] Figure 4 This is a T3 recovery backup flowchart provided by an embodiment of the present invention;
[0049] Figure 5 This is a structural block diagram of a snapshot data backup device provided in an embodiment of the present invention;
[0050] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention;
[0051] Figure 7This is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation
[0052] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0053] Definitions:
[0054] T3 Recovery: If system state has been lost across all control rack node containers, the system recovery process restores the entire storage system. This process recreates the storage system using saved configuration data. The saved configuration data resides on the active quota disk and in the latest XML configuration backup file. Recovery may not recover all volume data. This process is also known as "Tier 3 (T3)" recovery.
[0055] XML: Extensible Markup Language.
[0056] MCS: Multiple Controller System, is a type of storage control system.
[0057] NAS: Network Attached Storage, is a device that is connected to a network and has data storage capabilities.
[0058] Snapshot: A fully usable copy of the specified data set.
[0059] Snapshot volume: Recorded data representing the state of a file system at a specific point in time.
[0060] Unified storage: Data is stored on a central node consisting of one or more computers, also known as centralized storage.
[0061] Because current centralized storage backups for NAS clusters during disaster recovery are incomplete, snapshot data within the cluster cannot be recovered after NAS cluster restoration. NAS snapshots store rollback data needed by customers at specific points in time; losing NAS snapshot data results in incomplete NAS service data. Therefore, this invention backs up the configuration information of the target snapshot volume, the mapping relationship between the target snapshot volume and the target source volume, and the target source volume itself. This allows for the recovery of snapshot data from the cluster based on the backup files during NAS cluster restoration.
[0062] Reference Figure 1 The diagram illustrates a flowchart of a snapshot data backup method provided by an embodiment of the present invention. The method may specifically include the following steps:
[0063] Step 101: When performing unified storage, obtain the snapshot volume in the network auxiliary storage virtual machine and determine the target snapshot volume; the snapshot volume in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system.
[0064] The snapshot volume displayed in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system. Its corresponding physical snapshot data file, also known as the source volume, is recorded in a physical storage device.
[0065] When storing cluster data in a unified manner, you can first query whether there are snapshot volumes in the NAS virtual machines in the cluster. If it is determined that there are snapshot volumes in the NAS virtual machines, you can obtain all the snapshot volumes in the NAS virtual machines and use some or all of them as the target snapshot volume.
[0066] Step 102: Obtain the configuration information of the target snapshot volume; the configuration information of the target snapshot volume includes at least one of the following: the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume.
[0067] Once the target snapshot volume is determined, the corresponding file system and the shared data files created by that file system can be identified and mapped. For example, if target snapshot volume A records the state of file system A at a certain point in time, then the file system corresponding to target snapshot volume A is file system A. Further, the shared data files created by file system A can be queried. Assuming that file system A has created shared data file A, then the shared data file corresponding to target snapshot volume A is determined to be shared data file A. Thus, a mapping relationship can be established between target snapshot volume A and file system A, as well as a mapping relationship between target snapshot volume A and shared data file A.
[0068] After determining the target snapshot volume, you can also obtain the target snapshot volume's name and generation strategy. When the target snapshot volume is a timed snapshot volume, it refers to a snapshot volume generated periodically at preset time intervals, and the generation strategy of the target snapshot volume is its timed generation strategy. For example, the generation strategy of the target snapshot volume could be to generate a snapshot volume every other day.
[0069] Step 103: Obtain the mapping relationship between the target snapshot volume and the target source volume; the target source volume is the physical snapshot data file corresponding to the target snapshot volume.
[0070] Once the target snapshot volume is determined, the corresponding target source volume can be identified, and a mapping relationship between the two can be established.
[0071] Step 104: When backing up the target source volume, back up the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume.
[0072] When backing up the target source volume, the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume are also backed up. This allows the snapshot volume in the NAS virtual machine to be restored based on the configuration information of the target snapshot volume, and the target source volume to be located and the data in the target source volume to be obtained based on the mapping relationship between the target snapshot volume and the target source volume.
[0073] This invention, in its embodiments, acquires snapshot volumes from network-attached storage virtual machines (NAS) during unified storage operations and identifies target snapshot volumes. It then acquires the configuration information of the target snapshot volume and its mapping relationship with the target source volume. The configuration information includes the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the corresponding file system, the name of the target snapshot volume, and the generation strategy of the target snapshot volume. When backing up the target source volume, the configuration information of the target snapshot volume and its mapping relationship with the target source volume are also backed up. Therefore, when a NAS virtual machine fails and needs recovery, the snapshot volume in the virtual machine can be restored based on the backed-up target source volume, target snapshot volume configuration information, and the mapping relationship, thus improving the disaster recovery capability of centralized storage (NAS).
[0074] Reference Figure 2 The diagram illustrates a flowchart of another snapshot data backup method provided by an embodiment of the present invention. The method may specifically include the following steps:
[0075] Step 201: When performing unified storage, query whether a snapshot volume exists in the network-attached storage virtual machine.
[0076] Step 202: If a snapshot volume exists in the network attached storage virtual machine, then query whether a timed snapshot volume exists in the snapshot volume.
[0077] Step 203: If a timed snapshot volume exists in the snapshot volume, obtain the generation time of the timed snapshot volume, and select the timed snapshot volume with the latest generation time as the target snapshot volume.
[0078] Snapshot volumes include scheduled snapshot volumes and non-scheduled snapshot volumes, and their naming rules differ. Scheduled snapshot volumes are generally named in the format: cycle_policy_filesystem_name_snap timestamp, such as cycle_interval_node1fs1_snap20230505062358. Non-scheduled snapshots record the snapshot creation time in the snapshot volume name, i.e., the snapshot generation time, in seconds. The format is generally: palm_nas_vd_fsname_year / month / day / hour / minute / second, such as node1fs1_snap20230505062358, where 20230505062358 is the generation time of the scheduled snapshot. Therefore, the snapshot volume name can be obtained, and the scheduled snapshots within the snapshot volume can be identified using the name. Furthermore, the generation time of the scheduled snapshot volume can be determined based on its name, and thus, the scheduled snapshot volume with the latest generation time can be identified and used as the target snapshot volume.
[0079] Step 204: If there is no scheduled snapshot volume in the snapshot volume, then all the snapshot volumes obtained from the query will be used as the target snapshot volume.
[0080] When a snapshot volume does not contain a scheduled snapshot volume, it means that all current snapshot volumes are snapshot volumes that the user has specifically saved according to their own needs. Therefore, when backing up, all snapshot volumes need to be backed up. When a snapshot volume contains a scheduled snapshot volume, it means that the user only needs to update the snapshot volume periodically. Therefore, when backing up, only the most recently generated scheduled snapshot volume needs to be backed up.
[0081] Step 205: When the target snapshot volume is a timed snapshot volume, determine the configuration information of the target snapshot volume, including the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume.
[0082] Step 206: When the target snapshot volume is not a scheduled snapshot volume, determine the configuration information of the target snapshot volume, including the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
[0083] When the target snapshot volume is not a scheduled snapshot volume, you can back up information such as the mapping between the target snapshot volume and the file system, the mapping between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume. Furthermore, if there may be multiple target snapshot volumes, you can also back up the number of target snapshot volumes.
[0084] When the target snapshot volume is a timed snapshot volume, in addition to backing up the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume, it is also necessary to save the generation strategy of the timed snapshot volume.
[0085] Step 207: Obtain the mapping relationship between the target snapshot volume and the target source volume; the target source volume is the physical snapshot data file corresponding to the target snapshot volume.
[0086] Step 208: When backing up the target source volume, back up the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume.
[0087] Steps 207-208 in this embodiment of the invention are the same as steps 103-104 above, and will not be described again here.
[0088] By using all non-timed snapshot volumes as target snapshot volumes, or using the timed snapshot volume with the latest generation time among the timed snapshot volumes as the target snapshot volume, the present invention can meet users' backup needs for snapshot volumes while saving backup storage resources.
[0089] The current recovery process for centralized storage NAS T3 is as follows:
[0090] 1. Execute mcsconfig-backup to back up the MCS configuration information and business data, generating files such as mcsconfig.cron.xml;
[0091] 2. Execute backupnasconfig to back up the configuration information of the NAS virtual machine, generating files such as cib.xml;
[0092] 3. When restoring the NAS, follow these steps: (a) Check if the NAS cluster exists; if so, proceed to the next step; (b) Based on the mcsconfig.crom.xml file in the MCS backup file, use the recovervdisk vdisk_name command to restore the NAS virtual machine cluster, and simultaneously restore the mapping relationship between the virtual machines and the MCS; (c) Based on the NAS backup file, restore the NAS service network card; (d) Based on the cib.xml file in the NAS backup file, restore the NAS shared data.
[0093] In this T3 recovery, because the mcsconfig.cron.xml file does not contain the mapping relationship between the source volume in the MCS and the snapshot volume in the NAS virtual machine, and the cib.xml backup file does not contain the relevant configuration information of the NAS snapshot volume, the snapshot data in the NAS virtual machine will not be recovered after the T3 recovery.
[0094] Therefore, in one optional embodiment, the target source volume can be a file in the Multi-Controller System (MCS). When backing up the target source volume, the steps of backing up the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume can specifically include: backing up the multi-controller system and the network-attached storage virtual machine according to a preset time; when backing up the multi-controller system, backing up the target source volume and the mapping relationship between the target snapshot volume and the target source volume, and generating a first backup file; when backing up the network-attached storage virtual machine, backing up the configuration information of the target snapshot volume, and generating a second backup file. That is, when backing up the MCS, the target source volume and the mapping relationship between the target snapshot volume and the target source volume are also backed up, and a first backup file is generated; when backing up the NAS, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
[0095] In an optional embodiment, the first backup file can be an mcsconfig.crom.xml file, and the second backup file can be a cib.xml file. That is, the mapping relationship between the target snapshot volume and the target source volume can be stored in the mcsconfig.crom.xml file, and the configuration information of the target snapshot volume can be stored in the cib.xml file.
[0096] In one optional embodiment, the specific steps for backing up the multi-controller system may include: backing up the multi-controller system by executing the `mcsconfig --backup` command; the specific steps for backing up the network-attached storage virtual machine may include: backing up the network-attached storage virtual machine by executing the `backupnasconfig` command. The backup commands executed in the original backup process are maintained, except that after executing the backup commands, the mapping relationship between the target snapshot volume and the target source volume, as well as the configuration information of the target snapshot volume, are also backed up.
[0097] Reference Figure 3 The diagram illustrates a snapshot data backup flowchart provided by an embodiment of the present invention. First, when backing up the storage system, it checks if a NAS snapshot volume exists. If not, the original normal T3 backup process is executed, without needing to back up the NAS snapshot data.
[0098] If a NAS snapshot volume exists, the NAS snapshot data backup process is executed. The first step is to use the `lsfssnaptimer` command to check if a scheduled snapshot volume exists. If no scheduled snapshot volume exists, all snapshot volumes are queried, and the source volume corresponding to each snapshot volume is identified. A mapping relationship between each snapshot volume and its source volume is established. This mapping relationship can be viewed using the `lclcmap` command. Then, the `mcsconfig --backup` command is executed to save the mapping relationship between each snapshot volume and its source volume in the `mcsconfig.cron.xml` file. Simultaneously, `backupnasconfig` is executed to save the names of each snapshot volume, the mapping relationship between each snapshot volume and its corresponding file system, and the mapping relationship between each snapshot volume and its shared data files in the `cib.xml` file. These mapping relationships can be viewed using the `lssnap` command.
[0099] If a scheduled snapshot volume exists, execute `lsvdisk –backup` to query all NAS snapshot volumes. Based on the snapshot volume name, identify the snapshot volumes that are scheduled snapshots, and then identify the scheduled snapshot volume with the latest creation time based on its name. Then, query the source volume, file system, shared data files, scheduling policy, and name corresponding to the scheduled snapshot volume with the latest creation time. Next, execute the `mcsconfig –backup` command to save the mapping relationship between the scheduled snapshot volume and the source volume in the `mcsconfig.cron.xml` file. Simultaneously, execute `backupnasconfig` to save the name of the scheduled snapshot volume, the mapping relationship between the scheduled snapshot volume and the corresponding file system, the mapping relationship between the scheduled snapshot volume and the shared data files, and the creation policy of the scheduled snapshot volume in the `cib.xml` file.
[0100] Reference Figure 4 This diagram illustrates a T3 recovery backup flowchart provided by an embodiment of the present invention. Step 301: Execute the T3 backup process. Step 302: Locate all snapshot volumes in the NAS virtual machine. Snapshot volumes in the NAS virtual machine are virtual volumes. Step 303: Save the data in the virtual volumes to the mcsconfig.cron.xml file. Step 304: Query the configuration information of the snapshot volumes in the NAS virtual machine. The configuration information includes the mapping relationship between snapshot volumes and file systems, the mapping relationship with shared data files, the name of the snapshot volume, the number of snapshot volumes, etc. Step 305: Save this configuration information to the cib.xml file. Step 306: The T3 backup process ends.
[0101] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0102] Reference Figure 5 The diagram illustrates a structural block diagram of a snapshot data backup device provided by an embodiment of the present invention, which may specifically include the following modules:
[0103] The target snapshot volume determination module 401 is used to obtain the snapshot volume in the network auxiliary storage virtual machine and determine the target snapshot volume when performing unified storage; the snapshot volume in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system;
[0104] The configuration information acquisition module 402 is used to acquire the configuration information of the target snapshot volume; the configuration information of the target snapshot volume includes at least one of the following: the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume.
[0105] The mapping relationship acquisition module 403 is used to acquire the mapping relationship between the target snapshot volume and the target source volume; the target source volume is the physical snapshot data file corresponding to the target snapshot volume;
[0106] The backup module 404 is used to back up the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume when backing up the target source volume.
[0107] Optionally, the snapshot volume includes a timed snapshot volume, and the target snapshot volume determination module 401 is specifically used to: query whether a snapshot volume exists in the network attached storage virtual machine; if the snapshot volume exists in the network attached storage virtual machine, then query whether a timed snapshot volume exists in the snapshot volume; if the timed snapshot volume exists in the snapshot volume, then obtain the generation time of the timed snapshot volume, and according to the generation time, take the timed snapshot volume with the latest generation time as the target snapshot volume; if the timed snapshot volume does not exist in the snapshot volume, then take all the snapshot volumes obtained from the query as the target snapshot volume;
[0108] The configuration information acquisition module 402 is specifically used for: when the target snapshot volume is a timed snapshot volume, determining that the configuration information of the target snapshot volume includes the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume; when the target snapshot volume is not a timed snapshot volume, determining that the configuration information of the target snapshot volume includes the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
[0109] Optionally, the target snapshot volume determination module 401 is specifically used to: obtain the name of the timed snapshot volume; the name includes the generation time of the timed snapshot.
[0110] Optionally, when the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume may also include the number of target snapshot volumes.
[0111] Optionally, the target source volume is a file in the multi-controller system, and the backup module 404 is specifically used to: back up the multi-controller system and the network-attached storage virtual machine according to a preset time; when backing up the multi-controller system, back up the target source volume and the mapping relationship between the target snapshot volume and the target source volume, and generate a first backup file; when backing up the network-attached storage virtual machine, back up the configuration information of the target snapshot volume, and generate a second backup file.
[0112] Optionally, the first backup file is the mcsconfig.crom.xml file, and the second backup file is the cib.xml file.
[0113] Optionally, the backup module 404 is specifically used to: back up the multi-controller system by executing the mcsconfig-backup command; and back up the network-attached storage virtual machine by executing the backupnasconfig command.
[0114] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0115] Reference Figure 6 The diagram illustrates a structural block diagram of an electronic device 50 provided in an embodiment of the present invention. The electronic device 50 includes:
[0116] The processor 501, the memory 502, and the computer program 5021 stored in the memory 502 and capable of running on the processor 501. When the computer program 5021 is executed by the processor 501, it implements the various processes of the above-described data acquisition method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0117] Reference Figure 7 The diagram shows a structural block diagram of a computer-readable storage medium 60 provided in an embodiment of the present invention. The computer-readable storage medium 60 stores a computer program 601. When the computer program 601 is executed by a processor, it implements the various processes of the above-described data acquisition method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0119] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0123] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0124] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only 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 a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. 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 terminal device that includes said element.
[0125] The snapshot data backup method, apparatus, electronic device, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A snapshot data backup method, characterized in that, include: When performing unified storage, obtain the snapshot volume in the network-attached storage virtual machine and determine the target snapshot volume; The snapshot volume in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system. Obtain the configuration information of the target snapshot volume; the configuration information of the target snapshot volume includes at least one of the following: the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume; Obtain the mapping relationship between the target snapshot volume and the target source volume; The target source volume is the physical snapshot data file corresponding to the target snapshot volume; When backing up the target source volume, the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume are also backed up.
2. The snapshot data backup method according to claim 1, characterized in that, The snapshot volume includes a timed snapshot volume. The step of acquiring the snapshot volume in the network-attached storage virtual machine and determining the target snapshot volume includes: Query whether a snapshot volume exists in the network-attached storage virtual machine; If the snapshot volume exists in the network-attached storage virtual machine, then query whether a timed snapshot volume exists in the snapshot volume; If the timed snapshot volume exists in the snapshot volume, then the generation time of the timed snapshot volume is obtained, and the timed snapshot volume with the latest generation time is taken as the target snapshot volume according to the generation time. If the scheduled snapshot volume does not exist in the snapshot volume, then all the snapshot volumes obtained from the query will be used as the target snapshot volume; The step of obtaining the configuration information of the target snapshot volume includes: When the target snapshot volume is a timed snapshot volume, the configuration information of the target snapshot volume is determined to include the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume; When the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume is determined to include the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, and the name of the target snapshot volume.
3. The snapshot data backup method according to claim 2, characterized in that, The step of obtaining the generation time of the timed snapshot volume includes: Obtain the name of the timed snapshot volume; the name includes the generation time of the timed snapshot.
4. The snapshot data backup method according to claim 2, characterized in that, When the target snapshot volume is not a timed snapshot volume, the configuration information of the target snapshot volume also includes the number of target snapshot volumes.
5. The snapshot data backup method according to claim 1, characterized in that, The target source volume is a file in a multi-controller system. When backing up the target source volume, the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume are backed up, including: The multi-controller system and the network-attached storage virtual machine are backed up according to a preset time. When backing up the multi-controller system, the target source volume and the mapping relationship between the target snapshot volume and the target source volume are backed up, and a first backup file is generated; When backing up the network-attached storage virtual machine, the configuration information of the target snapshot volume is backed up, and a second backup file is generated.
6. The snapshot data backup method according to claim 5, characterized in that, The first backup file is mcsconfig.crom.xml, and the second backup file is cib.xml.
7. The snapshot data backup method according to claim 5, characterized in that, The backup of the multi-controller system includes: The multi-controller system is backed up by executing the mcsconfig-backup command; The backup of the network-attached storage virtual machine includes: The network-attached storage virtual machine is backed up by executing the backupnasconfig command.
8. A snapshot data backup device, characterized in that, include: The target snapshot volume determination module is used to obtain snapshot volumes in network-attached storage virtual machines and determine the target snapshot volume when performing unified storage. The snapshot volume in the virtual machine is a virtual snapshot data file generated after taking a snapshot of the file system. The configuration information acquisition module is used to acquire the configuration information of the target snapshot volume; the configuration information of the target snapshot volume includes at least one of the following: the correspondence between the target snapshot volume and the file system, the correspondence between the target snapshot volume and the shared data files created by the file system corresponding to the target snapshot volume, the name of the target snapshot volume, and the generation strategy of the target snapshot volume. The mapping relationship acquisition module is used to acquire the mapping relationship between the target snapshot volume and the target source volume; The target source volume is the physical snapshot data file corresponding to the target snapshot volume; The backup module is used to back up the configuration information of the target snapshot volume and the mapping relationship between the target snapshot volume and the target source volume when backing up the target source volume.
9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the snapshot data backup method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the snapshot data backup method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and system for online backup of database
CN102012947A
Multi-controller snapshot processing method and device
CN104268032A