On 07/11/2016 09:42 PM, Christopher Pereira wrote:
> Hi,
> 
> Let's say we have this chain:
> 
>     base <--- sn1 <--- sn2 <--- active
> 
> Can we shutdown the VM and "qemu-img convert sn2 -O qcow2 sn2_new" and
> rebase active to sn2_new like this:
> 
>     sn2_new <--- active
> 
> ?

Yes. As long as the guest-visible data in 'base <- sn1 <- sn2' is
identical to the guest-visible data in 'sn2_new', then it doesn't matter
which of the two files is used as the backing file for 'active'.

> 
> Or is it better practice to blockpull? BTW, is blockpull into an
> non-active snapshot already supported and stable?

There are patches proposed for blockpull into sn2, but those have not
been committed yet.  To pull data into sn2, you currently have to do
offline work.  However, you CAN commit from sn2 into base, creating the
chain 'base+ <- active' (where 'base+' represents the data that used to
be visible via 'base <- sn1 <- sn2') while the guest is live.

> 
> I have tested this qemu-img convert approach and it seems to work, but I
> would like to ask someone more familiar with qcow2 internals and prevent
> data corruption.

Data corruption is likely to happen if you make external modifications
to  base, sn1, or sn2 while the guest is running, including 'qemu-img
convert' modifications.  If the guest is running, only QMP commands are
safe.  But if the guest is offline, then as long as the guest-visible
contents are the same, you can rearrange backing chains however you see fit.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to