Action Chains - not chains but bunch?

Hello,

I use SuSE MultiLinux Manager about a year now, started with V4.3 and now on V5.0.2

I sincerely have a problem understanding the concept behind “Action Chain”, as it definitely is not what common language would suggest, a chain of actions in the sense of

  • sequence of steps
  • one after another
  • next step starts only if step before exited OK (not in error)
  • timestamps reflect start/end time of single steps
  • resulting log is as set up

From (many) SR I had open with Support SMLM Development explained that action steps are treated as state.apply, more steps combined and sent as single request to minion, so that neither start nor sequence of execution nor end time are assured but can be random.

Action Steps can be “Remote Commands”. The GUI offers an interface where I can put several commands in a wrapper suggesting that it will be executed as shell script. Tested this with just putting a line in “exit 1” and saw the action chain interrupted as the exit code was not 0.

Especially with production minions, being virtual machines, I prefer putting them into vmsnapshot. I have a script that does that. And I have a sls script that sends the script with vcenter login information to the minion, executes it and removes it from the minion once finished. To call this script, in Remote Commands, I use

venv-salt-call state.apply vmcrsnap

As Support explained steps from an action chain are (in the background treated as) state.apply they are put together in a combined request list and sent to the minion. With the implication, as explained above, that it is not determined which comes first, second, last.

Documentation says:

2. Action Chains

If you need to perform a number of sequential actions on your clients, you can create an action chain to ensure the order is respected.

By default, most clients execute an action as soon as the command is issued. In some case, actions take a long time, which could mean that actions issued afterwards fail. For example, if you instruct a client to reboot, then issue a second command, the second action could fail because the reboot is still occurring. To ensure that actions occur in the correct order, use action chains.

which in my humble opinion is what I understand should be and I understand is a perfect application of the idea of “Action Chain”.

As a workaround of SMLM in the background grouping several steps into one request list, with Support we agreed to put single unix commands as Remote Command in between steps, like “sleep 10”. This way, the action chain order should be assured (but not guaranteed anyway and with future versions might not be that way).

So what I do is, as an example:

  1. Remote Command: hostnamectl
  2. Remote Command: venv-salt-call state.apply vmcrsnap
  3. Remote Command: sleep 1
  4. Patch apply (standard action)
  5. Remote Command: sleep 1
  6. Update packages (standard action)
  7. Remote Command: sleep 1
  8. Remote Command: venv-salt-call state.apply (some other sls)
  9. Remote Command: sleep 1
  10. reboot (standard action)

In summary: action chains make sense if they are chains, meaning actions are worked in sequence and following step are aware of result of previous step.

Can someone help me here understand what I am apparently missing?

What experience do you guys have with action chains? Do you use Remote Commands in action chains? Does anyone else put vm’s in snapshot mode e.g. for updates?

I am really frustrated with this, it’s like talking against a wall of rubber, even after citing official documentation.

Thank you very much for your comments.

Kind regards and looking forward for your comments.