CN105573813B - The continuous Snapshot Method of virtual machine and device - Google Patents

The continuous Snapshot Method of virtual machine and device Download PDF

Info

Publication number
CN105573813B
CN105573813B CN201410532668.0A CN201410532668A CN105573813B CN 105573813 B CN105573813 B CN 105573813B CN 201410532668 A CN201410532668 A CN 201410532668A CN 105573813 B CN105573813 B CN 105573813B
Authority
CN
China
Prior art keywords
page
virtual machine
value
bit pattern
message bit
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
CN201410532668.0A
Other languages
Chinese (zh)
Other versions
CN105573813A (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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN201410532668.0A priority Critical patent/CN105573813B/en
Publication of CN105573813A publication Critical patent/CN105573813A/en
Application granted granted Critical
Publication of CN105573813B publication Critical patent/CN105573813B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A kind of continuous Snapshot Method of virtual machine of present invention offer and device, the continuous Snapshot Method of virtual machine include:Virtual machine is shut down;The value of the second message bit pattern of each page is updated according to the value of the first message bit pattern of each page in virtual machine;The value of first message bit pattern of each page in initialization of virtual machine;Restore the operation of virtual machine;Judge whether the value of the second message bit pattern of each page in virtual machine is the first preset value successively, and each page that the value of the second message bit pattern is the first preset value is saved in buffer area.The continuous fast photographing device of virtual machine need to only operate each web page bitmap information in virtual machine stopping process; and the time needed for the process is very short; shorten virtual machine downtime in snapshot processes; snapshot preservation is carried out to each page that needs preserve successively when the continuous snapshot of virtual machine; only preserve the page not being saved; the time for substantially reducing snapshot of virtual machine reduces influence of the snapshot processes to virtual machine performance.

Description

The continuous Snapshot Method of virtual machine and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of continuous Snapshot Methods of virtual machine and device.
Background technology
Virtualization technology can effectively integrate and utilize computer resource, and therefore, it has become the critical supports of field of cloud calculation It calculates.In order to provide the cloud service of continuous, High Availabitity, data and state in virtual machine need to meet reliability and safety, Thus snapping technique is introduced.Snapping technique can preserve the good working condition in virtual machine operational process, include the magnetic of virtual machine Plate-like state, internal storage state and equipment state, such as CPU, network, the state in virtual-machine fail for restoring virtual machine, to the greatest extent Measure the data and state of few loss virtual machine.
Currently, mainly being copied using shutdown when virtual machine carries out snapshot to internal storage state.It is to carry out virtually to shut down copy Virtual machine is hung up when machine continuous snapshot, restores virtual machine operation again after all internal storage datas have been saved, to ensure this The data of each page when secondary snapshot in virutal machine memory are complete, do not changed.
But shut down copy and the downtime of virtual machine when each snapshot is grown very much, affect the performance of virtual machine.
Invention content
A kind of continuous Snapshot Method of virtual machine of present invention offer and device, it is continuously fast for solving virtual machine in the prior art The problem of keeping virtual machine downtime long according to method, influence virtual machine performance.
The present invention provides a kind of continuous Snapshot Method of virtual machine, including:
Virtual machine is shut down;
The value of the second message bit pattern of each page is updated according to the value of the first message bit pattern of each page in the virtual machine, First message bit pattern is for identifying whether each page is changed, and second message bit pattern is for identifying each page Whether need to preserve, the first message bit pattern and the second message bit pattern of each page are corresponded with the address of each page;
Initialize the value of the first message bit pattern of each page in the virtual machine;
Restore the operation of the virtual machine;
Judge whether the value of the second message bit pattern of each page in the virtual machine is the first preset value successively;
Each page that the value of second message bit pattern is the first preset value is saved in buffer area, and buffer area will be saved in The value of the second message bit pattern of each page be changed to the second preset value.
The present invention provides a kind of continuous fast photographing device of virtual machine, including:
Module is shut down, for shutting down virtual machine;
Update module, for updating the second of each page according to the value of the first message bit pattern of each page in the virtual machine The value of message bit pattern, for identifying whether each page is changed, second message bit pattern is used for first message bit pattern Identify whether each page needs to preserve, the ground of the first message bit pattern and the second message bit pattern and each page of each page Location corresponds;
Initialization module, the value of the first message bit pattern for initializing each page in the virtual machine;
Recovery module, the operation for restoring the virtual machine;
Judgment module, for judging whether the value of the second message bit pattern of each page in the virtual machine is first pre- successively If value;
Processing module, for each page that the value of the second message bit pattern is the first preset value to be saved in buffer area, and The value of second message bit pattern of each page for being saved in buffer area is changed to the second preset value.
The continuous Snapshot Method of virtual machine provided by the invention and device, the continuous fast photographing device of virtual machine need to only stop in virtual machine The value of the first message bit pattern of each page in virtual machine is copied in the second message bit pattern during machine, you can restore virtual machine Operation, in virtual machine operational process according to the value of the second message bit pattern of each page successively to each page for preserving of needs into Row snapshot preserves, since the time needed for the operation to each web page bitmap information is very short so that virtual machine in a snapshot processes Downtime is shorter, and only needs to preserve the page changed from after last time snapshot in the continuous snapshot of virtual machine so that all The page is only saved once, and the page quantity of preservation is few, to substantially reduce the time of snapshot of virtual machine, reduces void Quasi- influence of the continuous snapshot processes of machine to virtual machine performance.
Description of the drawings
Fig. 1 is a kind of flow diagram of the continuous Snapshot Method embodiment of virtual machine provided by the invention one;
Fig. 2 is a kind of flow diagram of the continuous Snapshot Method embodiment of virtual machine provided by the invention two;
Fig. 3 is a kind of flow diagram of the continuous Snapshot Method embodiment of virtual machine provided by the invention three;
Fig. 4 is a kind of structural schematic diagram of the continuous fast photographing device embodiment of virtual machine provided by the invention one;
Fig. 5 is a kind of structural schematic diagram of the continuous fast photographing device embodiment of virtual machine provided by the invention two.
Specific implementation mode
Fig. 1 is a kind of flow diagram of the continuous Snapshot Method embodiment of virtual machine provided by the invention one.Such as Fig. 1 institutes Show, this method includes:
S10 shuts down virtual machine.
S11 updates the second message bit pattern of each page according to the value of the first message bit pattern of each page in the virtual machine Value.
Wherein, for identifying whether each page is changed, second message bit pattern is used for first message bit pattern Identify whether each page needs to preserve, the ground of the first message bit pattern and the second message bit pattern and each page of each page Location corresponds.
Specifically, this method embodiment is executed by the continuous fast photographing device of virtual machine.The minimum of virutal machine memory in the present invention Unit is the page, and each page corresponds to a page address.The continuous Snapshot Method of virtual machine provided by the invention is with to virtual machine Memory image for illustrate, establish message bit pattern table first for each page in virtual machine, message bit pattern table includes empty The correspondence of the address and the first message bit pattern and the second message bit pattern of each page in quasi- machine.A bit can be passed through respectively Value indicate the two states of the first message bit pattern and the second message bit pattern.For example indicate that the first bitmap is believed with 1 or 0 respectively The two states of breath and the second message bit pattern.
For convenience of description, in various embodiments of the present invention, the value of the first message bit pattern indicates that the page is write-protected with 0, not It is changed, indicates that change the page has been changed with 1;The value of second message bit pattern indicates that the page needs to preserve but do not preserve with 1, uses 0 indicates that the page has been saved or has been illustrated for need not preserving.
In the present embodiment in the continuous snapshot of progress virtual machine, virtual machine is shut down first, it then will be in message bit pattern table The value of first message bit pattern copies in the second message bit pattern, so continuous fast photographing device of virtual machine can according to the page whether It is modified to judge whether the page needs to save.For example, if including 3 pages altogether in virtual machine, virtual machine is shut down When, the value of the first message bit pattern of first page and the third page is 1, and the value of the first message bit pattern of second page is 0, then Illustrate that first page and the third page are changed, second page is not changed, and the first message bit pattern of each page is copied to After second message bit pattern, the second message bit pattern of first page and the third page is 1, and the second message bit pattern of second page is 0, Then illustrate that first page and the third page need to preserve, and second page need not preserve.
S12 initializes the value of the first message bit pattern of each page in the virtual machine.
Specifically, after the first message bit pattern of each page in virtual machine is copied to the second message bit pattern, this time for record In snapshot processes each page by modification situation, the first message bit pattern of each page is initialized, i.e., by first of each page The value of figure information is set to 0.Before next snapshot starts, the continuous fast photographing device of virtual machine again answers the first message bit pattern value of each page It makes into the second message bit pattern, can determine according to the second message bit pattern of each page changed in last time snapshot processes at this time The page, to only preserving the page being accordingly modified.
S13 restores the operation of the virtual machine.
It should be noted that above-mentioned S11 and S12 are only some simple data manipulations, required time is very short, to make void The time that quasi- machine is shut down is very short.
S14 judges whether the value of the second message bit pattern of each page in the virtual machine is the first preset value successively.
Each page that the value of second message bit pattern is the first preset value is saved in buffer area, and will be saved in slow by S15 The value for depositing the second message bit pattern of each page in area is changed to the second preset value.
Specifically, the first preset value in the present embodiment is 1.The continuous fast photographing device of virtual machine is shut down in virtual machine Afterwards, after the value of the first message bit pattern of each page in virtual machine only being copied to the second message bit pattern, that is, restore the fortune of virtual machine Row, later, judges the mark of the second message bit pattern of each page in virtual machine, if the mark of the second message bit pattern of certain page successively Knowledge is 0, then illustrates that the page has been saved or without preserving, if 1, has then illustrated that the page needs to preserve but do not preserve, will Each page that the value of the second message bit pattern is 1 in virtual machine is saved in buffer area, in addition to prevent virtual machine continuous snapshot dress It sets during whether judge the second message bit pattern of each page successively is 1, a certain page has been carried out repeating to judge, and it is more The case where secondary preservation, the continuous fast photographing device of virtual machine is the page that preserves will to be needed to be saved according to the second bitmap message identification slow After depositing area, then the mark of corresponding second message bit pattern in the page address is changed to 0.
It, can be by virtual machine before to virtual machine first time snapshot in the continuous Snapshot Method of virtual machine provided by the invention In the primary system one of the second message bit pattern of each page be set as 1, so continuous fast photographing device of virtual machine carries out first to virtual machine When secondary snapshot, each page can be saved in caching successively.In snapshot processes later, the second message bit pattern of each page Value can be determined according to the value of the first message bit pattern of the page, if the page is modified, by the second bitmap of the page The value of information is revised as 1, so that the continuous fast photographing device of virtual machine preserves the page when next snapshot so that the continuous snapshot dress of virtual machine The page only preserved to needs when setting each snapshot caches, and ensure that the integrality of the continuous snapshot of virtual machine.
The continuous Snapshot Method of virtual machine provided by the invention, the continuous fast photographing device of virtual machine only need to be in virtual machine stopping process The middle value by the first message bit pattern of each page in virtual machine copies in the second message bit pattern, you can restores the fortune of virtual machine Row successively carries out soon each page that needs preserve according to the value of the second message bit pattern of each page in virtual machine operational process According to preservation, since the time needed for the operation to each web page bitmap information is very short so that virtual machine is shut down in a snapshot processes Time is shorter, and only needs in the continuous snapshot processes of virtual machine to preserve the page changed from after last time snapshot so that all The page is only saved once, and the page quantity of preservation is few, to substantially reduce the time of snapshot of virtual machine, reduces void Quasi- influence of the continuous snapshot processes of machine to virtual machine performance.It is the continuous Snapshot Method embodiment of virtual machine that Fig. 2 provides for the present invention Two flow diagram.As shown in Fig. 2, before above-mentioned S13, this method further includes:
S20 carries out write-protect to the memory pages of the virtual machine.
Specifically, the continuous fast photographing device of virtual machine in order to intercept and capture the write request to the virutal machine memory page in real time, needs pair Virtual machine carries out write-protect.
After above-mentioned S13, this method further includes:
S21 intercepts and captures the write request to the memory pages of virtual machine being write-protected, and the write request includes to be written The address of the page of data and data to be written.
Specifically, when any entity needs the page into virutal machine memory that new data is written in network, it can be to void Quasi- machine sends write request can make virtual machine trap out to void the write operation of memory pages since virtual machine has carried out write-protect Quasi- monitor unit, to which virtual snapshot device can intercept the write request to virtual machine.Wherein, write request includes to be written The address of the page of new data.
The value of first message bit pattern of the page with the data to be written is changed to the preset value of third by S22.
Specifically, the continuous fast photographing device of virtual machine is when having intercepted write request, you can determine and the page in the write request The value of corresponding first message bit pattern in face address is 0, that is, illustrates that the page is write-protected, do not allow to change, then virtual machine is continuous The value of first message bit pattern of the page can be changed to 1 by fast photographing device, to mark the page to be changed.
S23 judges whether the value of the second message bit pattern of the page of the data to be written is the first preset value, if S24 is then executed, S25 is otherwise executed.
The page of the data to be written is saved in buffer area by S24.
S25 removes the write-protect to the pages of the data to be written, and the data to be written is written to described In the page of data to be written.
It should be noted that the above-mentioned steps S20 in the present embodiment carries out the operation of write-protect and above-mentioned S11 to virtual machine And without fixed sequencing between S12, as long as ensureing that S11, S12 and S20 are executed before S13, in Fig. 2 with S20 S12 it It is illustrated for afterwards.In addition step S21~S25 in the present embodiment is triggered after intercepting to the write request of virtual machine , it can be carried out at the same time between the action that their execution and above-mentioned S14 is actively initiated by the continuous fast photographing device of virtual machine. Above-mentioned S14 can always repeated from the background by the continuous fast photographing device of virtual machine, and step S10~S13, S21~S25 need It controls and realizes in foregrounding, is i.e. two processes are two threads carried out parallel, are independent of each other.
The page of data to be written is not saved before being changed in order to prevent, to data to be written in the present embodiment The page first judges whether the page has been stored in buffer area before modifying, i.e., first judge that the value of the second message bit pattern of the page is No is 1, if 1 again will first modify to the page after page deposit buffer area, if 0, then illustrate that the page is repaiied Data before changing may incorporate buffer area during the continuous fast photographing device of virtual machine executes above-mentioned S14, no longer need to protect It deposits.
The continuous Snapshot Method of virtual machine provided by the invention, the continuous fast photographing device of virtual machine only need to be in virtual machine stopping process The middle value by the first message bit pattern of each page in virtual machine copies in the second message bit pattern, you can restores the fortune of virtual machine Row carries out snapshot guarantor to each page that needs preserve successively when virtual machine is run according to the value of the second message bit pattern of each page It deposits, since the time needed for the operation to each web page bitmap information is very short, shortens the downtime of virtual machine, and in virtual machine It only needs to preserve the page changed from after last time snapshot in continuous snapshot processes so that all pages are only saved once, are protected The page quantity deposited is few, to substantially reduce the time of snapshot of virtual machine, reduces the continuous snapshot processes pair of virtual machine The influence of virtual machine performance.In addition, when receiving the write request to virtual machine, the first of the page for having modified data to be written After the value of message bit pattern, first determines and modify again to the page after the page of data to be written has preserved so that number to be written According to the page can be saved in front and back snapshot processes twice in the state before and after data are written, ensure that virtual machine connect The integrality and continuity of continuous snapshot.
Fig. 3 is the flow diagram of the continuous Snapshot Method embodiment of virtual machine provided by the invention three.As shown in figure 3, should Method further includes:
Whether S30, the residual capacity for monitoring the buffer area have reached the 4th preset value, if so then execute S31, otherwise Execute S34.
Specifically, the continuous fast photographing device of virtual machine will also monitor buffer area simultaneously when being stored in the page into buffer area Residual capacity, to prevent buffer area to be filled with or capacity is inadequate, and the new page being stored in is not saved.5th preset value It can be arranged according to the capacity of buffer area, such as be set as buffer capacity 1%, 3% or 0 etc..The present embodiment is to this It does not limit.
S31 deposits the page preserved in the buffer area shifting to specified position, and records time T1 used.
When due to by the data conversion storage in buffer area to disk, a large amount of input and output of host (Input and can be occupied Output, abbreviation IO) rate influences the performance of virtual machine to influence access of the virtual machine to I/O resource, therefore the present invention is real The continuous fast photographing device of virtual machine can be controlled by applying in example deposits the data shifting in buffer area to the rate of designated position.
S32, judges whether the time T1 is less than preset time T2, if so, executing S33, otherwise executes S34.
The embodiment of the present invention with it is adjacent twice by buffer area data shifting deposit to designated position at the beginning of carve be one Period occupies the I/O rate of host as possible not if can control and move to deposit to designated position by the data in buffer area in each period Influence the I/O rate that virtual machine occupies, you can improve the performance of virtual machine.
Further include in this method then:
In the past the primary operation for depositing the page preserved in buffer area shifting to specified position terminates up to this record It is secondary that the page preserved in buffer area is moved to the reality deposited to the virtual machine in the time interval T4 of the operation of specified position is defeated Enter output speed Vvm
Specifically, in virtual machine operational process, the size of the data of I/O operation each time, the IO of usual virtual machine are recorded As unit of sector, each sector is defaulted as 512 bytes for operation, so only recording the sector number of each I/O operation i.e. when record It can.Assuming that the sector sum recorded in T4 is N, then can determine within T4 times virtual machine actually enters output speed Vvm= (N*512)/T4。
According to the maximum input and output rate V of the virtual machinemaxAnd described actually enter output speed Vvm, described in determination The available input and output rate V of virtual machineava=Vmax-Vvm
In general, administrator can give the maximum I/O rate V of virtual machine one when virtual machine startsmax, thus can determine virtual The available I/O rate V of machineava=Vmax-Vvm
According to the current amount of storage S of the buffer areabufAnd the available input and output rate V of the virtual machineavaDetermine institute State preset time T2=Sbuf/Vava.If this amount of storage of buffer area is Sbuf, then can determine the data of buffer area this time Shifting is deposited to designated position available time, i.e., preset time T2=Sbuf/Vava=Sbuf/(Vmax-Vvm)=Sbuf/(Vmax-(N* 512)/T4)。
Each page that the value by the second message bit pattern is the first preset value is saved in the operation of buffer area by S33 Hang up T3 times, the T3=T2-T1.
If by comparing determining that the time T1 used in this time data write-in disk by buffer area is more available than in this period Time, T2 was short, then the rate that disk is this time written in the data of buffer area by explanation is likely larger than available I/O rate, in order to make It is in this period that the rate used in the data of buffer area write-in disk is relatively uniform, the snapshot process of virtual machine can be hung up The T3 times, to ensure to see that this time is suitable with T2 by the operating time T1 of the data write-in disk of buffer area on the whole, then Ensure that the speed that the data of buffer area are written to disk is less than above-mentioned available I/O rate.
It should be noted that not having between the process of above-mentioned S30~S33 and above-mentioned S10~S14 and the process of S20~S25 Fixed sequencing can be the process carried out parallel, can also often complete a snapshot in the continuous fast photographing device of virtual machine When, i.e., triggering executes a S30~S33, or can also set a fixed time interval, every the time interval Afterwards, the continuous fast photographing device of virtual machine triggers and executes S30~S33 etc., and the present embodiment does not limit this.
S34, execution judge whether the value of the second message bit pattern of each page in the virtual machine is first preset successively The operation of value.
, can be after specifically, when if the continuous fast photographing device of virtual machine judges that the capacity of buffer area may continue to preserve the page Whether continuous the second message bit pattern for judging each page in virtual machine is 1, and by the second message bit pattern for 1 the page be saved in it is slow It deposits in area.
The continuous Snapshot Method of virtual machine provided in this embodiment, the continuous fast photographing device of virtual machine is will be in virutal machine memory During the page is deposited into buffer area, while the capacity of buffer area is detected, in time to deposit the page shifting in buffer area to finger Fixed position, and according to the time that the page of buffer area is moved to designated position, control the time for hanging up snapshot processes, pass through Control every time deposits the page shifting in buffer area to the rate of specified position, reduces deposit the page shifting in buffer area as possible Influence to specified position to virtual machine performance.
Fig. 4 is the structural schematic diagram of the continuous fast photographing device embodiment of virtual machine provided by the invention one.As shown in Figure 1, should The continuous fast photographing device 400 of virtual machine, including:Shut down module 401, update module 402, initialization module 403, recovery module 404, Judgment module 405 and processing module 406.Wherein, module 401 is shut down for shutting down virtual machine;Update module 402 is used for basis The value of the first message bit pattern of each page updates the value of the second message bit pattern of each page, first bitmap in the virtual machine Information is for identifying whether each page is changed, and second message bit pattern is for identifying whether each page needs to protect It deposits, the first message bit pattern and the second message bit pattern of each page are corresponded with the address of each page;Initialization module 403 Value for the first message bit pattern for initializing each page in the virtual machine;Recovery module 404 is for restoring the virtual machine Operation;Judgment module 405 for judging whether the value of the second message bit pattern of each page in the virtual machine is first successively Preset value;Processing module 406 is used to each page that the value of the second message bit pattern is the first preset value being saved in buffer area, And the value of the second message bit pattern of each page for being saved in buffer area is changed to the second preset value.
In the continuous fast photographing device of virtual machine provided in this embodiment at the concrete function and the continuous snapshot of virtual machine of each module Reason flow can refer to the detailed description of the continuous Snapshot Method embodiment of above-mentioned virtual machine one, and details are not described herein again.
The continuous fast photographing device of virtual machine provided in this embodiment, the continuous fast photographing device of virtual machine need to only be shut down in virtual machine The value of the first message bit pattern of each page in virtual machine is copied in the second message bit pattern in journey, you can restore the fortune of virtual machine Row successively carries out soon each page that needs preserve according to the value of the second message bit pattern of each page in virtual machine operational process According to preservation, since the time needed for the operation to each web page bitmap information is very short so that virtual machine is shut down in a snapshot processes Time is shorter, and only needs in the continuous snapshot processes of virtual machine to preserve the page changed from after last time snapshot so that all The page is only saved once, and the page quantity of preservation is few, to substantially reduce the time of snapshot of virtual machine, reduces void Quasi- influence of the continuous snapshot processes of machine to virtual machine performance.
Fig. 5 is the structural schematic diagram of the continuous fast photographing device embodiment of virtual machine provided by the invention two.As shown in figure 5, On the basis of shown in Fig. 4, the continuous fast photographing device of the virtual machine 400 further includes:Write-protect module 501 and interception module 502.
Wherein, write-protect module 501 is used to carry out write-protect to the memory pages of the virtual machine;Interception module 502 is used In intercepting and capturing the write request to the memory pages being write-protected of virtual machine, the write request includes data to be written and to be written Enter the address of the page of data;The processing module 406 is additionally operable to believe the first bitmap of the page with the data to be written The value of breath is changed to the preset value of third;The judgment module 405 is additionally operable to judge the second of the page of the data to be written Whether the value of message bit pattern is the first preset value;The processing module 406 is additionally operable to if so, by the data to be written The page is saved in buffer area;The processing module 406 is additionally operable to remove the write-protect of the page to the data to be written, and will The data to be written are written in the page of the data to be written.
Further, the continuous fast photographing device of the virtual machine further includes:Monitoring modular 503.
Wherein, monitoring modular 503 is for monitoring whether the residual capacity of the buffer area has reached the 5th preset value;Institute Processing module 406 is stated to be additionally operable to if so, depositing the page preserved in the buffer area shifting to specified position, and used in record Time T1;The judgment module 405 is additionally operable to judge whether the time T1 is less than preset time T2;The processing module 406 are additionally operable to if so, each page that the value by the second message bit pattern is the first preset value is saved in buffer area T3 times, the T3=T2-T1 are hung up in operation.
In a kind of possible way of realization of the present invention, above-mentioned processing module 406 is additionally operable to if it is not, then continuing to execute successively Judge the second message bit pattern of each page in the virtual machine value whether be the first preset value operation.
In a kind of preferably way of realization of the present invention, the continuous fast photographing device of virtual machine 400 further includes:Computing module 504.
Wherein, computing module 504 is deposited for recording primary described move the page preserved in buffer area in the past to specified The operation of position terminates to deposit the page preserved in buffer area shifting to the time interval T4 of the operation of specified position up to this The interior virtual machine actually enters output speed Vvm;The computing module 504 is additionally operable to defeated according to the maximum of the virtual machine Enter output speed VmaxAnd described actually enter output speed Vvm, determine the available input and output rate V of the virtual machineava= Vmax-Vvm;The computing module 504 is additionally operable to according to the current amount of storage S of the buffer areabufAnd the virtual machine is available defeated Enter output speed VavaDetermine the preset time T2=Sbuf/Vava
The concrete function of each module and process flow can refer in the continuous fast photographing device of virtual machine provided in this embodiment The detailed description of the continuous snap processing method embodiment of virtual machine two and three is stated, details are not described herein again.
The continuous Snapshot Method of virtual machine provided by the invention, the continuous fast photographing device of virtual machine only need to be in virtual machine stopping process The middle value by the first message bit pattern of each page in virtual machine copies in the second message bit pattern, that is, restores the operation of virtual machine, Snapshot preservation is carried out to each page that needs preserve according to the value of the second message bit pattern of each page successively when virtual machine is run, Since the time needed for the operation to each web page bitmap information is very short, the downtime of virtual machine is shortened, and connect in virtual machine It only needs to preserve the page changed from after last time snapshot in continuous snapshot processes so that all pages are only saved once, are preserved Page quantity it is few, to substantially reduce the time of snapshot of virtual machine, reduce the continuous snapshot processes of virtual machine to void The influence of quasi- machine performance.In addition, when receiving the write request to virtual machine, first of the page of data to be written is being had modified After the value of figure information, first determines and modify again to the page after the page of data to be written has preserved so that data to be written The page can be saved in front and back snapshot processes twice in the state before and after data are written, ensure that virtual machine is continuous The integrality and continuity of snapshot.In addition, according to the time that the page of buffer area is moved to designated position, control snapshot processes The time of hang-up is every time deposited the page shifting in buffer area to the rate of specified position by controlling, and reducing as possible will be slow The snapshot for depositing area moves influence when depositing to virtual machine performance.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer read/write memory medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or The various media that can store program code such as person's CD.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Present invention has been described in detail with reference to the aforementioned embodiments for pipe, it will be understood by those of ordinary skill in the art that:Its according to So can with technical scheme described in the above embodiments is modified, either to which part or all technical features into Row equivalent replacement;And these modifications or replacements, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (4)

1. a kind of continuous Snapshot Method of virtual machine, which is characterized in that including:
Virtual machine is shut down;
The value of the second message bit pattern of each page is updated according to the value of the first message bit pattern of each page in the virtual machine, it is described First message bit pattern is for identifying whether each page is changed, and whether second message bit pattern is for identifying each page It needs to preserve, the first message bit pattern and the second message bit pattern of each page are corresponded with the address of each page;
Initialize the value of the first message bit pattern of each page in the virtual machine;
Restore the operation of the virtual machine;
Judge whether the value of the second message bit pattern of each page in the virtual machine is the first preset value successively;
Each page that the value of second message bit pattern is the first preset value is saved in buffer area, and each of buffer area will be saved in The value of second message bit pattern of the page is changed to the second preset value;
Whether the residual capacity for monitoring the buffer area has reached the 4th preset value;
If so, depositing the page preserved in the buffer area shifting to specified position, and record time T1 used;
Judge whether the time T1 is less than preset time T2;
If so, the operation that each page that the value by the second message bit pattern is the first preset value is saved in buffer area is hung Play T3 times, the T3=T2-T1;
If it is not, whether the value for then continuing to execute the second message bit pattern for judging each page in the virtual machine successively is first default Value operation;
The primary operation for depositing the page preserved in buffer area shifting to specified position of record the past terminates will up to this The page that is preserved in buffer area move deposit in the time interval T4 of the operation of specified position the virtual machine actually enter it is defeated Go out rate Vvm
According to the maximum input and output rate V of the virtual machinemaxAnd described actually enter output speed Vvm, determine described virtual The available input and output rate V of machineava=Vmax-Vvm
According to the current amount of storage S of the buffer areabufAnd the available input and output rate V of the virtual machineavaIt determines described pre- If time T2=Sbuf/Vava
2. the continuous Snapshot Method of virtual machine according to claim 1, which is characterized in that the fortune for restoring the virtual machine Before row, further include:
Write-protect is carried out to the memory pages of the virtual machine;
After the operation for restoring the virtual machine, further include:
Intercept and capture the write request to the memory pages being write-protected of the virtual machine, the write request includes data to be written And the address of the page of data to be written;
The value of first message bit pattern of the page with the data to be written is changed to the preset value of third;
Judge whether the value of the second message bit pattern of the page of the data to be written is the first preset value;
If so, the page of the data to be written is saved in buffer area;
The write-protect to the page of the data to be written is removed, and the data to be written are written to the number to be written According to the page in.
3. a kind of continuous fast photographing device of virtual machine, which is characterized in that including:
Module is shut down, for shutting down virtual machine;
Update module, the second bitmap for updating each page according to the value of the first message bit pattern of each page in the virtual machine The value of information, first message bit pattern is for identifying whether each page is changed, and second message bit pattern is for identifying Whether each page needs to preserve, the address one of the first message bit pattern and the second message bit pattern and each page of each page One corresponds to;
Initialization module, the value of the first message bit pattern for initializing each page in the virtual machine;
Recovery module, the operation for restoring the virtual machine;
Judgment module, for judging whether the value of the second message bit pattern of each page in the virtual machine is first preset successively Value;
Processing module for each page that the value of the second message bit pattern is the first preset value to be saved in buffer area, and will protect The value for being stored to the second message bit pattern of each page of buffer area is changed to the second preset value;
Whether monitoring modular, the residual capacity for monitoring the buffer area have reached the 5th preset value;
The processing module is additionally operable to if so, the page preserved in the buffer area shifting is deposited to specified position, and is recorded Time T1 used;
The judgment module is additionally operable to judge whether the time T1 is less than preset time T2;
The processing module is additionally operable to if so, being each page of the first preset value by the value by the second message bit pattern T3 times, the T3=T2-T1 are hung up in the operation for being saved in buffer area;
The processing module is additionally operable to if it is not, then continuing to execute the second bitmap letter for judging each page in the virtual machine successively The value of breath whether be the first preset value operation;
Computing module is deposited for recording primary described move the page preserved in buffer area in the past to the operation knot of specified position The page preserved in buffer area shifting this is deposited to the virtual machine in the time interval T4 of the operation of specified position by Shu Shizhi Actually enter output speed Vvm
The computing module is additionally operable to the maximum input and output rate V according to the virtual machinemaxAnd described actually enter output Rate Vvm, determine the available input and output rate V of the virtual machineava=Vmax-Vvm
The computing module is additionally operable to according to the current amount of storage S of the buffer areabufAnd the available input of the virtual machine is defeated Go out rate VavaDetermine the preset time T2=Sbuf/Vava
4. the continuous fast photographing device of virtual machine according to claim 3, which is characterized in that further include:
Write-protect module carries out write-protect for the memory pages to the virtual machine;
Interception module is wrapped for intercepting and capturing the write request to the memory pages of the virtual machine being write-protected in the write request Include the address of the page of data to be written and data to be written;
The processing module is additionally operable to the value of the first message bit pattern of the page with the data to be written being changed to third pre- If value;
The judgment module is additionally operable to judge whether the value of the second message bit pattern of the page of the data to be written is first pre- If value;
The processing module is additionally operable to if so, the page of the data to be written is saved in buffer area;
The processing module, is additionally operable to remove the write-protect to the page of data to be written, and by the data to be written It is written in the page of the data to be written.
CN201410532668.0A 2014-10-10 2014-10-10 The continuous Snapshot Method of virtual machine and device Active CN105573813B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410532668.0A CN105573813B (en) 2014-10-10 2014-10-10 The continuous Snapshot Method of virtual machine and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410532668.0A CN105573813B (en) 2014-10-10 2014-10-10 The continuous Snapshot Method of virtual machine and device

Publications (2)

Publication Number Publication Date
CN105573813A CN105573813A (en) 2016-05-11
CN105573813B true CN105573813B (en) 2018-11-13

Family

ID=55883985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410532668.0A Active CN105573813B (en) 2014-10-10 2014-10-10 The continuous Snapshot Method of virtual machine and device

Country Status (1)

Country Link
CN (1) CN105573813B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110825497B (en) * 2019-11-22 2022-04-22 北京浪潮数据技术有限公司 Virtual machine startup and shutdown method, device, equipment and medium
CN113849341B (en) * 2021-08-31 2023-09-08 苏州浪潮智能科技有限公司 Performance optimization method, system and equipment for NAS snapshot and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331949A (en) * 2011-10-12 2012-01-25 华为技术有限公司 Methods for generating and restoring memory snapshot of virtual machine, device and system
CN102436410A (en) * 2011-12-12 2012-05-02 华中科技大学 On-line storage method of virtual machine inspection point
CN103092673A (en) * 2012-11-27 2013-05-08 北京航空航天大学 Snapshot processing method and device for virtual machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8549241B2 (en) * 2010-01-06 2013-10-01 Vmware, Inc. Method and system for frequent checkpointing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331949A (en) * 2011-10-12 2012-01-25 华为技术有限公司 Methods for generating and restoring memory snapshot of virtual machine, device and system
CN102436410A (en) * 2011-12-12 2012-05-02 华中科技大学 On-line storage method of virtual machine inspection point
CN103092673A (en) * 2012-11-27 2013-05-08 北京航空航天大学 Snapshot processing method and device for virtual machine

Also Published As

Publication number Publication date
CN105573813A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
CN104407938B (en) A kind of a variety of granularity restoration methods after virtual machine image level backup
US8789069B2 (en) On-the-fly replacement of physical hardware with emulation
US20200097368A1 (en) Method and Apparatus for Generating Virtual Machine Snapshot
CN109428913B (en) Storage capacity expansion method and device
CN106919471A (en) For the method and system that snapshot is set up
CN102012853B (en) Zero-copy snapshot method
CN107291883A (en) The Snapshot Method and device of a kind of distributed memory system
CN106293781B (en) The method and apparatus of online upgrading machine virtual machine
US20130238867A1 (en) Method and apparatus to deploy and backup volumes
CN105190574B (en) Local cache consistency is provided in shared storage environment
CN104166601B (en) The backup method and device of a kind of data storage
US9552224B2 (en) Apparatus and method of data capture
KR20140147017A (en) System and method for recovering from an unexpected shutdown in a write-back caching environment
US20160050112A1 (en) Distributed caching systems and methods
CN107533602B (en) Computing device and method thereof, and computing system
CN105573813B (en) The continuous Snapshot Method of virtual machine and device
CN104951243B (en) Storage extended method and device in virtual storage system
US11347414B2 (en) Using telemetry data from different storage systems to predict response time
JP2008204460A (en) Near instantaneous backup and restoration of disc partition
JP2014194664A (en) Storage device, allocation release control method, and allocation release control program
US8977896B1 (en) Maintaining data integrity in data migration operations using per-migration device error flags
CN107301021A (en) It is a kind of that the method and apparatus accelerated to LUN are cached using SSD
US11748241B2 (en) Method and apparatus for generating simulated test IO operations
US10347284B2 (en) Fragmented data storage bands
US9384135B2 (en) System and method of caching hinted data

Legal Events

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