CN118012665A - Consistent snapshot group method, device, electronic equipment and storage medium - Google Patents

Consistent snapshot group method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN118012665A
CN118012665A CN202311770875.5A CN202311770875A CN118012665A CN 118012665 A CN118012665 A CN 118012665A CN 202311770875 A CN202311770875 A CN 202311770875A CN 118012665 A CN118012665 A CN 118012665A
Authority
CN
China
Prior art keywords
snapshot
group
cloud hard
consistency group
hard disk
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.)
Pending
Application number
CN202311770875.5A
Other languages
Chinese (zh)
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.)
Beijing Urban Construction Intelligent Control Technology Co ltd
Original Assignee
Beijing Urban Construction Intelligent Control Technology 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 Beijing Urban Construction Intelligent Control Technology Co ltd filed Critical Beijing Urban Construction Intelligent Control Technology Co ltd
Priority to CN202311770875.5A priority Critical patent/CN118012665A/en
Publication of CN118012665A publication Critical patent/CN118012665A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a device, electronic equipment and a storage medium for consistent snapshot groups, and relates to the technical field of cloud storage, wherein the method comprises the following steps: acquiring a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied; determining target storage back ends corresponding to all cloud hard disks and configuration types corresponding to all target storage back ends based on the mapping relation between all cloud hard disks and the storage back ends; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot; based on the configuration type corresponding to each target storage back end in the consistency group, a universal volume mode and/or a drive volume replication mode is adopted to create a consistency group snapshot corresponding to the consistency group. The method and the device can realize synchronous consistency group snapshot of a plurality of cloud hard disks corresponding to the same application program, and further realize consistency protection of data of the plurality of cloud hard disks.

Description

Consistent snapshot group method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of cloud storage technologies, and in particular, to a method, an apparatus, an electronic device, and a storage medium for consistent snapshot groups.
Background
With the advent of cloud computing, large-scale distributed systems and cloud platforms require efficient and reliable data backup and restoration mechanisms. Traditional backup and recovery methods often require a distributed system and a cloud platform to be shut down to perform operations such as data migration, resulting in service interruption and data loss. In this case, a consistent snapshot group technique has developed. Consistent snapshot group techniques utilize replication, slicing, and redundancy mechanisms in a distributed system to achieve high availability and fault tolerance of data by replicating and synchronizing data among multiple nodes. In addition, consistent snapshot group techniques may also facilitate data recovery when needed by creating snapshots at particular points in time and recording data states.
Existing consistent snapshot group technologies generally use a storage system (such as object storage or block storage) or a database system (such as a relational database or a NoSQL database) of a cloud service provider to perform snapshot backup, reply, version control and the like on a single cloud hard disk. However, when snapshot backup is performed on multiple cloud hard disks corresponding to the same application program, a group snapshot that is not supported by a part of cloud hard disks may exist in the multiple cloud hard disks, and it is not possible to ensure that the multiple cloud hard disks perform consistent snapshot groups at the same time point, and further it is not possible to ensure data consistency in the group snapshot.
Disclosure of Invention
The invention provides a consistent snapshot group method, a device, electronic equipment and a storage medium, which are used for solving the defect that the consistent group snapshot of a plurality of cloud hard disks cannot be ensured to be carried out at the same time point in the prior art, realizing the synchronous consistent group snapshot of the plurality of cloud hard disks corresponding to the same application program, and further realizing the consistent protection of data of the plurality of cloud hard disks.
The invention provides a consistent snapshot group method, which comprises the following steps:
acquiring a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied;
Determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
And creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
According to the method for creating the consistent snapshot group according to the present invention, based on the configuration type corresponding to each target storage back end in the consistent group, a general volume mode and/or the drive volume replication mode is adopted, and the method includes:
Under the condition that configuration types corresponding to the rear ends of the target storage in the consistency group support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the drive volume replication mode;
under the condition that the configuration type corresponding to the rear end of each target storage in the consistency group does not support the drive volume replication mode, a universal volume mode is adopted to create a consistency group snapshot corresponding to the consistency group;
and under the condition that the configuration type corresponding to the rear end of part of target storage in the consistency group does not support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the universal volume replication mode and the drive volume replication mode.
According to the consistent snapshot group method provided by the invention, the method for creating the consistent group snapshot corresponding to the consistent group by adopting the drive volume replication mode comprises the following steps:
synchronously calling each target storage back end at a drive layer by adopting the drive volume copying mode to copy the corresponding cloud hard disk volume, and creating a snapshot corresponding to each cloud hard disk;
And determining a consistency group snapshot corresponding to the consistency group based on all the snapshots, and storing snapshot information corresponding to each snapshot into a database.
According to the consistent snapshot group method provided by the invention, the method for creating the consistent snapshot group corresponding to the consistent group by adopting a universal volume mode comprises the following steps:
creating a virtual group in a database, and migrating all cloud hard disks into the virtual group to obtain a logical group corresponding to the consistency group;
traversing each cloud hard disk in the logical group by adopting a general volume mode, and creating a general volume corresponding to the cloud hard disk;
for each universal volume, migrating the universal volume to a target storage back end corresponding to the cloud hard disk;
And storing the snapshot information corresponding to each universal volume into a database, and deleting the virtual group.
According to the consistent snapshot group method provided by the invention, the method for creating the consistent group snapshot corresponding to the consistent group by adopting the universal volume mode and the drive volume replication mode comprises the following steps:
Determining at least one first storage back end supporting the drive volume replication mode and at least one second storage back end not supporting the drive volume replication mode from all target storage back ends; the sum of the number of the at least one first storage back end and the number of the at least one second storage back end is equal to the number of all target storage back ends;
the drive volume copying mode is adopted, the drive layer calls each first storage back end to copy volumes of the corresponding first cloud hard disks, and first snapshots corresponding to each first cloud hard disk are created;
Traversing the second cloud hard disk corresponding to each second storage back end by adopting the general volume mode, creating general volumes corresponding to each second cloud hard disk in a logic group created in a database, migrating each general volume to each second storage back end corresponding to each second cloud hard disk, and deleting a virtual group in the logic group; the logical group is obtained by migrating all the second cloud hard disks to a virtual group created in a database;
Determining a consistency group snapshot corresponding to the consistency group based on the first snapshot corresponding to each first cloud hard disk and the universal volume corresponding to each second cloud hard disk; the drive volume replication approach is performed in parallel with the generic volume approach.
According to the consistent snapshot group method provided by the invention, the method further comprises the following steps:
Judging whether the creation time of the corresponding snapshot or the universal volume of all cloud hard disks meets the consistency snapshot point or not based on the snapshot information corresponding to each cloud hard disk;
And under the condition that at least one creation time does not meet the consistency snapshot point in all creation times, snapshot failure information is generated based on the acquisition mode of the consistency group.
According to the consistent snapshot group method provided by the invention, the snapshot failure information is generated based on the acquisition mode of the consistent group, and the method comprises the following steps:
Under the condition that the acquisition mode of the consistency group is that the user responds to the acquisition of an operation instruction at the Web front end of the global wide area network, snapshot failure information is generated and sent to the Web front end for display;
and under the condition that the acquisition mode of the consistency group is based on timer task acquisition, generating the snapshot failure information, and adding the snapshot failure information into log information corresponding to the timer task based on the snapshot failure information.
The invention also provides a consistent snapshot set device, comprising:
The system comprises an acquisition module, a replication module and a replication module, wherein the acquisition module is used for acquiring a consistency group, and the consistency group comprises at least one cloud hard disk to be replicated;
the determining module is used for determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
The creating module is used for creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the consistent snapshot group method as described in any of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a consistent snapshot group method as described in any of the foregoing.
According to the consistency snapshot group method, the device, the electronic equipment and the storage medium, after a consistency group formed by at least one cloud hard disk to be copied is obtained, the target storage rear ends corresponding to the cloud hard disks are respectively determined, the configuration types corresponding to the target storage rear ends are determined, whether the target storage rear ends support a drive volume copying mode to create consistency group snapshots is judged according to the configuration types, the corresponding snapshot mode is determined from a general volume mode and/or a drive volume copying mode according to the judgment results corresponding to the target storage rear ends, and therefore consistency group snapshots of the cloud hard disks at the same time point are ensured, and further consistency of data in the cloud hard disks in the consistency group is ensured.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a consistent snapshot group method according to an embodiment of the present invention;
FIG. 2 is one of the schematic creation diagrams of a consistency group provided by an embodiment of the present invention;
FIG. 3 is a second schematic diagram of creation of a consistency group according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the creation of a timer provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of the creation of a timer task provided by an embodiment of the present invention;
FIG. 6 is a second flowchart of a consistent snapshot group method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a consistent snapshot set of devices according to an embodiment of the present invention;
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Aiming at the problem that in the prior art, consistent group snapshots of a plurality of cloud hard disks cannot be ensured to be carried out at the same time point, an embodiment of the invention provides a consistent snapshot group method, and fig. 1 is one of flow diagrams of the consistent snapshot group method provided by the embodiment of the invention, as shown in fig. 1, the method comprises the following steps:
step 110, obtaining a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied.
Optionally, the method for consistent snapshot group provided by the embodiment of the present invention is applied to a back-end server, where the consistent group may be obtained in response to an operation instruction of a user at a front end of a Web (World Wide Web), or when a current moment reaches a detection period set by a timer task, a creation event is triggered, where the creation event is used to control the front end of the Web to send the consistent group set in the timer task to the back-end server.
Optionally, in the case that the consistency group is obtained in response to an operation instruction of the user at the Web front end, the user may click a "create group snapshot" button in a snapshot group interface or a cloud host interface in the Web front end, and sequentially add cloud hard disks to be copied, so as to place the cloud hard disks in the same application in the same consistency group, and reduce management difficulty of the cloud hard disks to be copied. For example, fig. 2 is one of schematic creation diagrams of a consistency group provided in the embodiment of the present invention, as shown in fig. 2, on a snapshot group interface at the front end of the Web, a "create group" button may be clicked first, and after the name of the consistency group is input, an empty consistency group may be created, that is, the number of cloud hard disks in the consistency group is 0. Then, each time the "create group snapshot" button is clicked, one cloud hard disk to be replicated can be added in the empty consistency group. And after the cloud hard disk is added, obtaining the consistency group comprising at least one cloud hard disk to be copied. For example, fig. 3 is a second schematic diagram of creation of a consistency group according to the embodiment of the present invention, as shown in fig. 3, on a cloud host interface at the front end of the Web, a "create cloud host" button may be clicked first, and after a name of a cloud host is input, an empty cloud host may be created. Then, each time the "create group snapshot" button is clicked, one cloud hard disk to be copied can be added in the empty cloud host. And after the cloud hard disk is added, obtaining the consistency group comprising at least one cloud hard disk to be copied. In addition, in the snapshot group interface or the cloud host interface, operations such as editing and deleting can be performed on the added cloud hard disk.
Optionally, in the case that the consistency group snapshot is acquired based on a timer task, a timer may be first created in the Web front end by a user, and then a timer task corresponding to the timer may be set. For example, fig. 4 is a schematic diagram of creation of a timer according to an embodiment of the present invention, as shown in fig. 4, in a timer interface, a "create timer" button is clicked, a name of the timer is input, an "automatic backup snapshot group" is input, the selection type is repeatedly executed, the selection period is every 1 day, and the time is 16:35:19, so that the timer can be created. After that, fig. 5 is a schematic diagram of creation of a timer task provided in the embodiment of the present invention, as shown in fig. 5, after the timer is created, the created timer named "automatic backup snapshot group" is selected, and the "create" button is clicked, the creation interface of the timer task is displayed in a popup window form, after the timer task named "group snapshot task" is input, and the task type is a cloud host group snapshot, at least one cloud hard disk to be copied in the timer task is added by selecting resources, and after the addition is completed, the consistency group can be obtained. The timer task creates a consistency group snapshot for the consistency group at 16:35:19 per day.
Optionally, when the consistency group is created in the cloud host interface in the Web front end in response to a user, the cloud hard disk may be a cloud host root disk or a mount disk, and the cloud hard disk may be mounted to the cloud host and used as a physical hard disk.
Step 120, determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on a mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume copy mode to create a consistent snapshot.
Taking 8 cloud hard disks included in the consistency group shown in table 1 as an example, after the consistency group shown in table 1 is obtained, the target storage back ends corresponding to the cloud hard disks can be determined first according to the mapping relationship between each cloud hard disk and the storage back end, as can be seen from table 1, the cloud hard disks 1 to 4 correspond to the same target storage back end rbd, and the cloud hard disks 5 to 8 respectively correspond to different target storage back ends. After determining the corresponding target storage back ends of the 8 hard disks, the configuration type corresponding to each target storage back end can be further determined so as to determine whether each target storage back end supports a drive volume copy mode to create a consistent snapshot. As shown in table 1, the target storage backend corresponding to each of the cloud hard disk 1 to the cloud hard disk 5 does not support the drive volume copy mode to create the consistent snapshot, and the target storage backend corresponding to each of the cloud hard disk 6 to the cloud hard disk 8 supports the drive volume copy mode to create the consistent snapshot.
TABLE 1
It should be noted that, the target storage back ends corresponding to the cloud hard disks may be the same or different, that is, all the cloud hard disks may all correspond to the same target storage back end, or each cloud hard disk corresponds to one target storage back end respectively, and each target storage back end is different, or a part of the cloud hard disks corresponds to the same target storage back end, and another part of the cloud hard disks corresponds to different target storage back ends respectively.
In addition, when the target storage back end is created, the configuration type corresponding to the target storage back end is configured according to configuration information provided by a manufacturer, the configuration information can comprise the model number and the configuration type of the target storage back end, and whether the target storage back end supports a drive volume copy mode to create the consistent snapshot can be determined through the configuration type. When creating the target storage backend, other information such as the name, IP (Internet Protocol ) address, etc. of the target storage backend may also be configured. After the target storage back end is created, the storage type, the storage position and the like of the data in the cloud hard disk can be configured in the target storage back end, the name of the target storage back end is set in the cloud hard disk instance, and the mapping relation between the cloud hard disk and the target storage back end is obtained.
And 130, creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
Specifically, after determining the configuration type corresponding to each target storage back end, three situations existing in all target storage back ends can be respectively: all target storage back ends support a drive volume copying mode, all target storage back ends do not support the drive volume copying mode, and part of target storage back ends exist in all target storage back ends and do not support the drive volume copying mode. According to different situations, a proper snapshot mode is selected in a universal volume mode and/or a drive volume replication mode so as to create a consistency group snapshot corresponding to the consistency group.
Further, the creating, based on the configuration type corresponding to each target storage back end in the consistency group, a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode includes:
(1) Fig. 6 is a second flowchart of a consistent snapshot group method according to an embodiment of the present invention, as shown in fig. 6, where, in a case where a configuration type corresponding to a back end of each target storage in the consistent group supports the drive volume replication mode, a consistent group snapshot corresponding to the consistent group is created by using the drive volume replication mode.
Further, the creating, by using the drive volume replication method, a consistency group snapshot corresponding to the consistency group includes:
synchronously calling each target storage back end at a drive layer by adopting the drive volume copying mode to copy the corresponding cloud hard disk volume, and creating a snapshot corresponding to each cloud hard disk;
And determining a consistency group snapshot corresponding to the consistency group based on all the snapshots, and storing snapshot information corresponding to each snapshot into a database.
Specifically, if all target storage back ends in the consistency group support a drive volume replication mode, flexible and extensible virtual disk management service provided by OpenStack Cinder is utilized, volume replication is synchronously performed on cloud hard disks corresponding to the target storage back ends at a drive layer, snapshots corresponding to the cloud hard disks are created, and then the consistency group snapshots corresponding to the consistency group are obtained through all the snapshots. Taking the example that the consistency group includes the cloud hard disk 6 to the cloud hard disk 8 shown in table 1 as an example, synchronously calling the target storage back end insuper corresponding to the cloud hard disk 6 at the driving layer to perform volume copy on the data in the cloud hard disk 6, calling the target storage back end nexenta-nfs corresponding to the cloud hard disk 7 to perform volume copy on the data in the cloud hard disk 7, calling the target storage back end nexenta-issci corresponding to the cloud hard disk 8 to perform volume copy on the data in the cloud hard disk 8, and forming the consistency group snapshot corresponding to the consistency group by the obtained three snapshots. After creating the consistency group snapshot, snapshot information corresponding to each snapshot may be stored in a database, where the snapshot information may include a snapshot name, a snapshot description, a storage location, and the like.
It should be noted that, the OpenStack is the most widely used cloud computing platform currently on the market, and the cloud computing platform refers to a platform deployed with a computing model connected to a remote server and resources through the internet, and cloud computing allows users to access computing services, storage services and other services through a network without having to own or manage infrastructure, which provides advantages of acquiring resources as needed and flexibly expanding scale. The Cinder is a block storage service component in OpenStack, and the Cinder improves the reliability and availability of data by providing functions of sharing, snapshot, cloning, backup and the like of storage. In addition, the Cinder allows users to quota and manage storage resources to efficiently control and allocate storage resources.
(2) As shown in fig. 6, in the case where the configuration type corresponding to each target storage back end in the consistency group does not support the drive volume replication mode, a universal volume mode is adopted to create a consistency group snapshot corresponding to the consistency group.
Further, the creating the consistency group snapshot corresponding to the consistency group by adopting a universal volume mode includes:
creating a virtual group in a database, and migrating all cloud hard disks into the virtual group to obtain a logical group corresponding to the consistency group;
traversing each cloud hard disk in the logical group by adopting a general volume mode, and creating a general volume corresponding to the cloud hard disk;
for each universal volume, migrating the universal volume to a target storage back end corresponding to the cloud hard disk;
And storing the snapshot information corresponding to each universal volume into a database, and deleting the virtual group.
Specifically, if all target storage backend in the consistency group do not support the drive volume replication mode, a universal volume mode can be adopted to create a consistency group snapshot. Taking the example that the consistency group includes the cloud hard disks 1 to 5 shown in table 1 as an example, firstly, an empty virtual group is created in the database, and the cloud hard disks 1 to 5 are migrated into the empty virtual group to be combined into a logic group. Traversing 5 cloud hard disks in a logical group, and copying data in each cloud hard disk in turn to create a universal volume corresponding to the cloud hard disk, wherein each time a universal volume corresponding to the cloud hard disk is successfully created, a mark corresponding to the cloud hard disk can be modified to be successful, so that the success of the creation of the universal volumes corresponding to all cloud hard disks in the logical group is ensured, and the universal volume can be understood as a snapshot corresponding to each cloud hard disk. And then, migrating the created universal volumes corresponding to each cloud hard disk to the target storage back end corresponding to each cloud hard disk, storing snapshot information corresponding to each universal volume into a database, and deleting the created virtual group after all 5 universal volumes are migrated into the database. Because the time consumption of the creation process of the universal volume is short and can be ignored, the synchronous creation of the corresponding universal volume by all cloud hard disks can be realized, and then the consistency group snapshot corresponding to the consistency group is created.
(3) And under the condition that the configuration type corresponding to the rear end of part of target storage in the consistency group does not support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the universal volume replication mode and the drive volume replication mode.
Further, the creating a consistency group snapshot corresponding to the consistency group by adopting the universal volume mode and the drive volume replication mode includes:
Determining at least one first storage back end supporting the drive volume replication mode and at least one second storage back end not supporting the drive volume replication mode from all target storage back ends; the sum of the number of the at least one first storage back end and the number of the at least one second storage back end is equal to the number of all target storage back ends;
the drive volume copying mode is adopted, the drive layer calls each first storage back end to copy volumes of the corresponding first cloud hard disks, and first snapshots corresponding to each first cloud hard disk are created;
Traversing the second cloud hard disk corresponding to each second storage back end by adopting the general volume mode, creating general volumes corresponding to each second cloud hard disk in a logic group created in a database, migrating each general volume to each second storage back end corresponding to each second cloud hard disk, and deleting a virtual group in the logic group; the logical group is obtained by migrating all the second cloud hard disks to a virtual group created in a database;
Determining a consistency group snapshot corresponding to the consistency group based on the first snapshot corresponding to each first cloud hard disk and the universal volume corresponding to each second cloud hard disk; the drive volume replication approach is performed in parallel with the generic volume approach.
Taking an example that a consistency group includes 8 cloud hard disks 1 to 8 shown in table 1 as a total, and target storage rear ends corresponding to the cloud hard disks 6 to 8 respectively support a drive volume copy mode, then the cloud hard disks 6 to 8 are all first cloud hard disks, and target storage rear ends corresponding to the cloud hard disks 1 to 5 respectively do not support the drive volume copy mode, then the cloud hard disks 1 to 5 are all second cloud hard disks, at this time, for the cloud hard disks 6 to 8, the drive volume copy mode can be adopted, and the target storage rear ends corresponding to the cloud hard disks 6 to 8 respectively can be called to synchronously create first snapshots corresponding to the cloud hard disks 6 to 8 respectively; meanwhile, for the cloud hard disk 1 to the cloud hard disk 5, a virtual group can be created in a database by adopting a general volume mode, the cloud hard disk 1 to the cloud hard disk 5 are migrated into the virtual group to obtain a logic group, each cloud hard disk in the logic group is traversed, data of each cloud hard disk are sequentially copied, general volumes corresponding to each cloud hard disk 1 to the cloud hard disk 5 are created, after all the general volumes are created, the general volumes are migrated to target storage rear ends corresponding to each cloud hard disk 1 to the cloud hard disk 5, and snapshot information corresponding to each general volume is stored in the database. After the migration of the general volume is finished, the virtual group created in the data is deleted. In this case, the drive volume copy mode and the universal volume mode are executed in parallel to create consistent group snapshots corresponding to the cloud hard disk 1 to the cloud hard disk 8.
It should be noted that, the drive volume replication mode is to call the target storage back end to directly replicate the data of the cloud hard disk to create the member volumes of the cloud hard disks in the consistency group. And the general volume mode needs to perform operations such as creating a logical group, circularly copying the cloud hard disk, deleting the virtual group and the like. And secondly, the drive volume replication mode can discover and process connection faults or errors in the replication process in time by periodically sending heartbeat signals and checking states, when the cloud hard disk changes, the drive layer can automatically update the changes to corresponding member volumes, so that the consistency and the reliability of data in the consistency group snapshot are ensured, and the back-end servers in the general volume mode are independently detected. In terms of snapshot efficiency, the snapshot efficiency and fault tolerance of the drive volume replication mode are better than those of the general volume mode, however, the general volume mode also plays a role of supplementing a target storage back end which does not support the drive volume replication mode.
Further, the method further comprises:
Judging whether the creation time of the corresponding snapshot or the universal volume of all cloud hard disks meets the consistency snapshot point or not based on the snapshot information corresponding to each cloud hard disk;
And under the condition that at least one creation time does not meet the consistency snapshot point in all creation times, snapshot failure information is generated based on the acquisition mode of the consistency group.
Specifically, after the snapshot information corresponding to each cloud hard disk is created, it may be determined whether the creation time of the snapshot or the universal volume corresponding to each cloud hard disk in the consistency group meets a consistency snapshot point, where the consistency snapshot point may be understood as a specific time point corresponding to the creation of the consistency group snapshot, for example, a time point required by a user or a time set in a timer task. If all the creation moments meet the consistency snapshot point, consistency and accuracy of backup data corresponding to each cloud hard disk in the consistency group can be ensured, and reliability and stability of the system can be improved conveniently when disaster recovery backup or application program recovery is carried out. If at least one of the creation moments does not meet the consistency snapshot point, indicating that the consistency group snapshot of the consistency group fails to be created, and at this time, different snapshot failure information can be generated according to the acquisition mode of the consistency group.
Further, the generating snapshot failure information based on the obtaining manner of the consistency group includes:
Under the condition that the acquisition mode of the consistency group is that the user responds to the acquisition of an operation instruction at the Web front end of the global wide area network, snapshot failure information is generated and sent to the Web front end for display;
and under the condition that the acquisition mode of the consistency group is based on timer task acquisition, generating the snapshot failure information, and adding the snapshot failure information into log information corresponding to the timer task based on the snapshot failure information.
Specifically, if the consistency group is created manually by the user, that is, when the consistency group is created by the user on the snapshot group interface or the cloud host interface at the front end of the Web, snapshot failure information can be generated and sent to the front end of the Web for display. If the consistency group is set in the timer task, snapshot failure information can be added in the log information.
Optionally, when the snapshot failure information is displayed at the Web front end, the snapshot failure information may be displayed in a popup window mode, and the content in the snapshot failure information may be highlighted to remind the user that the snapshot of the consistency group fails to be created. In addition, if the user does not recreate the consistency group snapshot corresponding to the consistency group within the preset time period after the snapshot failure information is displayed, the snapshot failure information can be displayed in a popup window again, and if the user recreates the consistency group snapshot corresponding to the consistency group within the preset time period after the snapshot failure information is displayed, the snapshot failure information is not displayed any more. After the number of times of displaying the snapshot failure information reaches a preset threshold, the snapshot failure information is not displayed any more, and the preset threshold may be set to 3 times, 4 times, or 5 times, which is not limited in the embodiment of the present invention.
Optionally, after the consistency group snapshot corresponding to the consistency group is created, snapshot management can be performed on the consistency group snapshot, so that an administrator and a user can conveniently view, manage and operate the consistency group snapshot. The snapshot management includes listing the snapshots, viewing detailed information of the snapshots, or deleting unnecessary snapshots, etc. The consistency group snapshot may be used for data recovery when data loss, failure, or need to revert to a particular point in time occurs. An administrator or user may select a particular consistency group snapshot and apply the consistency group snapshot to a specified data volume, virtual machine, or database to restore the state of the data value at the time the consistency group snapshot was created. In addition, when a plurality of storage versions exist in the data in the cloud hard disk, a plurality of versions of consistency group snapshots can be created, and when the data is recovered, the specific version of consistency group snapshots can be selected for data recovery, so that more flexible data recovery options are provided.
According to the consistency snapshot group method provided by the embodiment of the invention, after the consistency group formed by at least one cloud hard disk to be copied is obtained, the target storage rear ends corresponding to the cloud hard disks are respectively determined, the configuration types corresponding to the target storage rear ends are determined, whether the target storage rear ends support a drive volume copying mode to create the consistency group snapshot is judged according to the configuration types, the corresponding snapshot mode is determined from a general volume mode and/or a drive volume copying mode according to the judgment results corresponding to the target storage rear ends, the consistency group snapshot of the cloud hard disks at the same time point is ensured, and the consistency of data in the cloud hard disks in the consistency group is further ensured.
The consistent snapshot set device provided by the invention is described below, and the consistent snapshot set device described below and the consistent snapshot set method described above can be correspondingly referred to each other.
An embodiment of the present invention further provides a consistent snapshot set device, and fig. 7 is a schematic structural diagram of the consistent snapshot set device provided by the embodiment of the present invention, as shown in fig. 7, where a consistent snapshot set device 700 includes: an acquisition module 710, a determination module 720, and a creation module 730, wherein:
An obtaining module 710, configured to obtain a consistency group, where the consistency group includes at least one cloud hard disk to be replicated;
The determining module 720 is configured to determine, based on a mapping relationship between each cloud hard disk and a storage backend, a target storage backend corresponding to each cloud hard disk, and a configuration type corresponding to each target storage backend; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
the creating module 730 is configured to create a consistency group snapshot corresponding to the consistency group by using a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each of the target storage backend in the consistency group.
According to the consistency snapshot set device provided by the embodiment of the invention, after the consistency set formed by at least one cloud hard disk to be copied is obtained, the target storage rear ends corresponding to the cloud hard disks are respectively determined, the configuration types corresponding to the target storage rear ends are determined, whether the target storage rear ends support a drive volume copying mode to create the consistency set snapshot is judged according to the configuration types, the corresponding snapshot mode is determined from a general volume mode and/or a drive volume copying mode according to the judgment results corresponding to the target storage rear ends, the consistency set snapshot of the cloud hard disks at the same time point is ensured, and the consistency of data in the cloud hard disks in the consistency set is further ensured.
Optionally, the creating module 730 is specifically configured to:
Under the condition that configuration types corresponding to the rear ends of the target storage in the consistency group support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the drive volume replication mode;
under the condition that the configuration type corresponding to the rear end of each target storage in the consistency group does not support the drive volume replication mode, a universal volume mode is adopted to create a consistency group snapshot corresponding to the consistency group;
and under the condition that the configuration type corresponding to the rear end of part of target storage in the consistency group does not support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the universal volume replication mode and the drive volume replication mode.
Optionally, the creating module 730 is specifically configured to:
synchronously calling each target storage back end at a drive layer by adopting the drive volume copying mode to copy the corresponding cloud hard disk volume, and creating a snapshot corresponding to each cloud hard disk;
And determining a consistency group snapshot corresponding to the consistency group based on all the snapshots, and storing snapshot information corresponding to each snapshot into a database.
Optionally, the creating module 730 is specifically configured to:
creating a virtual group in a database, and migrating all cloud hard disks into the virtual group to obtain a logical group corresponding to the consistency group;
traversing each cloud hard disk in the logical group by adopting a general volume mode, and creating a general volume corresponding to the cloud hard disk;
for each universal volume, migrating the universal volume to a target storage back end corresponding to the cloud hard disk;
And storing the snapshot information corresponding to each universal volume into a database, and deleting the virtual group.
Optionally, the creating module 730 is specifically configured to:
Determining at least one first storage back end supporting the drive volume replication mode and at least one second storage back end not supporting the drive volume replication mode from all target storage back ends; the sum of the number of the at least one first storage back end and the number of the at least one second storage back end is equal to the number of all target storage back ends;
the drive volume copying mode is adopted, the drive layer calls each first storage back end to copy volumes of the corresponding first cloud hard disks, and first snapshots corresponding to each first cloud hard disk are created;
Traversing the second cloud hard disk corresponding to each second storage back end by adopting the general volume mode, creating general volumes corresponding to each second cloud hard disk in a logic group created in a database, migrating each general volume to each second storage back end corresponding to each second cloud hard disk, and deleting a virtual group in the logic group; the logical group is obtained by migrating all the second cloud hard disks to a virtual group created in a database;
Determining a consistency group snapshot corresponding to the consistency group based on the first snapshot corresponding to each first cloud hard disk and the universal volume corresponding to each second cloud hard disk; the drive volume replication approach is performed in parallel with the generic volume approach.
Optionally, the consistent snapshot assembly 700 further includes a generating module, where the generating module is specifically configured to:
Judging whether the creation time of the corresponding snapshot or the universal volume of all cloud hard disks meets the consistency snapshot point or not based on the snapshot information corresponding to each cloud hard disk;
And under the condition that at least one creation time does not meet the consistency snapshot point in all creation times, snapshot failure information is generated based on the acquisition mode of the consistency group.
Optionally, the generating module is specifically configured to:
Under the condition that the acquisition mode of the consistency group is that the user responds to the acquisition of an operation instruction at the Web front end of the global wide area network, snapshot failure information is generated and sent to the Web front end for display;
and under the condition that the acquisition mode of the consistency group is based on timer task acquisition, generating the snapshot failure information, and adding the snapshot failure information into log information corresponding to the timer task based on the snapshot failure information.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 8, the electronic device may include: processor 810, communication interface (Communications Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. Processor 810 may invoke logic instructions in memory 830 to perform a consistent snapshot group method comprising:
acquiring a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied;
Determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
And creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing the consistent snapshot group method provided by the methods described above, the method comprising:
acquiring a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied;
Determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
And creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the consistent snapshot group method provided by the methods described above, the method comprising:
acquiring a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied;
Determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
And creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of consistent snapshot group, comprising:
acquiring a consistency group, wherein the consistency group comprises at least one cloud hard disk to be copied;
Determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
And creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
2. The method according to claim 1, wherein the creating the consistency group snapshot corresponding to the consistency group by using a general volume method and/or the drive volume replication method based on the configuration type corresponding to each of the target storage backend in the consistency group includes:
Under the condition that configuration types corresponding to the rear ends of the target storage in the consistency group support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the drive volume replication mode;
under the condition that the configuration type corresponding to the rear end of each target storage in the consistency group does not support the drive volume replication mode, a universal volume mode is adopted to create a consistency group snapshot corresponding to the consistency group;
and under the condition that the configuration type corresponding to the rear end of part of target storage in the consistency group does not support the drive volume replication mode, creating a consistency group snapshot corresponding to the consistency group by adopting the universal volume replication mode and the drive volume replication mode.
3. The method of consistent snapshot groups of claim 2, wherein creating a consistent group snapshot corresponding to the consistent group using the driven volume replication approach includes:
synchronously calling each target storage back end at a drive layer by adopting the drive volume copying mode to copy the corresponding cloud hard disk volume, and creating a snapshot corresponding to each cloud hard disk;
And determining a consistency group snapshot corresponding to the consistency group based on all the snapshots, and storing snapshot information corresponding to each snapshot into a database.
4. The method of consistent snapshot group according to claim 2, wherein creating a consistent group snapshot corresponding to the consistent group in a universal volume manner includes:
creating a virtual group in a database, and migrating all cloud hard disks into the virtual group to obtain a logical group corresponding to the consistency group;
traversing each cloud hard disk in the logical group by adopting a general volume mode, and creating a general volume corresponding to the cloud hard disk;
for each universal volume, migrating the universal volume to a target storage back end corresponding to the cloud hard disk;
And storing the snapshot information corresponding to each universal volume into a database, and deleting the virtual group.
5. The method of consistent snapshot groups of claim 2, wherein creating a consistent group snapshot corresponding to the consistent group using the universal volume approach and the driven volume replication approach includes:
Determining at least one first storage back end supporting the drive volume replication mode and at least one second storage back end not supporting the drive volume replication mode from all target storage back ends; the sum of the number of the at least one first storage back end and the number of the at least one second storage back end is equal to the number of all target storage back ends;
the drive volume copying mode is adopted, the drive layer calls each first storage back end to copy volumes of the corresponding first cloud hard disks, and first snapshots corresponding to each first cloud hard disk are created;
Traversing the second cloud hard disk corresponding to each second storage back end by adopting the general volume mode, creating general volumes corresponding to each second cloud hard disk in a logic group created in a database, migrating each general volume to each second storage back end corresponding to each second cloud hard disk, and deleting a virtual group in the logic group; the logical group is obtained by migrating all the second cloud hard disks to a virtual group created in a database;
Determining a consistency group snapshot corresponding to the consistency group based on the first snapshot corresponding to each first cloud hard disk and the universal volume corresponding to each second cloud hard disk; the drive volume replication approach is performed in parallel with the generic volume approach.
6. The consistent snapshot group method of any of claims 1-5, further comprising:
Judging whether the creation time of the corresponding snapshot or the universal volume of all cloud hard disks meets the consistency snapshot point or not based on the snapshot information corresponding to each cloud hard disk;
And under the condition that at least one creation time does not meet the consistency snapshot point in all creation times, snapshot failure information is generated based on the acquisition mode of the consistency group.
7. The method of consistent snapshot group of claim 6, wherein generating snapshot failure information based on a manner of acquisition of the consistent group comprises:
Under the condition that the acquisition mode of the consistency group is that the user responds to the acquisition of an operation instruction at the Web front end of the global wide area network, snapshot failure information is generated and sent to the Web front end for display;
and under the condition that the acquisition mode of the consistency group is based on timer task acquisition, generating the snapshot failure information, and adding the snapshot failure information into log information corresponding to the timer task based on the snapshot failure information.
8. A consistent snapshot set device, comprising:
The system comprises an acquisition module, a replication module and a replication module, wherein the acquisition module is used for acquiring a consistency group, and the consistency group comprises at least one cloud hard disk to be replicated;
the determining module is used for determining a target storage back end corresponding to each cloud hard disk and a configuration type corresponding to each target storage back end based on the mapping relation between each cloud hard disk and the storage back end; the configuration type is used for representing whether the target storage back end supports a drive volume replication mode to create a consistent snapshot;
The creating module is used for creating a consistency group snapshot corresponding to the consistency group by adopting a general volume mode and/or the drive volume replication mode based on the configuration type corresponding to each target storage back end in the consistency group.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the consistent snapshot set method of any of claims 1-7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the consistent snapshot set method of any of claims 1-7.
CN202311770875.5A 2023-12-21 2023-12-21 Consistent snapshot group method, device, electronic equipment and storage medium Pending CN118012665A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311770875.5A CN118012665A (en) 2023-12-21 2023-12-21 Consistent snapshot group method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311770875.5A CN118012665A (en) 2023-12-21 2023-12-21 Consistent snapshot group method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118012665A true CN118012665A (en) 2024-05-10

Family

ID=90946901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311770875.5A Pending CN118012665A (en) 2023-12-21 2023-12-21 Consistent snapshot group method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118012665A (en)

Similar Documents

Publication Publication Date Title
CN109558215B (en) Backup method, recovery method and device of virtual machine and backup server cluster
CN107533499B (en) Method and system for performing failover between storage systems
US10310949B1 (en) Disaster restore of big data application with near zero RTO
US7594138B2 (en) System and method of error recovery for backup applications
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
US10055300B2 (en) Disk group based backup
US10152387B1 (en) Instant start of virtual machine from archive copy on backup media
CN107256182B (en) Method and device for restoring database
CN104216793B (en) Application Backup, the method and apparatus recovered
CN105242990A (en) Cloud platform based data backup method and apparatus
CN110138577B (en) Cluster creation method, first server and readable storage medium
US10452502B2 (en) Handling node failure in multi-node data storage systems
US10452680B1 (en) Catch-up replication with log peer
CN110442427B (en) Virtual machine snapshot management method, device, equipment and storage medium
CN110825562B (en) Data backup method, device, system and storage medium
CN110750325A (en) Mirror image backup method and device of virtual machine, fault recovery method and device and electronic equipment
US20120324279A1 (en) Method and Apparatus of Backing up Subversion Repository
CN110972497A (en) Disaster recovery method and device for virtualization platform
CN113986450A (en) Virtual machine backup method and device
CN110196749B (en) Virtual machine recovery method and device, storage medium and electronic device
CN114356650A (en) Data backup method, device, equipment, system and storage medium
CN105574026A (en) Method and device for service supporting by using non-relational database
WO2021082925A1 (en) Transaction processing method and apparatus
CN118012665A (en) Consistent snapshot group method, device, electronic equipment and storage medium
CN112540873B (en) Disaster tolerance method and device, electronic equipment and disaster tolerance system

Legal Events

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