No ability to update consumer's project and/or user external ID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Jay Pipes |
Bug Description
Even though in Placement API microversion 1.12, we began requiring project and user ID in the PUT /allocations request payload, the project ID and user ID for an *existing* consumer are never actually updated.
What this means is that if you created an allocation for consumer X before 1.12, like so:
```
PUT /allocations/X
{
"allocations": ...
}
```
a consumer record will be created for the allocation and the project and user ID for that consumer record will be the CONF.placement.
If I do the following:
```
OpenStack-
PUT /allocations/X
{
"allocations": ...
"consumer_
"project_id": $NEW_PROJECT_ID,
"user_id": $NEW_USER_ID
}
```
The $NEW_PROJECT_ID and $NEW_USER_ID values are merely ignored.
Changed in nova: | |
importance: | Medium → High |
Changed in nova: | |
assignee: | Jay Pipes (jaypipes) → Eric Fried (efried) |
Changed in nova: | |
assignee: | Eric Fried (efried) → Jay Pipes (jaypipes) |
The reason these values are ignored is because utils.ensure_ consumer( ) is called from _new_allocations() in the allocation.py handler. This function simply looks up the consumer object and returns it if it exists, creating one otherwise. If the allocations payload had a different project or user, util.ensure_ consumer( ) makes no attempt whatsoever to update the consumer's project/user info.
I'm currently working on a fix for this.