All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc - A. Dahlhaus" <mad@wol.de>
To: Xen-devel <xen-devel@lists.xensource.com>
Subject: Re: Virtualization project idea
Date: Fri, 27 Aug 2010 12:31:50 +0200	[thread overview]
Message-ID: <1282905110.17730.61.camel@marc> (raw)
In-Reply-To: <AANLkTikSNL=t01VcKxubFSKADjjnoEeqr6TdbsRpLBUn@mail.gmail.com>

Am Freitag, den 27.08.2010, 14:53 +0530 schrieb Dhananjay Goel:
> This won't be straight forward. Think about USB memory/flash stick.
> If every VM sees it, and simultaneously writes to it, the filesystem
> in it will get corrupted immediately!
> 
> Why would it get corrupted immediately. Might be we can just lock a
> specific file which is being edited? Please suggest.


Hello Dhananjay,


in short: You can't do that.

Well, you may share the blockdevice itself quite easily this way
(AoE,iSCSI and FCoE could also be a simple way to do it).

But a Filesystem on a blockdevice is a totaly other beast than what you
know as shared access to a filesystem over NFS or CIFS/SMB[2].

There is a thing called "filesystem-cache".

Every OS that connects to your "shared-usb-flash-drive" reads the
filesystem-metadata (what data is where to find on the block device and
what name has it, what folders are there and what is in it) and places
this data into its local cache.

And here the things start to get nasty.

OS 1 adds a Folder but don't write the metadata for it to the device.
OS 2 don't know about the Folder and stores a file to the exact same
place on the device where OS 1 placed its new folder.
OS 1 writes its Data to the device.
Your filesystem gone nuts by here.

Even if OS 1 wrote the metadata to the device in the first place, there
is no notification that data was changed on the device for OS 2. OS 2
doesn't know anything about it because no one talked to OS 2 about the
write to the device.

The meta-information about the writes are local to the 2 VM's because
the filesystem isn't designed to be aware of datachages origination from
remote sources. There is no information exchange about what to write
where an when between the VM's. The filesystem on your device is not
"cluster-aware".

So:

Access to a "non cluster-aware block device filesystem" is exclusive to
only one OS instance. Period. There is no way around this.

Network shares are protocols only that are served by a server and this
server has the exclusive access to the storage block device and the
filesystem on it. NFS and CIFS/SMB[2] are a level higher (a network
protocol) and are only serving the access to files over the network.
The protocols have messages that make the clients aware that new data
has arrived on the server if the client cares and asks for such
notifications.

That said, you might want to take a look at GFS2 or OCFS2 to get more
information about what it takes to use the same filesystem on more than
one OS-Instance.



That's just the filesystem case. All other things have also problems to
get things right when data changes under its feet without notification. 

You can't share an usbcam because one host might change the format that
the cam sends its data (eg. the resolution) the other hosts don't know
about that change and thus show only invalid data...

You would have to write drivers for every device that are aware of other
players on the same device and you also would need a
communication-channel for the players on the device.

As far as i know this is impossible.

The only possible way i know of for "sharing" usb devices (a bus with
only one Host and thus only one OS-driver for each device) is to have an
interface where it is possible to attach usb devices to only one vm at a
time and detach it afterwards before you can attach it to another vm.


Marc

  reply	other threads:[~2010-08-27 10:31 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTi=+Oa6dOcc0A9X37Bse0znrjT7AQ7Er7OQ5VVzq@mail.gmail.com>
2010-08-26 18:40 ` [Qemu-devel] Virtualization project idea Dhananjay Goel
2010-08-26 18:44   ` Dhananjay Goel
2010-08-26 19:56     ` Pasi Kärkkäinen
2010-08-26 22:58     ` James Harper
2010-08-27  8:07       ` Dhananjay Goel
2010-08-27  8:46         ` Pasi Kärkkäinen
2010-08-27  9:15           ` Dhananjay Goel
2010-08-27  9:19             ` Pasi Kärkkäinen
2010-08-27  9:20               ` David Markey
2010-08-27  9:23                 ` Pasi Kärkkäinen
2010-08-27  9:25                   ` Dhananjay Goel
2010-08-27  9:44                     ` Keir Fraser
2010-08-27  9:48                       ` Dhananjay Goel
2010-08-27  9:50                         ` David Markey
2010-08-27  9:56                           ` Dhananjay Goel
2010-08-27  9:57                         ` Keir Fraser
2010-08-27 18:26                           ` Gianni Tedesco
2010-08-27  9:23               ` Dhananjay Goel
2010-08-27 10:31                 ` Marc - A. Dahlhaus [this message]
2010-08-27 10:57                 ` Pasi Kärkkäinen
2010-08-27 11:26                   ` Dhananjay Goel
2010-08-27 11:54                     ` Pasi Kärkkäinen
2010-08-27 12:46                       ` Dhananjay Goel
2010-08-27 12:53                         ` Pasi Kärkkäinen
2010-08-27 13:03                           ` Dhananjay Goel
2010-08-27 13:08                             ` Pasi Kärkkäinen
2010-08-27 13:17                               ` Michal Novotny
2010-08-27 13:30                                 ` Pasi Kärkkäinen
2010-08-27 13:35                                   ` Dhananjay Goel
2010-08-27 13:46                                     ` Pasi Kärkkäinen
2010-08-27 13:55                                       ` Dhananjay Goel
2010-08-27 14:09                                         ` Pasi Kärkkäinen
2010-08-27 13:47                                   ` Michal Novotny
2010-08-27 17:05                                   ` Pasi Kärkkäinen
2010-08-27 13:18                               ` Christoph Egger
2010-08-27 13:22                                 ` Pasi Kärkkäinen
2010-08-27 13:26                                   ` Michal Novotny
2010-08-27 13:33                                     ` Pasi Kärkkäinen
2010-08-27 13:48                                       ` Michal Novotny
2010-08-27 13:29                               ` Dhananjay Goel
2010-08-27 13:34                                 ` Pasi Kärkkäinen
2010-08-27 13:50                                   ` Michal Novotny
2010-08-27 14:00                                     ` Dhananjay Goel
2010-08-27 14:20                                       ` Michal Novotny
2010-08-27 16:58       ` Pasi Kärkkäinen
2010-08-27 15:12     ` Gianni Tedesco
2010-08-27 16:21       ` Konrad Rzeszutek Wilk
2010-08-27 16:51         ` [Qemu-devel] Re: [Xen-devel] " Stefano Stabellini
2010-08-27 16:51           ` Stefano Stabellini
2010-08-27 17:01           ` [Qemu-devel] Re: [Xen-devel] " David Markey
2010-08-27 17:01             ` David Markey
2010-08-27 17:06             ` [Qemu-devel] Re: [Xen-devel] " Pasi Kärkkäinen
2010-08-27 17:06               ` Pasi Kärkkäinen

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=1282905110.17730.61.camel@marc \
    --to=mad@wol.de \
    --cc=xen-devel@lists.xensource.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.