When a flavor has resource extra_specs disabling all standard fields, nova tries to make a request to the placements API with no resources

Bug #1708424 reported by Sam Betts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

When a flavor is defined like:

+----------------------------+--------------------------------------------------------------------+
| Field | Value |
+----------------------------+--------------------------------------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| access_project_ids | None |
| disk | 0 |
| id | 2f41a9c0-f194-4925-81d2-b62a3c07435a |
| name | test2 |
| os-flavor-access:is_public | True |
| properties | resources:DISK_GB='0', resources:MEMORY_MB='0', resources:VCPU='0' |
| ram | 256 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+--------------------------------------------------------------------+

Then it will disable all the standard resources, and pop them from the resources dictionary here:

https://github.com/openstack/nova/blob/57cd38d1fdc4d6b3439a8374e4713baf0b207184/nova/scheduler/utils.py#L141

the resources dictionary is then empty but nova still tries to use it to make a request to the placements API. This results in a error message like:

ERROR nova.scheduler.client.report [None req-030ec9a7-4299-47e0-bd38-b9d40721c210 admin admin] Failed to retrieve allocation candidates from placement API for filters {}. Got 400: <htm
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: <head>
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: <title>400 Bad Request</title>
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: </head>
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: <body>
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: <h1>400 Bad Request</h1>
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: The server could not comply with the request since it is either malformed or otherwise incorrect.<br /><br />
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: Badly formed resources parameter. Expected resources query string parameter in form: ?resources=VCPU:2,MEMORY_MB:1024. Got: empty string.
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: </body>
Aug 03 12:40:11 qa-cld-m1-neo4 nova-scheduler[4057]: </html>.

Nova should catch the case when the flavor has removed all filters and provide a more useful error message to indicate what the operator as done wrong.

Tags: placement
Revision history for this message
Sean Dague (sdague) wrote :

So, this really seems like going out of the way to break the system. A better error message would be fine if it was submitted, but this is very unlikely to hit in the real world.

Changed in nova:
status: New → Opinion
importance: Undecided → Wishlist
tags: added: placement
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.