All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-img convert of a backing qcow2 snapshot
@ 2016-07-12  3:42 Christopher Pereira
  2016-07-12 14:07 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Pereira @ 2016-07-12  3:42 UTC (permalink / raw)
  To: qemu-devel

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

?

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

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.

Best regards,
Christopher Pereira

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] qemu-img convert of a backing qcow2 snapshot
  2016-07-12  3:42 [Qemu-devel] qemu-img convert of a backing qcow2 snapshot Christopher Pereira
@ 2016-07-12 14:07 ` Eric Blake
  2016-07-12 20:16   ` [Qemu-devel] qemu-img convert of a backing qcow2 snapshot (THANKS) Christopher Pereira
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2016-07-12 14:07 UTC (permalink / raw)
  To: Christopher Pereira, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] qemu-img convert of a backing qcow2 snapshot (THANKS)
  2016-07-12 14:07 ` Eric Blake
@ 2016-07-12 20:16   ` Christopher Pereira
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Pereira @ 2016-07-12 20:16 UTC (permalink / raw)
  To: qemu-devel

On 12-Jul-16 10:07, Eric Blake wrote:
> 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'.
Nice! Thanks Eric for confirming and for all your brilliant work.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-12 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12  3:42 [Qemu-devel] qemu-img convert of a backing qcow2 snapshot Christopher Pereira
2016-07-12 14:07 ` Eric Blake
2016-07-12 20:16   ` [Qemu-devel] qemu-img convert of a backing qcow2 snapshot (THANKS) Christopher Pereira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.