A method, system, storage medium and device for creating snapshots

By freezing and writing cached data in the cloud disk file system, the problem of data unsynchronization during cloud platform snapshot creation is solved, and data consistency of cloud disk snapshots and convenient snapshot recovery are achieved.

CN113609075BActive Publication Date: 2024-10-18JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110951315.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-18
Publication Date
2024-10-18
Estimated Expiration
2041-08-18

AI Technical Summary

Technical Problem

When the cloud platform creates a snapshot for the consistency group, the data in the file system is not synchronized to the cloud disk, resulting in data inconsistency during cloud disk snapshot recovery, resulting in data recovery failure.

Method used

Send a request to the virtual machine through the cloud platform to freeze the cloud disk file system in the consistency group, write the file system cache data to the cloud disk, and unfreeze it after the snapshot is created to ensure data consistency.

Benefits of technology

It achieves data consistency at the file system level, avoids data recovery failures, improves the convenience of snapshot creation and consistency of storage-level operations, and saves time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113609075B_ABST
    Figure CN113609075B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, storage medium and device for creating snapshots, the method comprising: sending a first request to a virtual machine through a cloud platform, and freezing the file system corresponding to each cloud hard disk in a consistency group based on the first request through the virtual machine; in response to each file system being frozen, writing the data in the cache of each file system to the corresponding cloud hard disk; in response to the data in the cache of each file system being written to the corresponding cloud hard disk, sending a second request to a backend storage through the cloud platform, and creating snapshots for each cloud hard disk in the consistency group based on the second request through the backend storage; in response to the completion of creating snapshots for each cloud hard disk in the consistency group, sending a third request to the virtual machine through the cloud platform, and unfreezing the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine. The present invention realizes the reliability of the cloud platform creating snapshots for the consistency group.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a method, system, storage medium and device for creating a snapshot. Background Art

[0002] Currently, in some important application scenarios, such as large database applications, database tables, logs, and configuration files are stored in multiple different cloud hard disks, and the data in each cloud hard disk is interrelated and interdependent. When you need to create snapshots for all cloud hard disks, if the time when each cloud hard disk creates the snapshot is inconsistent, it may cause inconsistent data status in the cloud hard disk snapshot. Therefore, the cloud platform introduces the concept of consistency group. The data in the same application is written to each file system in real time, and the data in the file system is then written to each cloud hard disk in real time. When you need to create snapshots for all cloud hard disks used by the same application, first add all cloud hard disks to a consistency group, so that you can directly create a snapshot for the consistency group without having to create a snapshot for each cloud hard disk separately.

[0003] The core steps of the current cloud platform consistency group snapshot operation are: 1. All cloud hard disks in the consistency group will suspend the read and write IO of all cloud hard disks at the same time point; 2. All cloud hard disks will create corresponding snapshots at the same time point; 3. After the snapshot is created, all cloud hard disks will resume read and write IO at the same time. The current operation steps can only achieve storage-level operation consistency, and there may be some data in the file system and its cache that has not been written to the cloud hard disk through read and write IO, which will cause inconsistent data status in each cloud hard disk, causing errors when restoring data from the cloud hard disk snapshot, resulting in data recovery failure. Summary of the invention

[0004] In view of this, the purpose of the present invention is to propose a method, system, storage medium and device for creating a snapshot, so as to solve the problem in the prior art that when a cloud platform creates a snapshot for a consistency group, there is data in its file system that is not synchronized to the cloud hard disk, resulting in incorrect data in the subsequent cloud hard disk snapshot recovery.

[0005] Based on the above object, the present invention provides a method for creating a snapshot, comprising the following steps:

[0006] Sending a first request to the virtual machine through the cloud platform, and freezing the file system corresponding to each cloud hard disk in the consistency group based on the first request through the virtual machine includes:

[0007] Sending a first control instruction to a virtualization platform management tool through the cloud platform, and obtaining mount point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing each mount point information in a database respectively;

[0008] In response to each file system being frozen, the data in the cache of each file system is written to the corresponding cloud hard disk respectively;

[0009] In response to the data in the cache of each file system being written to the corresponding cloud hard disk, a second request is sent to the backend storage through the cloud platform, and a snapshot is created for each cloud hard disk in the consistency group based on the second request through the backend storage;

[0010] In response to the completion of creating snapshots for each cloud hard disk in the consistency group, a third request is sent to the virtual machine through the cloud platform, and the frozen file systems corresponding to each cloud hard disk are respectively unfrozen through the virtual machine based on the third request.

[0011] In some embodiments, sending a first request to a virtual machine through a cloud platform, and freezing a file system corresponding to each cloud hard disk in a consistency group through the virtual machine based on the first request includes:

[0012] Calling the first interface in the virtualization platform management tool through the cloud platform, and obtaining each mount point information from the database and transmitting it to the first interface respectively;

[0013] In response to each mount point information being transmitted to the first interface respectively, a first control instruction is sent to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction.

[0014] In some embodiments, sending the third request to the virtual machine through the cloud platform, and unfreezing the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine includes:

[0015] Sending a second control instruction to the virtualization platform management tool through the cloud platform, and acquiring information of each mount point from the database based on the second control instruction;

[0016] Calling the second interface in the virtualization platform management tool through the cloud platform and passing the information of each mount point into it;

[0017] In response to the input of each mount point information into the second interface, the second control instruction is sent to the virtual machine through the virtualization platform management tool, so that the virtual machine unfreezes the frozen file systems corresponding to each cloud hard disk based on the second control instruction.

[0018] In some embodiments, sending the first control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction includes:

[0019] The first control instruction is sent to the operating system of the virtual machine through the virtualization platform management tool, and the first control instruction is executed through the operating system to enable the virtual machine to freeze the file system corresponding to each cloud hard disk.

[0020] In some embodiments, executing the first control instruction through the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk includes:

[0021] In response to the operating system being Linux, the operating system executes the first control instruction to call the Fsfreeze method and freeze the file system corresponding to each cloud hard disk through the Fsfreeze method.

[0022] In some embodiments, freezing the file system corresponding to each cloud hard disk in the consistency group based on the first request by the virtual machine includes:

[0023] The file system corresponding to each cloud hard disk belonging to the same cloud host in the consistency group is frozen through the virtual machine based on the first request.

[0024] In some embodiments, the virtualization platform management tool includes libvirt.

[0025] Another aspect of the present invention further provides a system for creating a snapshot, comprising:

[0026] The file system freezing module is configured to send a first request to its virtual machine through the cloud platform, and freeze the file system corresponding to each cloud hard disk in the consistency group based on the first request through the virtual machine, including:

[0027] Sending a first control instruction to a virtualization platform management tool through the cloud platform, and obtaining mount point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing each mount point information in a database respectively;

[0028] A data writing module, configured to write the data in the cache of each file system into the corresponding cloud hard disk in response to each file system being frozen;

[0029] a snapshot creation module configured to send a second request to the backend storage through the cloud platform in response to the data in the cache of each file system being written to the corresponding cloud hard disk, and to create a snapshot for each cloud hard disk in the consistency group based on the second request through the backend storage; and

[0030] The unfreeze module is configured to send a third request to the virtual machine through the cloud platform in response to the completion of creating snapshots for each cloud hard disk in the consistency group, and unfreeze the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine.

[0031] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions implement any one of the above methods when executed.

[0032] According to another aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, any one of the above methods is executed.

[0033] The present invention has at least the following beneficial technical effects:

[0034] 1. The present invention freezes the file systems of all cloud hard disks in the consistency group at the same time, so that data in the application cannot be written to the file system, and the data in the cloud hard disk will no longer be updated, thereby omitting the suspension and recovery operations of the cloud hard disk read and write IO at the storage level in the prior art, effectively saving the time overhead caused by the operation;

[0035] 2. By synchronizing the data in the file system cache to the cloud hard disk, the consistency group snapshot has data consistency at the file system level, avoiding the situation in the prior art where data recovery fails due to the fact that some data in the cloud hard disk file system has not been snapshotted during snapshot recovery;

[0036] 3. By directly creating snapshots for the consistency group, the convenience of operation is improved, avoiding the tedious situation of operating the cloud hard disks in the consistency group one by one, and ensuring that the operation time of the back-end storage layer is consistent when creating snapshots for all cloud hard disks in the consistency group, thereby ensuring the data consistency in the cloud hard disk snapshots; by unfreezing the file systems of all cloud hard disks in the consistency group, the data in the application can continue to be written to the file system. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0038] Figure 1 A schematic diagram of a method for creating a snapshot according to an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of a system for creating a snapshot according to an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of a computer-readable storage medium for implementing a method for creating a snapshot according to an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of the hardware structure of a computer device for executing a method for creating a snapshot according to an embodiment of the present invention;

[0042] Figure 5 The figure is a schematic diagram of the relationship between various structures in the method for creating a snapshot according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0044] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are intended to distinguish two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, other steps or units inherent to a process, method, system, product or device that includes a series of steps or units.

[0045] Based on the above purpose, a first aspect of an embodiment of the present invention provides an embodiment of a method for creating a snapshot. Figure 1 FIG. 2 is a schematic diagram of an embodiment of a method for creating a snapshot provided by the present invention. Figure 1 As shown, the embodiment of the present invention includes the following steps:

[0046] Step S10, sending a first request to its virtual machine through the cloud platform, and freezing the file system corresponding to each cloud hard disk in the consistency group based on the first request through the virtual machine includes:

[0047] Sending a first control instruction to a virtualization platform management tool through the cloud platform, and obtaining mount point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing each mount point information in a database respectively;

[0048] Step S20: In response to each file system being frozen, the data in the cache of each file system is written into the corresponding cloud hard disk;

[0049] Step S30: In response to the data in the cache of each file system being written to the corresponding cloud hard disk, a second request is sent to the backend storage through the cloud platform, and a snapshot is created for each cloud hard disk in the consistency group based on the second request through the backend storage;

[0050] Step S40, in response to the completion of creating snapshots for each cloud hard disk in the consistency group, a third request is sent to the virtual machine through the cloud platform, and the frozen file systems corresponding to each cloud hard disk are unfrozen through the virtual machine based on the third request.

[0051] In the embodiment of the present invention, the cloud platform refers to a service based on hardware resources and software resources, which provides computing, network and storage capabilities. OpenStack is an open source cloud computing management platform project, and it is also one of the most widely used cloud platforms on the market. Currently, many domestic cloud platform service providers use the OpenStack architecture to develop cloud platforms. Cloud hard disks are a general term for block devices in the OpenStack cloud platform. Cloud hard disks can be mounted on cloud hosts and used like physical hard disks. Cloud hosts refer to virtual machines managed in the cloud computing platform. The consistency group can logically divide all cloud hard disks used by an application into a group. Back-end storage refers to storage devices managed by the cloud platform storage module. Currently, only storage devices from some manufacturers support the consistency group snapshot function. The back-end storage of this embodiment can be G2 storage.

[0052] In an embodiment of the present invention, Figure 5 As shown in the figure, the application and file system are both located in the memory of the cloud host, while the cloud hard disk is located in the physical device of the backend storage. The cloud hard disk needs to create a file system in the memory and then mount it to the specified directory of the cloud host before it can be used normally by the cloud host. The mount point information refers to the directory where the file system is mounted on the operating system of the cloud host. The mount point information can be used to prevent the file system from transmitting data to the cloud hard disk. Based on this, the state of writing data from multiple file systems to the cloud hard disk can be effectively maintained or unified, so that the storage process from memory to the cloud hard disk can be consistent.

[0053] Specifically, the data in the application must first be transferred to the file system corresponding to the cloud hard disk, and then transferred from the file system or file system cache to the cloud hard disk. When the freeze operation is started, the corresponding file system in the memory is frozen according to the mount point information (corresponding directory) to prevent the file system from writing to the cloud hard disk data.

[0054] The embodiment of the present invention freezes the file systems of all cloud hard disks in the consistency group at the same time, so that data in the application cannot be written to the file system, and the data in the cloud hard disk will no longer be updated, thereby omitting the suspension and recovery operations of the cloud hard disk read and write IO at the storage level in the prior art, effectively saving the time overhead caused by the operation; by synchronizing the data in the file system cache to the cloud hard disk, the consistency group snapshot has data consistency at the file system level, avoiding the situation in the prior art where data recovery fails due to the fact that some data in the file system of the cloud hard disk has not been snapshotted when restoring the snapshot; by directly creating a snapshot for the consistency group, the convenience of operation is improved, avoiding the tedious situation of operating the cloud hard disks in the consistency group in sequence, and ensuring that the operation time of all cloud hard disks in the consistency group is consistent at the back-end storage level when creating snapshots, thereby ensuring the data consistency in the cloud hard disk snapshot; by unfreezing the file systems of all cloud hard disks in the consistency group, the data in the application can continue to be written to the file system.

[0055] In some embodiments, sending a first request to its virtual machine through the cloud platform, and freezing the file system corresponding to each cloud hard disk in the consistency group based on the first request through the virtual machine includes: calling a first interface in the virtualization platform management tool through the cloud platform, and obtaining each mount point information from the database and transmitting it to the first interface respectively; in response to each mount point information being transmitted to the first interface respectively, sending a first control instruction to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction.

[0056] In some embodiments, sending a third request to the virtual machine through the cloud platform, and unfreezing the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine includes: sending a second control instruction to the virtualization platform management tool through the cloud platform, and obtaining each mount point information from the database based on the second control instruction; calling the second interface in the virtualization platform management tool through the cloud platform and passing each mount point information into it; in response to passing each mount point information into the second interface, sending the second control instruction to the virtual machine through the virtualization platform management tool, so that the virtual machine unfreezes the frozen file systems corresponding to each cloud hard disk based on the second control instruction.

[0057] In the above embodiment, by obtaining the mount point information of the file system, the corresponding file system can be located to operate the file system. The first interface and the second interface are APIs (application programming interfaces). APIs are some predefined interfaces (such as functions, HTTP interfaces), or agreements that cannot be connected to the components of a software system, which are used to provide a set of routines that applications and developers can access based on certain software or hardware without having to access the source code or understand the details of the internal working mechanism.

[0058] In some embodiments, sending the first control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction includes: sending the first control instruction to the operating system of the virtual machine through the virtualization platform management tool, and executing the first control instruction through the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk.

[0059] In some embodiments, executing a first control instruction through the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk includes: in response to the operating system being Linux, executing the first control instruction through the operating system to call the Fsfreeze method and freezing the file system corresponding to each cloud hard disk through the Fsfreeze method, and executing the sync (asynchronous) method to write the cache in the file system to the corresponding cloud hard disk.

[0060] In the above embodiment, Linux stands for GNU / Linux, which is a UNIX-like operating system that is free to use and freely disseminated, and is a multi-user, multi-tasking, multi-threaded and multi-CPU operating system based on POSIX. Fsfreeze is a command that can suspend or resume access to a file system.

[0061] In some embodiments, freezing the file system corresponding to each cloud hard disk in the consistency group based on the first request through the virtual machine includes: freezing the file system corresponding to each cloud hard disk in the consistency group belonging to the same cloud host based on the first request through the virtual machine.

[0062] In this embodiment, all file systems are frozen simultaneously, which requires that all cloud hard disks must belong to the same cloud host.

[0063] In some embodiments, the virtualization platform management tool includes libvirt.

[0064] In this embodiment, libvirt is an open source API, background program and management tool for managing virtualization platforms. The virtualization platform management tool libvirt can easily manage virtualization platforms such as KVM, Xen and QEMU.

[0065] A second aspect of the embodiments of the present invention further provides a system for creating a snapshot. Figure 2 FIG. 2 is a schematic diagram of an embodiment of a system for creating a snapshot provided by the present invention. Figure 2 As shown, a system for creating snapshots includes: a file system freezing module 10, configured to send a first request to its virtual machine through a cloud platform, and freeze the file system corresponding to each cloud hard disk in a consistency group based on the first request through the virtual machine, including: sending a first control instruction to a virtualization platform management tool through the cloud platform, and obtaining the mount point information of the file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing each mount point information in a database respectively; a data writing module 20, configured to write the data in the cache of each file system to the corresponding cloud hard disk respectively in response to each file system being frozen; a snapshot creation module 30, configured to send a second request to the backend storage through the cloud platform in response to the data in the cache of each file system being written to the corresponding cloud hard disk, and create snapshots for each cloud hard disk in the consistency group based on the second request through the backend storage; and a freeze release module 40, configured to send a third request to the virtual machine through the cloud platform in response to the completion of creating snapshots for each cloud hard disk in the consistency group, and release the frozen file systems corresponding to each cloud hard disk respectively based on the third request through the virtual machine.

[0066] In some embodiments, the file system freezing module 10 is further configured to send a first control instruction to the virtualization platform management tool through the cloud platform, and obtain the mount point information of the file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and store each mount point information in the database respectively; call the first interface in the virtualization platform management tool through the cloud platform, and obtain each mount point information from the database and transmit it to the first interface respectively; in response to each mount point information being transmitted to the first interface respectively, send the first control instruction to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction.

[0067] In some embodiments, the unfreeze module 40 includes a third request module, which is configured to send a second control instruction to the virtualization platform management tool through the cloud platform, and obtain each mount point information from the database based on the second control instruction; call the second interface in the virtualization platform management tool through the cloud platform and pass each mount point information thereto; in response to passing each mount point information into the second interface, send the second control instruction to the virtual machine through the virtualization platform management tool, so that the virtual machine unfreezes the frozen file systems corresponding to each cloud hard disk based on the second control instruction.

[0068] In some embodiments, the third request module includes a first control instruction module, which is configured to send the first control instruction to the operating system of the virtual machine through the virtualization platform management tool, and execute the first control instruction through the operating system to enable the virtual machine to freeze the file system corresponding to each cloud hard disk.

[0069] In some embodiments, the first control instruction module includes an operating system module, which is configured to execute the first control instruction through the operating system to call the Fsfreeze method in response to the operating system being Linux and freeze the file system corresponding to each cloud hard disk through the Fsfreeze method.

[0070] In some embodiments, the file system freezing module 10 includes a cloud hard disk module configured to freeze the file systems corresponding to the cloud hard disks in the consistency group and belonging to the same cloud host based on the first request through the virtual machine.

[0071] In some embodiments, the virtualization platform management tool includes libvirt.

[0072] A third aspect of the embodiments of the present invention further provides a computer-readable storage medium. Figure 3 A schematic diagram of a computer-readable storage medium for implementing a method for creating a snapshot according to an embodiment of the present invention is shown. Figure 3 As shown, the computer-readable storage medium 3 stores computer program instructions 31, which can be executed by a processor. When the computer program instructions 31 are executed, the method of any of the above embodiments is implemented.

[0073] It should be understood that, in the absence of mutual conflicts, all the embodiments, features and advantages described above for the method for creating a snapshot according to the present invention are also applicable to the system and storage medium for creating a snapshot according to the present invention.

[0074] A fourth aspect of the embodiments of the present invention further provides a computer device, including a memory 402 and a processor 401, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method of any one of the above embodiments is implemented.

[0075] like Figure 4 FIG. 1 is a schematic diagram of the hardware structure of a computer device for executing a method for creating a snapshot provided by the present invention. Figure 4 Taking the computer device shown in FIG. 4 as an example, the computer device includes a processor 401 and a memory 402, and may also include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means. Figure 4The example of the bus connection is taken as an example. The input device 403 can receive input digital or character information, and generate key signal input related to user settings and function control of the system for creating snapshots. The output device 404 can include display devices such as display screens.

[0076] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for creating a snapshot in the embodiment of the present application. The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of the method for creating a snapshot, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0077] The processor 401 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 402, that is, implements the method of creating a snapshot in the above method embodiment.

[0078] Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. As an example and not by way of limitation, a nonvolatile memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory may include a random access memory (RAM), which may act as an external cache memory. As an example and not by way of limitation, RAM may be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.

[0079] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or implemented as hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.

[0080] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0081] It should be understood that, as used herein, the singular form "a" or "an" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the items listed in association. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments.

[0082] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A method for creating a snapshot, characterized in that: The following steps are involved: Sending a first request to its virtual machine through the cloud platform, and freezing the file system corresponding to each cloud hard disk in the consistency group through the virtual machine based on the first request; In response to each file system being frozen, the data in the cache of each file system is written to the corresponding cloud hard disk respectively; In response to data in the cache of each file system being written to the corresponding cloud hard disk, a second request is sent to the backend storage through the cloud platform, and a snapshot is created for each cloud hard disk in the consistency group based on the second request through the backend storage; In response to the completion of creating snapshots for each cloud hard disk in the consistency group, a third request is sent to the virtual machine through the cloud platform, and the frozen file systems corresponding to each cloud hard disk are respectively unfrozen through the virtual machine based on the third request; Sending a first request to a virtual machine through a cloud platform, and freezing a file system corresponding to each cloud hard disk in a consistency group through the virtual machine based on the first request includes: Sending a first control instruction to a virtualization platform management tool through the cloud platform, and obtaining mount point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing each mount point information in a database respectively; Calling the first interface in the virtualization platform management tool through the cloud platform, and obtaining each mount point information from the database and transmitting it to the first interface respectively; In response to the information of each mount point being transmitted to the first interface respectively, the first control instruction is sent to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction; Sending a third request to the virtual machine through the cloud platform, and unfreezing the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine includes: Sending a second control instruction to the virtualization platform management tool through the cloud platform, and acquiring each mount point information from the database based on the second control instruction; Calling the second interface in the virtualization platform management tool through the cloud platform and passing the information of each mount point into it; In response to the input of each mount point information into the second interface, the second control instruction is sent to the virtual machine through the virtualization platform management tool, so that the virtual machine unfreezes the frozen file system corresponding to each cloud hard disk based on the second control instruction; Sending the first control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction includes: Sending the first control instruction to the operating system of the virtual machine through the virtualization platform management tool, and executing the first control instruction through the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk; Executing the first control instruction by the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk includes: In response to the operating system being Linux, the first control instruction is executed by the operating system to call an Fsfreeze method and freeze the file system corresponding to each cloud hard disk by using the Fsfreeze method.

2. The method according to claim 1 is characterized in that freezing the file system corresponding to each cloud hard disk in the consistency group based on the first request by the virtual machine includes: The file system corresponding to each cloud hard disk belonging to the same cloud host in the consistency group is frozen through the virtual machine based on the first request.

3. The method according to claim 1, characterized in that: The virtualization platform management tool includes libvirt.

4. A system for creating a snapshot, characterized in that: include: A file system freezing module, configured to send a first request to its virtual machine through the cloud platform, and freeze the file system corresponding to each cloud hard disk in the consistency group based on the first request through the virtual machine; A data writing module, configured to write the data in the cache of each file system into the corresponding cloud hard disk in response to each file system being frozen; A snapshot creation module, configured to send a second request to the backend storage through the cloud platform in response to the data in the cache of each file system being written to the corresponding cloud hard disk, and to create a snapshot for each cloud hard disk in the consistency group based on the second request through the backend storage; as well as a freeze unfreezing module configured to, in response to the completion of creating snapshots for each cloud hard disk in the consistency group, send a third request to the virtual machine through the cloud platform, and unfreeze the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine; Sending a first request to a virtual machine through a cloud platform, and freezing a file system corresponding to each cloud hard disk in a consistency group through the virtual machine based on the first request includes: Sending a first control instruction to a virtualization platform management tool through the cloud platform, and obtaining mount point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing each mount point information in a database respectively; Calling the first interface in the virtualization platform management tool through the cloud platform, and obtaining each mount point information from the database and transmitting it to the first interface respectively; In response to the information of each mount point being transmitted to the first interface respectively, the first control instruction is sent to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction; Sending a third request to the virtual machine through the cloud platform, and unfreezing the frozen file systems corresponding to each cloud hard disk based on the third request through the virtual machine includes: Sending a second control instruction to the virtualization platform management tool through the cloud platform, and acquiring each mount point information from the database based on the second control instruction; Calling the second interface in the virtualization platform management tool through the cloud platform and passing the information of each mount point into it; In response to the input of each mount point information into the second interface, the second control instruction is sent to the virtual machine through the virtualization platform management tool, so that the virtual machine unfreezes the frozen file system corresponding to each cloud hard disk based on the second control instruction; Sending the first control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction includes: Sending the first control instruction to the operating system of the virtual machine through the virtualization platform management tool, and executing the first control instruction through the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk; Executing the first control instruction by the operating system so that the virtual machine freezes the file system corresponding to each cloud hard disk includes: In response to the operating system being Linux, the first control instruction is executed by the operating system to call an Fsfreeze method and freeze the file system corresponding to each cloud hard disk by using the Fsfreeze method.

5. A computer-readable storage medium, characterized in that: Computer program instructions are stored, and when the computer program instructions are executed, the method according to any one of claims 1 to 3 is implemented.

6. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 3 is performed.

Citation Information

Patent Citations

  • Converting machines to virtual machines

    CN101443748A

  • Version-Controlling Storage Volume Snapshots

    US20180143883A1