解决Nova ERROR nova.compute.manager ResourceProviderCreationFailed: Failed to create resource provider。
Nova has an error similar to the following:
2023-04-08 14:35:03.881 15324 ERROR nova.compute.resource_tracker [req-da714ea2-1380-44e8-aff4-5107f201cd4e - - - - -] Skipping removal of allocations for deleted instances: Failed to retrieve allocations for resource provider 1899aa80-b9de-430b-ae41-d42d82b474b2: {“errors”: [{“status”: 404, “request_id”: “req-86eda19a-9b21-43d8-ade7-70915b6ecfb7”, “detail”: "The resource could not be found.\n\n Resource provider ‘1899aa80-b9de-430b-ae41-d42d82b474b2’ not found: No resource provider with uuid 1899aa80-b9de-430b-ae41-d42d82b474b2 found ", “title”: “Not Found”}]}: ResourceProviderAllocationRetrievalFailed: Failed to retrieve allocations for resource provider 1899aa80-b9de-430b-ae41-d42d82b474b2: {“errors”: [{“status”: 404, “request_id”: “req-86eda19a-9b21-43d8-ade7-70915b6ecfb7”, “detail”: "The resource could not be found.\n\n Resource provider ‘1899aa80-b9de-430b-ae41-d42d82b474b2’ not found: No resource provider with uuid 1899aa80-b9de-430b-ae41-d42d82b474b2 found ", “title”: “Not Found”}]}
2023-04-08 14:35:04.152 15324 ERROR nova.scheduler.client.report [req-da714ea2-1380-44e8-aff4-5107f201cd4e - - - - -] [req-64563475-92a9-4be1-8d87-a51b2f92b430] Failed to create resource provider record in placement API for UUID 1899aa80-b9de-430b-ae41-d42d82b474b2. Got 409: {“errors”: [{“status”: 409, “request_id”: “req-64563475-92a9-4be1-8d87-a51b2f92b430”, “detail”: "There was a conflict when trying to complete your request.\n\n Conflicting resource provider name: nova01 already exists. ", “title”: “Conflict”}]}.
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager [req-da714ea2-1380-44e8-aff4-5107f201cd4e - - - - -] Error updating resources for node nova01.: ResourceProviderCreationFailed: Failed to create resource provider nova01
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager Traceback (most recent call last):
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/manager.py”, line 8785, in _update_available_resource_for_node
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager startup=startup)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 887, in update_available_resource
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager self._update_available_resource(context, resources, startup=startup)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py”, line 328, in inner
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager return f(*args, **kwargs)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 972, in _update_available_resource
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager self._update(context, cn, startup=startup)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 1237, in _update
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager self._update_to_placement(context, compute_node, startup)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 68, in wrapped_f
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager return Retrying(*dargs, **dkw).call(f, *args, **kw)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 223, in call
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager return attempt.get(self._wrap_exception)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 261, in get
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager six.reraise(self.value[0], self.value[1], self.value[2])
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 217, in call
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 1151, in _update_to_placement
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager context, compute_node.uuid, name=compute_node.hypervisor_hostname)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 858, in get_provider_tree_and_ensure_root
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager parent_provider_uuid=parent_provider_uuid)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 644, in _ensure_resource_provider
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager parent_provider_uuid=parent_provider_uuid)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 72, in wrapper
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager return f(self, *a, **k)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 574, in _create_resource_provider
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager raise exception.ResourceProviderCreationFailed(name=name)
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager ResourceProviderCreationFailed: Failed to create resource provider nova01
2023-04-08 14:35:04.152 15324 ERROR nova.compute.manager
2023-04-08 14:36:03.479 15324 ERROR nova.compute.resource_tracker [req-da714ea2-1380-44e8-aff4-5107f201cd4e - - - - -] Skipping removal of allocations for deleted instances: Failed to retrieve allocations for resource provider 1899aa80-b9de-430b-ae41-d42d82b474b2: {“errors”: [{“status”: 404, “request_id”: “req-7b9fefe7-9836-47bb-9dc8-6a952dac3370”, “detail”: "The resource could not be found.\n\n Resource provider ‘1899aa80-b9de-430b-ae41-d42d82b474b2’ not found: No resource provider with uuid 1899aa80-b9de-430b-ae41-d42d82b474b2 found ", “title”: “Not Found”}]}: ResourceProviderAllocationRetrievalFailed: Failed to retrieve allocations for resource provider 1899aa80-b9de-430b-ae41-d42d82b474b2: {“errors”: [{“status”: 404, “request_id”: “req-7b9fefe7-9836-47bb-9dc8-6a952dac3370”, “detail”: "The resource could not be found.\n\n Resource provider ‘1899aa80-b9de-430b-ae41-d42d82b474b2’ not found: No resource provider with uuid 1899aa80-b9de-430b-ae41-d42d82b474b2 found ", “title”: “Not Found”}]}
2023-04-08 14:36:03.809 15324 ERROR nova.scheduler.client.report [req-da714ea2-1380-44e8-aff4-5107f201cd4e - - - - -] [req-19d81027-774b-4a28-b5bb-acfdf8b4ce53] Failed to create resource provider record in placement API for UUID 1899aa80-b9de-430b-ae41-d42d82b474b2. Got 409: {“errors”: [{“status”: 409, “request_id”: “req-19d81027-774b-4a28-b5bb-acfdf8b4ce53”, “detail”: "There was a conflict when trying to complete your request.\n\n Conflicting resource provider name: nova01 already exists. ", “title”: “Conflict”}]}.
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager [req-da714ea2-1380-44e8-aff4-5107f201cd4e - - - - -] Error updating resources for node nova01.: ResourceProviderCreationFailed: Failed to create resource provider nova01
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager Traceback (most recent call last):
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/manager.py”, line 8785, in _update_available_resource_for_node
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager startup=startup)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 887, in update_available_resource
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager self._update_available_resource(context, resources, startup=startup)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py”, line 328, in inner
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager return f(*args, **kwargs)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 972, in _update_available_resource
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager self._update(context, cn, startup=startup)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 1237, in _update
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager self._update_to_placement(context, compute_node, startup)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 68, in wrapped_f
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager return Retrying(*dargs, **dkw).call(f, *args, **kw)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 223, in call
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager return attempt.get(self._wrap_exception)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 261, in get
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager six.reraise(self.value[0], self.value[1], self.value[2])
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/retrying.py”, line 217, in call
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/compute/resource_tracker.py”, line 1151, in _update_to_placement
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager context, compute_node.uuid, name=compute_node.hypervisor_hostname)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 858, in get_provider_tree_and_ensure_root
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager parent_provider_uuid=parent_provider_uuid)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 644, in _ensure_resource_provider
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager parent_provider_uuid=parent_provider_uuid)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 72, in wrapper
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager return f(self, *a, **k)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager File “/usr/lib/python2.7/site-packages/nova/scheduler/client/report.py”, line 574, in _create_resource_provider
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager raise exception.ResourceProviderCreationFailed(name=name)
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager ResourceProviderCreationFailed: Failed to create resource provider nova01
2023-04-08 14:36:03.809 15324 ERROR nova.compute.manager
1 The computing node logs in to mysql;
mysql -uroot -p密码
2. Delete the nodes corresponding to the compute_nodes and services tables in the nova library;
use nova;
delete from compute_nodes where host='compute1';
3. Delete the associated data in the resource_providers and host_mappings tables in the nova_api library;
use nova_api;
4. Delete the corresponding node data in the resource_providers, resource_provider_aggregates, and resource_provider_traits tables in the placement library;
use placement;
delete from resource_providers where id=1;
Note: If you are prompted for a foreign key association, view the associated table in the following ways:
select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where REFERENCED_TABLE_NAME='被关联表的表名'
When encountering a table associated with a foreign key, but the data is inconsistent, it cannot be updated or deleted because a certain table lacks data:
this is because the foreign key association is set in MySQL, so the data cannot be updated or deleted. This can be avoided by setting the FOREIGN_KEY_CHECKS variable.
To disable foreign key constraints, we can use:
SET FOREIGN_KEY_CHECKS=0;
and then delete the data
To enable foreign key constraints, we can use:
SET FOREIGN_KEY_CHECKS=1;
To view the current value of FOREIGN_KEY_CHECKS, use the following command:
SELECT @@FOREIGN_KEY_CHECKS;
View the data volume of each table in a database in the mysql database:
SELECT table_name,table_rows FROM information_schema.tables WHERE TABLE_SCHEMA = 'nova' and table_rows<>0 ORDER BY table_rows DESC;
5. Restart the nova service corresponding to the computing node and the control node.