CN116991542B - Virtual machine snapshot method, system, electronic equipment and computer storage medium - Google Patents

Virtual machine snapshot method, system, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN116991542B
CN116991542B CN202311246758.9A CN202311246758A CN116991542B CN 116991542 B CN116991542 B CN 116991542B CN 202311246758 A CN202311246758 A CN 202311246758A CN 116991542 B CN116991542 B CN 116991542B
Authority
CN
China
Prior art keywords
target
virtual machine
write operation
operation data
cache layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311246758.9A
Other languages
Chinese (zh)
Other versions
CN116991542A (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent 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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311246758.9A priority Critical patent/CN116991542B/en
Publication of CN116991542A publication Critical patent/CN116991542A/en
Application granted granted Critical
Publication of CN116991542B publication Critical patent/CN116991542B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/45575Starting, stopping, suspending or resuming virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a virtual machine snapshot method, a system, electronic equipment and a computer storage medium, which relate to the technical field of server virtualization and are applied to a physical server to acquire first write operation data sent by a target virtual machine; redirecting a first write operation to a target cache layer in response to the presence of a snapshot operation to the target virtual machine; and after the snapshot operation of the target virtual machine is finished, redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine. The beneficial effects of the invention are as follows: when the target virtual machine has the snapshot, the write operation of the target virtual machine can still be processed by the target cache layer, so that the normal operation of the snapshot and the service stability of the target virtual machine are ensured. The virtual machine snapshot system, the electronic device and the computer readable storage medium provided by the invention also solve the corresponding technical problems.

Description

Virtual machine snapshot method, system, electronic equipment and computer storage medium
Technical Field
The present invention relates to the field of server virtualization technologies, and in particular, to a virtual machine snapshot method, a system, an electronic device, and a computer readable storage medium.
Background
Virtualization is one of techniques for constructing a cloud computing infrastructure, and snapshot technology is one of virtualized functions, and can save the current running state of a virtual machine and restore the running state of a system to a certain historical moment when needed.
However, when the snapshot is performed on the virtual machine in the server, the writing operation of the virtual machine is interrupted, so that the virtual machine needs to wait for the snapshot to finish before continuing the writing operation, and the service stability of the virtual machine is affected.
In summary, how to ensure the service stability of the virtual machine is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a snapshot method of a virtual machine, which can solve the technical problem of how to improve the service stability of the virtual machine to a certain extent. The invention also provides a virtual machine snapshot system, electronic equipment and a computer readable storage medium.
According to a first aspect of an embodiment of the present invention, there is provided a virtual machine snapshot method, applied to a physical server, including:
acquiring first write operation data sent by a target virtual machine;
redirecting the first write operation data to a target cache layer in response to a snapshot operation of the target virtual machine being present;
And after the snapshot operation of the target virtual machine is finished, redirecting the operation of the target write operation in the target cache layer to the virtual disk corresponding to the target virtual machine.
In an exemplary embodiment, the redirecting the first write operation data to a target cache layer includes:
acquiring a first receiving time stamp of the first write operation data;
storing the first write operation data into a target queue according to a receiving time sequence based on the first receiving time stamp;
the first write operation data in the target queue is redirected to the target cache layer sequentially from the head of the target queue.
In an exemplary embodiment, the redirecting the first write operation data to a target cache layer includes:
generating recording head information of the first write operation data;
judging whether the first write operation data is complete or not;
and if the first write operation data is complete, generating a complete mark, generating a write operation record based on the record head information, the first write operation data and the complete mark, and redirecting the write operation record to the target cache layer.
In an exemplary embodiment, after the determining whether the first write operation data is complete, the method further includes:
if the first write operation data is incomplete, sending information representing the incomplete first write operation data to the target virtual machine;
receiving supplementary data of the first write operation data sent by the target virtual machine;
and adding the supplementary data into the first write operation data, and returning to the step of judging whether the first write operation data is complete.
In an exemplary embodiment, the generating the recording head information of the first write operation data includes:
acquiring a request number of the first write operation data;
acquiring address information of the first write operation data on the virtual disk;
acquiring length information of the first write operation data;
the recording head information is generated based on the first reception time stamp, the request number, the address information, and the length information.
In an exemplary embodiment, the redirecting the operation of the target write operation in the target cache layer to the virtual disk corresponding to the target virtual machine includes:
for each target write operation data in the target cache layer, analyzing a target receiving time stamp of the target write operation data from recording head information corresponding to the target write operation data;
Sequencing the target receiving time stamps according to the time sequence to obtain sequencing time stamps;
and sequentially redirecting the operation of the target write operation corresponding to the sequencing timestamp to the virtual disk corresponding to the target virtual machine from the head part of the sequencing timestamp.
In an exemplary embodiment, the determining whether the first write operation data is complete includes:
acquiring a first check code corresponding to the first write operation data sent by the target virtual machine;
generating a second check code of the first write operation data;
judging whether the first check code is consistent with the second check code or not;
if the first check code is consistent with the second check code, judging that the first write operation data is complete;
and if the first check code is inconsistent with the second check code, judging that the first write operation data is incomplete.
In an exemplary embodiment, the redirecting the operation of the target write operation in the target cache layer to the virtual disk corresponding to the target virtual machine includes:
determining a first number of the target write operation data in the target cache layer;
Redirecting the first number of target write operations to the virtual disk corresponding to the target virtual machine;
judging whether to block the write operation of the target virtual machine;
if yes, blocking the write operation of the target virtual machine, determining a second number of target write operation data in the target cache layer each time, and redirecting the second number of target write operation data to the virtual disk corresponding to the target virtual machine until the target cache layer is empty;
and when the write operation of the target virtual machine is not blocked, acquiring second write operation data of the target virtual machine and redirecting the second write operation data to the target cache layer.
In an exemplary embodiment, after the determining whether to block the write operation of the target virtual machine, the method further includes:
if the write operation of the target virtual machine is not blocked, determining a third amount of target write operation data in the target cache layer;
redirecting the third number of target write operations to the virtual disk corresponding to the target virtual machine;
and returning to the step of executing the write operation of the target virtual machine.
In an exemplary embodiment, the determining whether to block the write operation of the target virtual machine includes:
determining a target quantity value of the target write operation data remaining in the target cache layer;
judging whether the target quantity value is smaller than a first preset quantity value or not;
if the target quantity value is smaller than the first preset quantity value, determining to block the write operation of the target virtual machine;
and if the target quantity value is greater than or equal to the first preset quantity value, judging that the write operation of the target virtual machine is not blocked.
In an exemplary embodiment, the determining whether to block the write operation of the target virtual machine includes:
determining a target data amount of the target write operation data remaining in the target cache layer;
judging whether the target data volume is smaller than a preset data volume value or not;
if the target data volume is smaller than the preset data volume value, determining to block the write operation of the target virtual machine;
and if the target data volume is larger than or equal to the preset data volume value, judging that the write operation of the target virtual machine is not blocked.
In an exemplary embodiment, the determining whether to block the write operation of the target virtual machine includes:
Determining a target data amount of the target write operation data remaining in the target cache layer;
estimating the data redirection time length of the target cache layer based on the target data amount;
judging whether the data redirection time length is smaller than a preset time length or not;
if the data redirection time length is smaller than the preset time length, determining to block the write operation of the target virtual machine;
and if the data redirection time length is greater than or equal to the preset time length, judging that the write operation of the target virtual machine is not blocked.
In an exemplary embodiment, after redirecting the first number of the target write operations to the virtual disk corresponding to the target virtual machine, before determining whether to block the write operation of the target virtual machine, the method further includes:
estimating the number of write operations of the target virtual machine in future time length;
judging whether the number of the write operations is larger than a second preset number value or not;
if the number of the write operations is smaller than or equal to the second preset number value, executing the step of judging whether to block the write operation of the target virtual machine;
and if the number of the write operations is greater than the second preset number value, returning to the step of determining the first number of the target write operation data in the target cache layer.
In an exemplary embodiment, the predicting the number of write operations of the target virtual machine in the future time period includes:
acquiring the number of historical write operations of the target virtual machine in the historical time length;
determining an average number of write operations of the target virtual machine in each time period based on the historical number of write operations;
and estimating the number of write operations of the target virtual machine in a future time length based on the average number of write operations.
In an exemplary embodiment, after redirecting the first write operation data to the target cache layer, the method further includes:
acquiring a read operation request sent by the target virtual machine;
searching the latest target data corresponding to the read operation request in the target cache layer;
if the target data is found in the target cache layer, returning the target data to the target virtual machine;
and if the target data is not found in the target cache layer, returning to the target virtual machine after the target data is found in the virtual disk.
In an exemplary embodiment, after redirecting the target write operation in the target cache layer to the virtual disk corresponding to the target virtual machine, the method further includes:
Formatting and bypassing the target cache layer;
acquiring third write operation data sent by the target virtual machine;
and storing the third write operation data to the virtual disk.
In an exemplary embodiment, before redirecting the first write operation data to the target cache layer in response to the presence of the snapshot operation on the target virtual machine, the method further includes:
judging whether a snapshot instruction of the target virtual machine is received or not;
if the snapshot instruction is received, determining the target cache layer;
initializing the target cache layer.
In an exemplary embodiment, the determining the target cache layer includes:
determining snapshot time length of the target virtual machine;
estimating the data storage amount required by the writing operation in the snapshot time length;
and determining the target cache layer based on the data storage amount.
In an exemplary embodiment, after the obtaining the first write operation data sent by the target virtual machine, the method further includes:
and in response to the fact that no snapshot operation on the target virtual machine exists, storing the first write operation data into the virtual disk corresponding to the target virtual machine.
According to a second aspect of an embodiment of the present invention, there is provided a virtual machine snapshot system, applied to a physical server, including:
The first acquisition module is used for acquiring first write operation data sent by the target virtual machine;
a first redirection module configured to redirect the first write operation data to a target cache layer in response to a snapshot operation of the target virtual machine being present;
and the second redirecting module is used for redirecting the target write operation data in the target cache layer to the virtual disk corresponding to the target virtual machine after the snapshot operation of the target virtual machine is finished.
According to a third aspect of an embodiment of the present invention, there is provided an electronic apparatus including:
a memory for storing a computer program;
a processor for implementing the steps of any of the virtual machine snapshot methods described above when executing the computer program.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the virtual machine snapshot method as described in any of the above.
The invention provides a virtual machine snapshot method which is applied to a physical server and used for acquiring first write operation data sent by a target virtual machine; redirecting a first write operation to a target cache layer in response to the presence of a snapshot operation to the target virtual machine; and after the snapshot operation of the target virtual machine is finished, redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine. The beneficial effects of the invention are as follows: when the target virtual machine has the snapshot, the write operation of the target virtual machine can still be processed by the target cache layer, so that the normal operation of the snapshot and the service stability of the target virtual machine are ensured. The virtual machine snapshot system, the electronic device and the computer readable storage medium provided by the invention also solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a first flowchart of a virtual machine snapshot method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a structure of a target cache layer;
FIG. 3 is a second flowchart of a virtual machine snapshot method according to an embodiment of the present invention;
FIG. 4 is a third flowchart of a virtual machine snapshot method according to an embodiment of the present invention;
FIG. 5 is a fourth flowchart of a virtual machine snapshot method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a virtual machine snapshot system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a first flowchart of a virtual machine snapshot method according to an embodiment of the present invention.
The virtual machine snapshot method provided by the embodiment of the invention is applied to a physical server and can comprise the following steps:
step S101: and acquiring first write operation data sent by the target virtual machine.
In practical application, the physical server may specifically obtain the first write operation data sent by the target virtual machine for a virtualization management program (Hypervisor) in the physical server, where the target virtual machine may be a single virtual machine or a plurality of virtual machines, and the write operation data may include a write request, data to be written, and the like, and the invention is not limited herein specifically.
Step S102: in response to there being a snapshot operation of the target virtual machine, the first write operation is redirected to the target cache layer.
In practical applications, after the first write operation data is obtained, if the target virtual machine is performing a snapshot, that is, in response to the existence of a snapshot operation on the target virtual machine, the first write operation data is redirected to the target cache layer, so as to process the first write operation data by means of the target cache layer.
Step S103: and after the snapshot operation of the target virtual machine is finished, redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine.
In practical applications, after redirecting the first write operation to the target cache layer, the physical server also needs to monitor the snapshot progress of the target virtual machine, and after the snapshot operation of the target virtual machine is finished, the target write operation in the target cache layer needs to be redirected to the virtual disk corresponding to the target virtual machine, so that the write operation data is really dropped. It should be noted that, in the process of waiting for the snapshot operation of the target virtual machine to end, all newly received write operation data needs to be redirected to the target cache layer.
In a specific application scenario, the target cache layer may be a certain block of storage space in a storage pool of the physical server, as shown in fig. 2, or may be a storage space configured for the physical server additionally, which is not limited herein. In addition, since the target cache layer is managed by a physical server and decoupled from the back-end storage pool, the method and the device can be applied to different types of storage pools, such as a local storage pool, a centralized storage pool, a software defined storage pool and the like.
The invention provides a virtual machine snapshot method which is applied to a physical server and used for acquiring first write operation data sent by a target virtual machine; redirecting a first write operation to a target cache layer in response to the presence of a snapshot operation to the target virtual machine; and after the snapshot operation of the target virtual machine is finished, redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine. The beneficial effects of the invention are as follows: when the target virtual machine has the snapshot, the write operation of the target virtual machine can still be processed by the target cache layer, so that the normal operation of the snapshot and the service stability of the target virtual machine are ensured.
Referring to fig. 3, fig. 3 is a second flowchart of a virtual machine snapshot method according to an embodiment of the present invention.
The virtual machine snapshot method provided by the embodiment of the invention is applied to a physical server and can comprise the following steps:
step S201: and acquiring first write operation data sent by the target virtual machine.
Step S202: in response to there being a snapshot operation of the target virtual machine, a first receive timestamp of the first write operation data is obtained.
Step S203: based on the first receive timestamp, the first write operation data is stored in the target queue in receive chronological order.
Step S204: the first write operation in the target queue is redirected to the target cache layer in sequence, starting from the head of the target queue.
In practical application, in the process of redirecting the first write operation data to the target cache layer, considering that the write operation data needs to be dropped according to the receiving time sequence, in order to facilitate the implementation of the operation, the write operation data can be stored in the target cache layer in sequence, that is, the first receiving timestamp of the first write operation data can be obtained; based on the first receiving time stamp, storing the first writing operation data into a target queue according to the receiving time sequence, and specifically, storing the first writing operation data into the tail part of the target queue; the first write operation in the target queue is redirected to the target cache layer in sequence from the head of the target queue, so that new service IO (Input/Output) accepted by the target cache layer is written to the tail, and therefore the IO write-back process works in parallel with virtual machine IO request processing, and IO requests cannot be blocked.
In a specific application scenario, in order to facilitate recording of each write operation data, in a process of redirecting the first write operation data to the target cache layer, recording head information of the first write operation data may be generated; judging whether the first write operation data is complete or not; if the first write operation data is complete, a complete mark is generated, and a write operation record is generated based on the recording head information, the first write operation data and the complete mark, for example, the recording head information, the first write operation data and the complete mark can be combined in sequence to generate the write operation record, and the write operation record is redirected to the target cache layer.
In a specific application scenario, after judging whether the first write operation data is complete, if the first write operation data is incomplete, information representing the incomplete first write operation data can be sent to the target virtual machine; receiving supplementary data of the first write operation data sent by the target virtual machine; and adding the supplementary data into the first write operation data, and returning to the step of judging whether the first write operation data is complete.
In a specific application scenario, in a process of generating the recording head information of the first write operation data, in order to facilitate subsequent understanding of corresponding information of the write operation data, a request number of the first write operation data may be acquired; acquiring address information of first write operation data on a virtual disk; acquiring length information of first write operation data; recording head information is generated based on the first reception timestamp, the request number, the address information, and the length information.
In a specific application scene, in the process of judging whether the first write operation data is complete, a first check code corresponding to the first write operation data sent by the target virtual machine can be obtained; generating a second check code of the first write operation data; judging whether the first check code is consistent with the second check code; if the first check code is consistent with the second check code, judging that the first write operation data is complete; if the first check code is inconsistent with the second check code, the first write operation data is judged to be incomplete.
Step S205: and after the snapshot operation of the target virtual machine is finished, redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine.
In a specific application scenario, in the process of redirecting target write operation data in a target cache layer to a virtual disk corresponding to a target virtual machine, for each target write operation data in the target cache layer, a target receiving timestamp of the target write operation data can be resolved from record head information corresponding to the target write operation data; sequencing the target receiving time stamps according to the time sequence to obtain sequencing time stamps; and sequentially redirecting the target write operation data corresponding to the ordering timestamp to the virtual disk corresponding to the target virtual machine from the head part of the ordering timestamp.
Referring to fig. 4, fig. 4 is a third flowchart of a virtual machine snapshot method according to an embodiment of the present invention.
The virtual machine snapshot method provided by the embodiment of the invention is applied to a physical server and can comprise the following steps:
step S301: and acquiring first write operation data sent by the target virtual machine.
Step S302: in response to there being a snapshot operation of the target virtual machine, the first write operation is redirected to the target cache layer.
Step S303: a first amount of target write operation data is determined in a target cache layer.
Step S304: and redirecting the first number of target write operations to the virtual disk corresponding to the target virtual machine.
Step S305: judging whether the write operation of the target virtual machine is blocked or not; if yes, go to step S306; if not, step S307 is performed.
Step S306: and blocking the write operation of the target virtual machine, determining a second number of target write operation data in the target cache layer each time, and redirecting the second number of target write operation data to the virtual disk corresponding to the target virtual machine until the target cache layer is empty.
Step S307: a third amount of target write operation data is determined in the target cache layer.
Step S308: redirecting the operation of the third number of target write operations to the virtual disk corresponding to the target virtual machine, and returning to execute the step S305; and when the write operation of the target virtual machine is not blocked, acquiring second write operation data of the target virtual machine and redirecting the second write operation data to the target cache layer.
In practical application, in the process of redirecting the target write operation data in the target cache layer to the virtual disk corresponding to the target virtual machine, because the target write operation data cannot be instantaneously redirected to the virtual disk, in the process, the write operation data of the target virtual machine may still need to be processed, so in order to balance the processing and redirection of the write operation data of the target virtual machine, a first number of target write operation data may be determined in the target cache layer; redirecting the operation of the first number of target writers to the virtual disk corresponding to the target virtual machine; judging whether the write operation of the target virtual machine is blocked or not; if yes, blocking the write operation of the target virtual machine, at the moment, not processing the write operation data newly sent by the target virtual machine, determining a second number of target write operation data in the target cache layer each time, and redirecting the second number of target write operation data to the virtual disk corresponding to the target virtual machine until the target cache layer is empty; and when the write operation of the target virtual machine is not blocked, acquiring second write operation data of the target virtual machine and redirecting the second write operation data to the target cache layer. It should be noted that, after the target write operation data in the target cache layer are all redirected to the virtual disk, the subsequent write operation data may be written into the virtual disk normally, so that in the process of blocking the write operation of the target virtual machine and completing the redirection of the target write data, the service of the target virtual machine is in an interrupt state, so that the condition of blocking the write operation of the target virtual machine may be determined according to the interrupt duration allowed by the target virtual machine.
In a specific application scene, after judging whether to block the write operation of the target virtual machine, if not, determining a third number of target write operation data in the target cache layer; redirecting the operation of the third number of target write operations to the virtual disk corresponding to the target virtual machine; and returning to the step of executing the write operation for judging whether the target virtual machine is blocked. The values of the first number, the second number, and the third number may be determined according to the application scenario, for example, the three values may be the same value, etc.
In a specific application scene, in the process of judging whether to block the writing operation of the target virtual machine, the number value of the residual target writing operation data, namely the number value can influence the interruption time of the target virtual machine, so that the target number value of the residual target writing operation data in the target cache layer can be determined; judging whether the target quantity value is smaller than a first preset quantity value or not; if the target quantity value is smaller than the first preset quantity value, determining to block the write operation of the target virtual machine; if the target quantity value is greater than or equal to the first preset quantity value, the writing operation of the target virtual machine is not blocked.
In a specific application scene, in the process of judging whether to block the writing operation of the target virtual machine, considering that the data quantity of the residual target writing operation data can influence the interruption time length of the target virtual machine, the target data quantity of the residual target writing operation data in the target cache layer can be determined; judging whether the target data volume is smaller than a preset data volume value or not; if the target data size is smaller than the preset data size, determining to block the write operation of the target virtual machine; and if the target data volume is greater than or equal to the preset data volume value, judging that the write operation of the target virtual machine is not blocked.
In a specific application scene, in the process of judging whether to block the writing operation of the target virtual machine, considering that the transfer duration of the residual target writing operation data influences the interruption duration of the target virtual machine, the data quantity of the residual target writing operation data in the target cache layer can be determined; estimating the data redirection time length of the target cache layer based on the data quantity; judging whether the data redirection time length is smaller than a preset time length or not; if the data redirection time length is smaller than the preset time length, determining to block the write operation of the target virtual machine; and if the data redirection time length is greater than or equal to the preset time length, judging that the write operation of the target virtual machine is not blocked.
In a specific application scenario, after redirecting the first number of target write operations to the virtual disk corresponding to the target virtual machine, before judging whether to block the write operation of the target virtual machine, the number of write operations of the target virtual machine in a future time period can be estimated; judging whether the number of the writing operations is larger than a second preset number value or not; if the number of the write operations is smaller than or equal to a second preset number value, executing the step of judging whether to block the write operation of the target virtual machine; and if the number of the write operations is greater than the second preset number value, returning to execute the step of determining the first number of target write operation data in the target cache layer. That is, under the condition that the target virtual machine needs to process a large amount of write operations, the blocking time of the target virtual machine can be delayed, so that the target virtual machine is ensured not to backlog a large amount of write operation data, and the service stability of the virtual machine is further ensured.
In a specific application scene, in the process of estimating the number of write operations of the target virtual machine in the future time length, the number of the historical write operations of the target virtual machine in the historical time length can be estimated according to the historical write operation data, namely the number of the historical write operations of the target virtual machine in the historical time length can be obtained; determining the average write operation number of the target virtual machine in each time period based on the historical write operation number; based on the average number of write operations, the number of write operations of the target virtual machine in a future time period is estimated, for example, when the future time period hits a single time period, the average number of write operations corresponding to the time period is directly used as the estimated number of write operations in the future time period, and when the future time period hits a plurality of time periods, the average value of the average number of write operations corresponding to the time periods can be used as an estimated number of write operations in the future time period, and the like.
Referring to fig. 5, fig. 5 is a fourth flowchart of a virtual machine snapshot method according to an embodiment of the present invention.
The virtual machine snapshot method provided by the embodiment of the invention is applied to a physical server and can comprise the following steps:
step S401: and acquiring first write operation data sent by the target virtual machine.
Step S402: in response to there being a snapshot operation of the target virtual machine, the first write operation is redirected to the target cache layer.
Step S403: and after the snapshot operation of the target virtual machine is finished, redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine.
Step S404: and acquiring a read operation request sent by the target virtual machine.
Step S405: and searching the latest target data corresponding to the read operation request in the target cache layer.
Step S406: and if the target data is found in the target cache layer, returning the target data to the target virtual machine.
Step S407: if the target data is not found in the target cache layer, the target data is returned to the target virtual machine after being found in the virtual disk.
In practical application, after redirecting the operation of the first writer to the target cache layer, if the lodestone needs to perform data reading, the target cache layer and the virtual disk need to be integrated to perform data reading, and thus a read operation request sent by the target virtual machine can be obtained; searching the latest target data corresponding to the read operation request in the target cache layer; if the target data is found in the target cache layer, returning the target data to the target virtual machine; if the target data is not found in the target cache layer, the target data is returned to the target virtual machine after being found in the virtual disk.
In practical application, after the target write operation data in the target cache layer is redirected to the virtual disk corresponding to the target virtual machine, the write operation data of the target virtual machine can be directly stored in the virtual disk according to a normal processing mode, and the target cache layer is not applied any more at this time, namely the target cache layer can be formatted and bypassed so as to cause the target cache layer to fail; acquiring third write operation data sent by a target virtual machine; and storing the third write operation data to the virtual disk.
In practical application, before redirecting the first write operation to the target cache layer in response to the existence of the snapshot operation on the target virtual machine, it may also be determined whether a snapshot instruction of the target virtual machine is received; if a snapshot instruction is received, determining a target cache layer; the target cache layer is initialized, such as initializing an address space of the target cache layer, initializing a state of the target cache layer, and the like, so as to accurately perform the operation on the target cache layer.
In practical application, in the process of determining the target cache layer, the size of the target cache layer can be estimated according to the snapshot time length, namely the snapshot time length of the target virtual machine can be determined; estimating the data storage amount required by writing operation in the snapshot time length; the target cache layer is determined based on the data storage amount.
In practical application, after the first write operation data sent by the target virtual machine is obtained, when no snapshot exists, that is, when no snapshot operation on the target virtual machine exists, the first write operation data can be stored in a virtual disk corresponding to the target virtual machine.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a virtual machine snapshot system according to an embodiment of the present invention.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server and can comprise:
a first obtaining module 101, configured to obtain first write operation data sent by a target virtual machine;
a first redirection module 102, configured to redirect a first write operation to a target cache layer in response to a snapshot operation of the target virtual machine being present;
and the second redirecting module 103 is configured to redirect the target write operation data in the target cache layer to the virtual disk corresponding to the target virtual machine after the snapshot operation of the target virtual machine is finished.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first redirection module can comprise:
a first acquisition unit configured to acquire a first reception time stamp of first write operation data;
The first storage unit is used for storing the first write operation data into the target queue according to the receiving time sequence based on the first receiving time stamp;
and the first redirection unit is used for sequentially redirecting the first write operation data in the target queue to the target cache layer from the head of the target queue.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first redirection unit can be specifically used for: generating recording head information of the first write operation data; judging whether the first write operation data is complete or not; if the first write operation data is complete, a complete mark is generated, a write operation record is generated based on the record head information, the first write operation data and the complete mark, and the write operation record is redirected to the target cache layer.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first redirection unit can be further used for: after judging whether the first write operation data is complete or not, if the first write operation data is incomplete, sending information representing the incomplete first write operation data to the target virtual machine; receiving supplementary data of the first write operation data sent by the target virtual machine; and adding the supplementary data into the first write operation data, and returning to the step of judging whether the first write operation data is complete.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first redirection unit can be specifically used for: acquiring a request number of first write operation data; acquiring address information of first write operation data on a virtual disk; acquiring length information of first write operation data; recording head information is generated based on the first reception timestamp, the request number, the address information, and the length information.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the second redirection module can comprise:
the first analyzing unit is used for analyzing the target receiving time stamp of the target write operation data from the record head information corresponding to the target write operation data for each target write operation data in the target cache layer;
the first ordering unit is used for ordering the target receiving time stamps according to the time sequence to obtain ordering time stamps;
and the second redirecting unit is used for sequentially redirecting the target write operation data corresponding to the ordering timestamp to the virtual disk corresponding to the target virtual machine from the head part of the ordering timestamp.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first redirection unit can be specifically used for: acquiring a first check code corresponding to first write operation data sent by a target virtual machine; generating a second check code of the first write operation data; judging whether the first check code is consistent with the second check code; if the first check code is consistent with the second check code, judging that the first write operation data is complete; if the first check code is inconsistent with the second check code, the first write operation data is judged to be incomplete.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the second redirection module can comprise:
a first determining unit configured to determine a first number of target write operation data in the target cache layer;
the third redirecting unit is used for redirecting the first number of target write operations to the virtual disk corresponding to the target virtual machine;
a first judging unit for judging whether to block the write operation of the target virtual machine; if yes, blocking the write operation of the target virtual machine, determining a second number of target write operation data in the target cache layer each time, and redirecting the second number of target write operation data to the virtual disk corresponding to the target virtual machine until the target cache layer is empty;
and when the write operation of the target virtual machine is not blocked, acquiring second write operation data of the target virtual machine and redirecting the second write operation data to the target cache layer.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first judging unit can be specifically used for: after judging whether to block the write operation of the target virtual machine, if not, determining a third number of target write operation data in the target cache layer; redirecting the operation of the third number of target write operations to the virtual disk corresponding to the target virtual machine; and returning to the step of executing the write operation for judging whether the target virtual machine is blocked.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first judging unit can be specifically used for: determining a target quantity value of target write operation data remaining in the target cache layer; judging whether the target quantity value is smaller than a first preset quantity value or not; if the target quantity value is smaller than the first preset quantity value, determining to block the write operation of the target virtual machine; if the target quantity value is greater than or equal to the first preset quantity value, the writing operation of the target virtual machine is not blocked.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first judging unit can be specifically used for: determining a target data amount of target write operation data remaining in the target cache layer; judging whether the target data volume is smaller than a preset data volume value or not; if the target data size is smaller than the preset data size, determining to block the write operation of the target virtual machine; and if the target data volume is greater than or equal to the preset data volume value, judging that the write operation of the target virtual machine is not blocked.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first judging unit can be specifically used for: determining a target data amount of target write operation data remaining in the target cache layer; estimating the data redirection time length of the target cache layer based on the target data quantity; judging whether the data redirection time length is smaller than a preset time length or not; if the data redirection time length is smaller than the preset time length, determining to block the write operation of the target virtual machine; and if the data redirection time length is greater than or equal to the preset time length, judging that the write operation of the target virtual machine is not blocked.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server and can further comprise:
the first estimating unit is used for estimating the number of write operations of the target virtual machine in future time before the first judging unit judges whether to block the write operations of the target virtual machine after the first number of target write operations are redirected to the virtual disk corresponding to the target virtual machine by the third redirecting unit;
the second judging unit is used for judging whether the number of the writing operations is larger than a second preset number value or not; if the number of the write operations is smaller than or equal to a second preset number value, executing the step of judging whether to block the write operation of the target virtual machine; and if the number of the write operations is greater than the second preset number value, returning to execute the step of determining the first number of target write operation data in the target cache layer.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first estimating unit can be specifically used for: acquiring the number of historical write operations of the target virtual machine in the historical time length; determining the average write operation number of the target virtual machine in each time period based on the historical write operation number; based on the average number of write operations, the number of write operations of the target virtual machine in a future time period is estimated.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server and can further comprise:
the second obtaining module is used for obtaining a read operation request sent by the target virtual machine after the first redirection module redirects the first write operation data to the target cache layer;
the first searching module is used for searching the latest target data corresponding to the read operation request in the target cache layer; if the target data is found in the target cache layer, returning the target data to the target virtual machine; if the target data is not found in the target cache layer, the target data is returned to the target virtual machine after being found in the virtual disk.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server and can further comprise:
the first processing module is used for formatting and bypassing the target cache layer after the second redirection module redirects the target write operation data in the target cache layer to the virtual disk corresponding to the target virtual machine;
the third acquisition module is used for acquiring third write operation data sent by the target virtual machine;
and the first storage module is used for storing the third write operation data into the virtual disk.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server and can further comprise:
the first judging module is used for judging whether a snapshot instruction of the target virtual machine is received or not before the first write operation is redirected to the target cache layer by the first redirecting module in response to the existence of the snapshot operation of the target virtual machine; if a snapshot instruction is received, determining a target cache layer; and initializing a target cache layer.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server, and the first judging module can be specifically used for: determining snapshot time length of the target virtual machine; estimating the data storage amount required by writing operation in the snapshot time length; the target cache layer is determined based on the data storage amount.
The virtual machine snapshot system provided by the embodiment of the invention is applied to a physical server and can further comprise:
the second storage module is used for storing the first write operation data to the virtual disk corresponding to the target virtual machine in response to no snapshot operation on the target virtual machine after the first write operation data sent by the target virtual machine is acquired by the first acquisition module.
The invention also provides electronic equipment and a computer readable storage medium, which have the corresponding effects of the virtual machine snapshot method provided by the embodiment of the invention. Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
An electronic device provided in an embodiment of the present invention includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the steps of the virtual machine snapshot method described in any of the embodiments above when executing the computer program.
Referring to fig. 8, another electronic device provided in an embodiment of the present invention may further include: an input port 203 connected to the processor 202 for transmitting an externally input command to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing communication between the electronic device and the outside. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication means adopted by the communication module 205 include, but are not limited to, mobile High-Definition Link (MHL), universal serial bus (Universal Serial Bus, USB), high-Definition multimedia interface (High-Definition Multimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, wiFi), bluetooth communication technology, bluetooth low energy communication technology, ieee802.11s based communication technology.
The embodiment of the invention provides a computer readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the virtual machine snapshot method described in any embodiment above are implemented.
The computer readable storage medium to which the present invention relates includes random access Memory (Random Access Memory, RAM), memory, read-Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the art.
The description of the related parts in the virtual machine snapshot method, the system, the electronic device and the computer readable storage medium provided in the embodiments of the present invention is referred to in the detailed description of the corresponding parts in the virtual machine snapshot method provided in the embodiments of the present invention, and will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present invention, which are consistent with the implementation principles of the corresponding technical solutions in the prior art, are not described in detail, so that redundant descriptions are avoided.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (21)

1. A virtual machine snapshot method, applied to a physical server, comprising:
acquiring first write operation data sent by a target virtual machine;
redirecting the first write operation data to a target cache layer in response to a snapshot operation of the target virtual machine being present;
after the snapshot operation of the target virtual machine is finished, redirecting the operation of the target write operation in the target cache layer to a virtual disk corresponding to the target virtual machine;
the redirecting the operation of the target write operation in the target cache layer to the virtual disk corresponding to the target virtual machine includes:
Determining a first number of the target write operation data in the target cache layer;
redirecting the first number of target write operations to the virtual disk corresponding to the target virtual machine;
judging whether to block the write operation of the target virtual machine;
if yes, blocking the write operation of the target virtual machine, determining a second number of target write operation data in the target cache layer each time, and redirecting the second number of target write operation data to the virtual disk corresponding to the target virtual machine until the target cache layer is empty;
when the write operation of the target virtual machine is not blocked, acquiring second write operation data of the target virtual machine and redirecting the second write operation data to the target cache layer;
the target cache layer comprises a block storage space in a storage pool of the physical server, or a storage space additionally configured for the physical server.
2. The method of claim 1, wherein the redirecting the first write operation data to a target cache layer comprises:
acquiring a first receiving time stamp of the first write operation data;
Storing the first write operation data into a target queue according to a receiving time sequence based on the first receiving time stamp;
the first write operation data in the target queue is redirected to the target cache layer sequentially from the head of the target queue.
3. The method of claim 2, wherein the redirecting the first write operation data to a target cache layer comprises:
generating recording head information of the first write operation data;
judging whether the first write operation data is complete or not;
and if the first write operation data is complete, generating a complete mark, generating a write operation record based on the record head information, the first write operation data and the complete mark, and redirecting the write operation record to the target cache layer.
4. The method of claim 3, wherein after the determining whether the first write operation data is complete, further comprising:
if the first write operation data is incomplete, sending information representing the incomplete first write operation data to the target virtual machine;
receiving supplementary data of the first write operation data sent by the target virtual machine;
And adding the supplementary data into the first write operation data, and returning to the step of judging whether the first write operation data is complete.
5. The method of claim 3, wherein the generating the recording head information of the first write operation data comprises:
acquiring a request number of the first write operation data;
acquiring address information of the first write operation data on the virtual disk;
acquiring length information of the first write operation data;
the recording head information is generated based on the first reception time stamp, the request number, the address information, and the length information.
6. The method of claim 5, wherein redirecting the target write operations in the target cache layer to the virtual disk corresponding to the target virtual machine comprises:
for each target write operation data in the target cache layer, analyzing a target receiving time stamp of the target write operation data from recording head information corresponding to the target write operation data;
sequencing the target receiving time stamps according to the time sequence to obtain sequencing time stamps;
And sequentially redirecting the operation of the target write operation corresponding to the sequencing timestamp to the virtual disk corresponding to the target virtual machine from the head part of the sequencing timestamp.
7. The method of claim 3, wherein said determining whether the first write operation data is complete comprises:
acquiring a first check code corresponding to the first write operation data sent by the target virtual machine;
generating a second check code of the first write operation data;
judging whether the first check code is consistent with the second check code or not;
if the first check code is consistent with the second check code, judging that the first write operation data is complete;
and if the first check code is inconsistent with the second check code, judging that the first write operation data is incomplete.
8. The method of claim 1, wherein after the determining whether to block the write operation of the target virtual machine, further comprising:
if the write operation of the target virtual machine is not blocked, determining a third amount of target write operation data in the target cache layer;
redirecting the third number of target write operations to the virtual disk corresponding to the target virtual machine;
And returning to the step of executing the write operation of the target virtual machine.
9. The method of claim 1, wherein the determining whether to block write operations of the target virtual machine comprises:
determining a target quantity value of the target write operation data remaining in the target cache layer;
judging whether the target quantity value is smaller than a first preset quantity value or not;
if the target quantity value is smaller than the first preset quantity value, determining to block the write operation of the target virtual machine;
and if the target quantity value is greater than or equal to the first preset quantity value, judging that the write operation of the target virtual machine is not blocked.
10. The method of claim 1, wherein the determining whether to block write operations of the target virtual machine comprises:
determining a target data amount of the target write operation data remaining in the target cache layer;
judging whether the target data volume is smaller than a preset data volume value or not;
if the target data volume is smaller than the preset data volume value, determining to block the write operation of the target virtual machine;
and if the target data volume is larger than or equal to the preset data volume value, judging that the write operation of the target virtual machine is not blocked.
11. The method of claim 1, wherein the determining whether to block write operations of the target virtual machine comprises:
determining a target data amount of the target write operation data remaining in the target cache layer;
estimating the data redirection time length of the target cache layer based on the target data amount;
judging whether the data redirection time length is smaller than a preset time length or not;
if the data redirection time length is smaller than the preset time length, determining to block the write operation of the target virtual machine;
and if the data redirection time length is greater than or equal to the preset time length, judging that the write operation of the target virtual machine is not blocked.
12. The method of claim 1, wherein after redirecting the first number of the target write operations into the virtual disk corresponding to the target virtual machine, the determining whether to block write operations of the target virtual machine further comprises:
estimating the number of write operations of the target virtual machine in future time length;
judging whether the number of the write operations is larger than a second preset number value or not;
if the number of the write operations is smaller than or equal to the second preset number value, executing the step of judging whether to block the write operation of the target virtual machine;
And if the number of the write operations is greater than the second preset number value, returning to the step of determining the first number of the target write operation data in the target cache layer.
13. The method of claim 12, wherein the predicting the number of write operations of the target virtual machine for a future time period comprises:
acquiring the number of historical write operations of the target virtual machine in the historical time length;
determining an average number of write operations of the target virtual machine in each time period based on the historical number of write operations;
and estimating the number of write operations of the target virtual machine in a future time length based on the average number of write operations.
14. The method of claim 1, wherein after redirecting the first write operation data to a target cache layer, further comprising:
acquiring a read operation request sent by the target virtual machine;
searching the latest target data corresponding to the read operation request in the target cache layer;
if the target data is found in the target cache layer, returning the target data to the target virtual machine;
and if the target data is not found in the target cache layer, returning to the target virtual machine after the target data is found in the virtual disk.
15. The method of claim 1, wherein after redirecting the target write operations in the target cache layer to the virtual disk corresponding to the target virtual machine, further comprising:
formatting and bypassing the target cache layer;
acquiring third write operation data sent by the target virtual machine;
and storing the third write operation data to the virtual disk.
16. The method of claim 1, wherein, in response to the presence of a snapshot operation on the target virtual machine, before redirecting the first write operation data to a target cache layer, further comprising:
judging whether a snapshot instruction of the target virtual machine is received or not;
if the snapshot instruction is received, determining the target cache layer;
initializing the target cache layer.
17. The method of claim 16, wherein the determining the target cache layer comprises:
determining snapshot time length of the target virtual machine;
estimating the data storage amount required by the writing operation in the snapshot time length;
and determining the target cache layer based on the data storage amount.
18. The method of claim 1, wherein after the obtaining the first write operation data sent by the target virtual machine, further comprising:
And in response to the fact that no snapshot operation on the target virtual machine exists, storing the first write operation data into the virtual disk corresponding to the target virtual machine.
19. A virtual machine snapshot system, applied to a physical server, comprising:
the first acquisition module is used for acquiring first write operation data sent by the target virtual machine;
a first redirection module configured to redirect the first write operation data to a target cache layer in response to a snapshot operation of the target virtual machine being present;
the second redirecting module is used for redirecting the operation data of the target write-in operation in the target cache layer to the virtual disk corresponding to the target virtual machine after the snapshot operation of the target virtual machine is finished;
wherein the second redirection module comprises:
a first determining unit, configured to determine a first number of the target write operation data in the target cache layer;
the third redirecting unit is used for redirecting the first number of target write operations to the virtual disk corresponding to the target virtual machine;
a first judging unit configured to judge whether to block a write operation of the target virtual machine; if yes, blocking the write operation of the target virtual machine, determining a second number of target write operation data in the target cache layer each time, and redirecting the second number of target write operation data to the virtual disk corresponding to the target virtual machine until the target cache layer is empty;
When the write operation of the target virtual machine is not blocked, acquiring second write operation data of the target virtual machine and redirecting the second write operation data to the target cache layer;
the target cache layer comprises a block storage space in a storage pool of the physical server, or a storage space additionally configured for the physical server.
20. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the virtual machine snapshot method of any of claims 1 to 18 when executing the computer program.
21. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the steps of the virtual machine snapshot method according to any of claims 1 to 18.
CN202311246758.9A 2023-09-26 2023-09-26 Virtual machine snapshot method, system, electronic equipment and computer storage medium Active CN116991542B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311246758.9A CN116991542B (en) 2023-09-26 2023-09-26 Virtual machine snapshot method, system, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311246758.9A CN116991542B (en) 2023-09-26 2023-09-26 Virtual machine snapshot method, system, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN116991542A CN116991542A (en) 2023-11-03
CN116991542B true CN116991542B (en) 2024-02-13

Family

ID=88526926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311246758.9A Active CN116991542B (en) 2023-09-26 2023-09-26 Virtual machine snapshot method, system, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN116991542B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012852A (en) * 2010-12-27 2011-04-13 创新科存储技术有限公司 Method for implementing incremental snapshots-on-write
CN103221925A (en) * 2012-11-23 2013-07-24 华为技术有限公司 Data processing method and storage equipment
CN104598293A (en) * 2015-01-06 2015-05-06 杭州华三通信技术有限公司 Online snapshot method and equipment
CN106293882A (en) * 2016-08-12 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of virtual disk snapshot implementing method and device
CN107203331A (en) * 2016-03-17 2017-09-26 中兴通讯股份有限公司 Write the method and device of data
CN109032507A (en) * 2018-06-28 2018-12-18 郑州云海信息技术有限公司 A kind of method, system and associated component generating source book storage snapshot
CN110597451A (en) * 2018-06-12 2019-12-20 华为技术有限公司 Method for realizing virtualized cache and physical machine
CN111522827A (en) * 2020-04-08 2020-08-11 北京奇艺世纪科技有限公司 Data updating method and device and electronic equipment
WO2021169129A1 (en) * 2020-02-27 2021-09-02 平安科技(深圳)有限公司 Virtual machine online migration method and apparatus, device, and computer readable storage medium
CN113849341A (en) * 2021-08-31 2021-12-28 苏州浪潮智能科技有限公司 Performance optimization method, system and device of NAS snapshot and readable storage medium
CN113946286A (en) * 2021-08-17 2022-01-18 丝路信息港云计算科技有限公司 Cloud node block-level caching method, storage device and server
CN116303325A (en) * 2023-02-24 2023-06-23 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for protecting remote copy data

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012852A (en) * 2010-12-27 2011-04-13 创新科存储技术有限公司 Method for implementing incremental snapshots-on-write
CN103221925A (en) * 2012-11-23 2013-07-24 华为技术有限公司 Data processing method and storage equipment
CN104598293A (en) * 2015-01-06 2015-05-06 杭州华三通信技术有限公司 Online snapshot method and equipment
CN107203331A (en) * 2016-03-17 2017-09-26 中兴通讯股份有限公司 Write the method and device of data
CN106293882A (en) * 2016-08-12 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of virtual disk snapshot implementing method and device
CN110597451A (en) * 2018-06-12 2019-12-20 华为技术有限公司 Method for realizing virtualized cache and physical machine
CN109032507A (en) * 2018-06-28 2018-12-18 郑州云海信息技术有限公司 A kind of method, system and associated component generating source book storage snapshot
WO2021169129A1 (en) * 2020-02-27 2021-09-02 平安科技(深圳)有限公司 Virtual machine online migration method and apparatus, device, and computer readable storage medium
CN111522827A (en) * 2020-04-08 2020-08-11 北京奇艺世纪科技有限公司 Data updating method and device and electronic equipment
CN113946286A (en) * 2021-08-17 2022-01-18 丝路信息港云计算科技有限公司 Cloud node block-level caching method, storage device and server
CN113849341A (en) * 2021-08-31 2021-12-28 苏州浪潮智能科技有限公司 Performance optimization method, system and device of NAS snapshot and readable storage medium
CN116303325A (en) * 2023-02-24 2023-06-23 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for protecting remote copy data

Also Published As

Publication number Publication date
CN116991542A (en) 2023-11-03

Similar Documents

Publication Publication Date Title
EP3923592A1 (en) Data processing method and live broadcast system
CN110221959B (en) Application program testing method, device and computer readable medium
CN108475201B (en) Data acquisition method in virtual machine starting process and cloud computing system
JP2018194882A (en) Control program, control method, control device, and database server
CN114020406A (en) Method, device and system for accelerating I/O of virtual machine by cloud platform
CN110716845A (en) Method for reading log information of Android system
CN111736945A (en) Virtual machine thermal migration method, device, equipment and medium based on intelligent network card
CN109656670B (en) Page rendering method and device
CN108228842B (en) Docker mirror image library file storage method, terminal, device and storage medium
CN116991542B (en) Virtual machine snapshot method, system, electronic equipment and computer storage medium
CN102843369B (en) The Network Access Method at UI interface and system
CN108062224B (en) Data reading and writing method and device based on file handle and computing equipment
CN112100092B (en) Information caching method, device, equipment and medium
CN112433669A (en) Method, system, equipment and medium for online migration of distributed storage volume
CN107766385B (en) Method and equipment for converting file format of virtual disk
CN114048465B (en) Stack state detection method, device, equipment and storage medium
CN115292147A (en) Convenient and efficient memory pressure testing method and system and readable storage medium
CN115185458A (en) Data writing method and device, storage medium and computer equipment
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN113760631A (en) Page loading duration determination method, device, equipment and storage medium
CN111737223A (en) File copying method, device, equipment and storage medium
CN110750569A (en) Data extraction method, device, equipment and storage medium
CN112231290A (en) Method, device and equipment for processing local log and storage medium
CN110908602A (en) Data writing method, device, equipment and storage medium of distributed storage system
CN112650445B (en) Method and device for executing Trim by solid state disk

Legal Events

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