Openstack - Migrate keystone endpoint URL
After a DNS record change for the controller node of our lab OpenStack infrastructure, Horizon client was still displaying the old endpoint DNS hostname in the API access
.
This information is coming from the keystone database, so we need to proceed a c
List endpoints list, filtered on interface public
:
1$ openstack endpoint list --interface public"
2+----------------------------------+-----------+--------------+--------------+---------+-----------+----------------------------------------------------------+
3| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
4+----------------------------------+-----------+--------------+--------------+---------+-----------+----------------------------------------------------------+
5| ********199a432b9da62586f978b2ee | RegionOne | glance | image | True | public | http://controller:9292 |
6| ********de5b490d8d51b45dc1766999 | RegionOne | cinder | volume | True | public | http://controller:8776/v1/%(tenant_id)s |
7| ********a042463397613d0304812f38 | RegionOne | cinderv2 | volumev2 | True | public | http://controller:8776/v2/%(tenant_id)s |
8| ********a4e446169a4ff9f0e6865f54 | RegionOne | keystone | identity | True | public | http://controller:5000/v3 |
9| ********8ce74fcd860f0f63000cf2f4 | RegionOne | swift | object-store | True | public | http://controller:8080/v1/AUTH_%(tenant_id)s |
10| ********1dcb42ac8f6592ae2c0aacab | RegionOne | neutron | network | True | public | http://controller:9696 |
11| ********b0ba4d6c87e4c20e18230a39 | RegionOne | nova | compute | True | public | http://controller:8774/v2.1/%(tenant_id)s |
12+----------------------------------+-----------+--------------+--------------+---------+-----------+----------------------------------------------------------+
The same information from database side:
1$ mysql keystone
2MariaDB [keystone]> select id,url from keystone.endpoint where interface='public' ;
3+----------------------------------+----------------------------------------------+
4| id | url |
5+----------------------------------+----------------------------------------------+
6| ********199a432b9da62586f978b2ee | http://controller:9292 |
7| ********de5b490d8d51b45dc1766999 | http://controller:8776/v1/%(tenant_id)s |
8| ********a042463397613d0304812f38 | http://controller:8776/v2/%(tenant_id)s |
9| ********a4e446169a4ff9f0e6865f54 | http://controller:5000/v3 |
10| ********8ce74fcd860f0f63000cf2f4 | http://controller:8080/v1/AUTH_%(tenant_id)s |
11| ********1dcb42ac8f6592ae2c0aacab | http://controller:9696 |
12| ********b0ba4d6c87e4c20e18230a39 | http://controller:8774/v2.1/%(tenant_id)s |
13+----------------------------------+----------------------------------------------+
147 rows in set (0.00 sec)
The query to change the endpoint url:
1MariaDB [keystone]> update keystone.endpoint SET url = REPLACE(url, 'controller', 'newurl.domain.tld') WHERE interface='public';
2Query OK, 7 rows affected (0.00 sec)
3Rows matched: 7 Changed: 7 Warnings: 0
And the result:
1MariaDB [keystone]> select id,url from keystone.endpoint where interface='public' ;
2+----------------------------------+----------------------------------------------------------+
3| id | url |
4+----------------------------------+----------------------------------------------------------+
5| 30da1779199a432b9da62586f978b2ee | http://newurl.domain.tld:9292 |
6| 4b14eeb0de5b490d8d51b45dc1766999 | http://newurl.domain.tld:8776/v1/%(tenant_id)s |
7| 62fb579da042463397613d0304812f38 | http://newurl.domain.tld:8776/v2/%(tenant_id)s |
8| 976bf154a4e446169a4ff9f0e6865f54 | http://newurl.domain.tld:5000/v3 |
9| c158b4718ce74fcd860f0f63000cf2f4 | http://newurl.domain.tld:8080/v1/AUTH_%(tenant_id)s |
10| df0b3f6f1dcb42ac8f6592ae2c0aacab | http://newurl.domain.tld:9696 |
11| ee2b5119b0ba4d6c87e4c20e18230a39 | http://newurl.domain.tld:8774/v2.1/%(tenant_id)s |
12+----------------------------------+----------------------------------------------------------+
137 rows in set (0.00 sec)
To apply the change, we restart memcached and keystone service:
1service keystone restart
2service memcached restart
Now the endpoint displayed from the horizon portal is updated with the new URL :