I've hit a very similar issue with the next charms whereby:
* keystone has 3 units
* keystone has a vip configured
* keystone relations all receive service_host set to the vip
* keystone db (i.e. endpoint) is configured to use non-vip
Looking at the code I think I can see why this is happening. The endpoint gets created by [1] which can be called from shared-db db_changed [2] hook or config_changed hook [3].
The problem is that if [2] executes prior to keystone being clustered then [4] never returns the vip hence the endpoint is set to be the local address of the unit. If I trigger a config change this does get fixed by [3] BUT if i don't it never gets resolved because [2] will never call [1] again once the db is initialised. I think we can easily fix this by adding a gratuitous call to [1] once the hacluster is complete.
I've hit a very similar issue with the next charms whereby:
* keystone has 3 units
* keystone has a vip configured
* keystone relations all receive service_host set to the vip
* keystone db (i.e. endpoint) is configured to use non-vip
Looking at the code I think I can see why this is happening. The endpoint gets created by [1] which can be called from shared-db db_changed [2] hook or config_changed hook [3].
[1] https:/ /github. com/openstack/ charm-keystone/ blob/stable/ 18.08/hooks/ keystone_ utils.py# L1105 /github. com/openstack/ charm-keystone/ blob/stable/ 18.08/hooks/ keystone_ hooks.py# L346 /github. com/openstack/ charm-keystone/ blob/stable/ 18.08/hooks/ keystone_ hooks.py# L246 /github. com/openstack/ charm-keystone/ blob/stable/ 18.08/charmhelp ers/contrib/ openstack/ ip.py#L116
[2] https:/
[3] https:/
[4] https:/
The problem is that if [2] executes prior to keystone being clustered then [4] never returns the vip hence the endpoint is set to be the local address of the unit. If I trigger a config change this does get fixed by [3] BUT if i don't it never gets resolved because [2] will never call [1] again once the db is initialised. I think we can easily fix this by adding a gratuitous call to [1] once the hacluster is complete.