All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Pereira <kripper@imatronix.cl>
To: Eric Blake <eblake@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>, Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Can qemu reopen image files?
Date: Wed, 28 Dec 2016 15:51:58 -0300	[thread overview]
Message-ID: <a982da67-2971-3134-de18-7d470b1fb4d2@imatronix.cl> (raw)
In-Reply-To: <f8f625d2-fd0d-f152-7521-6ef2b3d74309@imatronix.cl>

Hi Eric,

There is something I don't understand.

We are doing: "virsh save", "qemu-img convert", "qemu-img rebase" and 
"virsh restore".
We only touch the backing chain by doing the rebase while the VM is down.
Is there any chance this procedure can destroy data?
If so, is there any difference between shutting down and just 
saving/restoring the VM?
Maybe save/restore keeps a cache?

Best regards,
Christopher.

On 19-Dec-16 13:24, Christopher Pereira wrote:
> Hi Eric,
>
> Thanks for your great answer.
>
> On 19-Dec-16 12:48, Eric Blake wrote:
>
>>
>>> Then we do the rebase while the VM is suspended to make sure the image
>>> files are reopened.
>> That part is where you are liable to break things.  Qemu does NOT have a
>> graceful way to reopen the backing chain, so rebasing snap3 to point to
>> snap2' behind qemu's back is asking for problems.  Since qemu may be
>> caching things it has already learned about snap2, you have invalidated
>> that cached data by making snap3 point to snap2', but have no way to
>> force qemu to reread the backing chain to start reading from snap2'.
> We are actually doing a save, rebase and restore to reopen the backing 
> chain.
> We only touch files (rebase) while the VM is down.
> Can you please confirm this is 100% safe?
>
>> Or, if you don't want to merge into "base'", you can use block-stream to
>> merge the other direction, so that "base <- snap1 <- snap2" is converted
>> into "snap2'" - but that depends on patches that were only barely added
>> in qemu 2.8 (intermediate block-commit has existed a lot longer than
>> intermediate block-stream).  But the point remains that you are still
>> using qemu to do the work, and therefore with no external qemu-img
>> process interfering with the chain, you don't need any guest downtime or
>> any risk of breaking qemu operation by invalidating data it may have 
>> cached.
> Right. Since images are backed up remotely, we don't want to merge 
> into base nor touch the backing chain at all (only the active snapshot 
> should be modified). This is to keep things simple and avoid to 
> re-syncs of images (remote backups).
>
> Besides, we don't want to merge the whole backing chain, but an 
> intermediate point, so it seems that the clean way is to use the 
> "intermediate block-stream" feature.
>
> We didn't try it, because when we researched we got the impression 
> that the patches were not stable yet or not included in the qemu 
> versions shipped with CentOS, so we went with 'qemu-img convert' 
> because we needed something known, simple and stable (we are dealing 
> with critical information for gov. orgs.).
>
>> If block-commit and block-stream don't have enough power to do what you
>> want, then we should patch them to expose that power, rather than
>> worrying about how to use qemu-img to modify the backing chain behind
>> qemu's back.
> "intermediate block-stream" seems to be the right solution for our use 
> case.
> Does it also allow QCOW2 compression?
> Compression is interesting, especially when files are sync'ed via 
> network.
>

  reply	other threads:[~2016-12-28 18:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-18 23:52 [Qemu-devel] Can qemu reopen image files? Christopher Pereira
2016-12-19  1:07 ` Fam Zheng
2016-12-19 13:55   ` Stefan Hajnoczi
2016-12-19 15:03     ` Christopher Pereira
2016-12-19 15:48       ` Eric Blake
2016-12-19 16:24         ` Christopher Pereira
2016-12-28 18:51           ` Christopher Pereira [this message]
2016-12-29 13:42             ` Eric Blake
2016-12-29 13:52               ` Eric Blake
2016-12-29 13:55                 ` Eric Blake
2016-12-29 13:39           ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a982da67-2971-3134-de18-7d470b1fb4d2@imatronix.cl \
    --to=kripper@imatronix.cl \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.