Received: from [140.186.70.92] (port=41102 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1gqS-0005W5-Px for qemu-devel@nongnu.org; Mon, 21 Mar 2011 11:16:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1gqQ-00033v-3E for qemu-devel@nongnu.org; Mon, 21 Mar 2011 11:16:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58876 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1gqP-00033m-PV for qemu-devel@nongnu.org; Mon, 21 Mar 2011 11:16:34 -0400 Subject: Re: [Qemu-devel] Moving beyond image files Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <4D876930.6000106@us.ibm.com> Date: Mon, 21 Mar 2011 16:16:30 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <145C4163-3365-4A73-B2F2-EC397669D363@suse.de> References: <4D876930.6000106@us.ibm.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Chunqiang Tang , Eric Van Hensbergen , qemu-devel , Stefan Hajnoczi On 21.03.2011, at 16:05, Anthony Liguori wrote: > We've been evaluating block migration in a real environment to try to = understand what the overhead of it is compared to normal migration. The = results so far are pretty disappointing. The speed of local disks ends = up becoming a big bottleneck even before the network does. >=20 > This has got me thinking about what we could do to avoid local I/O via = deduplication and other techniques. This has led me to wonder if its = time to move beyond simple image files into something a bit more = sophisticated. >=20 > Ideally, I'd want a full Content Addressable Storage database like = Venti but there are lots of performance concerns with something like = that. >=20 > I've been thinking about a middle ground and am looking for some = feedback. Here's my current thinking: >=20 > 1) All block I/O goes through a daemon. There may be more than one = daemon to support multi-tenancy. >=20 > 2) The daemon maintains metadata for each image that includes an = extent mapping and then a clustered allocated bitmap within each extent = (similar to FVD). >=20 > At this point, it's basically sparse raw but through a single daemon. >=20 > 3) All writes result in a sha1 being calculated before the write is = completed. The daemon maintains a mapping of sha1's -> clusters. A = single sha1 may map to many clusters. The sha1 mapping can be made = eventually consistent using a journal or even dirty bitmap. It can be = partially rebuilt easily. >=20 > I think this is where v1 stops. With just this level of = functionality, I think we have some very interesting properties: >=20 > a) Performance should be pretty close to raw >=20 > b) Without doing any (significant) disk I/O, we know exactly what data = an image is composed of. This means we can do an rsync style image = streaming that uses potentially much less network I/O and potentially = much less disk I/O. >=20 > In a v2, I think you can add some interesting features that take = advantage of the hashing. For instance: >=20 > 4) If you run out of disk space, you can looking at a hash with a = refcount > 1, and split off a reference making it copy-on-write. Then = you can treat the remaining references as free list entries. >=20 > 5) Copy-on-write references potentially become very interesting for = image streaming because you can avoid any I/O for blocks that are = already stored locally. >=20 > This is not fully baked yet but I thought I'd at least throw it out = there as a topic for discussion. I think we've focused almost entirely = on single images so I think it's worth thinking a little about different = storage models. Wouldn't it make sense to have your file system be that daemon and add = an interface to it so you can receive the sha1 sums (that you need for = dedup anyways) to calculate rsync style diffs? That way you'd also speed up 2 other use cases: a) normal raw storage - no need to implement new protocols, file = formats, etc b) real rsync on real data that is not vm images Alex