minions down report via salt -v is not consistent
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.
I don't follow, salt -v -G 'os_family=RedHat' test.ping does not report downed minions?
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.
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
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.
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.
Adding a "/me too" as this (mis)behavior is also biting me, and causing grief.
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.