IP Library › Granted Patent US 9,842,032
Granted Patent B2
US 9,842,032 · App. 14/011,572 · Granted Dec 12, 2017

Memory first live snapshot

Inventor: Eric Blake (Salt Lake City, UT)
Assignee: Red Hat, Inc.
G06F11/1484G06F11/1438G06F2201/84
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,842,032
App. No.
14/011,572
Granted
Dec 12, 2017
Kind
B2
Abstract

The subject matter of this specification can be implemented in, among other things, a method including receiving a request to create a live snapshot of a state of a virtual machine including a memory and an original disk file. The method further includes copying, by a hypervisor, data from the memory to a storage device to form a memory snapshot. The method further includes pausing the virtual machine and creating a new disk file at a reference point-in-time. The original disk file is a backing file of the new disk file. The method further includes resuming the virtual machine. The virtual machine is to perform disk operations using the new disk file after the reference point-in-time. The method further includes copying the original disk file to a disk snapshot file. The method further includes providing the live snapshot including the disk snapshot file and the memory snapshot.

Claims (85)

1. A method comprising:

receiving a request to create a live snapshot of a state of a virtual machine having a memory and an original disk file;

copying, by a processor executing a hypervisor, data from the memory to a storage device to form a memory snapshot;

pausing the virtual machine and creating a new disk file at a reference point-in-time, wherein the original disk file is a backing file of the new disk file;

resuming the virtual machine, wherein the virtual machine is to perform disk operations using the new disk file after the reference point-in-time;

accessing the original disk file when the new disk file does not have data needed to perform the disk operations after the reference point in time;

copying the original disk file to a disk snapshot file;

monitoring progress of a copy operation of data copied from the original disk file to the disk snapshot file using an indicator for the disk snapshot file;

providing the live snapshot comprising the disk snapshot file and the memory snapshot; and

in response to the original disk file being copied to the disk snapshot file, merging the original disk file and the new disk file to form a merged file, wherein the virtual machine is to continue to perform disk operations using the merged file, wherein the merging comprises:

creating a mirror disk file;

copying data of the original disk file to the mirror disk file;

copying data of the new disk file to the mirror disk file;

in response to receiving a write request before the mirror file is synchronized with the original disk file and the new disk file, writing data to both the new disk file and the mirror file, wherein determining whether the mirror file is synchronized with the original disk file and the new disk file comprises determining whether entries of a bitmap for the mirror disk file match corresponding entries of a bitmap for the new disk file; and

in response to the mirror disk file being synchronized with the original disk file and the new disk file, breaking a link to the original disk file and the new disk file.

2. The method of claim 1 , wherein the memory comprises a plurality of clusters of data, wherein copying data from the memory to the storage device comprises:

copying one of the plurality of clusters to the storage device; and

recording in a storage that the cluster was copied to the storage device.

3. The method of claim 2 , wherein copying data from the memory to the storage device further comprises:

checking the storage device to determine whether any of the plurality of clusters have not been copied to the storage device; and

in response to one of the plurality of clusters not being copied to the storage device, copying that cluster to the storage device.

4. The method of claim 2 further comprising:

identifying a cluster of memory that has been modified;

updating the storage to indicate that the modified cluster has not been copied to the storage device, and

wherein copying data from the memory to the storage device further comprises:

copying the modified cluster to the storage device; and

updating the storage to indicate that the modified cluster has been copied to the storage device.

5. The method of claim 2 , wherein copying data from the memory to the storage device further comprises identifying a last cluster in the plurality of clusters that has not been copied to the storage device, and wherein pausing the virtual machine comprises:

suspending the virtual machine; and

copying the last cluster to the storage device.

6. The method of claim 2 further comprising:

in response to each of the plurality of clusters being copied to the storage device, generating an indication that the memory snapshot is complete.

7. The method of claim 1 , wherein the new disk file is a Quick EMUlator (QEMU) copy-on-write (qcow2) file and the original disk file and the mirror file have a same type of format.

8. The method of claim 7 , wherein the original disk file and the new disk file are raw image files.

9. The method of claim 1 , wherein the virtual machine comprises a plurality of original disk files, wherein creating a new disk file comprises creating a wrapper file around the plurality of original disk files, wherein the merged file is created by merging the plurality of original disk files and the wrapper file.

10. The method of claim 9 , wherein the merged file is a disk image file.

11. A system comprising:

a host memory;

a storage device;

a processor operatively coupled to the host memory and to the storage device, the processor to:

receive a request to create a live snapshot of a state of a virtual machine having a virtual machine memory and an original disk file;

copy data from the virtual machine memory to the storage device to form a memory snapshot;

pause the virtual machine and create a new disk file at a reference point-in-ti me, wherein the original disk file is a backing file of the new disk file;

resume the virtual machine, wherein the virtual machine is to perform disk operations using the new disk file after the reference point-in-time;

access the original disk file when the new disk file does not have data needed to perform the disk operations after the reference point in time;

copy the original disk file to a disk snapshot file in the storage device;

monitor progress of a copy operation of data copied from the original disk file to the disk snapshot file using an indicator for the disk snapshot file;

provide the live snapshot comprising the disk snapshot file and the memory snapshot; and

in response to the original disk file being copied to the disk snapshot file, merge the original disk file and the new disk file to form a merged file, wherein the virtual machine is to continue to perform disk operations using the merged file, wherein to merge the processor is to:

create a mirror disk file;

copy data of the original disk file to the mirror disk file;

copy data of the new disk file to the mirror disk file;

in response to receiving a write request before the mirror file is synchronized with the original disk file and the new disk file, write data to both the new disk file and the mirror file, wherein determining whether the mirror file is synchronized with the original disk file and the new disk file comprises determining whether entries of a bitmap for the mirror disk file match corresponding entries of a bitmap for the new disk file; and

in response to the mirror disk file being synchronized with the original disk file and the new disk file, breaking a link to the original disk file and the new disk file.

12. The system of claim 11 , wherein the virtual machine memory comprises a plurality of clusters of data, wherein in response to the processor copying data from the virtual machine memory to the storage device, the processor is further to:

copy one of the plurality of clusters to the storage device; and

record in a management file that the cluster was copied to the storage device.

13. The system of claim 12 , wherein in response to the processor identifying a cluster of memory that has been modified, the processor is to update the management file to indicate that the modified cluster has not been copied to the storage device, and wherein in response to the processor copying data from the memory to the storage device, the processor is further to:

copy the written cluster to the storage device; and

update the management file to indicate that the modified cluster has been copied to the storage device.

14. A non-transitory computer-readable storage medium comprising instructions that, when executed by a processor, cause the processor to:

receive a request to create a live snapshot of a state of a virtual machine having a memory and an original disk file;

copy, by the processor, data from the memory to a storage device to form a memory snapshot;

pause the virtual machine and create a new disk file at a reference point-in-time, wherein the original disk file is a backing file of the new disk file;

resume the virtual machine, wherein the virtual machine is to perform disk operations using the new disk file after the reference point-in-time;

access the original disk file when the new disk file does not have data needed to perform the disk operations after the reference point in time;

copy the original disk file to a disk snapshot file;

monitor progress of a copy operation of data copied from the original disk file to the disk snapshot file using an indicator for the disk snapshot file;

provide the live snapshot comprising the disk snapshot file and the memory snapshot; and

in response to the original disk file being copied to the disk snapshot file, merge the original disk file and the new disk file to form a merged file, wherein the virtual machine is to continue to perform disk operations using the merged file, wherein to merge the processor is to:

create a mirror disk file;

copy data of the original disk file to the mirror disk file;

copy data of the new disk file to the mirror disk file;

in response to receiving a write request before the mirror file is synchronized with the original disk file and the new disk file, write data to both the new disk file and the mirror file, wherein determining whether the mirror file is synchronized with the original disk file and the new disk file comprises determining whether entries of a bitmap for the mirror disk file match corresponding entries of a bitmap for the new disk file; and

in response to the mirror disk file being synchronized with the original disk file and the new disk file, breaking a link to the original disk file and the new disk file.

15. The non-transitory computer-readable storage medium of claim 14 , wherein to copy data from the memory to the storage device further comprises to identify a last cluster in a plurality of clusters that has not been copied to the storage device, and wherein to pause the virtual machine comprises:

suspend the virtual machine; and

copy the last cluster to the storage device.

16. The non-transitory computer-readable storage medium of claim 14 further comprising in response to each of a plurality of clusters being copied to the storage device, generate an indication that the memory snapshot is complete.

17. The method of claim 1 , further comprising:

in response to a data mismatch between the data of the original disk file copied to the mirror disk file and the data of the new disk file copied to the mirror disk file, selecting the data of the new disk file over the data of the original disk file.

18. The system of claim 11 , the processor further to:

in response to a data mismatch between the data of the original disk file copied to the mirror disk file and the data of the new disk file copied to the mirror disk file, select the data of the new disk file over the data of the original disk file.

19. The non-transitory computer-readable storage medium of claim 14 comprising further instructions that, when executed by the processor, cause the processor to:

in response to a data mismatch between the data of the original disk file copied to the mirror disk file and the data of the new disk file copied to the mirror disk file, select the data of the new disk file over the data of the original disk file.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 27, 2013
From: BLAKE, ERIC
To: RED HAT, INC.
Reel/Frame 031094/0804 →
Continuity (1)
Related Publication 20150066859A1 · Mar 5, 2015