Can't create a host when using a differen project than what blazar is setup with

Bug #1881228 reported by Sam Morrison
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

It looks like blazar assumes that the user/project initiating a host-create command will be the same as the os_admin credentials specified in blazar.conf

If not host-create fails with the following error

2020-05-29 13:06:33.560 30541 ERROR blazar.api.v1.utils [-] Traceback (most recent call last):
  File "/opt/blazar/blazar/api/v1/", line 86, in handler
    return func(**kwargs)
  File "/opt/blazar/blazar/api/v1/oshosts/", line 42, in computehosts_create
    return api_utils.render(host=_api.create_computehost(data))
  File "/opt/blazar/blazar/utils/", line 32, in __run_method
    return getattr(self.instance, __name)(*args, **kwargs)
  File "/opt/blazar/blazar/", line 112, in wrapped
    return func(self, *args, **kwargs)
  File "/opt/blazar/blazar/utils/", line 93, in wrapped
    setattr(to_update, 'trust_id',
  File "/opt/blazar/blazar/api/v1/oshosts/", line 39, in create_computehost
    return self.manager_rpcapi.create_computehost(data)
  File "/opt/blazar/blazar/manager/oshosts/", line 47, in create_computehost
  File "/opt/blazar/blazar/utils/", line 44, in call
    return, name, **kwargs)
  File "/opt/stein/lib/python3.6/site-packages/oslo_messaging/rpc/", line 504, in call
    return self.prepare().call(ctxt, method, **kwargs)
  File "/opt/stein/lib/python3.6/site-packages/oslo_messaging/rpc/", line 178, in call
  File "/opt/stein/lib/python3.6/site-packages/oslo_messaging/", line 128, in _send
  File "/opt/stein/lib/python3.6/site-packages/oslo_messaging/_drivers/", line 645, in send
    call_monitor_timeout, retry=retry)
  File "/opt/stein/lib/python3.6/site-packages/oslo_messaging/_drivers/", line 636, in _send
    raise result
oslo_messaging.rpc.client.RemoteError: Remote error: BadRequest Malformed request URL: URL's project_id '9427903ca1544f0795ba4117d55ed9b2' doesn't match Context's project_id '2f3e9e705b0b460b9de90d9844e88fd2' (HTTP 400) (Request-ID: req-ee174a23-7a4d-45ff-9847-2cbb740261ed)

Revision history for this message
Pierre Riteau (priteau) wrote :

I believe this may be solved by removing /%(tenant_id)s from Nova endpoints. See for how this was changed in Kolla Ansible. If this is not an appropriate solution we would need to allow to provide a custom Nova endpoint URL via blazar.conf. I don't remember whether that's already possible or not.

Revision history for this message
Sam Morrison (sorrison) wrote :

I don't think that is the right approach. I've been having a look how this is done and want to refactor it a bit but haven't had time.

In the meantime is a simple fix that does the job and gets us moving forward.

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.