Nova compute Error: Failed to create resource provider

Описание проблемы

Виртуалки не создаются на гипервизоре. В логе nova-compute.log видим следующее:

2024-01-11 15:34:38.292 39591 ERROR nova.compute.manager nova.exception.ResourceProviderCreationFailed: Failed to create resource provider cmpt-c01z03-a4002

Более подробно:

2024-01-11 16:00:24.524 39951 ERROR nova.compute.manager [None req-3e589334-3663-4b46-8378-827b9705e667 - - - - - -] Could not retrieve compute node resource provider 5658771b-93e7-42f2-9646-e0e932a2ff40 and therefore unable to error out any instances stuck in BUILDING state.  
Error: Failed to retrieve allocations for resource provider 5658771b-93e7-42f2-9646-e0e932a2ff40: {"errors": [{"status": 404, "title": "Not Found", "detail": "The resource could not be found.\n\n Resource provider '5658771b-93e7-42f2-9646-e0e932a2ff40' not found: No resource provider with uuid 5658771b-93e7-42f2-9646-e0e932a2ff40 found  ", "request_id": "req-cf73ad25-3f29-4c63-b893-6b67728e7b84"}]}: nova.exception.ResourceProviderAllocationRetrievalFailed: Failed to retrieve allocations for resource provider 5658771b-93e7-42f2-9646-e0e932a2ff40: {"errors": [{"status": 404, "title": "Not Found", "detail": "The resource could not be found.\n\n Resource provider '5658771b-93e7-42f2-9646-e0e932a2ff40' not found: No resource provider with uuid 5658771b-93e7-42f2-9646-e0e932a2ff40 found  ", "request_id": "req-cf73ad25-3f29-4c63-b893-6b67728e7b84"}]}  
2024-01-11 16:00:25.567 39951 ERROR nova.scheduler.client.report [None req-3e589334-3663-4b46-8378-827b9705e667 - - - - - -] [req-0c827e79-fc0c-4554-a27e-c32b527a9c35] Failed to create resource provider record in placement API for UUID 5658771b-93e7-42f2-9646-e0e932a2ff40. Got 409: {"errors": [{"status": 409, "title": "Conflict", "detail": "There was a conflict when trying to complete your request.\n\n Conflicting resource provider name: cmpt-c01z03-a4002 already exists.  ", "request_id": "req-0c827e79-fc0c-4554-a27e-c32b527a9c35"}]}.  

Решение проблемы

Проблема возникает в том случае, если запись resource provider не соответствует хосту - то есть она существует, но неверная. А новую ресурсную запись nova создать не может, т.к. она уже существует - Conflicting.. already exist. Чтобы исправить, необходимо сначала найти и удалить провайдер ресурса для данного хоста:

# openstack resource provider list --name cmpt-c01z03-a4002
+--------------------------------------+-------------------+------------+
| uuid                                 | name              | generation |
+--------------------------------------+-------------------+------------+
| a7c08f67-a39c-4dba-a688-8b2f08b16a67 | cmpt-c01z03-a4002 |         19 |
+--------------------------------------+-------------------+------------+

Удаляем:

openstack resource provider delete a7c08f67-a39c-4dba-a688-8b2f08b16a67
Создаем новый:
systemctl restart nova-compute
Проверяем:
# openstack resource provider list --name cmpt-c01z03-a4002
+--------------------------------------+-------------------+------------+
| uuid                                 | name              | generation |
+--------------------------------------+-------------------+------------+
| 5658771b-93e7-42f2-9646-e0e932a2ff40 | cmpt-c01z03-a4002 |          2 |
+--------------------------------------+-------------------+------------
После этих действий все заработало.

Опубликовано: 24.07.2024