Use-case: we would like to reboot units in a juju-controlled manner (to avoid doing a reboot amid a hook execution) within functional tests. Using `juju run -u <unit> juju-reboot --now` seems like a natural candidate but this is not allowed by Juju since it treats `juju run` invocations as unnamed actions:
juju run --unit ovn-dedicated-chassis/0 'juju-reboot --now' ; echo $?
ERROR juju-reboot is not supported when running an action.
1
Likewise, I cannot invoke `juju-run` with a unit context from a `juju run` invocation (presumably because that would be mixing the unnamed action context and the context requested for juju-run):
$ juju run --unit ovn-dedicated-chassis/0 'juju-run' ; echo $?
ERROR cannot use "juju-run" as an action command (not supported)
1
Except it does not provide a good feedback loop on the completion of a reboot. We can monitor juju status and act accordingly until the unit becomes active again but having a native way to do it seems like a better idea.
Some context:
https:/ /bugs.launchpad .net/juju/ +bug/1989629 /github. com/openstack- charmers/ zaza-openstack- tests/issues/ 921
https:/
Use-case: we would like to reboot units in a juju-controlled manner (to avoid doing a reboot amid a hook execution) within functional tests. Using `juju run -u <unit> juju-reboot --now` seems like a natural candidate but this is not allowed by Juju since it treats `juju run` invocations as unnamed actions:
juju run --unit ovn-dedicated- chassis/ 0 'juju-reboot --now' ; echo $?
ERROR juju-reboot is not supported when running an action.
1
Likewise, I cannot invoke `juju-run` with a unit context from a `juju run` invocation (presumably because that would be mixing the unnamed action context and the context requested for juju-run):
$ juju run --unit ovn-dedicated- chassis/ 0 'juju-run' ; echo $?
ERROR cannot use "juju-run" as an action command (not supported)
1
It is possible to do something like this:
juju ssh ovn-dedicated- chassis/ 0 'sudo juju-run -u ovn-dedicated- chassis/ 0 "juju-reboot --now"' ; echo $?
Connection to 10.10.20.40 closed.
0
Except it does not provide a good feedback loop on the completion of a reboot. We can monitor juju status and act accordingly until the unit becomes active again but having a native way to do it seems like a better idea.