2022-09-19 12:40:38 |
Dmitrii Shcherbakov |
description |
Some context:
https://bugs.launchpad.net/juju/+bug/1989629
https://github.com/openstack-charmers/zaza-openstack-tests/issues/921
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. |
Some context:
https://bugs.launchpad.net/juju/+bug/1989629
https://github.com/openstack-charmers/zaza-openstack-tests/issues/921
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
$ juju show-status-log ovn-dedicated-chassis/0
Time Type Status Message
# ...
19 Sep 2022 15:01:59+03:00 workload active Unit is ready
19 Sep 2022 15:02:19+03:00 juju-unit executing running action juju-run
19 Sep 2022 15:02:19+03:00 juju-unit idle
19 Sep 2022 15:05:02+03:00 juju-unit executing running commands
19 Sep 2022 15:05:02+03:00 juju-unit rebooting
19 Sep 2022 15:06:22+03:00 juju-unit executing running start hook
19 Sep 2022 15:06:25+03:00 workload active Unit is ready
19 Sep 2022 15:06:25+03:00 juju-unit idle
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. |
|