Features/Block/Merge: Difference between revisions
(Created page with '== Summary == Provide a mechanism to merge a leaf image to its backing file without pausing the guest's execution. == Owner == * '''Name:''' [[User:AnthonyLiguori|Anthony Ligu…') |
No edit summary |
||
(3 intermediate revisions by one other user not shown) | |||
Line 12: | Line 12: | ||
Backup applications need an interface to snapshot a virtual machine's disk image so that data can be backed up in a consistent fashion. Once the backup has completed, the snapshot needs to be merged into the base image in order to eliminate any performance penalties. It should be possible to also provide information to the backup application about which blocks have changed since the last backup. | Backup applications need an interface to snapshot a virtual machine's disk image so that data can be backed up in a consistent fashion. Once the backup has completed, the snapshot needs to be merged into the base image in order to eliminate any performance penalties. It should be possible to also provide information to the backup application about which blocks have changed since the last backup. | ||
It should be possible for this to work with any type of format/protocol with the appropriate feature set. | It should be possible for this to work with any type of format/protocol with the appropriate feature set. | ||
== Simple use-case == | == Simple use-case == | ||
(qemu) snapshot ide0-disk0 foo.qcow2 | (qemu) snapshot ide0-disk0 foo.qcow2 | ||
(qemu) # perform backup | (qemu) # perform backup | ||
(qemu) merge -d ide0-disk0 | (qemu) merge -d ide0-disk0 | ||
(qemu) # original image is now restored | (qemu) # original image is now restored | ||
The -d flag causes foo.qcow2 to be deleted once the merge is complete. | The -d flag causes foo.qcow2 to be deleted once the merge is complete. | ||
Line 25: | Line 25: | ||
== Advanced use-case == | == Advanced use-case == | ||
(qemu) snapshot ide0-disk0 foo.qcow2 | (qemu) snapshot ide0-disk0 foo.qcow2 | ||
(qemu) # perform backup | (qemu) # perform backup | ||
(qemu) merge ide0-disk0 | (qemu) merge ide0-disk0 | ||
(qemu) # still using foo.qcow2 | (qemu) # still using foo.qcow2 | ||
(qemu) merge ide0-disk0 | (qemu) merge ide0-disk0 | ||
(qemu) # perform incremental backup | (qemu) # perform incremental backup | ||
In this use case, the cases of full-backup and incremental backup are differentiated. There is a cost associated with doing this because a two-level image is now used. | In this use case, the cases of full-backup and incremental backup are differentiated. There is a cost associated with doing this because a two-level image is now used. | ||
Line 46: | Line 46: | ||
Still gathering requirements. | Still gathering requirements. | ||
[[Category:Obsolete feature pages]] |
Latest revision as of 14:44, 11 October 2016
Summary
Provide a mechanism to merge a leaf image to its backing file without pausing the guest's execution.
Owner
- Name: Anthony Liguori
- Email: anthony@codemonkey.ws
Detailed Summary
Backup applications need an interface to snapshot a virtual machine's disk image so that data can be backed up in a consistent fashion. Once the backup has completed, the snapshot needs to be merged into the base image in order to eliminate any performance penalties. It should be possible to also provide information to the backup application about which blocks have changed since the last backup.
It should be possible for this to work with any type of format/protocol with the appropriate feature set.
Simple use-case
(qemu) snapshot ide0-disk0 foo.qcow2 (qemu) # perform backup (qemu) merge -d ide0-disk0 (qemu) # original image is now restored
The -d flag causes foo.qcow2 to be deleted once the merge is complete.
Advanced use-case
(qemu) snapshot ide0-disk0 foo.qcow2 (qemu) # perform backup (qemu) merge ide0-disk0 (qemu) # still using foo.qcow2 (qemu) merge ide0-disk0 (qemu) # perform incremental backup
In this use case, the cases of full-backup and incremental backup are differentiated. There is a cost associated with doing this because a two-level image is now used.
Implementation
BlockDriverAIOCB *bdrv_aio_merge(BlockDriverState *bs, uint64_t offset, BlockDriverCompletionFunc *cb, void *opaque);
bdrv_aio_merge begins searching for a mergable block at offset. Once it is able to merge at least one block, it will the number of bytes scanned and merged which can then be added to offset and used in the next call. If the completion function returns 0, that indicates the the image is fully merged. If offset + ret == bdrv_getlength(), the caller should reset offset to 0 and continue calling bdrv_aio_merge.
Status
Still gathering requirements.