Nova Compute Charm is not setting the auth_url to internalURL when use-internal-endpoints option is set to true

Bug #2030877 reported by Bartosz Woronicz
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Charm Helpers
New
Undecided
Unassigned
OpenStack Nova Compute Charm
New
Undecided
Unassigned

Bug Description

So far I see setting the use-internal-endpoints works only for VolumeAPI context.
It allows that the options
[glance]
api_servers =
to be set the internalURL
even when adminURL is merged with publicURL

https://github.com/juju/charm-helpers/blob/a0235ca70c2a8d3f1ddd10d130630bef86128362/charmhelpers/contrib/openstack/context.py#L2121

In my case adminURL == publicURL

so nova cannot register hypervisor to the keystone as auth_url is in publicURL , which is inaccessible
The env is quite limited, I cannot access the public api network via OAM

So I wonder whether we can fix it so charmhelpers would also change auth_url to the internal endpoint
or the client has to add the public api network to the computes so can access that directly.

I did it manually and it works without and issues here. It is just for auth url
so far I see that part is taken from relation data
https://github.com/juju/charm-helpers/blob/a0235ca70c2a8d3f1ddd10d130630bef86128362/charmhelpers/contrib/openstack/context.py#L497
And the charm keystone set auth_host to admin
```
./hooks/keystone_utils.py: relation_data["auth_host"] = resolve_address(ADMIN)
```
https://opendev.org/openstack/charm-keystone/src/commit/16b009d74397983e07a77735c25ba62f5717711a/hooks/keystone_utils.py#L2045

so far I see that there's InternalEndpointContext is used nowherebeyond that VolumeAPIContext
I am trying dig it more, but so far I see /etc/nova/nova.conf on the computes will always use the adminURL regardless of use-internal-endpoints setting
In other deployment that might have worked because there was no firewall from OAM to Public/External API network

```
root@compute-1:/var/lib/juju/agents/unit-nova-compute-0/charm# grep -iHR InternalEndpointContext .
./hooks/charmhelpers/contrib/openstack/context.py:class InternalEndpointContext(OSContextGenerator):
./hooks/charmhelpers/contrib/openstack/context.py:class VolumeAPIContext(InternalEndpointContext):
grep: ./hooks/charmhelpers/contrib/openstack/__pycache__/context.cpython-310.pyc: binary file matches
./hooks/nova_compute_utils.py: context.InternalEndpointContext(),
```

`context.InternalEndpointContext(),` is mapped in nova_compute_utils.py in resource map but not used anywhere
https://opendev.org/openstack/charm-nova-compute/src/branch/master/hooks/nova_compute_utils.py#L245
not sure yet what this piece of code does this BASE_RESOURCE_MAP

Beyond that nova got their own context provided, and I don't see that it uses config 'use-internal-endpoints' at all
https://opendev.org/openstack/charm-nova-compute/src/branch/master/hooks/nova_compute_context.py

I would love to prepare patch for this. But the code seems hard to read for me. Not sure at which point I could tap in to make a switch for using internal_host instead of auth_host
So far workaround for that is the proper routing to the publicURL for nova Computes. But I think it should not be this way. And make the cloud more error prone as it relies on the gateway. Despite it uses only for authorizing to the keystone here.

summary: - Nova Charm is not setting the auth_url to internalURL whe use-internal-
- endpoints option is set
+ Nova Charm is not setting the auth_url to internalURL when use-internal-
+ endpoints option is set to true
summary: - Nova Charm is not setting the auth_url to internalURL when use-internal-
- endpoints option is set to true
+ Nova Compute Charm is not setting the auth_url to internalURL when use-
+ internal-endpoints option is set to true
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.