In a parent/child resource provider aggregate, if a child resource providers is deleted then the deleted child resource provider will be seen as available in the parent resource provider aggregate list.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Expired
|
Undecided
|
Unassigned |
Bug Description
In a parent/child resource provider aggregate, if a child resource providers is deleted then the deleted child resource provider will be seen as available in the parent resource provider aggregate list.
For ex: create two resource providers having uuid's say A and B. Here, if B is attached to A then B is child to A.
Attach B as an aggregate to A using command "openstack --os-placement-
Delete resource provider B using command " openstack resource provider delete B"
List aggregate resource provider for A "openstack resource provider aggregate list A"
There should be referential key constraint for <uuid> in "placement_
Hi Dennis, I believe you may be confusing aggregates with child relationships (nested providers).
When you create the resource provider, you can specify a parent provider UUID for that resource provider. This will make that resource provider a child of the provider you specified.
Aggregates, on the other hand, are simply groups of resource providers with no parent->child relationship.
When you create two resource providers, like so:
openstack resource provider create --name="rp_A"
openstack resource provider create --name="rp_B"
and then add those providers to an aggregate, like so:
openstack resource provider aggregate set <UUID of rp_A> --aggregate <UUID of aggregate_X>
you need to provider the UUID of the *aggregate*, not another resource provider. To put both resource providers in the same aggregate, you would do the same for rp_B:
openstack resource provider aggregate set <UUID of rp_B> --aggregate <UUID of aggregate_X>
at this point, both provider A and B are in aggregate X.
When deleting provider A, you would *not* delete provider B (because they are not related, just in the same aggregate).
To delete all providers in an aggregate, you would need to list the providers in the aggregate, like so:
openstack resource provider aggregate list <UUID of aggregate_X>
and call:
openstack resource provider delete <UUID of rp>
for each of the listed resource providers.
Now, that said, if what you are truly trying to represent is a parent->child relationship, then you would need to do the following [1]:
openstack resource provider create --name="parent" provider- uuid=<UUID of parent>
openstack resource provider create --name="child" --parent-
At that point, if you attempt to delete the parent, you will get an error back about not being able to delete a parent until its children are first deleted. There is a foreign key constraint on the resource_providers table that prevents orphaning records in this way.
Best,
-jay
[1] Unfortunately, this functionality in the openstack client is still under review here: https:/ /review. openstack. org/#/c/ 546675/ at the time of this comment, so please be patient as we bring the client up to date with the latest placement service API.