Comment 3 for bug 1939291

Revision history for this message
Adam Tomas (bkslash) wrote : Re: Can't add host to masakari segment - "Compute service with name XXXX could not be found"

I've found what causes this strange behavior of Masakari - somehow variable region_name gets value "RegionTwo" (it's a proper name of second region) and Masakari tries to GET /os-services from this region's public endpoint. That's why it works without a problem in RegionTwo and doesn't work in RegionOne

In compute/nova.py , line 128 there is

 region_name=CONF.os_region_name

when I replace it with

 region_name='RegionOne'

everything works, I am able to add hosts to segment and I can see notifications, etc.

openstack segment list
+--------------------------------------+----------+-------------+--------------+-----------------+
| uuid | name | description | service_type | recovery_method |
+--------------------------------------+----------+-------------+--------------+-----------------+
| ffa57bf0-xxxxxxxxxxxxxxx4f6e3ffeaa75 | pierwszy | None | COMPUTE | auto |
+--------------------------------------+----------+-------------+--------------+-----------------+
openstack segment host list ffa57bf0-xxxxxxxxxxxxxxxxxxxx4f6e3ffeaa75
+--------------------------------------+-----------------+---------+--------------------+----------+----------------+--------------------------------------+
| uuid | name | type | control_attributes | reserved | on_maintenance | failover_segment_id |
+--------------------------------------+-----------------+---------+--------------------+----------+----------------+--------------------------------------+
| e8e95c4b-xxxxxxxxxxxxxxxxxxx133994b8 | compute2 | compute | ssh | False | False | ffa57bf0-xxxxxxxxxxxxxxx4f6e3ffeaa75 |
| 8ad367a7-xxxxxxxxxxxxxxxxxxxb928e571 | compute1 | compute | ssh | False | False | ffa57bf0-xxxxxxxxxxxxxxx4f6e3ffeaa75 |
+--------------------------------------+-----------------+---------+--------------------+----------+----------------+--------------------------------------+

So the question is: How Masakari gets the value for region_name variable? And how to force it to get proper value? Maybe it's a common problem in multi-region environments?