Rudi Ahlers
2008-Mar-05 15:38 UTC
[Xen-users] How do I share a folder with xen guests on Linux?
Hi How do I share a folder, say /bkp with xen hosts? I''m using CentOS 5.1 as host -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tomasz Chmielewski
2008-Mar-05 15:43 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Rudi Ahlers schrieb:> Hi > > How do I share a folder, say /bkp with xen hosts? I''m using CentOS 5.1 > as hostNFS? -- Tomasz Chmielewski http://wpkg.org _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-05 15:52 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Tomasz Chmielewski wrote:> Rudi Ahlers schrieb: >> Hi >> >> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >> 5.1 as host > > NFS? > >Sorry, I should have said, I''d like to the folder to be visible to the guests, and not NFS / FTP, as it will interfere with the network statistics on the NIC -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tomasz Chmielewski
2008-Mar-05 16:04 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Rudi Ahlers schrieb:> Tomasz Chmielewski wrote: >> Rudi Ahlers schrieb: >>> Hi >>> >>> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >>> 5.1 as host >> >> NFS? >> >> > Sorry, I should have said, I''d like to the folder to be visible to the > guests, and not NFS / FTP, as it will interfere with the network > statistics on the NICI don''t think there are any other options to share data between the host and guest other than using network. Certainly, using a serial connection or VNC are not an option. Why not create a separate interface just for this kind of traffic? -- Tomasz Chmielewski http://wpkg.org _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-05 16:07 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Tomasz Chmielewski wrote:> Rudi Ahlers schrieb: >> Tomasz Chmielewski wrote: >>> Rudi Ahlers schrieb: >>>> Hi >>>> >>>> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >>>> 5.1 as host >>> >>> NFS? >>> >>> >> Sorry, I should have said, I''d like to the folder to be visible to >> the guests, and not NFS / FTP, as it will interfere with the network >> statistics on the NIC > > I don''t think there are any other options to share data between the > host and guest other than using network. > > Certainly, using a serial connection or VNC are not an option. > > Why not create a separate interface just for this kind of traffic?ok, I see where you''re going with this. I''ll give it a try, thanx :) -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Francesco Polzella
2008-Mar-05 16:43 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Rudi Ahlers schrieb:> Hi > > How do I share a folder, say /bkp with xen hosts? I''m using CentOS > 5.1 as host >Another option is to use GFS that is very easy to set up on Centos. Clearly it''s quite impossible to completly avoid the network usage since all the concurrent filesystems usually have network deamons that implement the protocol and policies to ensure the data consistency. Another option you have is to use OCFS v.2 (Oracle Cluster Filesystem) Best Regards Francesco Polzella _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-05 20:39 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Francesco Polzella wrote:> Rudi Ahlers schrieb: > >> Hi >> >> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >> 5.1 as host > Another option is to use GFS that is very easy to set up on Centos. > Clearly it''s quite impossible to completly avoid the network usage > since all the concurrent filesystems usually > have network deamons that implement the protocol and policies to > ensure the data consistency. > Another option you have is to use OCFS v.2 (Oracle Cluster Filesystem) > > Best Regards > > Francesco Polzella > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >I think the NFS option will work, if I use a separate internal IP subnet for this purpose, which I can then just exclude from Cacti :) -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2008-Mar-06 02:16 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Tomasz Chmielewski wrote:> Rudi Ahlers schrieb: >> Tomasz Chmielewski wrote: >>> Rudi Ahlers schrieb: >>>> Hi >>>> >>>> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >>>> 5.1 as host >>> >>> NFS? >>> >>> >> Sorry, I should have said, I''d like to the folder to be visible to >> the guests, and not NFS / FTP, as it will interfere with the network >> statistics on the NIC > > I don''t think there are any other options to share data between the > host and guest other than using network. > > Certainly, using a serial connection or VNC are not an option. > > Why not create a separate interface just for this kind of traffic? > >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. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-06 07:46 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Nico Kadel-Garcia wrote:> Tomasz Chmielewski wrote: >> Rudi Ahlers schrieb: >>> Tomasz Chmielewski wrote: >>>> Rudi Ahlers schrieb: >>>>> Hi >>>>> >>>>> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >>>>> 5.1 as host >>>> >>>> NFS? >>>> >>>> >>> Sorry, I should have said, I''d like to the folder to be visible to >>> the guests, and not NFS / FTP, as it will interfere with the network >>> statistics on the NIC >> >> I don''t think there are any other options to share data between the >> host and guest other than using network. >> >> Certainly, using a serial connection or VNC are not an option. >> >> Why not create a separate interface just for this kind of traffic? >> >> > 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. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >This is what I am looking for, but the purpose of the exercise is to allow the VM''s to backup their data to the extra block device. /dev/hdd1 is basically an extra empty HDD that I want to use for backups, so it''s imperative for them to write to them. Currently it''s mounted on /bck on the dom0, so I think I''ll just create a seperate folder for each vm, like /bck/vm01, /bck/vm02, etc But, how do I share that block device with the domU''s? I''m very new to Xen -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tomasz Chmielewski
2008-Mar-06 07:54 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Nico Kadel-Garcia schrieb:> Tomasz Chmielewski wrote: >> Rudi Ahlers schrieb: >>> Tomasz Chmielewski wrote: >>>> Rudi Ahlers schrieb: >>>>> Hi >>>>> >>>>> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >>>>> 5.1 as host >>>> >>>> NFS? >>>> >>>> >>> Sorry, I should have said, I''d like to the folder to be visible to >>> the guests, and not NFS / FTP, as it will interfere with the network >>> statistics on the NIC >> >> I don''t think there are any other options to share data between the >> host and guest other than using network. >> >> Certainly, using a serial connection or VNC are not an option. >> >> Why not create a separate interface just for this kind of traffic? >> >> > 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. -- Tomasz Chmielewski http://wpkg.org _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-06 07:57 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Tomasz Chmielewski wrote:> Nico Kadel-Garcia schrieb: >> Tomasz Chmielewski wrote: >>> Rudi Ahlers schrieb: >>>> Tomasz Chmielewski wrote: >>>>> Rudi Ahlers schrieb: >>>>>> Hi >>>>>> >>>>>> How do I share a folder, say /bkp with xen hosts? I''m using >>>>>> CentOS 5.1 as host >>>>> >>>>> NFS? >>>>> >>>>> >>>> Sorry, I should have said, I''d like to the folder to be visible to >>>> the guests, and not NFS / FTP, as it will interfere with the >>>> network statistics on the NIC >>> >>> I don''t think there are any other options to share data between the >>> host and guest other than using network. >>> >>> Certainly, using a serial connection or VNC are not an option. >>> >>> Why not create a separate interface just for this kind of traffic? >>> >>> >> 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 :) -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tomasz Chmielewski
2008-Mar-06 08:27 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
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@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2008-Mar-06 08:42 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Rudi Ahlers wrote:> Nico Kadel-Garcia wrote: >> Tomasz Chmielewski wrote: >>> Rudi Ahlers schrieb: >>>> Tomasz Chmielewski wrote: >>>>> Rudi Ahlers schrieb: >>>>>> Hi >>>>>> >>>>>> How do I share a folder, say /bkp with xen hosts? I''m using >>>>>> CentOS 5.1 as host >>>>> >>>>> NFS? >>>>> >>>>> >>>> Sorry, I should have said, I''d like to the folder to be visible to >>>> the guests, and not NFS / FTP, as it will interfere with the >>>> network statistics on the NIC >>> >>> I don''t think there are any other options to share data between the >>> host and guest other than using network. >>> >>> Certainly, using a serial connection or VNC are not an option. >>> >>> Why not create a separate interface just for this kind of traffic? >>> >>> >> 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. >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users >> > This is what I am looking for, but the purpose of the exercise is to > allow the VM''s to backup their data to the extra block device. > /dev/hdd1 is basically an extra empty HDD that I want to use for > backups, so it''s imperative for them to write to them. Currently it''s > mounted on /bck on the dom0, so I think I''ll just create a seperate > folder for each vm, like /bck/vm01, /bck/vm02, etc > > But, how do I share that block device with the domU''s? I''m very new to > Xen >Only do it to one guest at a time: allowing multiple guests to mount and write at the same time is deadly. But there are plenty of published walk throughs, look up "block-attach" in the manual page for xm, which has a good example. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2008-Mar-06 08:46 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Tomasz Chmielewski wrote:> Nico Kadel-Garcia schrieb: >> Tomasz Chmielewski wrote: >>> Rudi Ahlers schrieb: >>>> Tomasz Chmielewski wrote: >>>>> Rudi Ahlers schrieb: >>>>>> Hi >>>>>> >>>>>> How do I share a folder, say /bkp with xen hosts? I''m using >>>>>> CentOS 5.1 as host >>>>> >>>>> NFS? >>>>> >>>>> >>>> Sorry, I should have said, I''d like to the folder to be visible to >>>> the guests, and not NFS / FTP, as it will interfere with the >>>> network statistics on the NIC >>> >>> I don''t think there are any other options to share data between the >>> host and guest other than using network. >>> >>> Certainly, using a serial connection or VNC are not an option. >>> >>> Why not create a separate interface just for this kind of traffic? >>> >>> >> 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.Well, yes. If you have multiple systems able to write to the device, you''re begging for disaster. That requires network-style mountable file systems, because each OS makes the working system that it owns its own block devices and no one else is mucking with them. It''s as bad as having two infants and only one breast for them. They have to take turns..... _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-06 12:40 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Nico Kadel-Garcia wrote:> Tomasz Chmielewski wrote: >> Nico Kadel-Garcia schrieb: >>> Tomasz Chmielewski wrote: >>>> Rudi Ahlers schrieb: >>>>> Tomasz Chmielewski wrote: >>>>>> Rudi Ahlers schrieb: >>>>>>> Hi >>>>>>> >>>>>>> How do I share a folder, say /bkp with xen hosts? I''m using >>>>>>> CentOS 5.1 as host >>>>>> >>>>>> NFS? >>>>>> >>>>>> >>>>> Sorry, I should have said, I''d like to the folder to be visible to >>>>> the guests, and not NFS / FTP, as it will interfere with the >>>>> network statistics on the NIC >>>> >>>> I don''t think there are any other options to share data between the >>>> host and guest other than using network. >>>> >>>> Certainly, using a serial connection or VNC are not an option. >>>> >>>> Why not create a separate interface just for this kind of traffic? >>>> >>>> >>> 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. > Well, yes. If you have multiple systems able to write to the device, > you''re begging for disaster. That requires network-style mountable > file systems, because each OS makes the working system that it owns > its own block devices and no one else is mucking with them. It''s as > bad as having two infants and only one breast for them. They have to > take turns..... > > _______________________________________________ok, I didn''t know that''s how it works. With VirtualBox one can just share a folder between the host & guest (or multiple guests for that matter) without any problems, so I thought this was the case with Xen as well. But I''ll use NFS then between them, thank you :) -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Alexander Piavka
2008-Mar-06 12:51 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
> ok, I didn''t know that''s how it works. With VirtualBox one can just share a > folder between the host & guest (or multiple guests for that matter) without > any problems, so I thought this was the case with Xen as well. But I''ll use > NFS then between them, thank you :)Virtual box is running as linux user space process, so the actual disk access is made by these Virtual box linux processes, and linux take care that the access is not concurrent. Alex _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-06 13:44 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Alexander Piavka wrote:>> ok, I didn''t know that''s how it works. With VirtualBox one can just >> share a folder between the host & guest (or multiple guests for that >> matter) without any problems, so I thought this was the case with Xen >> as well. But I''ll use NFS then between them, thank you :) > > Virtual box is running as linux user space process, so the actual > disk access is made by these Virtual box linux processes, and linux > take care that the access is not concurrent. > > Alex > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >I actually use Winbox on my Windows PC, but find that it''s not workable in a hosting environment, hence the use of Xen :) -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rudi Ahlers
2008-Mar-08 06:24 UTC
Re: [Xen-users] How do I share a folder with xen guests on Linux?
Rudi Ahlers wrote:> Francesco Polzella wrote: >> Rudi Ahlers schrieb: >> >>> Hi >>> >>> How do I share a folder, say /bkp with xen hosts? I''m using CentOS >>> 5.1 as host >> Another option is to use GFS that is very easy to set up on Centos. >> Clearly it''s quite impossible to completly avoid the network usage >> since all the concurrent filesystems usually >> have network deamons that implement the protocol and policies to >> ensure the data consistency. >> Another option you have is to use OCFS v.2 (Oracle Cluster Filesystem) >> >> Best Regards >> >> Francesco Polzella >> >> >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users >> > I think the NFS option will work, if I use a separate internal IP > subnet for this purpose, which I can then just exclude from Cacti :) >Can someone perhaps help me? I have setup an NFS server on the dom0, as follows: cat /etc/exports /bck 192.168.10.0/24(rw) tail -f /var/log/messages Mar 7 23:04:13 venus kernel: nfsd: last server has exited Mar 7 23:04:13 venus kernel: nfsd: unexporting all filesystems Mar 7 23:04:13 venus kernel: RPC: failed to contact portmap (errno -5). Mar 7 23:04:13 venus kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory Mar 7 23:04:13 venus kernel: NFSD: starting 90-second grace period Mar 7 23:04:14 venus mountd[10383]: authenticated mount request from 192.168.10.11:834 for /bck (/bck) Mar 7 23:05:27 venus mountd[10383]: authenticated mount request from 192.168.10.11:977 for /bck (/bck) So it looks if all is well, but on the client side, I get this: root@vps01 [~]# mount 192.168.10.10:/bck /bck mount.nfs: Input/output error -- Kind Regards Rudi Ahlers CEO, SoftDux Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users