I have the below as a module (cleaned up & reduced a bit for simplicity). Every time puppet runs, it remounts all of the mounts. Why is it doing this? According to the wiki: http://www.reductivelabs.com/trac/puppet/wiki/TypeReference#mount Note that if a mount receives an event from another resource, it will try to remount the filesystems if ensure is set to mounted. But what event is this referring to? I don''t believe I''m sending it any events or doing a require anywhere. Here''s the cleaned-up version of the module: =class nfs01 { package { "nfs-utils.x86_64": ensure => present; } service { "portmap": enable => true, ensure => running, require => Package["nfs-utils.x86_64"]; } file { [ "/nfs01", "/nfs01/media", "/nfs01/media/type1", "/nfs01/media/type2" ]: ensure => directory, require => Service["portmap"]; } Mount { atboot => true, ensure => mounted, fstype => "nfs", options => "rw,auto,nouser,noatime,nosharecache,context=system_u:object_r:httpd_sys_content_t", dump => "0", pass => "0" } mount { "/nfs01/media/type1": device => "172.16.1.1:/data/media/type1", name => "/nfs01/media/type1", require => File["/nfs01/media/type1"]; "/nfs01/media/type2": device => "172.16.1.1:/data/media/type2", name => "/nfs01/media/type2", require => File["/nfs01/media/type2"]; } }
On Jan 30, 2008, at 9:39 PM, Johnny Tan wrote:> I have the below as a module (cleaned up & reduced a bit for > simplicity). > > Every time puppet runs, it remounts all of the mounts. Why > is it doing this?Does it also think it''s making a change every time?> > According to the wiki: > http://www.reductivelabs.com/trac/puppet/wiki/TypeReference#mount > Note that if a mount receives an event from another > resource, it will try to remount the filesystems if ensure > is set to mounted. > > But what event is this referring to? I don''t believe I''m > sending it any events or doing a require anywhere.Events are sent by other resources that the mount might be subscribed to. It looks like you''re not doing this. -- Hollywood is a place where they''ll pay you a thousand dollars for a kiss and fifty cents for your soul. -- Marilyn Monroe --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
matthew.malthouse@guardian.co.uk
2008-Jan-30 16:10 UTC
Re: "ensure" on mounts keeps re-mounting nfs share
puppet-users-bounces@madstop.com wrote on 30/01/2008 12:30:34:> On Jan 30, 2008, at 9:39 PM, Johnny Tan wrote: > > > I have the below as a module (cleaned up & reduced a bit for > > simplicity). > > > > Every time puppet runs, it remounts all of the mounts. Why > > is it doing this? > > Does it also think it''s making a change every time? > > > According to the wiki: > > http://www.reductivelabs.com/trac/puppet/wiki/TypeReference#mount > > Note that if a mount receives an event from another > > resource, it will try to remount the filesystems if ensure > > is set to mounted. > > > > But what event is this referring to? I don''t believe I''m > > sending it any events or doing a require anywhere. > > Events are sent by other resources that the mount might be subscribed > to. It looks like you''re not doing this.No, it doesn''t action a re-mount. It attempts a _mount_ and fails A snip of the role/class and below that the effect from /var/adm/messages class foo_mounts { Mount { atboot => yes, blockdevice => "-", ensure => mounted, fstype => nfs, options => "ro,nosuid,noquota", pass => "-", dump => "-" } file { [ "/foo", "/foo/bar ]: ensure => directory, } mount { "/foo": device => "nfs.my.domain:/export/foo" } mount { "/foo/bar": device => "nfs.my.domain:/export/foo/bar" } } Jan 30 00:21:33 tivprv11 puppetd[22389]: [ID 702911 daemon.notice] [//serve/role/foo_mounts/Mount[/foo]) Refreshing self Jan 30 00:21:36 tivprv11 puppetd[22389]: [ID 702911 daemon.error] (//serve/role/class/Mount[/foo]/ensure) change from present to mounted failed: Execution of ''/usr/sbin/mount -o ro,nosuid,noquota /foo'' returned 8448: nfs mount: mount: /foo: Device busy Jan 30 00:21:36 tivprv11 puppetd[22389]: [ID 702911 daemon.notice] (//serve/role/foo_mounts/Mount[/foo/bar]) Refreshing self Jan 30 00:21:38 tivprv11 puppetd[22389]: [ID 702911 daemon.error] (//serve/role/foo_mounts/Mount[/foo/bar]/ensure) change from present to mounted failed: Execution of ''/usr/sbin/mount -o ro,nosuid,noquota /foo/bar'' returned 8448: nfs mount: mount: /foo/bar: Device busy I understand from Marcin (aka Porridge) that this has been commented on before, may even have been logged as a bug. I''ve written the config for the real-life servers the above is abstracted from and am reasonably confident that nothing else is subscribing to the mounts. Unfortunately this isn''t trivial when you have lots of mounts and puppetd runs frequently: myserver#> grep "returned 8448" /var/adm/messages | wc -l 2809 The logic seems to be "Mount this resource" when what would be preferable would be "Check and if _not_ mounted do it" Matthew -- ------------------------------------------------------------------ Visit Guardian Unlimited - the UK''s most popular newspaper website http://guardian.co.uk http://observer.co.uk ------------------------------------------------------------------ The Newspaper Marketing Agency Opening Up Newspapers http://www.nmauk.co.uk ------------------------------------------------------------------ Please consider the environment before printing this email This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way. Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software. Guardian News & Media Limited A member of Guardian Media Group PLC Registered Office Number 1 Scott Place, Manchester M3 3GG Registered in England Number 908396
Luke Kanies wrote:> On Jan 30, 2008, at 9:39 PM, Johnny Tan wrote: > >> I have the below as a module (cleaned up & reduced a bit for >> simplicity). >> >> Every time puppet runs, it remounts all of the mounts. Why >> is it doing this? > > Does it also think it''s making a change every time?Not entirely sure, here''s what it reports each time. Seems to always be these three lines. From them, I gather that it always thinks the mount is currently "present" and wants to change it to "mounted" per my manifest. Jan 30 10:55:47 r16 puppetd[8076]: (//r16/webnode/nfs01/nfs01/Mount[/nfs01/media/type1]/ensure) ensure changed ''present'' to ''mounted'' Jan 30 10:55:47 r16 puppetd[8076]: (//r16/webnode/nfs01/nfs01/Mount[/nfs01/media/type1]) Refreshing self Jan 30 10:55:47 r16 puppetd[8076]: (//r16/webnode/nfs01/nfs01/Mount[/nfs01/media/type1]) Failed to call refresh on Mount[/nfs01/media/type1]: Execution of ''/bin/mount -o remount /nfs01/media/type1'' returned 8192: johnn
On Jan 31, 2008, at 3:10 AM, matthew.malthouse@guardian.co.uk wrote:> I understand from Marcin (aka Porridge) that this has been commented > on > before, may even have been logged as a bug. > > I''ve written the config for the real-life servers the above is > abstracted > from and am reasonably confident that nothing else is subscribing to > the > mounts. > > Unfortunately this isn''t trivial when you have lots of mounts and > puppetd > runs frequently: > > myserver#> grep "returned 8448" /var/adm/messages | wc -l > 2809 > > The logic seems to be "Mount this resource" when what would be > preferable > would be "Check and if _not_ mounted do it"That is the logic, but it looks like Puppet is incorrectly determining that the filesystem is not mounted. If you run it in debug mode, do you see evidence that the filesystem is incorrectly determined to be ''present'' instead of ''mounted''? I don''t see any open bugs about this, so if it was filed, I must have fixed it already. -- It''s not that I''m afraid to die. I just don''t want to be there when it happens. -- Woody Allen --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Jan 31, 2008, at 8:00 AM, Johnny Tan wrote:> Not entirely sure, here''s what it reports each time. Seems > to always be these three lines. From them, I gather that it > always thinks the mount is currently "present" and wants to > change it to "mounted" per my manifest. > > Jan 30 10:55:47 r16 puppetd[8076]: > (//r16/webnode/nfs01/nfs01/Mount[/nfs01/media/type1]/ensure) > ensure changed ''present'' to ''mounted'' > Jan 30 10:55:47 r16 puppetd[8076]: > (//r16/webnode/nfs01/nfs01/Mount[/nfs01/media/type1]) > Refreshing self > Jan 30 10:55:47 r16 puppetd[8076]: > (//r16/webnode/nfs01/nfs01/Mount[/nfs01/media/type1]) Failed > to call refresh on Mount[/nfs01/media/type1]: Execution of > ''/bin/mount -o remount /nfs01/media/type1'' returned 8192:Is the filesystem actually mounted? It looks like the mount is refrshing itself even when the only change that''s happened is that it''s gotten mounted, which would be a bug. If the fs is already mounted before this run, though, it means that Puppet is not correctly determining this fact. -- Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. -- Susan Ertz --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
matthew.malthouse@guardian.co.uk
2008-Jan-31 08:41 UTC
Re: "ensure" on mounts keeps re-mounting nfs share
puppet-users-bounces@madstop.com wrote on 30/01/2008 22:57:31:> > If you run it in debug mode, do you see evidence that the filesystem > is incorrectly determined to be ''present'' instead of ''mounted''?Running "puppetd --onetime --debug debug: service provider smf: Executing ''/usr/bin/svcs -l /system/filesystem/autofs:default'' debug: mount provider parsed: Executing ''/usr/sbin/mount'' debug: //server/role/class1/class2/Mount[/mnt/nfsserv09/app2/data101a]: Changing ensure debug: //server/role/class1/class2/Mount[/mnt/nfsserv09/app2/data101a]: 1 change(s) debug: mount provider parsed: Executing ''/usr/sbin/mount'' debug: //server/role/class1/class2/Mount[/mnt/nfsserv09/app2/data101a]/ensure: setting mounted (currently present) debug: mount provider parsed: Executing ''/usr/sbin/mount'' debug: mount provider parsed: Executing ''/usr/sbin/mount'' debug: mount provider parsed: Executing ''/usr/sbin/mount'' debug: mount provider parsed: Executing ''/usr/sbin/mount -o ro,nosuid,noquota /mnt/nfsserv09/app2/data101a'' err: //server/role/class1/class2/Mount[/mnt/nfsserv09/app2/data101a]/ensure: change from present to mounted failed: Execution of ''/usr/sbin/mount -o ro,nosuid,noquota /mnt/nfsserv09/app2/data101a'' returned 8448: nfs mount: mount: /mnt/nfsserv09/app2/data101a: Device busy notice: //server/role/class1/class2/Mount[/mnt/nfsserv09/app2/data101a]: Refreshing self info: Mount[/mnt/nfsserv09/app2/data101a](provider=parsed): Remounting debug: mount provider parsed: Executing ''/usr/sbin/mount -o remount /mnt/nfsserv09/app2/data101a'' Matthew -- ------------------------------------------------------------------ Visit Guardian Unlimited - the UK''s most popular newspaper website http://guardian.co.uk http://observer.co.uk ------------------------------------------------------------------ The Newspaper Marketing Agency Opening Up Newspapers http://www.nmauk.co.uk ------------------------------------------------------------------ Please consider the environment before printing this email This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way. Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software. Guardian News & Media Limited A member of Guardian Media Group PLC Registered Office Number 1 Scott Place, Manchester M3 3GG Registered in England Number 908396
Luke Kanies wrote:> If you run it in debug mode, do you see evidence that the filesystem > is incorrectly determined to be ''present'' instead of ''mounted''?Strange... unlike Matthew, if I run it from the command-line, it doesn''t seem to do the remount. In debug mode, it just lists a bunch of Autorequires, then does nothing. It only seems to do the remount when puppet is running as a daemon (I can get the behavior just by stopping/starting puppet). But here''s my debug in daemon mode. It does seem to see the mounts as "present" (whereas Matthew''s appears to be a result of "device busy"?). debug: mount provider parsed: Executing ''/bin/mount'' debug: //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: Changing ensure debug: //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: 1 change(s) debug: mount provider parsed: Executing ''/bin/mount'' debug: //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]/ensure: setting mounted (currently present) debug: mount provider parsed: Executing ''/bin/mount'' debug: mount provider parsed: Executing ''/bin/mount'' debug: mount provider parsed: Executing ''/bin/mount'' debug: mount provider parsed: Executing ''/bin/mount -o ro,auto,nouser,noatime,nosharecache,context=system_u:object_r:httpd_sys_content_t /nfs01/media/type1'' notice: //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]/ensure: ensure changed ''present'' to ''mounted'' notice: //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: Refreshing self info: Mount[/nfs01/media/type1](provider=parsed): Remounting debug: mount provider parsed: Executing ''/bin/mount -o remount /nfs01/media/type1'' err: //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: Failed to call refresh on Mount[/nfs01/media/type1]: Execution of ''/bin/mount -o remount /nfs01/media/type1'' returned 8192:
Luke Kanies wrote:> Is the filesystem actually mounted? > > It looks like the mount is refrshing itself even when the only change > that''s happened is that it''s gotten mounted, which would be a bug. If > the fs is already mounted before this run, though, it means that > Puppet is not correctly determining this fact.Yes, the filesystem *is* mounted. If you determine it''s a bug based on the debugs that Matthew and I sent, I''d be happy to file a bug (unless Matthew''s already done so). I just want to make sure it''s not something stupid I''m doing. johnn
On Feb 1, 2008, at 7:26 AM, Johnny Tan wrote:> Yes, the filesystem *is* mounted. > > If you determine it''s a bug based on the debugs that Matthew > and I sent, I''d be happy to file a bug (unless Matthew''s > already done so). I just want to make sure it''s not > something stupid I''m doing.Looks like a bug; please file, including the output of ''mount'' with no arguments, along with your platform. (And please wrap pastes in {{{}}} so it marks up correctly.) -- You can''t wait for inspiration. You have to go after it with a club. -- Jack London --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Johnny Tan schrieb:> Luke Kanies wrote: >> If you run it in debug mode, do you see evidence that the filesystem >> is incorrectly determined to be ''present'' instead of ''mounted''? > > Strange... unlike Matthew, if I run it from the > command-line, it doesn''t seem to do the remount. In debug > mode, it just lists a bunch of Autorequires, then does nothing. > > It only seems to do the remount when puppet is running as a > daemon (I can get the behavior just by stopping/starting > puppet).Then perhaps it''s depending on its ENV? You could also try running it under "env" to remove all environment variables. If that makes a change, you can try to find out which ENV makes a difference. Regards, DavidS> > > But here''s my debug in daemon mode. It does seem to see the > mounts as "present" (whereas Matthew''s appears to be a > result of "device busy"?). > > debug: mount provider parsed: Executing ''/bin/mount'' > debug: > //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: > Changing ensure > debug: > //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: > 1 change(s) > debug: mount provider parsed: Executing ''/bin/mount'' > debug: > //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]/ensure: > setting mounted (currently present) > debug: mount provider parsed: Executing ''/bin/mount'' > debug: mount provider parsed: Executing ''/bin/mount'' > debug: mount provider parsed: Executing ''/bin/mount'' > debug: mount provider parsed: Executing ''/bin/mount -o > ro,auto,nouser,noatime,nosharecache,context=system_u:object_r:httpd_sys_content_t > /nfs01/media/type1'' > notice: > //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]/ensure: > ensure changed ''present'' to ''mounted'' > notice: > //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: > Refreshing self > info: Mount[/nfs01/media/type1](provider=parsed): Remounting > debug: mount provider parsed: Executing ''/bin/mount -o > remount /nfs01/media/type1'' > err: > //r16/webnode/nfs01/nfs01::ingest/Mount[/nfs01/media/type1]: > Failed to call refresh on Mount[/nfs01/media/type1]: > Execution of ''/bin/mount -o remount /nfs01/media/type1'' > returned 8192: > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
matthew.malthouse@guardian.co.uk
2008-Feb-01 08:16 UTC
Re: "ensure" on mounts keeps re-mounting nfs share
puppet-users-bounces@madstop.com wrote on 01/02/2008 00:25:29:> On Feb 1, 2008, at 7:26 AM, Johnny Tan wrote: > > > Yes, the filesystem *is* mounted. > > > > If you determine it''s a bug based on the debugs that Matthew > > and I sent, I''d be happy to file a bug (unless Matthew''s > > already done so). I just want to make sure it''s not > > something stupid I''m doing. > > > Looks like a bug; please file, including the output of ''mount'' with no > arguments, along with your platform. (And please wrap pastes in > {{{}}} so it marks up correctly.)I think my problem has been fixed (allegedly), vide http://reductivelabs.com/trac/puppet/ticket/761 However since we''re still on 0.23.2.... Matthew -- ------------------------------------------------------------------ Visit Guardian Unlimited - the UK''s most popular newspaper website http://guardian.co.uk http://observer.co.uk ------------------------------------------------------------------ The Newspaper Marketing Agency Opening Up Newspapers http://www.nmauk.co.uk ------------------------------------------------------------------ Please consider the environment before printing this email This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way. Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software. Guardian News & Media Limited A member of Guardian Media Group PLC Registered Office Number 1 Scott Place, Manchester M3 3GG Registered in England Number 908396