CN113609075A - Method, system, storage medium and equipment for creating snapshot - Google Patents

Method, system, storage medium and equipment for creating snapshot Download PDF

Info

Publication number
CN113609075A
CN113609075A CN202110951315.4A CN202110951315A CN113609075A CN 113609075 A CN113609075 A CN 113609075A CN 202110951315 A CN202110951315 A CN 202110951315A CN 113609075 A CN113609075 A CN 113609075A
Authority
CN
China
Prior art keywords
cloud
virtual machine
request
cloud hard
control instruction
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.)
Granted
Application number
CN202110951315.4A
Other languages
Chinese (zh)
Other versions
CN113609075B (en
Inventor
江治林
雷跃辉
沈新新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data 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 Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202110951315.4A priority Critical patent/CN113609075B/en
Publication of CN113609075A publication Critical patent/CN113609075A/en
Application granted granted Critical
Publication of CN113609075B publication Critical patent/CN113609075B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a system, a storage medium and a device for creating a snapshot, wherein the method comprises the following steps: sending a first request to a virtual machine of the 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; in response to the fact that all the file systems are frozen, respectively writing the data in the caches of all the file systems into the corresponding cloud hard disks; responding to the fact that data in the cache of each file system are written into the corresponding cloud hard disk, sending a second request to the back-end storage through the cloud platform, and creating snapshots for the cloud hard disks in the consistency group respectively through the back-end storage based on the second request; and in response to the completion of respectively creating snapshots for the cloud hard disks in the consistency group, sending a third request to the virtual machine through the cloud platform, and respectively freezing and removing the frozen file systems corresponding to the cloud hard disks through the virtual machine based on the third request. The invention realizes the reliability of creating the snapshot for the consistency group by the cloud platform.

Description

Method, system, storage medium and equipment for creating snapshot
Technical Field
The present invention relates to the field of cloud computing technologies, and in particular, to a method, a system, a storage medium, and a device for creating a snapshot.
Background
Currently, in some important application scenarios, such as large-scale database applications, tables, logs, and configuration files of a database are stored in a plurality of different cloud hard disks, and data in the cloud hard disks are correlated and interdependent. When snapshots need to be created for all cloud hard disks, if the time for creating the snapshots of the cloud hard disks is inconsistent, data states in the snapshots of the cloud hard disks may be inconsistent. The cloud platform introduces the concept of consistency groups. Data in the same application are written into each file system in real time, and then the data in the file systems can be written into each cloud hard disk in real time. When snapshots need to be created for all cloud hard disks used by the same application, all the cloud hard disks are added into one consistency group, so that the snapshot creation operation can be directly executed on the consistency group, and the snapshot creation operation does not need to be executed on each cloud hard disk.
The operation core steps of the consistency group snapshot of the current cloud platform are as follows: 1. all cloud hard disks in the consistency group can temporarily hang read-write IO of all cloud hard disks at the same time point; 2. all the cloud hard disks respectively create corresponding snapshots at the same time point; 3. after the snapshot is created, all the cloud hard disks recover reading and writing IO simultaneously. The current operation steps can only realize the operation consistency of the storage level, and partial data possibly exist in a file system and a cache of the file system and are not written into the cloud hard disk through read-write IO, so that the data states in the cloud hard disks are inconsistent, and errors are caused when the cloud hard disk snapshots recover the data, so that the data recovery fails.
Disclosure of Invention
In view of this, the present invention provides a method, a system, a storage medium, and a 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, data in a file system of the cloud platform is not synchronized to a cloud hard disk, so that data recovered from a snapshot on the cloud hard disk in a later period is incorrect.
Based on the above object, the present invention provides a method for creating a snapshot, comprising the following steps:
the method for freezing the file system corresponding to each cloud hard disk in the consistency group comprises the following steps of sending a first request to a virtual machine of the cloud platform 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:
sending a first control instruction to a virtualization platform management tool through the cloud platform, acquiring mounting point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing the mounting point information into a database respectively;
in response to the fact that all the file systems are frozen, respectively writing the data in the caches of all the file systems into the corresponding cloud hard disks;
responding to the fact that data in the cache of each file system are written into the corresponding cloud hard disk, sending a second request to the back-end storage through the cloud platform, and creating snapshots for the cloud hard disks in the consistency group respectively through the back-end storage based on the second request;
and in response to the completion of respectively creating snapshots for the cloud hard disks in the consistency group, sending a third request to the virtual machine through the cloud platform, and respectively freezing and removing the frozen file systems corresponding to the cloud hard disks through the virtual machine based on the third request.
In some embodiments, sending, by the cloud platform, a first request to the virtual machine thereof, and freezing, by the virtual machine, the file system corresponding to each cloud hard disk in the consistency group based on the first request includes:
calling a first interface in a virtualization platform management tool through a cloud platform, acquiring information of each mounting point from a database and respectively transmitting the information into the first interface;
responding to the fact that the information of each mounting point is respectively transmitted into the first interface, and 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.
In some embodiments, sending, by the cloud platform, the third request to the virtual machine, and performing, by the virtual machine, freeze-releasing, based on the third request, the frozen file systems corresponding to the cloud hard disks respectively includes:
sending a second control instruction to a virtualization platform management tool through the cloud platform, and acquiring information of each mounting point from the database based on the second control instruction;
calling a second interface in the virtualization platform management tool through the cloud platform and transmitting information of each mounting point into the second interface;
and responding to the information of each mounting point transmitted into the second interface, and sending a second control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine can freeze and unfreeze the frozen file system corresponding to each cloud hard disk based on the second control instruction.
In some embodiments, sending, by the virtualization platform management tool, the first control instruction to the virtual machine, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction includes:
and sending the first control instruction to an operating system of the virtual machine through a virtualization platform management tool, and executing the first control instruction through the operating system so that the virtual machine freezes a file system corresponding to each cloud hard disk.
In some embodiments, executing, by the operating system, the first control instruction to cause the virtual machine to freeze the file system corresponding to each cloud hard disk includes:
and responding to the fact that the operating system is Linux, executing a first control instruction through the operating system to call an Fsfreeze method, and freezing the file systems corresponding to the cloud hard disks through the Fsfreeze method.
In some embodiments, freezing, by the virtual machine, the file system corresponding to each cloud hard disk in the consistency group based on the first request includes:
and freezing file systems corresponding to the cloud hard disks belonging to the same cloud host in the consistency group through the virtual machine based on the first request.
In some embodiments, the virtualization platform management tool comprises libvirt.
In another aspect of the present invention, a system for creating a snapshot is further provided, including:
the file system freezing module is configured to send a first request to a virtual machine of the cloud platform through the cloud platform, and the step of freezing, through the virtual machine, a file system corresponding to each cloud hard disk in the consistency group based on the first request includes:
sending a first control instruction to a virtualization platform management tool through the cloud platform, acquiring mounting point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing the mounting point information into a database respectively;
the data writing module is configured to respond to that the file systems are all frozen, and respectively write the data in the caches of the file systems into the corresponding cloud hard disks;
the snapshot creating module is configured to respond that data in the cache of each file system are written into the corresponding cloud hard disk, send a second request to the back-end storage through the cloud platform, and create snapshots for the cloud hard disks in the consistency group respectively through the back-end storage based on the second request; and
and the freeze removing module is configured to respond to the completion of creating snapshots for the cloud hard disks in the consistency group, send a third request to the virtual machine through the cloud platform, and respectively freeze and remove the frozen file systems corresponding to the cloud hard disks through the virtual machine based on the third request.
In yet another aspect of the present invention, there is also provided a computer readable storage medium storing computer program instructions which, when executed, implement any one of the methods described above.
In yet another aspect of the present invention, a computer device is provided, which includes a memory and a processor, the memory storing a computer program, the computer program executing any one of the above methods when executed by the processor.
The invention has at least the following beneficial technical effects:
1. according to the invention, the file systems of all the cloud hard disks in the consistency group are simultaneously frozen, so that data in application cannot be continuously written into the file systems, and the data in the cloud hard disks are not updated any more, and further, the operation of suspending and recovering the read-write IO of the cloud hard disks on the storage layer surface in the prior art is omitted, and the time overhead brought by the operation is effectively saved;
2. the data in the cache of the file system is synchronized to the cloud hard disk, so that the consistency group snapshot has the data consistency of the file system level, and the condition that the data recovery fails because a part of data in the file system of the cloud hard disk is not snapshot-created in the snapshot recovery process in the prior art is avoided;
3. by directly creating snapshots for the consistency group, the convenience of operation is improved, the complex situation that the cloud hard disks in the consistency group are sequentially operated is avoided, and the consistency of the operation time of a back-end storage layer is ensured when all the cloud hard disks in the consistency group create the snapshots, so that the data consistency in the snapshots of the cloud hard disks is ensured; the file systems of all the cloud hard disks in the consistency group are unfrozen, so that the data in the application can be continuously written into the file systems.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a diagram illustrating a method for creating a snapshot according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a system for creating snapshots, according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a computer-readable storage medium that implements a method of creating a snapshot according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a hardware structure of a computer device for executing a method for creating a snapshot according to an embodiment of the present invention;
fig. 5 is a relationship diagram of structures in the method for creating a snapshot according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two non-identical entities with the same name or different parameters, and it is understood that "first" and "second" are only used for convenience of expression and should not be construed as limiting the embodiments of the present invention. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements does not include all of the other steps or elements inherent in the list.
In view of the above object, a first aspect of the embodiments of the present invention proposes an embodiment of a method for creating a snapshot. Fig. 1 is a schematic diagram illustrating an embodiment of a method for creating a snapshot provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
step S10, sending a first request to the virtual machine thereof through the cloud platform, and freezing, by the virtual machine, the file system corresponding to each cloud hard disk in the consistency group based on the first request includes:
sending a first control instruction to a virtualization platform management tool through the cloud platform, acquiring mounting point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing the mounting point information into a database respectively;
step S20, in response to the fact that all the file systems are frozen, respectively writing the data in the caches of all the file systems into the corresponding cloud hard disks;
step S30, responding to the fact that data in the cache of each file system are written into the corresponding cloud hard disks, sending a second request to the back-end storage through the cloud platform, and creating snapshots for the cloud hard disks in the consistency group respectively through the back-end storage based on the second request;
step S40, in response to the completion of creating snapshots for the cloud hard disks in the consistency group, sending a third request to the virtual machine through the cloud platform, and performing freeze removal on the frozen file systems corresponding to the cloud hard disks by the virtual machine based on the third request.
In the embodiment of the invention, the cloud platform is a service based on hardware resources and software resources, and provides computing, network and storage capabilities. OpenStack is an open source cloud computing management platform project, and is one of cloud platforms which are most widely applied in the current market, and a plurality of cloud platform service providers in China use OpenStack architecture to develop the cloud platform. The cloud hard disk is a general name of the OpenStack cloud platform for the block device, the cloud hard disk can be mounted on a cloud host and used as a physical hard disk, and the cloud host refers to a virtual machine managed in the cloud computing platform. A consistency group may logically divide all cloud hard disks used by one application into one group. The back-end storage refers to a storage device managed by a cloud platform storage module, only part of storage devices of manufacturers support the consistency group snapshot function at present, and the back-end storage in this embodiment may be G2 storage.
In the embodiment of the present invention, as shown in fig. 5, both the application and the file system are located in the memory of the cloud host, and the cloud hard disk is located in the physical device stored at the back end. The cloud hard disk can be normally used by the cloud host only by creating a file system in the memory and then mounting the file system on a specified directory of the cloud host. The mounting point information refers to a directory mounted on an operating system of the cloud host by the file system, and the data transmission from the file system to the cloud hard disk data can be prevented through the mounting point information. Based on the method, the state of writing data from a plurality of file systems to the cloud hard disk can be effectively maintained or unified, and the storage process from the memory to the cloud hard disk is enabled to be consistent.
Specifically, data in the application needs to be transmitted to a file system corresponding to the cloud hard disk first, and then transmitted to the cloud hard disk from the file system or a file system cache. When the freezing operation is started, the corresponding file system in the memory is frozen according to the mounting point information (corresponding directory) to prevent the file system from writing data in the cloud hard disk.
In the embodiment of the invention, the file systems of all the cloud hard disks in the consistency group are simultaneously frozen, so that the data in the application cannot be continuously written into the file systems, and the data in the cloud hard disks are not updated any more, thereby omitting the temporary suspension and recovery operation of the cloud hard disk read-write IO on the storage layer surface in the prior art, and effectively saving the time overhead brought by the operation; the data in the cache of the file system is synchronized to the cloud hard disk, so that the consistency group snapshot has the data consistency of the file system level, and the condition that the data recovery fails because a part of data in the file system of the cloud hard disk is not snapshot-created in the snapshot recovery process in the prior art is avoided; by directly creating snapshots for the consistency group, the convenience of operation is improved, the complex situation that the cloud hard disks in the consistency group are sequentially operated is avoided, and the consistency of the operation time of a back-end storage layer is ensured when all the cloud hard disks in the consistency group create the snapshots, so that the data consistency in the snapshots of the cloud hard disks is ensured; the file systems of all the cloud hard disks in the consistency group are unfrozen, so that the data in the application can be continuously written into the file systems.
In some embodiments, sending, by the cloud platform, a first request to the virtual machine thereof, and freezing, by the virtual machine, the file system corresponding to each cloud hard disk in the consistency group based on the first request includes: calling a first interface in a virtualization platform management tool through a cloud platform, acquiring information of each mounting point from a database and respectively transmitting the information into the first interface; responding to the fact that the information of each mounting point is respectively transmitted into the first interface, and 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.
In some embodiments, sending, by the cloud platform, the third request to the virtual machine, and performing, by the virtual machine, freeze-releasing, based on the third request, the frozen file systems corresponding to the cloud hard disks respectively includes: sending a second control instruction to a virtualization platform management tool through the cloud platform, and acquiring information of each mounting point from the database based on the second control instruction; calling a second interface in the virtualization platform management tool through the cloud platform and transmitting information of each mounting point into the second interface; and responding to the information of each mounting point transmitted into the second interface, and sending a second control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine can freeze and unfreeze the frozen file system corresponding to each cloud hard disk based on the second control instruction.
In the above embodiment, by obtaining the mounting 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 program interfaces). An API is a predefined interface (e.g., a function, HTTP interface), or a convention that does not allow components of a software system to interface, and is used to provide a set of routines that applications and developers can access based on certain software or hardware without accessing source code or understanding the details of the internal workings.
In some embodiments, sending, by the virtualization platform management tool, the first control instruction to the virtual machine, so that the virtual machine freezes the file system corresponding to each cloud hard disk based on the first control instruction includes: and sending the first control instruction to an operating system of the virtual machine through a virtualization platform management tool, and executing the first control instruction through the operating system so that the virtual machine freezes a file system corresponding to each cloud hard disk.
In some embodiments, executing, by the operating system, the first control instruction to cause the virtual machine to freeze the file system corresponding to each cloud hard disk includes: and responding to the fact that the operating system is Linux, executing a first control instruction through the operating system to call an Fsfreeze method, freezing the file systems corresponding to the cloud hard disks through the Fsfreeze method, and executing a sync (asynchronous) method to write the caches in the file systems into the corresponding cloud hard disks.
In the embodiment, Linux is called GNU/Linux entirely, is a UNIX-like operating system which is free to use and spread freely, and is a POSIX-based multi-user, multi-task, multi-thread-supporting and multi-CPU-based operating system. Fsfreeze is a command that can pause or resume access to the file system.
In some embodiments, freezing, by the virtual machine, the file system corresponding to each cloud hard disk in the consistency group based on the first request includes: and freezing file systems corresponding to the cloud hard disks belonging to the same cloud host in the consistency group through the virtual machine based on the first request.
In this embodiment, all file systems are frozen at the same time, and all cloud hard disks are required to belong to the same cloud host.
In some embodiments, the virtualization platform management tool comprises libvirt.
In this embodiment, libvirt is an API, a daemon, and a management tool for managing the open source of the virtualization platform. The virtualization platform management tool libvirt can conveniently manage virtualization platforms such as KVM, Xen and QEMU.
In a second aspect of the embodiments of the present invention, a system for creating a snapshot is also provided. FIG. 2 is a schematic diagram illustrating an embodiment of a system for creating snapshots provided by the present invention. As shown in fig. 2, a system for creating a snapshot includes: the file system freezing module 10 is configured to send a first request to a virtual machine of the cloud platform, and the freezing, by the virtual machine, a file system corresponding to each cloud hard disk in the consistency group based on the first request includes: sending a first control instruction to a virtualization platform management tool through the cloud platform, acquiring mounting point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing the mounting point information into a database respectively; the data writing module 20 is configured to, in response to that each file system is frozen, respectively write data in the cache of each file system into the corresponding cloud hard disk; the snapshot creating module 30 is configured to respond that the data in the cache of each file system is written into the corresponding cloud hard disk, send a second request to the backend storage through the cloud platform, 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 the cloud hard disks in the consistency group, and freeze release the frozen file systems corresponding to the cloud hard disks by the virtual machine based on the third request.
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, obtain mounting point information of the file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and store the mounting point information in the database respectively; calling a first interface in a virtualization platform management tool through a cloud platform, acquiring information of each mounting point from a database and respectively transmitting the information into the first interface; responding to the fact that the information of each mounting point is respectively transmitted into the first interface, and 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.
In some embodiments, the freeze release module 40 includes a third request module configured to send a second control instruction to the virtualization platform management tool through the cloud platform, and obtain information of each mount point from the database based on the second control instruction; calling a second interface in the virtualization platform management tool through the cloud platform and transmitting information of each mounting point into the second interface; and responding to the information of each mounting point transmitted into the second interface, and sending a second control instruction to the virtual machine through the virtualization platform management tool so that the virtual machine can freeze and unfreeze the frozen file system corresponding to each cloud hard disk based on the second control instruction.
In some embodiments, the third request module includes a first control instruction module configured to send the first control instruction to an operating system of the virtual machine through the virtualization platform management tool, and execute the first control instruction through the operating system, so that the virtual machine freezes a file system corresponding to each cloud hard disk.
In some embodiments, the first control instruction module includes an operating system module configured to, in response to the operating system being Linux, execute, by the operating system, the first control instruction to call the Fsfreeze method and freeze, by the Fsfreeze method, the file system corresponding to each cloud hard disk.
In some embodiments, the file system freezing module 10 includes a cloud hard disk module configured to freeze, by the virtual machine, a file system corresponding to each cloud hard disk belonging to the same cloud host in the consistency group based on the first request.
In some embodiments, the virtualization platform management tool comprises libvirt.
In a third aspect of the embodiment of the present invention, a computer-readable storage medium is further provided, and fig. 3 illustrates a schematic diagram of a computer-readable storage medium implementing a method for creating a snapshot according to an embodiment of the present invention. As shown in fig. 3, the computer-readable storage medium 3 stores computer program instructions 31, the computer program instructions 31 being executable by a processor. The computer program instructions 31 when executed implement the method of any of the embodiments described above.
It should be understood that all of the embodiments, features and advantages set forth above with respect to the method of creating a snapshot according to the present invention apply equally, without conflict therewith, to the system and storage medium of creating a snapshot according to the present invention.
In a fourth aspect of the embodiments of the present invention, there is further provided a computer device, including a memory 402 and a processor 401, where the memory stores a computer program, and the computer program, when executed by the processor, implements the method of any one of the above embodiments.
Fig. 4 is a schematic hardware structural diagram of an embodiment of a computer device for executing the method for creating a snapshot according to the present invention. Taking the computer device shown in fig. 4 as an example, the computer device includes a processor 401 and a memory 402, and may further 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 by a bus or other means, and fig. 4 illustrates an example of a connection by a bus. The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the system that created the snapshot. The output device 404 may include a display device such as a display screen.
The memory 402, which is a non-volatile computer-readable storage medium, may 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 embodiments of the present application. The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created using a method of creating a snapshot, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 402 may optionally include memory located remotely from processor 401, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor 401 executes various functional applications of the server and data processing by running nonvolatile software programs, instructions and modules stored in the memory 402, that is, implements the method of creating a snapshot of the above-described method embodiment.
Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method of creating a snapshot, comprising the steps of:
sending a first request to a virtual machine of the cloud platform, and freezing a file system corresponding to each cloud hard disk in a consistency group by the virtual machine based on the first request comprises:
sending a first control instruction to a virtualization platform management tool through the cloud platform, acquiring mounting point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing the mounting point information into a database respectively;
in response to the fact that all the file systems are frozen, respectively writing the data in the caches of all the file systems into the corresponding cloud hard disks;
responding to that data in the cache of each file system is written into the corresponding cloud hard disk, sending a second request to back-end storage through the cloud platform, and creating snapshots for the cloud hard disks in the consistency group respectively through the back-end storage based on the second request;
and in response to the completion of creating snapshots for the cloud hard disks in the consistency group, sending a third request to the virtual machine through the cloud platform, and respectively freezing and removing the frozen file systems corresponding to the cloud hard disks through the virtual machine based on the third request.
2. The method of claim 1, wherein sending, by a cloud platform, a first request to a virtual machine thereof, and freezing, by the virtual machine, a file system corresponding to each cloud hard disk in a consistency group based on the first request further comprises:
calling a first interface in the virtualization platform management tool through the cloud platform, acquiring information of each mounting point from the database, and respectively transmitting the information into the first interface;
responding to the fact that the information of each mounting point is respectively transmitted into the first interface, and 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.
3. The method of claim 2, wherein sending, by the cloud platform, a third request to the virtual machine, and performing, by the virtual machine, unfreezing, based on the third request, the frozen file systems corresponding to the cloud hard disks respectively comprises:
sending a second control instruction to the virtualization platform management tool through the cloud platform, and acquiring information of each mounting point from the database based on the second control instruction;
calling a second interface in the virtualization platform management tool through the cloud platform and transmitting information of each mounting point into the second interface;
and responding to the information of each mounting point transmitted into the second interface, and sending the second control instruction to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes and unfreezes the frozen file system corresponding to each cloud hard disk based on the second control instruction.
4. The method according to claim 2, wherein sending the first control instruction to the virtual machine through the virtualization platform management tool, so that the virtual machine freezes a file system corresponding to each cloud hard disk based on the first control instruction comprises:
and sending the first control instruction to an 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 a file system corresponding to each cloud hard disk.
5. The method of claim 4, wherein executing, by the operating system, the first control instruction to cause the virtual machine to freeze a file system corresponding to each cloud hard disk comprises:
and in response to the fact that the operating system is Linux, executing the first control instruction through the operating system to call an Fsfreeze method, and freezing file systems corresponding to the cloud hard disks through the Fsfreeze method.
6. The method of claim 1, wherein freezing, by the virtual machine based on the first request, a file system corresponding to each cloud hard disk in a consistency group comprises:
and freezing file systems corresponding to the cloud hard disks belonging to the same cloud host in the consistency group through the virtual machine based on the first request.
7. The method of claim 2, wherein the virtualized platform management tool comprises libvirt.
8. A system for creating snapshots, comprising:
the file system freezing module is configured to send a first request to a virtual machine of the cloud platform, and the freezing, by the virtual machine, of a file system corresponding to each cloud hard disk in the consistency group based on the first request includes:
sending a first control instruction to a virtualization platform management tool through the cloud platform, acquiring mounting point information of a file system corresponding to each cloud hard disk in the consistency group based on the first control instruction, and storing the mounting point information into a database respectively;
the data writing module is configured to respond to that the file systems are all frozen, and respectively write the data in the caches of the file systems into the corresponding cloud hard disks;
the snapshot creating module is configured to respond that data in the cache of each file system is written into the corresponding cloud hard disk, send a second request to the back-end storage through the cloud platform, and create snapshots for the cloud hard disks in the consistency group respectively through the back-end storage based on the second request; and
and the freeze removing module is configured to respond to the completion of creating snapshots for the cloud hard disks in the consistency group, send a third request to the virtual machine through the cloud platform, and respectively freeze the frozen file systems corresponding to the cloud hard disks through the virtual machine based on the third request.
9. A computer-readable storage medium, characterized in that computer program instructions are stored which, when executed, implement the method according to any one of claims 1-7.
10. A computer device comprising a memory and a processor, characterized in that the memory has stored therein a computer program which, when executed by the processor, performs the method according to any one of claims 1-7.
CN202110951315.4A 2021-08-18 2021-08-18 Method, system, storage medium and equipment for creating snapshot Active CN113609075B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110951315.4A CN113609075B (en) 2021-08-18 2021-08-18 Method, system, storage medium and equipment for creating snapshot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110951315.4A CN113609075B (en) 2021-08-18 2021-08-18 Method, system, storage medium and equipment for creating snapshot

Publications (2)

Publication Number Publication Date
CN113609075A true CN113609075A (en) 2021-11-05
CN113609075B CN113609075B (en) 2024-10-18

Family

ID=78341145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110951315.4A Active CN113609075B (en) 2021-08-18 2021-08-18 Method, system, storage medium and equipment for creating snapshot

Country Status (1)

Country Link
CN (1) CN113609075B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422537A (en) * 2022-03-28 2022-04-29 维塔科技(北京)有限公司 Multi-cloud storage system, multi-cloud data reading and writing method and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101443748A (en) * 2006-05-08 2009-05-27 微软公司 Converting machines to virtual machines
US20110047340A1 (en) * 2009-08-21 2011-02-24 James Robert Olson Proxy Backup of Virtual Disk Image Files on NAS Devices
US7925631B1 (en) * 2007-08-08 2011-04-12 Network Appliance, Inc. Method and system for reporting inconsistency of file system persistent point in time images and automatically thawing a file system
US8010495B1 (en) * 2006-04-25 2011-08-30 Parallels Holdings, Ltd. Method and system for fast generation of file system snapshot bitmap in virtual environment
CN106648830A (en) * 2016-11-18 2017-05-10 国云科技股份有限公司 Method for performing online snapshot on virtual machine disk
US20180143883A1 (en) * 2016-11-22 2018-05-24 International Business Machines Corporation Version-Controlling Storage Volume Snapshots
CN110196755A (en) * 2019-05-07 2019-09-03 腾讯科技(深圳)有限公司 A kind of virtual machine snapshot management method, device, server and storage medium
CN111078368A (en) * 2019-12-26 2020-04-28 浪潮电子信息产业股份有限公司 Memory snapshot method and device of cloud computing platform virtual machine and readable storage medium
CN112162882A (en) * 2020-09-04 2021-01-01 北京浪潮数据技术有限公司 Data hot snapshot method, device, equipment and computer readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8010495B1 (en) * 2006-04-25 2011-08-30 Parallels Holdings, Ltd. Method and system for fast generation of file system snapshot bitmap in virtual environment
CN101443748A (en) * 2006-05-08 2009-05-27 微软公司 Converting machines to virtual machines
US7925631B1 (en) * 2007-08-08 2011-04-12 Network Appliance, Inc. Method and system for reporting inconsistency of file system persistent point in time images and automatically thawing a file system
US20110047340A1 (en) * 2009-08-21 2011-02-24 James Robert Olson Proxy Backup of Virtual Disk Image Files on NAS Devices
CN106648830A (en) * 2016-11-18 2017-05-10 国云科技股份有限公司 Method for performing online snapshot on virtual machine disk
US20180143883A1 (en) * 2016-11-22 2018-05-24 International Business Machines Corporation Version-Controlling Storage Volume Snapshots
CN110196755A (en) * 2019-05-07 2019-09-03 腾讯科技(深圳)有限公司 A kind of virtual machine snapshot management method, device, server and storage medium
CN111078368A (en) * 2019-12-26 2020-04-28 浪潮电子信息产业股份有限公司 Memory snapshot method and device of cloud computing platform virtual machine and readable storage medium
CN112162882A (en) * 2020-09-04 2021-01-01 北京浪潮数据技术有限公司 Data hot snapshot method, device, equipment and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
冯伟斌;张云勇;王志军;: "支持不同存储方式的OpenStack云平台设计与实现", 电信科学, no. 04, 20 April 2016 (2016-04-20) *
韩文智;: "浅析KVM虚拟化平台的构建", 四川职业技术学院学报, no. 03, 15 June 2016 (2016-06-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422537A (en) * 2022-03-28 2022-04-29 维塔科技(北京)有限公司 Multi-cloud storage system, multi-cloud data reading and writing method and electronic equipment
CN114422537B (en) * 2022-03-28 2022-06-21 维塔科技(北京)有限公司 Multi-cloud storage system, multi-cloud data reading and writing method and electronic equipment

Also Published As

Publication number Publication date
CN113609075B (en) 2024-10-18

Similar Documents

Publication Publication Date Title
US8738883B2 (en) Snapshot creation from block lists
CN108469986B (en) Data migration method and device
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
US9971622B2 (en) Technologies for application migration using lightweight virtualization
US9870288B2 (en) Container-based processing method, apparatus, and system
CN105765534B (en) Virtual computing system and method
US8924954B2 (en) Application software installation method and application software installation apparatus
EP3750066B1 (en) Protection of infrastructure-as-a-service workloads in public cloud
KR20190041033A (en) Replaying jobs at a secondary location of a service
CN110347483B (en) Method and device for migrating physical machine to virtual machine and storage medium
US9983988B1 (en) Resuming testing after a destructive event
CN106777394B (en) Cluster file system
WO2017045491A1 (en) Method and system for upgrading sqlite3 embedded database
CN112256397A (en) Virtual machine cross-platform migration method and system
US10169027B2 (en) Upgrade of an operating system of a virtual machine
CN113609075B (en) Method, system, storage medium and equipment for creating snapshot
CN106775846B (en) Method and device for online migration of physical server
CN106933604B (en) System upgrading method and device
CN109324931B (en) Method for realizing vmware mount recovery in data de-duplication system
CN110928624A (en) Cloud desktop calling method and device for user terminal and terminal
CA2997302C (en) Application migration
CN115951949A (en) Recovery method and device for configuration parameters of BIOS (basic input output System) and computing equipment
CN111813501A (en) Data deleting method, device, equipment and storage medium
US9372638B1 (en) Systems and methods for backing up virtual machine data
CN113626263A (en) Method for keeping data consistency in SCST storage system and application

Legal Events

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