public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Laurent Vivier <Laurent.Vivier@bull.net>
Cc: kvm@vger.kernel.org
Subject: Re: Sharing disks between two kvm guests
Date: Fri, 20 Jun 2008 14:30:23 -0500	[thread overview]
Message-ID: <485C054F.2020004@codemonkey.ws> (raw)
In-Reply-To: <1213988077.3858.4.camel@frecb07144>

Laurent Vivier wrote:
> Le vendredi 20 juin 2008 à 11:37 -0500, Anthony Liguori a écrit :
>   
>> Laurent Vivier wrote:
>>     
>>> Le vendredi 20 juin 2008 à 09:07 -0500, Javier Guerra a écrit :
>>>   
>>>       
>>>> On Fri, Jun 20, 2008 at 7:23 AM, carlopmart <carlopmart@gmail.com> wrote:
>>>>     
>>>>         
>>>>> Felix Leimbach wrote:
>>>>>       
>>>>>           
>>>>>>>  This is my first post to this list. I have already installed kvm-70
>>>>>>> under rhel5.2. My intention is to share on disk image betwwen two rhel5.2
>>>>>>> kvm guests. Is it possible to accomplish this in kvm like xen or vmware
>>>>>>> does?? How can I do?? I didn't find any reference abou this on kvm
>>>>>>> documentation ...
>>>>>>>           
>>>>>>>               
>>>> i tried this looong ago and didn't really work because there was some
>>>> userspace cache on each QEMU instance.  but the -drive option has a
>>>> 'cache=off' 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=xxx,cache=off on both
>>>> KVM instances
>>>> - use a cluster filesystem!
>>>>     
>>>>         
>>> 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 connections
>>> 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/nbd1"
>>>
>>> Of course the filesystem must know how to share the access to the disk
>>> with others (-> "cluster filesystem")
>>>
>>> II- in a second step, we can include directly the nbd protocol in qemu
>>> (block-nbd.c, "-drive file=nbd:localhost:1024") to connect to the
>>> server. We can also add some commands to the protocol to manage lock,
>>> HA, "what else ?" (Hi George).
>>>   
>>>       
>> 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".
>   

That patch is very old by now.  It needs to be updated/written to use 
the aio infrastructure which will be a little tough since there are some 
assumptions right now that all aio is posix-aio.

Regards,

Anthony Liguori

> Laurent
>
>   
>> Regards,
>>
>> Anthony Liguori
>>
>>     
>>> Any comments ?
>>>
>>> Cheers,
>>> Laurent
>>>   
>>>       
>>     


  reply	other threads:[~2008-06-20 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20  8:57 Sharing disks between two kvm guests carlopmart
2008-06-20 11:04 ` Felix Leimbach
2008-06-20 12:23   ` carlopmart
2008-06-20 14:07     ` Javier Guerra
2008-06-20 16:32       ` Laurent Vivier
2008-06-20 16:37         ` Anthony Liguori
2008-06-20 18:54           ` Laurent Vivier
2008-06-20 19:30             ` Anthony Liguori [this message]
2008-06-20 18:28       ` Avi Kivity

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=485C054F.2020004@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=Laurent.Vivier@bull.net \
    --cc=kvm@vger.kernel.org \
    /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