Search code examples
openstackdevstackkeystonejuju

Can't validate keystone endpoint when I trying to define an OpenStack cloud for juju


I am trying to define an OpenStack cloud for juju. To do this, I have first deployed Devstack using the following configuration in the local.conf file:

$ cat local.conf | grep -v "#" | grep -v "^$"
[[local|localrc]]
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
HOST_IP=172.29.21.181
FLOATING_RANGE=172.29.20.1/22
Q_FLOATING_ALLOCATION_POOL=start=172.29.21.182,end=172.29.21.184
PUBLIC_NETWORK_GATEWAY=172.29.21.181
ENABLED_SERVICES+=,tls-proxy
ENABLED_SERVICES+=,g-api,g-reg
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data

After a successful deployment, these are the endpoints:

$ openstack endpoint list
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
| ID                               | Region    | Service Name | Service Type   | Enabled | Interface | URL                                             |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
| 0b489b8a683d4be489448230437e39ca | RegionOne | cinder       | block-storage  | True    | public    | https://172.29.21.181/volume/v3/$(project_id)s  |
| 0b9e96cfe0b440b781171ac0b082de3a | RegionOne | keystone     | identity       | True    | admin     | https://172.29.21.181/identity                  |
| 29ce5b2061dd474492f3aebda164acd0 | RegionOne | cinderv2     | volumev2       | True    | public    | https://172.29.21.181/volume/v2/$(project_id)s  |
| 45e10e75eb6848f5a934674373962e11 | RegionOne | glance       | image          | True    | public    | https://172.29.21.181/image                     |
| 8c35460b8c0d4c21ac9b7dd27bc92c48 | RegionOne | keystone     | identity       | True    | public    | https://172.29.21.181/identity                  |
| af451150c3094497936fd6877380d877 | RegionOne | placement    | placement      | True    | public    | https://172.29.21.181/placement                 |
| b3907f627f684ada8526b89c2c9683f9 | RegionOne | neutron      | network        | True    | public    | https://172.29.21.181:9696/                     |
| c642b07700b54be39e1dd537e8c0f8be | RegionOne | nova         | compute        | True    | public    | https://172.29.21.181/compute/v2.1              |
| dbb94215bc89457383a390a0490a89f6 | RegionOne | nova_legacy  | compute_legacy | True    | public    | https://172.29.21.181/compute/v2/$(project_id)s |
| e1037ed336d541b080e365caa0020e78 | RegionOne | cinderv3     | volumev3       | True    | public    | https://172.29.21.181/volume/v3/$(project_id)s  |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+

But when I try to add the cloud to juju using the "juju add-cloud" command (I am following the indications of this link: https://juju.is/docs/olm/openstack) I get the following error:

$ juju add-cloud openstack
This operation can be applied to both a copy on this client and to the one on a controller.
No current controller was detected and there are no registered controllers on this client: either bootstrap one or register one.
Cloud Types
  lxd
  maas
  manual
  openstack
  vsphere

Select cloud type: openstack

Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: https://172.29.21.181/identity
Can't validate endpoint: No Openstack server running at https://172.29.21.181/identity

Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: https://172.29.21.181/identity/v3
Can't validate endpoint: No Openstack server running at https://172.29.21.181/identity/v3

Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: http://172.29.21.181/identity
Can't validate endpoint: No Openstack server running at http://172.29.21.181/identity

Enter the API endpoint url for the cloud [https://172.29.21.181/identity]: https://172.29.21.181:5000/v3
Can't validate endpoint: No Openstack server running at https://172.29.21.181:5000/v3

I can curl the url:

$ curl https://172.29.21.181/identity
{"versions": {"values": [{"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "https://172.29.21.181/identity/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}]}}

And I can connect to the port where Keystone is listening:

$ nc -vz 172.29.21.181 5000
Connection to 172.29.21.181 5000 port [tcp/*] succeeded!

I set no_proxy=127.0.0.1,localhost,172.29.21.181 and NO_PROXY=127.0.0.1,localhost,172.29.21.181 as environment variables, because searching for solutions on the Internet I understood that maybe it could solve my problem. But it didn't work. Apart from this cloud I have another one deployed through Openstack-Ansible. In this cloud I have not encountered this error, the only difference I see is that the url is https://{HOST_IP}:5000/v3. If anyone has any ideas it would be very helpful, thank you.


Solution

  • I have found a way to bypass this error, but I don’t know exactly why. I have modified the OS_AUTH_URL environment variable to end in “/v3”:

    $ unset OS_AUTH_URL
    $ export OS_AUTH_URL=https://172.29.21.181/identity/v3
    

    Now, after using it as suggested value when running “juju add-cloud”, I don’t get the error when running “juju bootstrap”. I guess when you enter the url manually, juju checks the validity of it and fails for some code reason maybe. Having skipped that check, I guess the “juju bootstrap” command will directly use the url ending in “/v3” which is correct and works.

    Now I get the following error:

    $ juju bootstrap openstack --verbose
    Adding contents of "/opt/stack/.local/share/juju/ssh/juju_id_rsa.pub" to authorized-keys
    Creating Juju controller "openstack-regionone" on openstack/RegionOne
    Loading image metadata
    ERROR failed to bootstrap model: no image metadata found
    

    But I guess I just have to add Swift to my deployment and follow the instructions in this link: https://juju.is/docs/olm/cloud-image-metadata