Embodiment
Fig. 1 is the process flow diagram of data back up method of the virtual machine consistently online migration of the embodiment of the invention;
Fig. 2 is the structural representation that the virtual disk of the embodiment of the invention is asked image file;
Fig. 3 is the synoptic diagram of the state exchange of the embodiment of the invention;
Fig. 4 is two signaling process figure that confirm operation of the embodiment of the invention;
Fig. 5 is the process flow diagram that the main host of the embodiment of the invention carries out the detailed process of consistently online migration;
Fig. 6 is the process flow diagram that the backup host of the embodiment of the invention carries out the detailed process of consistently online migration;
Fig. 7 is the structural representation of the main host of the embodiment of the invention;
Fig. 8 is the structural representation of the backup host of the embodiment of the invention;
Fig. 9 is the structural representation of the virtual machine consistently online migratory system of the embodiment of the invention.
Further specify the technical scheme of the embodiment of the invention below in conjunction with accompanying drawing and specific embodiment.
According to embodiments of the invention; A kind of data back up method of virtual machine consistently online migration is provided; Fig. 1 is the process flow diagram of data back up method of the virtual machine consistently online migration of the embodiment of the invention; As shown in Figure 1, may further comprise the steps according to the data back up method of the virtual machine consistently online of embodiment of the invention migration:
Step 101 according to the operation of host virtual machine instance virutal machine memory data on the main host and the data block in the virtual disk image file in the network memory are upgraded operation, and the virutal machine memory data after will upgrading sends to the backup host;
Particularly, in the process of host virtual machine instance operation, main host can upgrade operation to the data block of virutal machine memory data in the main host internal memory and the virtual disk image file in the network memory according to the operation of host virtual machine instance; For fear of when unexpected hardware fault takes place; Virtual machine can not be moved to non-fault machine in time and continued operation, and host virtual machine can be initiated online migration to the backup host constantly, for example; Host virtual machine is every initiates once online migration at a distance from the schedule time to the backup host; After initiating online migration, the virutal machine memory data after upgrading are sent to the backup host, can be in the process of operation to guarantee virtual machine; Running status with self is saved in the backup host continuously, makes the backup host preserve virtual machine state a little earlier.
Need to prove that in the virtual disk image file, the data of disk are unit composition data piece with specific size; Virtual machine can be reduced to the visit to the data block that comprises this address date to the visit of the data that comprise in a certain physical address of disk.In addition, include the mapping table of numbering virtual disk image file offset address by data block in the virtual disk image file.In embodiments of the present invention; As shown in Figure 2; Except preserving metadata and data block, the lightweight snapshot can also be preserved two mapping tables in the virtual disk image file in the virtual disk image file: current mapping table and snapshot mapping table, wherein; Current mapping table is used to identify disk under current state and snapshot state, the position of data block in the virtual disk image file; The snapshot mapping table is used to identify disk under snapshot state, the position of data block in the virtual disk image file.
In embodiments of the present invention, also define the state of data block, comprised following four kinds of states:
Unallocated state: be not the data block allocations storage space as yet in the virtual disk image file;
Distributed read-write state: be data block memory allocated space in the virtual disk image file, and allowed this data block is carried out read-write operation;
Distributed a read states: be data block memory allocated space in the virtual disk image file, but forbidden writing data to this storage space;
Distributed state to be recycled; Be data block memory allocated space in the virtual disk image file, but this data block is updated, when creating the lightweight snapshot, this data block will be recovered next time.
In the lightweight snapshot, any one data block can only be in the wherein a kind of state in above-mentioned four kinds of states.For the data block that is in unallocated state; Can in current mapping table, use and corresponding virtual disk image file offset address is designated unappropriated mode the state of data block is identified; For example, with corresponding virtual disk image file offset address sign " 0 "; For being in the data block of distributing read-write state, distributing a read states, perhaps having distributed state to be recycled, can use bitmap that the state of this data block is identified.
In step 101, the renewal operation that the data block in the right virtual disk image file of main host is carried out specifically comprises:
1, read operation: according to data block numbering read block data;
2, write operation: write data to given data block numbering;
3, batch operation: according to data block numbering distribute data piece in the virtual disk image file;
4, releasing operation: discharge given data block occupation space in the virtual disk image file.
Particularly, when carrying out read operation, handle below needing to carry out: 1, the data block of data block is numbered and be mapped as virtual disk image file offset address according to current mapping table; 2, the state of confirming this data block be in distribute read-write state, distribute a read states, or distributed under the situation of state to be recycled, read the data block of designated length and return according to virtual disk image file offset address; 3, be under the situation of unallocated state at the specified data bulk state, do not operate, directly return.
When carrying out write operation, handle below needing to carry out: 1, the data block of data block is numbered and be mapped as virtual disk image file offset address according to current mapping table; 2, be under the situation of unallocated state at the state of confirming this data block, carry out batch operation, write data according to virtual disk image file offset address then and return; 3, be under the situation of distributing read-write state at the state of confirming this data block, directly write data and return according to virtual disk image file offset address; 4, be under the situation of distributing a read states at the state of confirming this data block; New data block is carried out batch operation; With the status modifier of former data block for distributing state to be recycled, 5, the virtual disk image file offset address that distributes according to batch operation writes data and return.
As above, when carrying out write operation, might need to carry out batch operation, carrying out batch operation needs following the processing: confirm that 1, minimum unallocated continuation address is an address space to be allocated; 2, with the status modifier of the data block in the address space to be allocated for distributing read-write state; 3, obtain the virtual disk image file offset address of address space to be allocated; 4, use the virtual disk image file offset address of address space to be allocated to upgrade current mapping table; 5, the virtual disk image file offset address that returns address space to be allocated is given write operation.
When carrying out releasing operation, handle below needing to carry out: the status modifier of the data block that 1, will discharge is unallocated; The station location marker of the data block that 2, will discharge in current mapping table is unallocated, and for example, the station location marker of data block in current mapping table that needs are discharged is " 0 ".
By on can know; In step 101; Main host also can upgrade the current mapping table of data block numbering under the preservation current state with virtual disk image file offset address corresponding relation when the data block in the virtual disk image file in the network memory being upgraded operation synchronously.
Step 102; Operation suspension host virtual machine instance; Lock through the state of lock operation, obtain the lightweight snapshot of virtual disk image file data block in the virtual disk image file, and the host virtual machine instance that resumes operation; Wherein, the virtual disk image file is used to back up host and carries out rolling back action.
Particularly; When the online migration of main host reaches a predetermined critical point; Main host needs operation suspension host virtual machine instance, locks through the state of lock operation to data block in the virtual disk image file, obtains the lightweight snapshot of this virtual disk image file; Wherein, above-mentioned virtual disk image file is used to back up host and carries out rolling back action; After obtaining the lightweight snapshot, main host just can recover the operation of host virtual machine instance.
State through data block in the lock operation locking virtual disk image file; Obtain the lightweight snapshot of virtual disk image file,, can avoid the waste of storage space because this lightweight snapshot only need take very little storage space; In addition; According to the technical scheme of the embodiment of the invention a large amount of virtual disk image file data of needs transmission not, and can create the lightweight snapshot fast, greatly improve the performance of virtual machine.
As stated; Lock operation can be created the lightweight snapshot for the virtual disk image file; When carrying out lock operation, comprise following processing: 1, for being in the data block of distributing read-write state in the current mapping table, with the status modifier of this data block for distributing a read states; 2, for being in the data block of distributing state to be recycled in the current mapping table, this data block is carried out releasing operation; 3, use current mapping table to cover the snapshot mapping table, wherein, above-mentioned snapshot mapping table is used to represent that disk data block under snapshot state is numbered and the corresponding relation of virtual disk image file offset address.
In addition; In step 102; Behind the lightweight snapshot that obtains this virtual disk image file, main host can be kept at this lightweight snapshot in the virtual disk image file, also can the lightweight snapshot be kept in the internal memory of main host; If the lightweight snapshot is kept in the internal memory of main host, main host need send to subsequent use host with this lightweight snapshot as the part of virutal machine memory data through network.Because the speed of read/write data is much larger than the speed of read/write data from disk from internal memory; The lightweight snapshot is kept in the internal memory of main host; Can reduce read/write operation, thereby shorten the running time, can in the shorter time, carry out online migration disk.
After step 102, under the situation that the host virtual machine instance can not continue to move, the backup host returns to the virtual disk image file and back up the state of the virutal machine memory data consistent of host preservation through rolling back action according to this lightweight snapshot; Subsequently, the backup host just can be according to virtual disk image file after the rollback and virutal machine memory data run backup virtual machine instance.
Wherein, Rolling back action can return to the state when setting up the lightweight snapshot with the virtual disk image file; When the execution rolling back action comprises, comprise following processing: 1,, this data block is carried out releasing operation for being in the data block of distributing read-write state in the current mapping table; 2, for being in the data block of distributing state to be recycled in the current mapping table, with this data block status modifier for distributing a read states; 3, use the snapshot mapping table to cover current mapping table.
Below, the conversion of each operation to the data bulk state is elaborated.Fig. 3 is the synoptic diagram of the state exchange of the embodiment of the invention, and is as shown in Figure 3, if data block is in unallocated state, after the execution batch operation, the state transformation of data block is for distribute read-write state; If the data block to distributing read-write state conducts the locking operations, the state transformation of this data block is for distribute a read states; If the data block to distributing a read states is carried out write operation, then the state transformation of former data block is for distribute state to be recycled, and the state transformation of new data block is for distribute read-write state; If the data block to distributing state to be recycled is carried out lock operation and releasing operation, the state transformation of this data block is unallocated state; If carry out rolling back action to being in the data block of distributing state to be recycled, then the state exchange of this data block is for distribute a read states; If carry out rolling back action to being in the data of distributing read-write state, the state exchange of this data block is unallocated state.The data block of distributing read-write state is carried out the read/write operation attitude of will remaining stationary; The data block of distributing a read states is carried out the read operation attitude of also will remaining stationary.
Continuing based on virtual machine in the high-availability system of migration, needing to guarantee state consistency between disk internal state consistance and disk and internal memory.Wherein, Network memory internal state consistance is meant at any time; Be in conforming state between each data block that comprises in the virtual disk image file, thereby make the normal data in the reading disk and can not read and write mistake of operating system and application program of virtual disk driver and virtual machine; State consistency is meant that the data that copy in the virutal machine memory data that virtual machine had and the data block of disk from the virtual disk image file on the backup host are consistent in time between disk and internal memory; That is the final modification time of the data that, copy in final time of revising of virutal machine memory data and the data block of disk from the virtual disk image file is identical.
In embodiments of the present invention; The lightweight snapshot can be realized " lock operation " and " rolling back action " for network memory; When accomplishing once online migration; Can " lock " in the network memory state of data block in the virtual disk image file, guarantee that subsequent write operation can not influence the historic state of data block in the virtual disk image file, the consistance of promptly protecting the disk internal state; When virtual machine breaks down when needing rollback; The state of data block in the virtual disk image file in can " rollback " network memory; Abandon and the inconsistent modification of virutal machine memory data, the data block in the virtual disk image file is rolled back to one and the corresponding to version of virutal machine memory data.Can guarantee the consistance of state between disk and internal memory.
In addition, the embodiment of the invention can also further guarantee the consistance of state between disk and internal memory through two affirmation mechanisms.Main host can obtain to back up the affirmation of host to the virutal machine memory data after being saved on the backup host through online migration mechanism the virutal machine memory data; Main host can obtain disk snapshot and confirm after disk is carried out the operation of lightweight snapshot creation.Have only after main host obtains two affirmations, can recover the virtual machine operation, thereby guarantee the consistance of state between disk and internal memory.Fig. 4 is two signaling process figure that confirm operation of the embodiment of the invention, and is as shown in Figure 4, comprises following processing:
Step 401, main host starts virtual machine;
Step 402, main host is initiated online migration, and sends the virutal machine memory data to the backup host;
Step 403, when online migration arrived a predetermined critical point, main host was accomplished the transmission of virutal machine memory data, suspends the operation of virtual machine;
Step 404, backup host are sent Memory Backup to main host and are confirmed that main host receives the Memory Backup that returns and confirms;
Step 405, main host is created the lightweight snapshot;
Step 406, main host receive the lightweight snapshot foundation affirmation that network memory returns;
Step 407, after main host has received Memory Backup affirmation and lightweight snapshot foundation affirmation, the operation that recovers virtual machine.
Through above-mentioned processing, can guarantee the consistance of state between disk and internal memory.Those skilled in the art can understand; When realizing the above-mentioned processing procedure of the embodiment of the invention; Main host also can receive only Memory Backup and confirm or receive only the lightweight snapshot to set up affirmation; Another is confirmed that main host can be given tacit consent to and receives, can reach the conforming purpose that guarantees state between disk and internal memory equally.
Below, from the angle of main host, processing procedure shown in Figure 1 is carried out complete explanation respectively with the backup host.Fig. 5 is the process flow diagram that the main host of the embodiment of the invention carries out the detailed process of consistently online migration, and is as shown in Figure 5, comprises following processing:
Step 501, main host loads the virtual disk image file of host virtual machine instance, starts the host virtual machine instance;
Step 502, main host is confirmed suitable backup host according to start-up parameter or predefined strategy;
Step 503, main host is initiated online migration to the backup host;
Step 504 when the online migration of main host arrives predetermined critical point, is suspended the operation of host virtual machine instance;
Step 505, the lock operation that main host provides through the lightweight snapshot are that the virtual disk image file of host virtual machine instance is created the lightweight snapshot;
Step 506, main host recovers the operation of host virtual machine instance;
Step 507, main host judge whether to arrive new backup point; If do not reach new backup point, then do not do any operation, execution instep 503, the operation that keeps the host virtual machine instance; If reach new backup point, then turn back to step 503; If break down, then execution instep 508;
Step 508, main host stops the operation of host virtual machine instance, and the state of cleaning host virtual machine instance.
Through above-mentioned processing, main host can be created the lightweight snapshot for the virtual disk image file through the lock operation that the lightweight snapshot provides, and guarantees that subsequent write operation can not influence the historic state of virtual disk image file.
Fig. 6 is the process flow diagram that the backup host of the embodiment of the invention carries out the detailed process of online migration, and is as shown in Figure 6, comprises following processing:
Step 601, the backup host is according to the request of host virtual machine or the virtual disk image file of predefined strategy loading backup virtual machine;
Step 602, the backup host suspends the operation of the virtual disk image file of backup virtual machine, waits for online migration;
Step 603, the backup host detects the health status of the host virtual machine instance on the main host, if the host virtual machine instance breaks down, can not normally move, and then execution instep 604; Otherwise, execution instep 602;
Step 604, the backup host loads the virutal machine memory data that the host virtual machine instance transmits through online migration pattern;
Step 605, the lightweight snapshot of preserving in the tool loads virtual disk image file that the backup host provides through the lightweight snapshot;
Step 606, the corresponding to state of virutal machine memory data that the rolling back action that the backup host uses the lightweight snapshot to provide rolls back to the virtual disk image file and preserve;
Step 607, the operation that the backup host recovers virtual machine, and operation backup virtual machine instance;
Step 608, the backup host moves as main host, and the backup virtual machine instance is initiated consistently online migration next time subsequently as the operation of host virtual machine instance.
Through above-mentioned processing; When virtual machine breaks down rollback; Can abandon virtual disk image file and the inconsistent modification of virutal machine memory state through rolling back action; The virtual disk image file is rolled back to one and the corresponding to version of internal storage state, make that virtual machine can be at backup host relaying reforwarding row.
According to another embodiment of the present invention; A kind of main host is provided; Fig. 7 is the structural representation of the main host of the embodiment of the invention, and is as shown in Figure 7, comprises according to the main host of the embodiment of the invention: updatemodule 70, sendingmodule 72 and lockingmodule 74; Below, the main host according to the embodiment of the invention is carried out detailed explanation.
Particularly, in the process of host virtual machine instance operation,update module 70 is upgraded operation according to the operation of host virtual machine instance to the data block in the virtual disk image file in virutal machine memory data and the network memory.
Need to prove that in the virtual disk image file, the data of disk are unit composition data piece with specific size; Virtual machine can be reduced to the visit to the data block that comprises this address date to the visit of the data that comprise in a certain physical address of disk.In addition, as shown in Figure 2 in embodiments of the present invention, except preserving metadata and data block, the lightweight snapshot can also be preserved two mapping tables in the virtual disk image file in the virtual disk image file.
In embodiments of the present invention, also defined the state of data block, comprised following four kinds of states: unallocated state, distribute read-write state, distribute a read states, distribute state to be recycled.In the lightweight snapshot, any one data block can only be in the wherein a kind of state in above-mentioned four kinds of states.For the data block that is in unallocated state; Can in current mapping table, use and corresponding virtual disk image file offset address is designated unappropriated mode the state of data block is identified; For example, with corresponding virtual disk image file offset address sign " 0 "; For being in the data block of distributing read-write state, distributing a read states, perhaps having distributed state to be recycled, can use bitmap that the state of this data block is identified.
The renewal operation that data block in the virtual disk image file that update module is 70 pairs is carried out specifically comprises: 1, read operation, 2, write operation, 3, batch operation, 4, releasing operation.The concrete processing procedure that updatemodule 70 is carried out aforesaid operations can be understood with reference to the related content in the foregoing description, repeats no more inferior.
In addition;Update module 70 also can be upgraded the current mapping table of data block numbering under the preservation current state with virtual disk image file offset address corresponding relation when the data block in the virtual disk image file in the network memory being upgraded operation synchronously.
For fear of when unexpected hardware fault takes place; Virtual machine can not be moved to non-fault machine in time and continued operation, and host virtual machine can be initiated online migration to the backup host constantly, for example; Host virtual machine is every initiates once online migration at a distance from the schedule time to the backup host; After initiating online migration, the virutal machine memory data after sendingmodule 72 will upgrade send to the backup host, can be in the process of operation to guarantee virtual machine; Running status with self is saved in the backup host continuously, makes the backup host preserve virtual machine state a little earlier.
When the online migration of main host reaches a predetermined critical point; Lockingmodule 74 needs operation suspension host virtual machine instance; Lock through the state of lock operation data block in the virtual disk image file; Obtain the lightweight snapshot of this virtual disk image file, wherein, above-mentioned virtual disk image file is used to back up host and carries out rolling back action; After obtaining the lightweight snapshot, recover the operation of host virtual machine instance.
As stated; Lock operation can be created the lightweight snapshot for the virtual disk image file; When carrying out lock operation, comprise following processing: 1, for being in the data block of distributing read-write state in the current mapping table, with the status modifier of this data block for distributing a read states; 2, for being in the data block of distributing state to be recycled in the current mapping table, this data block is carried out releasing operation; 3, use current mapping table to cover the snapshot mapping table.
After lockingmodule 74 obtains the lightweight snapshot of this virtual disk image file; Main host can be kept at this lightweight snapshot in the virtual disk image file; Also the lightweight snapshot is kept in the internal memory of main host; If the lightweight snapshot is kept in the internal memory of main host, main host need send to subsequent use host with this lightweight snapshot as the part of virutal machine memory data through network.Because the speed of read/write data is much larger than the speed of read/write data from disk from internal memory; The lightweight snapshot is kept in the internal memory of main host; Can reduce read/write operation, thereby shorten the running time, can in the shorter time, carry out online migration disk.
Through above-mentioned processing, main host can be created the lightweight snapshot for the virtual disk image file through the lock operation that the lightweight snapshot provides, and guarantees that subsequent write operation can not influence the historic state of virtual disk image file.
According to an embodiment more of the present invention; A kind of backup host is provided; Fig. 8 is the structural representation of the backup host of the embodiment of the invention, and is as shown in Figure 8, comprises according to the backup host of the embodiment of the invention: preservemodule 80, roll-back module 82, operation module 84.Below, the backup host according to the embodiment of the invention is elaborated.
Particularly, thepreservation module 80 of backup host is preserved the virutal machine memory data that main host sends; Under the situation that the host virtual machine instance can not continue to move, the roll-back module 82 of backup host returns to the virtual disk image file and back up the state of the virutal machine memory data consistent of host preservation through rolling back action according to this lightweight snapshot; Subsequently,operation module 84 just can be according to virtual disk image file after the rollback and virutal machine memory data run backup virtual machine instance.
Wherein, The rolling back action of roll-back module 82 can return to the state when setting up the lightweight snapshot with the virtual disk image file; When roll-back module 82 execution rolling back actions comprise; Comprise following processing: 1,, this data block is carried out releasing operation for being in the data block of distributing read-write state in the current mapping table; 2, for being in the data block of distributing state to be recycled in the current mapping table, with this data block status modifier for distributing a read states; 3, use the snapshot mapping table to cover current mapping table.
Through above-mentioned processing; When virtual machine breaks down rollback; The backup host can abandon virtual disk image file and the inconsistent modification of virutal machine memory state through rolling back action; The virtual disk image file is rolled back to one and the corresponding to version of internal storage state, make that virtual machine can be at backup host relaying reforwarding row.
According to an embodiment more of the present invention; A kind of virtual machine consistently online migratory system is provided, and Fig. 9 is the structural representation of the virtual machine consistently online migratory system of the embodiment of the invention, and is as shown in Figure 9; Virtual machine consistently online migratory system according to the embodiment of the invention comprises: main host 1, network memory 3, backup host 5; Wherein, comprise in the main host 1: host virtual machine 10, promptly above-mentioned host virtual machine instance; All use host virtual machine 10, main host monitor of virtual machine 12, main host operating system and hardware 14 in the following description; Comprise in the main host monitor of virtual machine 12: main host migration controller 120, main host lightweight snapshot drives 122, comprises in main host operating system and the hardware 14: network memory drives 140; Comprise in the backup host 5: backup virtual machine 50; It is above-mentioned backup virtual machine instance; All use backup virtual machine 50, backup host monitor of virtual machine 52, backup host operating system and hardware 54 in the following description; Comprise in the backup host monitor of virtual machine 52: backup host migration controller 520, backup host lightweight snapshot drives 522; Comprise in backup host operating system/hardware 54: network memory drives 540; Wherein, main host monitor of virtual machine 12 is connected with backup host monitor of virtual machine 52 through network, and the backup virtual machine 50 on the host virtual machine 10 of main host 1 and the backup host 5 is shared the virtual disk image file through network memory 3.Below, the virtual machine consistently online migratory system according to the embodiment of the invention is elaborated.
Particularly, be example at first with main host 1, the structure of host is described.Comprise internal memory and disk in the hostvirtual machine 10, wherein, the mainhost migration controller 120 in internal memory and the main host monitor of virtual machine 12 links to each other; Under the control of mainhost migration controller 120; Can the virutal machine memory data be sent to backuphost migration controller 520, the disk that main host lightweight snapshot driving 122 is connected in the hostvirtual machine 10, and the virtual disk image file that drives in 140 pairs ofnetwork memories 3 through network memory carries out the lightweight snapshot; Wherein, Network memory drives 140 and is used fornetwork memory 3 is driven, and,network memory 3 is carried out read/write operation that is.
Below, main host 1 and the process thatbackup host 5 carries out the consistently online migration are elaborated.
At first; Main host 1 loads the virtual disk image file of hostvirtual machine 10 fromnetwork memory 3 through network memory driving 140; And start hostvirtual machine 10, subsequently, main host 1 is confirmedsuitable backup host 5 according to start-up parameter or predefined strategy.
Backup host 5 is according to the request of main host 1 or the virtual disk image file of predefined strategy loading backupvirtual machine 50, and subsequently,backup host 5 suspends the operation of the virtual disk image file of backupvirtual machine 50, waits for online migration.
Mainhost migration controller 120 is initiated online migration to backuphost migration controller 520; After initiating online migration; Virutal machine memory data after mainhost migration controller 120 will upgrade send to the backup host; When the online migration of main host 1 arrived predetermined critical point, main host 1 suspended the operation of hostvirtual machine 10, and the lock operation that main host lightweight snapshot driving 122 provides through the lightweight snapshot is that the virtual disk image file of hostvirtual machine 10 is created the lightweight snapshot; After setting up the lightweight snapshot, the operation that main host 1 recovers hostvirtual machine 10.
Main host 1 judges whether to arrive new backup point, if do not reach new backup point, then main host 1 is not done any operation, continues to keep the operation of hostvirtual machine 10; If reach new backup point, mainhost migration controller 120 is initiated online migration once more tobackup host 5; If hostvirtual machine 10 breaks down, 1 operation that stops hostvirtual machine 10 of main host, and the state of cleaning hostvirtual machine 10.
Whenbackup host 5 is waited for online migration;Backup host 5 needs to detect the health status of the host virtual machine instance on the main host 1; If hostvirtual machine 10 breaks down and definite hostvirtual machine 10 can not normally move;Backup host 5 loads the virutal machine memory data that hostvirtual machine 10 transmits through online migration pattern, otherwisebackup host 5 continues to wait for online migration.
Afterbackup host 5 loads the virutal machine memory data of hostvirtual machine 10 through online migration pattern transmission; Backup host lightweight snapshot drives the lightweight snapshot of preserving in the 522 tool loads virtual disk image files that provide through the lightweight snapshot, and the rolling back action that uses the lightweight snapshot to provide the corresponding to state of virutal machine memory data that the virtual disk image file is rolled back to and preserves.
Carrying out behind the rolling back action,backup host 5 operation backupvirtual machine 50,backup host 5 is as main host 1 operation, and backupvirtual machine 50 backs uphost migration controller 520 subsequently and initiates consistently online migration next time as hostvirtual machine 10 operations.
In addition, the embodiment of the invention can also further guarantee the consistance of state between disk and internal memory through two affirmation mechanisms.Main host 1 can obtain to back up the affirmation of 5 pairs of virutal machine memory data of host after being saved on thebackup host 5 through online migration mechanism the virutal machine memory data; After 1 pair of disk of main host carries out the operation of lightweight snapshot creation, can obtain disk snapshot and confirm.Have only after main host 1 obtains two affirmations, can recover the virtual machine operation, thereby guarantee the consistance of state between disk and internal memory.Its detailed process can be understood with reference to Fig. 4, repeats no more at this.
In sum, main host can be created the lightweight snapshot for the virtual disk image file through the lock operation that the lightweight snapshot provides, and guarantees that subsequent write operation can not influence the historic state of virtual disk image file; When virtual machine breaks down rollback; Can abandon virtual disk image file and the inconsistent modification of virutal machine memory state through rolling back action; The virtual disk image file is rolled back to one and the corresponding to version of internal storage state, make that virtual machine can be at backup host relaying reforwarding row.
And; Because the embodiment of the invention has been preserved current mapping table and snapshot mapping table; Make this lightweight snapshot only need take very little storage space; Can not increase the space of storage snapshot along with the increase of snapshot number of times, overcome the defective that disk snapshot in the prior art need take a large amount of storage spaces.In addition, the embodiment of the invention has guaranteed that also virtual machine can be in the process of operation, and the running status with self is saved in the backup host continuously, makes the backup host can have host virtual machine coherency state a little earlier; And, through setting up continuous storage space, and the state of data in magnetic disk piece is saved in the continuous memory block for the data block of disk, can reduce read/write operation to exterior storage, shorten the time of lock operation, rolling back action.According to the technical scheme of the embodiment of the invention a large amount of virtual disk image file data of needs transmission not, and can create the lightweight snapshot fast, greatly improve the performance of virtual machine.
Through the description of above embodiment, those skilled in the art can be well understood to each embodiment and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware.Based on such understanding; The part that technique scheme contributes to prior art in essence in other words can be come out with the embodied of software product; This computer software product can be stored in the computer-readable recording medium, like ROM/RAM, magnetic disc, CD etc., comprises that some instructions are with so that a computer equipment (can be a personal computer; Server, perhaps network equipment etc.) carry out the described method of some part of each embodiment or embodiment.
What should explain at last is: above embodiment is only in order to explaining technical scheme of the present invention, but not to its restriction; Although with reference to previous embodiment the present invention has been carried out detailed explanation, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these are revised or replacement, do not make the spirit and the scope of the essence disengaging various embodiments of the present invention technical scheme of relevant art scheme.