Child's root provider is not updated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Eric Fried |
Bug Description
Description
===========
You can update a resource provider(old root RP)'s parent RP from None to a specific existing RP(original root RP).
But if the resource provider(old root RP) has a child RP, the child RP's root RP is not updated automatically to the new root RP.
Reproduction
============
1. There is already an RP
```
* original_root
```
{
"resource_
{
"uuid": "da9bd8c5-
"name": "original_root"
}
]
}
2. create a new RP and its child using POST /resource_providers
```
* original_root
* old_root_rp
|
+-- child_rp
```
{
"resource_
{
"uuid": "da9bd8c5-
"name": "original_root"
},
{
"uuid": "6985934e-
"name": "old_root_rp"
}
{
"uuid": "b80b63c9-
"name": "child_rp"
}
]
}
3. Update old root rp's parent to the original root using PUT /resource_
```
* original_root
|
+-- old_root_rp
|
+-- child_rp
```
{
"resource_
{
"uuid": "da9bd8c5-
"name": "original_root"
},
{
"uuid": "6985934e-
"name": "old_root_rp"
},
{
"uuid": "b80b63c9-
"name": "child_rp"
}
]
}
The old_root_rp's root provider uuid is updated,
but the child_rp's root provider uuid remains old root rp's uuid.
Expected
========
The child_rp's root provider uuid is also updated to the original_root's rp uuid.
{
"resource_
{
"uuid": "da9bd8c5-
"name": "original_root"
},
{
"uuid": "6985934e-
"name": "old_root_rp"
},
{
"uuid": "b80b63c9-
"name": "child_rp"
}
]
}
tags: | added: placement |
Changed in nova: | |
assignee: | Tetsuro Nakamura (tetsuro0907) → Eric Fried (efried) |
summary: |
- child's root provider is not updated. + Child's root provider is not updated |
Yeah we need to do a recursive update of the root_id of the descendants at /github. com/openstack/ nova/blob/ 9382b7854286bba 21235c4bfe39c58 5a6b894419/ nova/api/ openstack/ placement/ objects/ resource_ provider. py#L1045
https:/