RT overrides default allocation_ratios for ram cpu and disk
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Maciej Jozefczyk |
Bug Description
Description
===========
Resource tracker overrides default allocation ratio values with values from configuration files without checking it those values are "valid ones".
Allocation ratios values are taken directly from configuration files. This is a good approach unless allocation ratios in configuration file are set to 0.0. Here comes a problem. Default configuration parameter sets those ratios to be 0.0:
https:/
So if allocation ratio is set as 0.0 (or not set, because 0.0 is default value), we would have issues with send this ratio with RT update to placement.
*BUT here comes the solution*:
https:/
When we read ComputeNode object from DB we also check if ratios are 0.0, if yes we override them (CPU-16x, RAM-1.5x, DISK-1x).
But just after initialization of ComputeNode object here:
https:/
We copy actual resources to it (thanks to _copy_resources).
We override allocations from ComputeNode to those that are taken from configuration file - yes, thats ok. If operator wants to change ratios - he will do it in conf file and then restart the service.
But what if he would leave those parameters untouched in config? Here comes the problem!
Those params would be always set to 0.0 - placement api doesn't like it and raise:
InvalidInventor
The exception is raised here:
https:/
Some code around problem:
Code:
> /opt/stack/
602 def _copy_resources
603 """Copy resource values to supplied compute_node."""
604 # purge old stats and init with anything passed in by the driver
605 self.stats.clear()
606 self.stats.
607 compute_node.stats = copy.deepcopy(
608
609 # update the allocation ratios for the related ComputeNode object
610 -> compute_
611 compute_
612 compute_
613
614 # now copy rest to compute_node
615 compute_
(Pdb++) self.cpu_
0.0
self.cpu_
https:/
https:/
Environment
===========
Latest master
How to reproduce
===========
1. Spawn devstack
2. Leave configuration files untouched
3. Observe overrides in
https:/
4. Watch how RT sends it to placement and placement responds with 400 - bad request.
Changed in nova: | |
assignee: | nobody → Maciej Jozefczyk (maciej.jozefczyk) |
Fix proposed to branch: master /review. openstack. org/532924
Review: https:/