Comment 6 for bug 1722580

Revision history for this message
Nobuto Murata (nobuto) wrote : Re: feature: Juju should be able to add OpenStack cloud without typing all information already in openrc.sh

@Andrew,

Thanks for the input, I have tried that, but looks like some bits are missing. I can use the same credential to get authenticated, but not with juju bootstrap.

## sourced env

$ env | grep OS_
OS_PROJECT_ID=f2b17b339ce0482c9d01b6250005db53
OS_REGION_NAME=MY_Cloud
OS_USER_DOMAIN_NAME=admin_domain
OS_PROJECT_NAME=admin
OS_IDENTITY_API_VERSION=3
OS_PASSWORD=PASSWORD
OS_AUTH_URL=http://172.20.5.49:5000/v3
OS_USERNAME=admin
OS_INTERFACE=public

## verify the credentail

$ openstack token issue
+------------+----------------------------------+
| Field | Value |
+------------+----------------------------------+
| expires | 2018-01-25T15:53:35.000000Z |
| id | efa5f03c94a840629633702f2c426c9c |
| project_id | f2b17b339ce0482c9d01b6250005db53 |
| user_id | fa594f790d6142f38ac854c05251e268 |
+------------+----------------------------------+

## bootstrap

$ juju bootstrap openstack --debug
14:53:46 INFO juju.cmd supercommand.go:56 running juju [2.3.2 gc go1.8]
14:53:46 DEBUG juju.cmd supercommand.go:57 args: []string{"juju", "bootstrap", "openstack", "--debug"}
14:53:46 INFO cmd bootstrap.go:739 cloud "openstack" not found, trying as a provider name
14:53:46 INFO cmd cloudcredential.go:51 no credentials found, checking environment
14:53:46 DEBUG juju.cmd.juju.commands bootstrap.go:829 authenticating with region "MY_Cloud" and credential "admin" ()
14:53:46 DEBUG juju.cmd.juju.commands bootstrap.go:954 provider attrs: map[external-network: use-floating-ip:false use-default-secgroup:false network:]
14:53:46 INFO cmd authkeys.go:114 Adding contents of "/home/ubuntu/.local/share/juju/ssh/juju_id_rsa.pub" to authorized-keys
14:53:46 DEBUG juju.cmd.juju.commands bootstrap.go:1010 preparing controller with config: map[provisioner-harvest-mode:destroyed apt-http-proxy: firewall-mode:instance ssl-hostname-verification:true use-default-secgroup:false agent-stream:released enable-os-upgrade:true network: authorized-keys:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8ZZy6BE44yl3DyXOvmqoY2QYWCYxiVR6bkqK1H9Sf0xMx5P25J2vU7dv4J4yoxh8CYNfTI7SdMSHteAQtIlLOK2DP0kY3ssokFc0drs8L/FwL3tvPXnA3qo/YYNQOSbcRkPL8XBlTH9YEKnfkA+pZyluPcPjVorjDkBSe9/Yx8Zhdbex47vYjKMSQxDpJ0bEKdj8aLq3eX4tPA7GnPH8LZMoiBc4+lLq7Ibrq6ZdKjkMH0V7I49l/2Dj4JYHp1WZ7uNmhQLjHL2KDCJNo+jYg87tnI4qP9wAvx/L0W159l8f/Hfk8sqQ7CUVvylb3sWQdbHJ4YBCVfm/5KNbuiu+T juju-client-key
 resource-tags: max-status-history-age:336h disable-network-management:false image-metadata-url: ftp-proxy: no-proxy:127.0.0.1,localhost,::1 uuid:f160ec8d-a427-4692-82e8-c37272b10b94 type:openstack name:controller max-status-history-size:5G ignore-machine-addresses:false apt-https-proxy: logging-config: use-floating-ip:false logforward-enabled:false apt-mirror: external-network: development:false egress-subnets: http-proxy: update-status-hook-interval:5m proxy-ssh:false enable-os-refresh-update:true https-proxy: max-action-results-age:336h cloudinit-userdata: max-action-results-size:5G net-bond-reconfigure-delay:17 agent-metadata-url: image-stream:released fan-config: apt-no-proxy: automatically-retry-hooks:true apt-ftp-proxy: test-mode:false container-networking-method: default-series:xenial transmit-vendor-metrics:true]
14:53:46 INFO juju.provider.openstack provider.go:144 opening model "controller"
14:53:47 DEBUG juju.provider.openstack provider.go:803 authentication failed: authentication failed
caused by: requesting token: Unauthorised URL http://172.20.5.49:5000/v3/auth/tokens
caused by: request (http://172.20.5.49:5000/v3/auth/tokens) returned unexpected status: 401; error info: Failed: 401 error: The request you have made requires authentication.
ERROR authentication failed.

Please ensure the credentials are correct. A common mistake is
to specify the wrong tenant. Use the OpenStack "project" name
for tenant-name in your model configuration.
14:53:47 DEBUG cmd supercommand.go:459 error stack:
github.com/juju/juju/provider/openstack/provider.go:808: authentication failed.

Please ensure the credentials are correct. A common mistake is
to specify the wrong tenant. Use the OpenStack "project" name
for tenant-name in your model configuration.
github.com/juju/juju/environs/bootstrap/prepare.go:163:
github.com/juju/juju/environs/bootstrap/prepare.go:99:
github.com/juju/juju/cmd/juju/commands/bootstrap.go:471: