Cannot use juju-reboot as a part of a `juju run` invocation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Some context:
https:/
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-
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-
ERROR cannot use "juju-run" as an action command (not supported)
1
It is possible to do something like this:
juju ssh ovn-dedicated-
Connection to 10.10.20.40 closed.
0
$ juju show-status-log ovn-dedicated-
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.
description: | updated |
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
milestone: | none → 3.0.1 |
Changed in juju: | |
milestone: | 3.0.1 → 3.0.2 |
Changed in juju: | |
milestone: | 3.0.2 → 3.0.3 |
Changed in juju: | |
milestone: | 3.0.3 → 3.0.4 |
I don't have a problem with juju-reboot being available from an action
context. We'd have to think about when does the "action" complete? Is it
completed and then a reboot triggers, or is the action still pending during
the reboot. What is the entry point when you come back in? If you just
unpowered the machine during an action, I believe we would come back up
trying to run that action again, but you certainly don't want to have an
endless loop of juju-reboot firing, causing the action to restart, causing
juju-reboot to trigger, etc.
On Tue, Nov 15, 2022 at 4:56 AM Canonical Juju QA Bot <
<email address hidden>> wrote:
> ** Changed in: juju /bugs.launchpad .net/bugs/ 1990140 /bugs.launchpad .net/juju/ +bug/1990140/ +subscriptions
> Milestone: 3.0.1 => 3.0.2
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https:/
>
> Title:
> Cannot use juju-reboot as a part of a `juju run` invocation
>
> To manage notifications about this bug go to:
> https:/
>
>