Home » General » Support » WORKAROUND - Does AutoFS work in OpenVZ yet?
WORKAROUND - Does AutoFS work in OpenVZ yet? [message #21652] |
Fri, 12 October 2007 16:20  |
dranch
Messages: 33 Registered: August 2007
|
Member |
|
|
Hello Everyone,
I'm trying to get NIS/AutoFS/NFS working here on Centos5 VPSs but it's not working out. Per a thread dated August 2006, it said that AUTOFS hadn't been virtualized yet.
http://forum.openvz.org/index.php?t=tree&goto=4960&& amp; amp;srch=autofs#msg_4960
Has this issue been fixed?
Looking at the most current Centos5 kernel configuration, AutoFS4 *is* a module and autofs works fine in the machine VPS (VPS#0).
http://download.openvz.org/kernel/branches/rhel5-2.6.18/028s tab045.1/configs/kernel-2.6.18-i686.config.ovz
--
. . .
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=m
. . .
--
The machine is running the current OpenVZ kernel, fully patched, etc.
When I start a VPS and autofs starts up, I see:
--
Oct 11 19:11:56 fruitpie-A automount[21693]: Starting automounter version 5.0.1-0.rc2.43.0.2, master map auto.master
Oct 11 19:11:56 fruitpie-A automount[21693]: using kernel protocol version 5.00
Oct 11 19:11:56 fruitpie-A automount[21693]: do_mount_autofs_indirect: failed to create autofs directory /misc
Oct 11 19:11:56 fruitpie-A automount[21693]: handle_mounts: mount of /misc failed!
Oct 11 19:11:56 fruitpie-A automount[21693]: master_do_mount: failed to startup mount
Oct 11 19:11:56 fruitpie-A automount[21693]: master_read_master: no mounts in table
--
When a remote user tries to log into a VPS, the authetication (NIS) works but they can't get into their homedir:
--
dranch@fruitpie-a's password:
Last login: Thu Oct 11 19:11:43 2007 from dolly-centos5
Could not chdir to home directory /homes/dranch: No such file or directory
--
The OpenVZ configuration is fairly basic:
1. I'm using the posted Centos5 i686 "default" template to run three VPSs
2. My VPS configuration is pretty basic. The only thing that might be a little advanced is the hardware node has (4)NICs. eth0 is for the management network and the remaining three are
mapped directly into a VPS for dedicated use. Everything is fine as the VPSs can "ypcat" the various NIS maps, SSH around, etc. It's just
--
ORIGIN_SAMPLE="pvl.basic"
OSTEMPLATE="centos-5-i386-default"
NAME="fruitpie-A"
HOSTNAME="fruitpie-A"
IP_ADDRESS="10.159.16.102"
NAMESERVER="172.17.28.100 172.17.28.101"
NETDEV="eth1"
--
Thoughts?
[Updated on: Fri, 02 November 2007 17:27] Report message to a moderator
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #21840 is a reply to message #21652] |
Tue, 16 October 2007 20:51   |
efball
Messages: 41 Registered: September 2006 Location: Santa Rosa, California
|
Member |
|
|
Quote: | I'm trying to get NIS/AutoFS/NFS working here on Centos5 VPSs but it's not working out. Per a thread dated August 2006, it said that AUTOFS hadn't been virtualized yet.
Has this issue been fixed?
|
I'd like to know the answer to this too. I know somebody else trying to make autofs work.
I've been using the amd automounter instead of autofs. It works with the 2.6.18-ovz028stab039.1-smp kernel (vanilla 2.6.18), but NOT with the 2.6.18-8.1.8.el5.028stab039.1 kernel (RHEL 5 2.6.18).
NIS works fine. NFS hard mounts work fine.
dranch: you say you are using the "latest" kernel. Which tree? There are several latest kernels.
E Frank Ball efball@efball.com
|
|
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #21900 is a reply to message #21894] |
Wed, 17 October 2007 18:00   |
efball
Messages: 41 Registered: September 2006 Location: Santa Rosa, California
|
Member |
|
|
dranch wrote on Wed, 17 October 2007 11:50 | So I'd like to set something working so I guess I'll try your approach until I hope this can be fixed. A few questions if I may:
1. Did you take a vanilla 2.6.18.1 kernel and applied the OpenVZ patches or did you use a linux-2.6.18.8 vanilla kernel and patched it?
|
I downloaded the kernel from openvz. I'm currently using 2.6.18-ovz028stab039.1-smp
Quote: | 2. On the Centos5 copy running on the base machine, are you using autofs there or are you using AMD on the base?
|
My base machine is Enterprise 4. My VMs are CentOS 4. amd is running on both.
Quote: | 3. I can't say I've used AMD before. Does it "just" work like autofs or do you need to configure it? Any pointers or URLs?
|
amd is not a simple "it just works" solution. I'm using this at work, and we use amd here not autofs (it's a really old network that used to be all HP-UX). The NFS maps for amd are distributed via NIS. I didn't setup the network, or the NIS servers, or the file servers, just my clients.
E Frank Ball efball@efball.com
|
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #21907 is a reply to message #21906] |
Wed, 17 October 2007 20:36   |
efball
Messages: 41 Registered: September 2006 Location: Santa Rosa, California
|
Member |
|
|
dranch wrote on Wed, 17 October 2007 16:04 | Are you using a RHEL4 kernel configuration against a patched vanilla 2.4.18 codebase or did you configure the kernel options manually? Ideally, I'd like to keep this machine as "stock" as possible.
|
Neither. I didn't compile a kernel, I downloaded the kernel from the openvz yum repository.
E Frank Ball efball@efball.com
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #21908 is a reply to message #21652] |
Wed, 17 October 2007 20:55   |
 |
dowdle
Messages: 261 Registered: December 2005 Location: Bozeman, Montana
|
Senior Member |
|
|
When that original post was written, NFS mounts inside of a VPS wasn't working so well. Now that seems to be working fairly well... at least it is for me... on CentOS 5 host node and CentOS 5 based VPSes.
For specifics on how to make this work, see:
http://wiki.openvz.org/NFS
If you haven't gone through that, it ain't going to work.
So far as autofs goes, if it doesn't have to load a kernel module to work and it doesn't use kernel threads (and it doesn't in both of those cases I believe), it has the potential to work. OpenVZ is mostly for server virtualization and I have to wonder why not use persistant NFS mounts rather than autofs dynamic ones? I use autofs for NFS mounts for (non-virtualized) student lab machines and for some workstations but for servers, why use autofs? Perhaps you have a good reason?
NIS should work fine.
I've have problems getting NFS working inside of a VPS on CentOS 4 based systems... so I'm not sure that is working... but in any event if you can't get it to work from the VPS, the alternative is to get it working on the host node and then bind mount it into the VPS space.
Perhaps the reason there hasn't been a lot of discussion on this topic here in the forum is because of the existence of the wiki page?!?
--
TYL, Scott Dowdle
Belgrade, Montana, USA
|
|
|
|
|
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #22024 is a reply to message #22023] |
Thu, 18 October 2007 18:58   |
 |
dowdle
Messages: 261 Registered: December 2005 Location: Bozeman, Montana
|
Senior Member |
|
|
From the kernel version that was given, I'm certain a stock CentOS 5 kernel is in use. He said make sure the autofs module is loaded... and all of that output you gave did not include a module listing.
I previously thought that autofs wasn't a kernel related process but if there is a module, looks like it is.
lsmod | grep auto
If you don't see the autofs4 module, load it... and bingo it might work.
I can tell you nfs doesn't work unless the nfs related modules are loaded.
I've had some problems getting depmod/modprobe figuring out the dependancies of modules and automatically loading everything as they should... so when that happened, I manually loaded all of the pieces myself with insmod. At the very least here is the module you want loaded:
/lib/modules/2.6.18-8.1.14.el5/kernel/fs/autofs4/autofs4.ko
Of course depending on the arch you have, the kernel version number directory might be a little different.
--
TYL, Scott Dowdle
Belgrade, Montana, USA
|
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #22031 is a reply to message #21840] |
Fri, 19 October 2007 01:49   |
dranch
Messages: 33 Registered: August 2007
|
Member |
|
|
So following efball's recommendation, I installed the patched 2.6.18 vanilla kernel and converted the VPS machines from autofs to amd. Low and behold this WORKS! Awesome but the solution is less than optimal and I really still need to get autofs working.
Why?
1) This workaround uses a plain 2.6.18 kernel and not the centos5 2.6.18 kernel. Centos and RHEL offer, in theory, a more regressed and stable kernel platform which receives timely patches via yum, etc.
2) The NIS servers I bind to offer autofs formatted maps which are incompatible with amd's format. I found the following Perl script which mostly converts the two formats but this isn't an automatic process, the script needs some minor tweaks to create 100% clean AMD maps, etc.
http://groups.google.com/group/comp.unix.bsd.freebsd.misc/br owse_thread/thread/83b4855b95148f8/d0414ce35e72e474?hl=en&am p;lnk=st&q=convert+autofs+nis+maps+to+amd#d0414ce35e72e4 74
My biggest issue with this autofs -> amd approach is that I'll need to put this Perl script into a crontab to get updates for new/deleted users, changed filers, etc. I'll also have to automate the updating of the /etc/amd.conf file whenever any automounter maps are changed (new maps, deleted, etc). All of these items are automatic with autofs and it's auto.master file.
As a test to keep things moving with getting the Autofs problem identified and hopefully fixed, I again tried to use the patched Centos5 kernel with this known working AMD setup but the VPS fails with different errors than before:
Oct 18 18:32:34 dolly-centos5-A amd[9711]: switched to logfile "syslog"
Oct 18 18:32:34 dolly-centos5-A amd[9711]: AM-UTILS VERSION INFORMATION:
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Copyright (c) 1997-2006 Erez Zadok
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Copyright (c) 1990 Jan-Simon Pendry
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Copyright (c) 1990 Imperial College of Science, Technology & Medicine
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Copyright (c) 1990 The Regents of the University of California.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: am-utils version 6.1.5 (build 1).
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Report bugs to https://bugzilla.am-utils.org/ or am-utils@am-utils.org.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Configured by mockbuild@builder6.centos.org on date Wed Mar 21 22:12:34 EDT 2007.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Built by mockbuild@builder6.centos.org on date Wed Mar 21 22:14:35 EDT 2007.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: cpu=i686 (little-endian), arch=i386, karch=i686.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: full_os=linux, os=linux, osver=2.6.9-42.0.3.ELsmp, vendor=redhat, distro=rh4.92.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: domain=spglab.juniper.net, host=dolly-centos5-A, hostd=dolly-centos5-A.dude.net.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Map support for: root, passwd, hesiod, ldap, union, nisplus, nis, ndbm,
Oct 18 18:32:34 dolly-centos5-A amd[9711]: file, exec, error.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: AMFS: nfs, link, nfsx, nfsl, host, linkx, program, union, ufs, lofs,
Oct 18 18:32:34 dolly-centos5-A amd[9711]: cdfs, auto, direct, toplvl, error, inherit.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: FS: iso9660, lofs, nfs, nfs3, tmpfs, ext3.
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Network 1: wire="dolly-centos5-a.spglab.juniper.net" (netnumber=10.159.4.232).
Oct 18 18:32:34 dolly-centos5-A amd[9711]: Network 2: wire="1.0.0.0" (netnumber=1).
Oct 18 18:32:34 dolly-centos5-A amd[9711]: My ip addr is 127.0.0.1
Oct 18 18:32:34 dolly-centos5-A amd[9718]: released controlling tty using setsid()
Oct 18 18:32:34 dolly-centos5-A amd[9718]: file server localhost, type local, state starts up
Oct 18 18:32:34 dolly-centos5-A amd[9718]: simfs restarted fstype link on /, flags 0x89
Oct 18 18:32:34 dolly-centos5-A amd[9718]: proc restarted fstype link on /proc, flags 0x89
Oct 18 18:32:34 dolly-centos5-A amd[9718]: sysfs restarted fstype link on /sys, flags 0x89
Oct 18 18:32:34 dolly-centos5-A amd[9718]: devpts restarted fstype link on /dev/pts, flags 0x89
Oct 18 18:32:34 dolly-centos5-A amd[9718]: creating mountpoint directory '/home-adp'
Oct 18 18:32:34 dolly-centos5-A amd[9718]: creating mountpoint directory '/adpdev'
Oct 18 18:32:34 dolly-centos5-A amd[9719]: '/home-adp': mount: No such device
Oct 18 18:32:34 dolly-centos5-A amd[9720]: '/adpdev': mount: No such device
Oct 18 18:32:34 dolly-centos5-A amd[9718]: creating mountpoint directory '/local'
Oct 18 18:32:34 dolly-centos5-A amd[9721]: '/local': mount: No such device
Oct 18 18:32:34 dolly-centos5-A amd[9718]: creating mountpoint directory '/homes'
Oct 18 18:32:34 dolly-centos5-A amd[9722]: '/homes': mount: No such device
Oct 18 18:32:34 dolly-centos5-A amd[9718]: creating mountpoint directory '/vols'
Oct 18 18:32:34 dolly-centos5-A amd[9723]: '/vols': mount: No such device
Oct 18 18:32:34 dolly-centos5-A init: no more processes left in this runlevel
Oct 18 18:32:35 dolly-centos5-A amd[9719]: '/home-adp': mount: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9719]: amfs_toplvl_mount: amfs_mount failed: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9720]: '/adpdev': mount: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9720]: amfs_toplvl_mount: amfs_mount failed: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9721]: '/local': mount: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9721]: amfs_toplvl_mount: amfs_mount failed: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9722]: '/homes': mount: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9722]: amfs_toplvl_mount: amfs_mount failed: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9723]: '/vols': mount: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9723]: amfs_toplvl_mount: amfs_mount failed: No such device
Oct 18 18:32:35 dolly-centos5-A amd[9718]: /home-adp: mount (amfs_cont): No such device
Oct 18 18:32:35 dolly-centos5-A amd[9718]: /adpdev: mount (amfs_cont): No such device
Oct 18 18:32:35 dolly-centos5-A amd[9718]: /vols: mount (amfs_cont): No such device
Oct 18 18:32:35 dolly-centos5-A amd[9718]: /homes: mount (amfs_cont): No such device
Oct 18 18:32:35 dolly-centos5-A amd[9718]: /local: mount (amfs_cont): No such device
|
|
|
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #22091 is a reply to message #22031] |
Fri, 19 October 2007 20:10   |
dranch
Messages: 33 Registered: August 2007
|
Member |
|
|
So I spoke too soon about AMD being a viable workaround.
Though amd does seem to work for one VE (VE#100) compared to autofs, the other two VEs either show nothing in the user's home directory or get I/O errors:
SSHing into VE100:
--
Last login: Fri Oct 19 12:39:00 2007 from 10.150.52.4
dolly-centos5-A:~$
[ Everything is ok, I can see my files and mount shows my homedir being mounted:
nfs on /.automount/uranus2/vol/homes/homes2/dranch type nfs (rw,nosuid,vers=3,rsize=8192,wsize=8192,hard,intr,proto=tcp, timeo=600,retrans=3,sec=sys,addr=uranus2)
--
-------------------------------
SSHing into VE101:
--
Last login: Fri Oct 19 12:32:23 2007 from 10.150.52.4
-bash-3.1$ ls
[ Nothing. No files but also no errors. I'm supposedly in /homes/dranch but there is nothing there when I du a "ls", "du", etc. I can supposedly goto other user directories with the same behavior. Running mount does NOT show my homedir as being mounted. ]
-------------------------------
SSHing into VE102:
--
Last login: Fri Oct 19 12:41:22 2007 from 10.150.52.4
Could not chdir to home directory /homes/dranch: No such file or directory
[ This is even worse. I'm dropped to /. Mount doesn't show my homedir as being mounted. Nothing in the logs. No change if I restart amd. If I shutdown this VE, I see
--
Oct 19 12:38:57 dolly-centos5-A sshd[26588]: pam_loginuid(sshd:session): set_loginuid failed opening loginuid
--
---------------------------
Experimenting a bit, I logged out of the working VE#100 and tried to umount the /homes/dranch directory via the VZ console. This worked a few times but then later usually failed:
# umount /.automount/uranus2/vol/homes/homes2/dranch/
umount.nfs: nfs: not found / mounted or server not reachable
At this point, I would see this error upon shutdown of the VE#100:
RPC: failed to contact portmap (errno -5).
With VE#100 shutdown, I would then try to log into VE#101 to only see I/O errors and mount wouldn't show my homedir being mounted
--
Could not chdir to home directory /homes/dranch: Input/output error
-bash: /homes/dranch/.bash_profile: Input/output error
--
So I now shut down ALL VEs (100, 101, and 102). I then only restart VE#102 which was the worst off from the above examples. VE#102 now works fine.
So I start VE#101 to only get the empty directory stuff but no errors. Finally, I start VE#102 to only see the "/homes/dranch: No such file or directory" errors. It seems the behavior of the VE depends on the order it's started. Not good.
So.. there you have it. AMD does do a bit more compared to AutoFS but overall, things are still broken beyond one VE.
Other misc notes:
I've also noticed that when I shut down VEs, I always see this
in the physical machine's /var/log/messages. Maybe another hint:
--
Oct 19 12:44:12 dolly-centos5-openvz kernel: neigh_parms_release: not found
--
|
|
|
|
Re: Does AutoFS work in OpenVZ yet? [message #22753 is a reply to message #22092] |
Fri, 02 November 2007 18:29  |
dranch
Messages: 33 Registered: August 2007
|
Member |
|
|
Workaround:
Woohoo! I have been working with "gblond" on this issue for some time and through the various troubleshooting, I discovered a workaround that works though we are still working on the root problem.
Specifically, with:
- the RHEL5 kernel with OpenVZ patches (2.6.18-8.1.15.el5.028stab047.1) -- no need for a vanilla kernel patched with OpenVZ
- autofs running on the HE
- amd running in the VEs (autofs doesn't work still -- bummer and thus requires cron scripts in each VE to periodically update the various maps and restart amd)
I am now able to boot the VEs and users see all their files if I do the following:
1. disable OpenVZ from automatically starting in rc3.d
2. in the rc.local file, do an "ls" of some user that is only reachable via the automounter system. This seems to kick off the NFS system in the HE properly where as it DOESN'T kick off in the VEs properly. You will see the FS caching system kick off in the logs which is critical
--
FS-Cache: Loaded
FS-Cache: netfs 'nfs' registered for caching
--
3. In the rc.local file, now wait 20 seconds
4. In the rc.local file, now start openvz
|
|
|
Goto Forum:
Current Time: Tue Sep 26 02:13:19 GMT 2023
Total time taken to generate the page: 0.02178 seconds
|