Re: NFS Mount Bug

19 views
Skip to first unread message

Eric Shamow

unread,
Mar 26, 2010, 5:46:05 PM3/26/10
to puppet-dev
Eric (this will get confusing VERY quickly for others following this) --

When I try and mount the filesystem, using either just a straight
"mount <targetdir>" or the full line used by puppet, I get the
following:

[root@ssf-prod-02 disk2]# /bin/mount -o \
vers=3,rsize=32768,wsize=32768,tcp,noatime,nocto,hard,intr,timeo=60,retrans=2,actimeo=30
/var/www/
mount.nfs: /var/www is already mounted or busy
[root@ssf-prod-02 disk2]# echo $?
32

Puppet sees the same thing -- with debug logging turned on:

err: //mod-ssf3-testing/Mount[nfs_var_www]/ensure: change from present
to mounted failed: Execution of '/bin/mount -o
vers=3,rsize=32768,wsize=32768,tcp,noatime,nocto,hard,intr,timeo=60,retrans=2,actimeo=30
/var/www/' returned 32: mount.nfs: /var/www is already mounted or busy

This suggests to me that the mount command itself is ok and that
Puppet's handling is wrong....it's looking for a successful mount
message even though it should accept "is already mounted or busy."

-Eric

> Eric Sorenson <ahp...@gmail.com> Mar 26 10:24AM -0700 ^
>
> Hi Eric - I'm using a lot of nfs mounts, albeit not on Linux, and I'm somewhat familiar with the code underlying this activity. In debugging this I would try to ascertain why the provider thought the filesystem was not already mounted and therefor thought it had to change the ensure "from present to mounted" in the first place. The code here is pretty straightforward:
>
> puppet/lib/provider/mount.rb:40
>
> # Is the mount currently mounted?
> def mounted?
> platform = Facter.value("operatingsystem")
> name = resource[:name]
> mounts = mountcmd.split("\n").find do |line|
> case platform
> when "Darwin"
> line =~ / on #{name} / or line =~ %r{ on /private/var/automount#{name}}
> when "Solaris"
> line =~ /^#{name} on /
> else
> line =~ / on #{name} /
> end
> end
> end
>
> So...What does your 'mount' output look like for these filesystems? Are you changing the $name in a way that would cause it to fail the match?
>
> -=Eric
>
>
> On Mar 25, 2010, at 1:03 PM, eshamow wrote:
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
> To post to this group, send email to puppe...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
>

Eric Sorenson

unread,
Mar 26, 2010, 6:19:26 PM3/26/10
to puppe...@googlegroups.com

On Mar 26, 2010, at 2:46 PM, Eric Shamow wrote:

> Puppet sees the same thing -- with debug logging turned on:
>
> err: //mod-ssf3-testing/Mount[nfs_var_www]/ensure: change from present
> to mounted failed: Execution of '/bin/mount -o
> vers=3,rsize=32768,wsize=32768,tcp,noatime,nocto,hard,intr,timeo=60,retrans=2,actimeo=30
> /var/www/' returned 32: mount.nfs: /var/www is already mounted or busy
>
> This suggests to me that the mount command itself is ok and that
> Puppet's handling is wrong....it's looking for a successful mount
> message even though it should accept "is already mounted or busy."


Right, but the code I quoted, which is the piece that causes puppet to think the state needs to change from 'present' (in fstab but not active) to 'mounted' (in fstab and accessible), just runs 'mount' without any options and parses the output. This happens before the point in execution you pasted but doesn't emit any output. If that succeeded, which it should do for this filesystem but is not doing, puppet wouldn't even attempt to execute this command.

But I think I see from the output what's going on -- It looks like you are defining your mount resources like:

mount { "nfs_var_www": path => "/var/www", device => "server:/www", ensure => mounted }

and maybe puppet's grepping for nfs_var_www instead of "/var/www". Does putting the path up into the name change things for you?

I'm eric0 on freenode irc, feel free to ping me if you want to step through it realtime.

-=Eric

eshamow

unread,
Mar 26, 2010, 6:38:46 PM3/26/10
to Puppet Developers
Bingo...that did it.

So this is interesting. Mount objects are not allowed to be labeled
differently than the mount name? Even though I explicitly define the
name parameter in my config....

My definitions in Puppet config -- the following did not work:

mount { "nfs_var_www":
device => "nfs-1.sys.cdc.advance.net:/vol/ssf_prod/stage",
ensure => mounted,
fstype => "nfs",
name => "/var/www",
options =>
"vers=3,rsize=32768,wsize=32768,tcp,noatime,nocto,hard,intr,timeo=60,retrans=2,actimeo=30",
require => [ Package["httpd"], File["ifcfg_eth1"], Exec['/
sbin/ifup eth1'] ],
}

This, however, DOES work:

mount { "/var/www":
device => "nfs-1.sys.cdc.advance.net:/vol/ssf_prod/stage",
ensure => mounted,
fstype => "nfs",
options =>
"vers=3,rsize=32768,wsize=32768,tcp,noatime,nocto,hard,intr,timeo=60,retrans=2,actimeo=30",
require => [ Package["httpd"], File["ifcfg_eth1"], Exec['/
sbin/ifup eth1'] ],
}

Interesting. Problem solved from my pov but there's definitely
something wrong there.

-Eric

David Schmitt

unread,
Mar 27, 2010, 4:17:25 AM3/27/10
to puppe...@googlegroups.com
Hi Eric,

I've created http://projects.reductivelabs.com/issues/3444 for you. You
can subscribe there and add any useful info you might have, like log
output from your Puppet master and client. You can generate these logs
by running the Puppet master and client with the --trace --verbose
--debug flags. Also the versions (client, server, OS) you are running
would be interesting.

Thanks, David


--
dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at
Klosterneuburg UID: ATU64260999

FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg

Reply all
Reply to author
Forward
0 new messages