From: Stefan Hajnoczi <stefanha@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Alex Bligh <alex@alex.org.uk>, Kaveh Razavi <kaveh@cs.vu.nl>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Introduce cache images for the QCOW2 format
Date: Thu, 15 Aug 2013 10:11:54 +0200 [thread overview]
Message-ID: <20130815081154.GD22521@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20130814153216.GN4583@dhcp-200-207.str.redhat.com>
On Wed, Aug 14, 2013 at 05:32:16PM +0200, Kevin Wolf wrote:
> Am 14.08.2013 um 16:26 hat Kaveh Razavi geschrieben:
> > On 08/14/2013 03:50 PM, Alex Bligh wrote:
> > > Assuming the cache quota is not exhausted, how do you know how that
> > > a VM has finished 'creating' the cache? At any point it might
> > > read a bit more from the backing image.
> >
> > I was assuming on shutdown.
>
> Wait, so you're not really changing the cache while it's used, but you
> only create it once and then use it like a regular backing file? If so,
> the only thing we need to talk about is the creation, because there's no
> difference for using it.
>
> Creation can use the existing copy-on-read functionality, and the only
> thing you need additionally is a way to turn copy-on-read off at the
> right point.
>
> Or do I misunderstand what you're doing?
Yes, it seems we're talking about placing an intermediate backing file
on the host:
/nfs/template.qcow2 <- /local/cache.qcow2 <- /local/vm001.qcow2
On first boot the image runs in "record" mode which populates the cache
via copy-on-read.
Once "record" mode is disabled the cache image can be shared with other
VMs on the host. They all open it read-only and no longer modify the
cache.
At that point you have a normal qcow2 backing file chain:
/nfs/template.qcow2 <- /local/cache.qcow2 <- /local/vm001.qcow2
<- /local/vm002.qcow2
With this approach you don't need a qemu-nbd process that arbitrates
writes to the cache.qcow2 image file. The disadvantage is that it only
caches the "record" mode read requests and does not adapt to changes if
the workload begins reading other data. Also, it requires more
complicated management tools to handle the "record"/"playback" states of
the cache:
1. Launching vm002 while vm001 is still recording the cache. (Bypass
the cache temporarily for vm002.)
2. Switching the cache from "record" to "playback" after vm001 has
finished its first run.
3. Switching vm002 to use the cache once it transitions to "playback"
mode.
Stefan
next prev parent reply other threads:[~2013-08-15 8:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 17:03 [Qemu-devel] [PATCH] Introduce cache images for the QCOW2 format Kaveh Razavi
2013-08-13 21:37 ` Eric Blake
2013-08-14 11:13 ` Kaveh Razavi
2013-08-13 22:53 ` Alex Bligh
2013-08-14 11:28 ` Kaveh Razavi
2013-08-14 11:52 ` Fam Zheng
2013-08-14 12:03 ` Alex Bligh
2013-08-14 15:58 ` Richard W.M. Jones
2013-08-15 0:53 ` Fam Zheng
2013-08-15 5:51 ` Alex Bligh
2013-08-14 11:57 ` Alex Bligh
2013-08-14 13:37 ` Kaveh Razavi
2013-08-13 23:16 ` Alex Bligh
2013-08-14 11:42 ` Kaveh Razavi
2013-08-14 12:02 ` Alex Bligh
2013-08-14 13:43 ` Kaveh Razavi
2013-08-14 13:50 ` Alex Bligh
2013-08-14 14:26 ` Kaveh Razavi
2013-08-14 15:02 ` Alex Bligh
2013-08-14 15:32 ` Kevin Wolf
2013-08-15 7:50 ` Wenchao Xia
2013-08-15 8:11 ` Stefan Hajnoczi [this message]
2013-08-14 9:29 ` Stefan Hajnoczi
2013-08-14 14:20 ` Kaveh Razavi
2013-08-15 8:32 ` Stefan Hajnoczi
2013-08-15 12:25 ` Kaveh Razavi
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=20130815081154.GD22521@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=alex@alex.org.uk \
--cc=kaveh@cs.vu.nl \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).