From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Subject: Re: Sharing disks between two kvm guests Date: Fri, 20 Jun 2008 20:54:37 +0200 Message-ID: <1213988077.3858.4.camel@frecb07144> References: <485B70E4.5030904@gmail.com> <485B8EAB.606@gmx.net> <485BA15D.3080309@gmail.com> <90eb1dc70806200707k4e08c4d7s41708fc9f84c2a3c@mail.gmail.com> <1213979531.15996.28.camel@frecb07144> <485BDCE4.9070401@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Anthony Liguori Return-path: Received: from ecfrec.frec.bull.fr ([129.183.4.8]:43265 "EHLO ecfrec.frec.bull.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbYFTSyn (ORCPT ); Fri, 20 Jun 2008 14:54:43 -0400 In-Reply-To: <485BDCE4.9070401@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: Le vendredi 20 juin 2008 =C3=A0 11:37 -0500, Anthony Liguori a =C3=A9cr= it : > Laurent Vivier wrote: > > Le vendredi 20 juin 2008 =C3=A0 09:07 -0500, Javier Guerra a =C3=A9= crit : > > =20 > >> On Fri, Jun 20, 2008 at 7:23 AM, carlopmart = wrote: > >> =20 > >>> Felix Leimbach wrote: > >>> =20 > >>>>> This is my first post to this list. I have already installed k= vm-70 > >>>>> under rhel5.2. My intention is to share on disk image betwwen t= wo rhel5.2 > >>>>> kvm guests. Is it possible to accomplish this in kvm like xen o= r vmware > >>>>> does?? How can I do?? I didn't find any reference abou this on = kvm > >>>>> documentation ... > >>>>> =20 > >> i tried this looong ago and didn't really work because there was s= ome > >> userspace cache on each QEMU instance. but the -drive option has = a > >> 'cache=3Doff' setting that should be enough. > >> > >> in theory (i haven't tested, but Avi 'blessed' it): > >> - create a new image with qemu-img > >> - add it to the command line using -drive file=3Dxxx,cache=3Doff o= n both > >> KVM instances > >> - use a cluster filesystem! > >> =20 > > > > RFC: > > > > Well, well, perhaps it is delusions of a sick mind but since the > > introduction of qemu-nbd I think we can develop easily something to > > share a disk between several virtual hosts: > > > > I- in a first step, we can modify qemu-nbd to accept several connec= tions > > for one disk image, for instance: > > > > # qemu-nbd my-disk.qcow2 > > # nbd-client localhost 1024 /dev/nbd0 > > # nbd-client localhost 1024 /dev/nbd1 > > > > and start two virtual hosts: > > > > "qemu -hda v1.img -hdb /dev/nbd0" and "qemu -hda v2.img -hdb /dev/n= bd1" > > > > Of course the filesystem must know how to share the access to the d= isk > > with others (-> "cluster filesystem") > > > > II- in a second step, we can include directly the nbd protocol in q= emu > > (block-nbd.c, "-drive file=3Dnbd:localhost:1024") to connect to the > > server. We can also add some commands to the protocol to manage loc= k, > > HA, "what else ?" (Hi George). > > =20 >=20 > http://hg.codemonkey.ws/qemu-pq/file/25ca451f2040/block-nbd.diff You're not fun, Anthony. Perhaps, now, it should be better if you use functions defined in the (new) file "nbd.c". Laurent > Regards, >=20 > Anthony Liguori >=20 > > Any comments ? > > > > Cheers, > > Laurent > > =20 >=20 >=20 --=20 ------------- Laurent.Vivier@bull.net --------------- "The best way to predict the future is to invent it." - Alan Kay