On Thu, Oct 17, 2013 at 01:36:41PM +0800, Fam Zheng wrote:
This series adds for point-in-time snapshot NBD exporting based on
blockdev-backup (variant of drive-backup with existing device as target).
In general this seems to work great. I did a bunch of testing and was
able to mount filesystems over NBD, do many writes (on backed up
image)/reads (on target), intense IO etc and all held up fine.
There are definitely some issues with some of the commands allowing you
to blow things up. I'm interested to hear opinions on whether this is a
showstopper at this time or not.
We get a thin point-in-time snapshot by COW mechanism of drive-backup, and
export it through built in NBD server. The steps are as below:
1. (SHELL) qemu-img create -f qcow2 BACKUP.qcow2 <source size here>
(Alternatively we can use -o backing_file=RUNNING-VM.img to omit explicitly
providing the size by ourselves, but it's risky because RUNNING-VM.qcow2 is
used r/w by guest. Whether or not setting backing file in the image file
doesn't matter, as we are going to override the backing hd in the next
step)
2. (QMP) blockdev-add backing=source-drive file.driver=file
file.filename=BACKUP.qcow2 id=target0 if=none driver=qcow2
I had to create a custom python script to make these commands work as
they require nested dicts. Is that normal or did I miss something
entirely?