[Puppet Users] exec resource long runtime

2015-01-17 Thread Royee Tager


Hi, 

If I run the following command manually (time /usr/sbin/rhnreg_ks -v 
--serverUrl=http://spacewalk.example.com/XMLRPC 
--activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
--nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. 
However, if the command is performed via the exe resource the runtime is 
~48 seconds.

Why is the runtime via the exe resource longer?

Is it possible shorten the runtime?

class spacewalk::config inherits spacewalk {

  file { '/etc/yum/pluginconf.d/rhnplugin.conf':

ensure   => present,

source   => 'puppet:///modules/spacewalk/rhnplugin.conf',

owner=> root,

group=> root,

mode => '0644',

before   => Exec['register-client'],

  }

  exec { 'register-client':

command => "/usr/sbin/rhnreg_ks -v 
--serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC 
--activationkey=${::spacewalk::activation_key} --force --nohardware 
--nopackages --novirtinfo --norhnsd -v",

require => Class['spacewalk::install'],

unless  => '/usr/sbin/spacewalk-channel -l',

  }

}


Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
Starting to evaluate the resource

Debug: Exec[register-client](provider=posix): Executing check 
'/usr/sbin/spacewalk-channel -l'

Debug: Executing '/usr/sbin/spacewalk-channel -l'

Debug: 
/Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: 
Unable to locate SystemId file. Is this system registered?

Debug: Exec[register-client](provider=posix): Executing 
'/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC 
--activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
--nopackages --novirtinfo --norhnsd'

Debug: Executing '/usr/sbin/rhnreg_ks 
--serverUrl=http://spacewalk.example.com/XMLRPC 
--activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
--nopackages --novirtinfo --norhnsd'

Notice: 
/Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: 
executed successfully

Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: The 
container Class[Spacewalk::Config] will propagate my refresh event

Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
Evaluated in 47.20 seconds


Thank you in advance,

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] exec resource long runtime

2015-01-18 Thread Martin Alfke
The 48 seconds is the complete time the agent needs for the catalog.
Within the catalog you are running two commands:

spacewalk-channel -l and rhnreg.

Please add both execution times when comparing.

On 18 Jan 2015, at 08:29, Royee Tager  wrote:

> Hi, 
> 
> If I run the following command manually (time /usr/sbin/rhnreg_ks -v 
> --serverUrl=http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. However, 
> if the command is performed via the exe resource the runtime is ~48 seconds.
> 
> Why is the runtime via the exe resource longer?
> 
> Is it possible shorten the runtime?
> 
> class spacewalk::config inherits spacewalk {
> 
>   file { '/etc/yum/pluginconf.d/rhnplugin.conf':
> 
> ensure   => present,
> 
> source   => 'puppet:///modules/spacewalk/rhnplugin.conf',
> 
> owner=> root,
> 
> group=> root,
> 
> mode => '0644',
> 
> before   => Exec['register-client'],
> 
>   }
> 
>   exec { 'register-client':
> 
> command => "/usr/sbin/rhnreg_ks -v 
> --serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC 
> --activationkey=${::spacewalk::activation_key} --force --nohardware 
> --nopackages --novirtinfo --norhnsd -v",
> 
> require => Class['spacewalk::install'],
> 
> unless  => '/usr/sbin/spacewalk-channel -l',
> 
>   }
> 
> }
> 
> 
> 
> Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> Starting to evaluate the resource
> 
> Debug: Exec[register-client](provider=posix): Executing check 
> '/usr/sbin/spacewalk-channel -l'
> 
> Debug: Executing '/usr/sbin/spacewalk-channel -l'
> 
> Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: 
> Unable to locate SystemId file. Is this system registered?
> 
> Debug: Exec[register-client](provider=posix): Executing '/usr/sbin/rhnreg_ks 
> --serverUrl=http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd'
> 
> Debug: Executing '/usr/sbin/rhnreg_ks 
> --serverUrl=http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd'
> 
> Notice: 
> /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: 
> executed successfully
> 
> Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: The 
> container Class[Spacewalk::Config] will propagate my refresh event
> 
> Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> Evaluated in 47.20 seconds
> 
> 
> 
> Thank you in advance,
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/F54FF072-9664-4EAF-B356-1E6582333CEF%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] exec resource long runtime

2015-01-18 Thread Royee Tager
Hi Martin,

Attached is the output of the commands:

[root@labit-lg02 ~]# time /usr/sbin/spacewalk-channel -l
Unable to locate SystemId file. Is this system registered?

real 0m1.125s
user 0m0.120s
sys 0m0.055s
[root@labit-lg02 ~]#

[root@labit-lg02 ~]# time /usr/sbin/rhnreg_ks 
--serverUrl=http://spacewalk.example.com/XMLRPC 
--activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
--nopackages --novirtinfo --norhnsd
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: 
NOKEY

real 0m15.558s
user 0m9.997s
sys 0m0.704s
[root@labit-lg02 ~]#

בתאריך יום ראשון, 18 בינואר 2015 בשעה 15:46:38 UTC+2, מאת Martin Alfke:
>
> The 48 seconds is the complete time the agent needs for the catalog. 
> Within the catalog you are running two commands: 
>
> spacewalk-channel -l and rhnreg. 
>
> Please add both execution times when comparing. 
>
> On 18 Jan 2015, at 08:29, Royee Tager > 
> wrote: 
>
> > Hi, 
> > 
> > If I run the following command manually (time /usr/sbin/rhnreg_ks -v 
> --serverUrl=http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. 
> However, if the command is performed via the exe resource the runtime is 
> ~48 seconds. 
> > 
> > Why is the runtime via the exe resource longer? 
> > 
> > Is it possible shorten the runtime? 
> > 
> > class spacewalk::config inherits spacewalk { 
> > 
> >   file { '/etc/yum/pluginconf.d/rhnplugin.conf': 
> > 
> > ensure   => present, 
> > 
> > source   => 'puppet:///modules/spacewalk/rhnplugin.conf', 
> > 
> > owner=> root, 
> > 
> > group=> root, 
> > 
> > mode => '0644', 
> > 
> > before   => Exec['register-client'], 
> > 
> >   } 
> > 
> >   exec { 'register-client': 
> > 
> > command => "/usr/sbin/rhnreg_ks -v 
> --serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC 
> --activationkey=${::spacewalk::activation_key} --force --nohardware 
> --nopackages --novirtinfo --norhnsd -v", 
> > 
> > require => Class['spacewalk::install'], 
> > 
> > unless  => '/usr/sbin/spacewalk-channel -l', 
> > 
> >   } 
> > 
> > } 
> > 
> > 
> > 
> > Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> Starting to evaluate the resource 
> > 
> > Debug: Exec[register-client](provider=posix): Executing check 
> '/usr/sbin/spacewalk-channel -l' 
> > 
> > Debug: Executing '/usr/sbin/spacewalk-channel -l' 
> > 
> > Debug: 
> /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: 
> Unable to locate SystemId file. Is this system registered? 
> > 
> > Debug: Exec[register-client](provider=posix): Executing 
> '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd' 
> > 
> > Debug: Executing '/usr/sbin/rhnreg_ks --serverUrl=
> http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd' 
> > 
> > Notice: 
> /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: 
> executed successfully 
> > 
> > Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> The container Class[Spacewalk::Config] will propagate my refresh event 
> > 
> > Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> Evaluated in 47.20 seconds 
> > 
> > 
> > 
> > Thank you in advance, 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to puppet-users...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4e05168d-407d-44c1-b631-bd0c9960d1a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] exec resource long runtime

2015-01-18 Thread Martin Alfke
Please also keep in mind that puppet is doing more:

require => Class['spacewalk::install'], 

There is another class which also gets executed.

The 48 second is not only the command execution time.
Its the whole catalog apply time.
Puppet always checks whether it has do do something prior doing changes.
e.g. check file md5sum, owner and group and permissions.

hth,

Martin

On 18 Jan 2015, at 15:54, Royee Tager  wrote:

> Hi Martin,
> 
> Attached is the output of the commands:
> 
> [root@labit-lg02 ~]# time /usr/sbin/spacewalk-channel -l
> Unable to locate SystemId file. Is this system registered?
> 
> real  0m1.125s
> user  0m0.120s
> sys   0m0.055s
> [root@labit-lg02 ~]#
> 
> [root@labit-lg02 ~]# time /usr/sbin/rhnreg_ks 
> --serverUrl=http://spacewalk.example.com/XMLRPC 
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> --nopackages --novirtinfo --norhnsd
> warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: 
> NOKEY
> 
> real  0m15.558s
> user  0m9.997s
> sys   0m0.704s
> [root@labit-lg02 ~]#
> 
> בתאריך יום ראשון, 18 בינואר 2015 בשעה 15:46:38 UTC+2, מאת Martin Alfke:
> The 48 seconds is the complete time the agent needs for the catalog. 
> Within the catalog you are running two commands: 
> 
> spacewalk-channel -l and rhnreg. 
> 
> Please add both execution times when comparing. 
> 
> On 18 Jan 2015, at 08:29, Royee Tager  wrote: 
> 
> > Hi, 
> > 
> > If I run the following command manually (time /usr/sbin/rhnreg_ks -v 
> > --serverUrl=http://spacewalk.example.com/XMLRPC 
> > --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> > --nopackages --novirtinfo --norhnsd -v), the runtime is 15 seconds. 
> > However, if the command is performed via the exe resource the runtime is 
> > ~48 seconds. 
> > 
> > Why is the runtime via the exe resource longer? 
> > 
> > Is it possible shorten the runtime? 
> > 
> > class spacewalk::config inherits spacewalk { 
> > 
> >   file { '/etc/yum/pluginconf.d/rhnplugin.conf': 
> > 
> > ensure   => present, 
> > 
> > source   => 'puppet:///modules/spacewalk/rhnplugin.conf', 
> > 
> > owner=> root, 
> > 
> > group=> root, 
> > 
> > mode => '0644', 
> > 
> > before   => Exec['register-client'], 
> > 
> >   } 
> > 
> >   exec { 'register-client': 
> > 
> > command => "/usr/sbin/rhnreg_ks -v 
> > --serverUrl=http://${::spacewalk::spacewalk_server_fqdn}/XMLRPC 
> > --activationkey=${::spacewalk::activation_key} --force --nohardware 
> > --nopackages --novirtinfo --norhnsd -v", 
> > 
> > require => Class['spacewalk::install'], 
> > 
> > unless  => '/usr/sbin/spacewalk-channel -l', 
> > 
> >   } 
> > 
> > } 
> > 
> > 
> > 
> > Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> > Starting to evaluate the resource 
> > 
> > Debug: Exec[register-client](provider=posix): Executing check 
> > '/usr/sbin/spacewalk-channel -l' 
> > 
> > Debug: Executing '/usr/sbin/spacewalk-channel -l' 
> > 
> > Debug: 
> > /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless: 
> > Unable to locate SystemId file. Is this system registered? 
> > 
> > Debug: Exec[register-client](provider=posix): Executing 
> > '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC 
> > --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> > --nopackages --novirtinfo --norhnsd' 
> > 
> > Debug: Executing '/usr/sbin/rhnreg_ks 
> > --serverUrl=http://spacewalk.example.com/XMLRPC 
> > --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware 
> > --nopackages --novirtinfo --norhnsd' 
> > 
> > Notice: 
> > /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns: 
> > executed successfully 
> > 
> > Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: The 
> > container Class[Spacewalk::Config] will propagate my refresh event 
> > 
> > Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]: 
> > Evaluated in 47.20 seconds 
> > 
> > 
> > 
> > Thank you in advance, 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to puppet-users...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/4e05168d-407d-44c1-b631-bd0c9960d1a7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout

Re: [Puppet Users] exec resource long runtime

2015-01-22 Thread Trevor Vaughan
Hi Royee,

Try adding --evaltrace to your puppet run to see how long each resource is
taking to apply.

Thanks,

Trevor

On Sun, Jan 18, 2015 at 9:54 AM, Royee Tager  wrote:

> Hi Martin,
>
> Attached is the output of the commands:
>
> [root@labit-lg02 ~]# time /usr/sbin/spacewalk-channel -l
> Unable to locate SystemId file. Is this system registered?
>
> real 0m1.125s
> user 0m0.120s
> sys 0m0.055s
> [root@labit-lg02 ~]#
>
> [root@labit-lg02 ~]# time /usr/sbin/rhnreg_ks --serverUrl=
> http://spacewalk.example.com/XMLRPC
> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware
> --nopackages --novirtinfo --norhnsd
> warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de:
> NOKEY
>
> real 0m15.558s
> user 0m9.997s
> sys 0m0.704s
> [root@labit-lg02 ~]#
>
> בתאריך יום ראשון, 18 בינואר 2015 בשעה 15:46:38 UTC+2, מאת Martin Alfke:
>>
>> The 48 seconds is the complete time the agent needs for the catalog.
>> Within the catalog you are running two commands:
>>
>> spacewalk-channel -l and rhnreg.
>>
>> Please add both execution times when comparing.
>>
>> On 18 Jan 2015, at 08:29, Royee Tager  wrote:
>>
>> > Hi,
>> >
>> > If I run the following command manually (time /usr/sbin/rhnreg_ks -v
>> --serverUrl=http://spacewalk.example.com/XMLRPC --activationkey=1-
>> aab07306b6f673c367ebecae2aa55f22 --force --nohardware --nopackages
>> --novirtinfo --norhnsd -v), the runtime is 15 seconds. However, if the
>> command is performed via the exe resource the runtime is ~48 seconds.
>> >
>> > Why is the runtime via the exe resource longer?
>> >
>> > Is it possible shorten the runtime?
>> >
>> > class spacewalk::config inherits spacewalk {
>> >
>> >   file { '/etc/yum/pluginconf.d/rhnplugin.conf':
>> >
>> > ensure   => present,
>> >
>> > source   => 'puppet:///modules/spacewalk/rhnplugin.conf',
>> >
>> > owner=> root,
>> >
>> > group=> root,
>> >
>> > mode => '0644',
>> >
>> > before   => Exec['register-client'],
>> >
>> >   }
>> >
>> >   exec { 'register-client':
>> >
>> > command => "/usr/sbin/rhnreg_ks -v --serverUrl=http://${::
>> spacewalk::spacewalk_server_fqdn}/XMLRPC 
>> --activationkey=${::spacewalk::activation_key}
>> --force --nohardware --nopackages --novirtinfo --norhnsd -v",
>> >
>> > require => Class['spacewalk::install'],
>> >
>> > unless  => '/usr/sbin/spacewalk-channel -l',
>> >
>> >   }
>> >
>> > }
>> >
>> >
>> >
>> > Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]:
>> Starting to evaluate the resource
>> >
>> > Debug: Exec[register-client](provider=posix): Executing check
>> '/usr/sbin/spacewalk-channel -l'
>> >
>> > Debug: Executing '/usr/sbin/spacewalk-channel -l'
>> >
>> > Debug: 
>> > /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/unless:
>> Unable to locate SystemId file. Is this system registered?
>> >
>> > Debug: Exec[register-client](provider=posix): Executing
>> '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.example.com/XMLRPC
>> --activationkey=1-aab07306b6f673c367ebecae2aa55f22 --force --nohardware
>> --nopackages --novirtinfo --norhnsd'
>> >
>> > Debug: Executing '/usr/sbin/rhnreg_ks --serverUrl=http://spacewalk.
>> example.com/XMLRPC --activationkey=1-aab07306b6f673c367ebecae2aa55f22
>> --force --nohardware --nopackages --novirtinfo --norhnsd'
>> >
>> > Notice: 
>> > /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]/returns:
>> executed successfully
>> >
>> > Debug: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]:
>> The container Class[Spacewalk::Config] will propagate my refresh event
>> >
>> > Info: /Stage[main]/Spacewalk/Spacewalk::Config/Exec[register-client]:
>> Evaluated in 47.20 seconds
>> >
>> >
>> >
>> > Thank you in advance,
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Puppet Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to puppet-users...@googlegroups.com.
>> > To view this discussion on the web visit https://groups.google.com/d/
>> msgid/puppet-users/e7aa4d1b-3086-4705-ab83-65f2acf85714%
>> 40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/4e05168d-407d-44c1-b631-bd0c9960d1a7%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaug...@onyxpoint.com

-- This account not approved for unencrypted proprietary information --