WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] How do I share a folder with xen guests on Linux?

To: Rudi Ahlers <Rudi@xxxxxxxxxxx>
Subject: Re: [Xen-users] How do I share a folder with xen guests on Linux?
From: Tomasz Chmielewski <mangoo@xxxxxxxx>
Date: Thu, 06 Mar 2008 09:27:52 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx, Nico Kadel-Garcia <nkadel@xxxxxxxxx>
Delivery-date: Thu, 06 Mar 2008 00:28:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <47CFA3E1.4020109@xxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <47CEBE6E.9080801@xxxxxxxxxxx> <47CEBF90.7030600@xxxxxxxx> <47CEC1C2.6080509@xxxxxxxxxxx> <47CEC49D.7040405@xxxxxxxx> <47CF53F6.1080804@xxxxxxxxx> <47CFA31C.7070202@xxxxxxxx> <47CFA3E1.4020109@xxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061110 Mandriva/1.5.0.8-1mdv2007.1 (2007.1) Thunderbird/1.5.0.8 Mnenhy/0.7.4.666
Rudi Ahlers schrieb:

(...)

Yes, there is. Once you've booted the Xen domaiin, you can add hte block device or ISO or other file system image to the list of block devices of the guest domain with the "xm" command, and then log into the Xen guest and mount it there. I recommend this only for read-only block devices, to avoid becoming confused about what is writing to the partition and how too manage it.

Yeah, but it's not really a "shared" device then.



Why not? The device belongs to dom0, and it's shared with dom_U's as well :)

;)

By a shared folder I understand something that can be *at least* read by more than one node (or guest, or host, for that matter).

By definition, any distributed fs (gfs, ocfs2) needs something which will prevent collision - the thing is called a lock manager. And it implies network.

That being said - what if we use a non-distributed fs? It doesn't need a lock manager of any kind, so it should work without network on multiple nodes? Technically, there are at least two ways to do it:

1. Mount the fs on host, write data, unmount it (unmounting is really important here). Add the device to the guest, mount it, use data, unmount it. Add the device to another guest etc. etc.

However, it is doubtful we can treat it as a *shared* device - it may depend on the definition here, of course :) And manageability is poor here.


2. What happens if we mount a non-distributed fs on multiple nodes?

If we mount it rw on multiple nodes, the filesystem will break sooner or later - so don't do that.

If we, however, mount the filesystem rw as *ext2* on host, and ro as *ext2* on guests, it will work. Note - you have to mount it as ext2 - even if you mount ext3 as ro, the system will make writes to it (journal updates)! So, again, use ext2 (or any other fs without the journal).

One problematic thing is that the nodes which mounted that fs are not aware of changes made on the filesystem by the node which has it mounted rw. Changes like adding new files, removing or changing them. What may help, is dropping cache on nodes which have the fs mounted ro, or unmounting/mounting the filesystem again.

It's not perfect, error prone if there are writes we don't really control, but will work for simple cases.


Note: last time I tried, Xen didn't want to add a block device to the guest if that block device was already used by the host. So it may or may not work for you.




--
Tomasz Chmielewski
http://wpkg.org

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>