Features/VMSnapshotEnchancement
VM Back up enhancement
This feature will enhance VM backup functionality, to make it possible taking internal/external snapshots lively, and make it works better with underlining components such as LVM.
- Name: Wenchao Xia
- Email: xiawenc@linux.vnet.ibm.com, xiaxia347os@163.com
General Summary
This feature would provide APIs that can do:
- 1 block device live snapshot as internal/external/blank delta data, export sync API for all type.
- 2 vmstate live save as internal/external data, export async API for external data, fix the size problem.
- 3 combination(internal block snapshot + internal vmstate save, internal block snapshot + external vmstate save, external block snapshot external vmstate save).
Component Details
Now qemu support block device live external snapshot, live migration to file, static internal block snapshot + internal vmstate save, following are the blanks need to be filled:
- 1 block device live internal snapshot, block device data drain, provide the interfaces in unified style.
- 2 change vmstate save from static to live, fix the problem that size is not predictable, add support to save vmstate to external file format that qemu support(raw, qcow2...).
- 3 an API allow management stack configure the combination.
- 4 qmp/hmp for related information retrieving.
User Cases
General goal from backup application persperctive:
- Case 1: external image snapshot data + external vmstate data
This is what qemu 1.3 support by migration to file and then blkdev-snapshot-sync each block device in qmp interface. The thing need to solve is the vmstate size restriction. Advantage: less dependence, chain and block bitmap are managed by qemu.
- Case 2: internal image snapshot data + external vmstate data
In this case, qemu first need save vmstate lively to an external file, then take internal snapshots for every stops the vm and pause vm. Then other components on host steps in, for example, LVM2 take snapshots. After done resume vm. Advantage: faster.
- Case 3: internal image blank data (drain) + external vmstate data
In this case, qemu first save vmstate lively, then drain all block data and stop to ensure at qemu level data was consistent. Then LVM2 steps in to take snapshots. Advantage: faster, and chain management is offloaded from qemu, bitmap management is offloaded if not using qcow2. This give lower software or hardware a chance to accelerate it.
- Case 4: internal image snapshot data + internal vmstate data
need to change static to live plus vmstate size issue fixed. Advantage: less dependence, chain, vmstate and block bitmap are managed by qemu, faster. Disadvantage: qemu lacks a function export the delta data for internal snapshots.