juju list-controllers --format yaml to include provider type and properties

Bug #1554721 reported by Adam Stokes
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Andrew Wilkins

Bug Description

Currently, the only way to determine what type of provider is associated with a particular controller is to read ~/.local/share/juju/models/cache.yaml.

It would be handy to have information such as the type (eg. type: maas for maas, type: lxd for lxd) when doing a `juju list-controllers --format yaml`. Also the cache.yaml contains the necessary maas-oauth and maas-server attributes that would be useful for applications wanting to make use of MAAS and juju's bundle machine placement capabilities. At the very least knowing the controller name and the fact that it is of type: maas will greatly help when determining which credentials to apply when wanting to make use of some external features.

Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
tags: added: juju-release-support
Changed in juju-core:
milestone: none → 2.0-beta3
tags: added: conjure
Changed in juju-core:
importance: Medium → High
Andrew Wilkins (axwalk)
Changed in juju-core:
status: Triaged → In Progress
assignee: nobody → Andrew Wilkins (axwalk)
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Adam, to better understand your requirements, can you please answer a couple of questions?

1. Is there a reason why you can't just use "juju get-model-config" to get the type? And MAAS server address?
2. If you need to be able to get this information without making API calls, do you need to get this information from any machine other than the one that ran the bootstrap command?

I'm working on a change that adds "bootstrap config" to the output of show-controller. This will only be available on the client that ran "juju bootstrap". Bootstrap config includes:
 - the cloud name (e.g. aws)
 - the cloud type (e.g. ec2)
 - the region name (e.g. us-east-1)
 - any additional config passed to bootstrap with --config

Would that work for you?

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Adam, please see my proposed change here: https://github.com/juju/juju/pull/4864. Sample abridged output:

local.ctrl:
  details:
    ...
  accounts:
    ...
  current-account: admin@local
  bootstrap-config:
    config:
      name: admin
      type: lxd
    cloud: lxd
    region: localhost

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Here's a more useful example, for AWS:

bootstrap-config:
  config:
    name: admin
    type: ec2
  cloud: aws
  region: ap-southeast-2
  endpoint: https://ap-southeast-2.aws.amazon.com/v1.2/
  credential: axw

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Responding inline:

Adam, to better understand your requirements, can you please answer a couple of questions?

1. Is there a reason why you can't just use "juju get-model-config" to get the type? And MAAS server address?

>> I'm not sure, I haven't looked at this particular command.

2. If you need to be able to get this information without making API calls, do you need to get this information from any machine other than the one that ran the bootstrap command?

>> Probably not from any machine though I guess I could see where getting this information from another user/system that didn't run the bootstrap command.

I'm working on a change that adds "bootstrap config" to the output of show-controller. This will only be available on the client that ran "juju bootstrap". Bootstrap config includes:
 - the cloud name (e.g. aws)
 - the cloud type (e.g. ec2)
 - the region name (e.g. us-east-1)
 - any additional config passed to bootstrap with --config

Would that work for you?

>> Yea this would work for my current needs (I'm not sure what to expect beyond this from a user's perspective)

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Re "juju get-model-config": that's the new name for "juju get-env".

You can do "juju get-model-config type" to get the current model's type; and then "juju get-model-config maas-server" to get the MAAS server endpoint.

I've improved the output for bootstrap-config a bit based on a suggestion by Ian, and I'm going to commit it. If there's a need to get the cloud type from another client, without going over the API, then we'll address that separately.

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Marking this as fixed for beta-3. Please take a look when it's out, and let us know if there's anything else you need.

Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
tags: added: 2.0-count
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta3 → none
milestone: none → 2.0-beta3
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.