salt icon indicating copy to clipboard operation
salt copied to clipboard

minions down report via salt -v is not consistent

Open mlister2006 opened this issue 13 years ago • 7 comments

salt version: 0.14.1 salt -v doesn't report downed minion consistently.

salt -v '*' test.ping : reports downed minion with 'Minion did not return' message correctly.

While invocations like below won't report downed minion at all. salt -I 'roles:Myrole' test.ping salt -G 'os_family=RedHat' test.ping and other variations like there.

It would be a nice feature to report downed minion consistently with salt -v option (or may be an additional command line option salt --down-report ) this would be very helpful when pushing states to large number of minions and knowing if any minion is missed in that cycle.

mlister2006 avatar May 05 '13 01:05 mlister2006

I don't follow, salt -v -G 'os_family=RedHat' test.ping does not report downed minions?

thatch45 avatar May 06 '13 18:05 thatch45

For detailed discussion from google group: https://groups.google.com/forum/?fromgroups=#!topic/salt-users/m7IhQ5-RvEQ

But an easy way to reproduce:

  • Setup a minion. (for this example, a minion with os_family:Redhat type (RHEL, CentOS. ...)
  • Then shutdown a minion. (/etc/init.d/salt-minion stop)
  • Try: salt -v * test.ping (It will report downed minion as 'Minion did not return'
  • Now try: salt -v -G 'os_family:Redhat' test.ping (it won't report any minion that is currently down)

hope this helps.

mlister2006 avatar May 07 '13 00:05 mlister2006

So the problem here is that for grain or pillar-based minion matching, the minions actually decide for themselves whether they should execute the command. When we're matching based on minion IDs (such as using salt '*' test.ping) then the master globs the minions which have authenticated and decide which should return.

Talking to Tom, it sounds like the master does cache the pillar and grain information, so we just need to put logic in place for the master to match against this information for "minion down" notifications.

Now I just have to find time to implement this! =P

basepi avatar May 08 '13 17:05 basepi

Thanks for looking into it. This is a very important feature required in our setup.

Few comments here. Caching on master depends upon a configurable value, so this may not be available if someone decides to turn it off. (I see no reason why this shouldn't be a standard feature and cache grains and pillars on master no matter what.) #minion_data_cache: True

As far as I understand, Caching only gets updated when someone runs state.highstate or saltutil.refersh_pilllar and saltutil.sync_grains type of options. In our setup, we use saltutil.refersh_pilllar before every salt command (as a part of salt command wrapper) this is adding few seconds to each salt command but gives us consistent result which is more important for us.

mlister2006 avatar May 08 '13 18:05 mlister2006

Well, we don't like to mandate things for our users when we can avoid it -- I think the option of turning the caching off is a reasonable one, so we don't want to remove it, but we can definitely add in "minion down" functionality when caching is on.

basepi avatar May 08 '13 19:05 basepi

Adding a "/me too" as this (mis)behavior is also biting me, and causing grief.

netllama avatar May 13 '13 22:05 netllama

This is fixed! Please test it and keep me posted if you see anything weird! The compound matcher was the most complex, so any testing you can do there would be great.

basepi avatar Aug 29 '13 21:08 basepi