destroy-controller should prompt for --destroy-all-models and storage options

Bug #1829797 reported by Tim McNamara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

When running juju destroy-controller on a system with live models, Juju aborts after taking users to a prompt. It should either abort immediately or continue the interactive session.

Example:

juju destroy-controller c-2
WARNING! This command will destroy the "c-2" controller.
This includes all machines, applications, data and other resources.

Continue? (y/N):y
Destroying controller
ERROR cannot destroy controller "c-2"

The controller has live hosted models. If you want
to destroy all hosted models in the controller,
run this command again with the --destroy-all-models
option.

Models:
 admin/default (alive), 2 machines, 1 application
 admin/misc (alive), 4 machines, 1 application

Here is a possible alternative:

juju destroy-controller c-2
WARNING! This command will destroy the "c-2" controller.
This includes all machines, applications, data and other resources.

Continue? (y/N):y
Destroying controller
ERROR cannot destroy controller "c-2"

The controller has live hosted models. Do you want
to destroy all hosted models? Skip this step by
running this command again with the --destroy-all-models
option.

Models:
 admin/default (alive), 2 machines, 1 application
 admin/misc (alive), 4 machines, 1 application

Destroy all models? (y/N):y

A similar stanza could be made for storage:

Destroy storage? (destroy/release/Abort)

Revision history for this message
Richard Harding (rharding) wrote : Re: [Bug 1829797] [NEW] destroy-controller should prompt for --destroy-all-models and storage options

I'd prefer it just fails fast and says if you still want to do this rerun
the command with --destroy-all-models vs waiting until after the "Are you
sure" to check if it can/will do it.

In this way we don't need extra interactive bits to the command.

On Mon, May 20, 2019 at 6:45 PM Tim McNamara <email address hidden>
wrote:

> Public bug reported:
>
> When running juju destroy-controller on a system with live models, Juju
> aborts after taking users to a prompt. It should either abort
> immediately or continue the interactive session.
>
>
> Example:
>
> juju destroy-controller c-2
> WARNING! This command will destroy the "c-2" controller.
> This includes all machines, applications, data and other resources.
>
> Continue? (y/N):y
> Destroying controller
> ERROR cannot destroy controller "c-2"
>
> The controller has live hosted models. If you want
> to destroy all hosted models in the controller,
> run this command again with the --destroy-all-models
> option.
>
> Models:
> admin/default (alive), 2 machines, 1 application
> admin/misc (alive), 4 machines, 1 application
>
>
> Here is a possible alternative:
>
>
> juju destroy-controller c-2
> WARNING! This command will destroy the "c-2" controller.
> This includes all machines, applications, data and other resources.
>
> Continue? (y/N):y
> Destroying controller
> ERROR cannot destroy controller "c-2"
>
> The controller has live hosted models. Do you want
> to destroy all hosted models? Skip this step by
> running this command again with the --destroy-all-models
> option.
>
> Models:
> admin/default (alive), 2 machines, 1 application
> admin/misc (alive), 4 machines, 1 application
>
> Destroy all models? (y/N):y
>
>
> A similar stanza could be made for storage:
>
> Destroy storage? (destroy/release/Abort)
>
> ** Affects: juju
> Importance: Low
> Status: Triaged
>
>
> ** Tags: cli destroy-controller destroy-model usability
>
> --
> You received this bug notification because you are subscribed to juju.
> https://bugs.launchpad.net/bugs/1829797
>
> Title:
> destroy-controller should prompt for --destroy-all-models and storage
> options
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1829797/+subscriptions
>

Revision history for this message
Tim McNamara (tim-clicks) wrote :
Download full text (5.0 KiB)

Failing fast, rather than taking people into the interactive prompt seems
perfectly reasonable.

On Thu, 23 May 2019 at 02:30, Richard Harding <email address hidden>
wrote:

> I'd prefer it just fails fast and says if you still want to do this rerun
> the command with --destroy-all-models vs waiting until after the "Are you
> sure" to check if it can/will do it.
>
> In this way we don't need extra interactive bits to the command.
>
> On Mon, May 20, 2019 at 6:45 PM Tim McNamara <email address hidden>
> wrote:
>
> > Public bug reported:
> >
> > When running juju destroy-controller on a system with live models, Juju
> > aborts after taking users to a prompt. It should either abort
> > immediately or continue the interactive session.
> >
> >
> > Example:
> >
> > juju destroy-controller c-2
> > WARNING! This command will destroy the "c-2" controller.
> > This includes all machines, applications, data and other resources.
> >
> > Continue? (y/N):y
> > Destroying controller
> > ERROR cannot destroy controller "c-2"
> >
> > The controller has live hosted models. If you want
> > to destroy all hosted models in the controller,
> > run this command again with the --destroy-all-models
> > option.
> >
> > Models:
> > admin/default (alive), 2 machines, 1 application
> > admin/misc (alive), 4 machines, 1 application
> >
> >
> > Here is a possible alternative:
> >
> >
> > juju destroy-controller c-2
> > WARNING! This command will destroy the "c-2" controller.
> > This includes all machines, applications, data and other resources.
> >
> > Continue? (y/N):y
> > Destroying controller
> > ERROR cannot destroy controller "c-2"
> >
> > The controller has live hosted models. Do you want
> > to destroy all hosted models? Skip this step by
> > running this command again with the --destroy-all-models
> > option.
> >
> > Models:
> > admin/default (alive), 2 machines, 1 application
> > admin/misc (alive), 4 machines, 1 application
> >
> > Destroy all models? (y/N):y
> >
> >
> > A similar stanza could be made for storage:
> >
> > Destroy storage? (destroy/release/Abort)
> >
> > ** Affects: juju
> > Importance: Low
> > Status: Triaged
> >
> >
> > ** Tags: cli destroy-controller destroy-model usability
> >
> > --
> > You received this bug notification because you are subscribed to juju.
> > https://bugs.launchpad.net/bugs/1829797
> >
> > Title:
> > destroy-controller should prompt for --destroy-all-models and storage
> > options
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/juju/+bug/1829797/+subscriptions
> >
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1829797
>
> Title:
> destroy-controller should prompt for --destroy-all-models and storage
> options
>
> Status in juju:
> Triaged
>
> Bug description:
> When running juju destroy-controller on a system with live models,
> Juju aborts after taking users to a prompt. It should either abort
> immediately or continue the interactive session.
>
>
> Example:
>
> juju destroy-controller c-2
> WARNING! This command will destroy the ...

Read more...

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.