Efficient copying between storage devices
A system and method are disclosed for efficiently copy a disk image between storage devices. In accordance with one example, a computer system issues a request to create on a first storage device a snapshot of a first disk image that is stored on the first storage device. The computer system then issues a request to create on the first storage device a second disk image based on the snapshot, and copies the snapshot on to a second storage device. The computer system issues a request to create on the second storage device a third disk image based on the snapshot. The computer system then issues a request to compute a difference between the second disk image and the snapshot, and the difference is overwritten on to the third disk image.
1. A method comprising:
issuing, by a processor, a request to create on a first storage device a snapshot of a first disk image that is stored on the first storage device;
issuing a request to create on the first storage device a second disk image in view of the snapshot;
copying the snapshot on to a second storage device;
issuing a request to create on the second storage device a third disk image in view of based on the snapshot;
issuing a request to compute a difference by the first storage device between the second disk image and the snapshot; and
overwriting the difference on to the third disk image.
2. The method of claim 1 wherein the snapshot is created by the first storage device.
3. The method of claim 2 , wherein when the second storage device does not support native snapshotting, the copying of the snapshot on to the second storage device comprises creating, by the processor, a structure on the second storage device.
4. The method of claim 3 wherein the structure is a Quick EMUlator (QEMU) Copy On Write structure.
5. The method of claim 2 , wherein when the second storage device supports native snapshotting, the copying of the snapshot on to the second storage device comprises creating a native snapshot of the first disk image on the second storage device.
6. The method of claim 1 wherein the snapshot is created by the processor.
7. The method of claim 1 wherein the first disk image is a virtual disk of a virtual machine.
8. An apparatus comprising:
an interface device to connect a processor to one or more storage devices; and
the processor coupled to the interface device, to:
create on a first storage device of the one or more storage devices, via the interface device, a snapshot of a first disk image that is stored on the first storage device;
create on the first storage device, via the interface device, a second disk image in view of the snapshot;
copy, via the interface device, the snapshot on to a second storage device;
create on the second storage device, via the interface device, a third disk image in view of the snapshot;
issue a request to compute a difference by the first storage device between the second disk image and the snapshot; and
overwrite, via the interface device, the difference on to the third disk image.
9. The apparatus of claim 8 , wherein when the second storage device does not support native snapshotting, the copying of the snapshot on to the second storage device comprises creating a structure on the second storage device.
10. The apparatus of claim 9 wherein the structure is a Quick EMUlator (QEMU) Copy On Write structure.
11. The apparatus of claim 8 , wherein when the second storage device supports native snapshotting, the copying of the snapshot on to the second storage device comprises creating a native snapshot of the first disk image on the second storage device.
12. A non-transitory computer readable storage medium, having instructions stored therein, which when executed, cause a processor to:
issue a request to create on a first storage device a snapshot of a first disk image that is stored on the first storage device;
issue a request to create on the first storage device a second disk image in view of based on the snapshot;
copy the snapshot on to a second storage device;
issue a request to create on the second storage device a third disk image in view of the snapshot;
issue a request to compute a difference by the first storage device between the second disk image and the snapshot; and
overwrite the difference on to the third disk image.
13. The non-transitory computer readable storage medium of claim 12 wherein the first disk image is a virtual disk of a virtual machine.
14. The non-transitory computer readable storage medium of claim 12 wherein the snapshot is created by the first storage device.
15. The non-transitory computer readable storage medium of claim 14 , wherein when the second storage device does not support native snapshotting, the instructions to copy the snapshot on to the second storage device comprises creating a structure on the second storage device.
16. The non-transitory computer readable storage medium of claim 14 , wherein when the second storage device supports native snapshotting, the instructions to copy the snapshot on to the second storage device comprises creating a native snapshot of the first disk image on the second storage device.
17. The non-transitory computer readable storage medium of claim 12 wherein the snapshot is created by the processor.