← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1799727] Re: CPU_Allocation_Ratio from nova.conf doesn't update exisiting providers

 

I believe the bug is right here:

https://github.com/openstack/nova/blob/835faf3f40af6b0e07c585690982a997d6a2ac47/nova/compute/provider_tree.py#L128

That is just comparing the keys in the dict, not the values, so:

>>> old
{'a': 1, 'b': 2}
>>> new
{'a': 1, 'b': 2}
>>> new['b'] = 3
>>> old
{'a': 1, 'b': 2}
>>> new
{'a': 1, 'b': 3}
>>> old != new
True
>>> set(old) == set(new)
True
>>> set(old)
set(['a', 'b'])
>>> set(new)
set(['a', 'b'])
>>> 


Which means it's saying inventory hasn't changed, which is true for the keys but not the values.

That was added in change: https://review.openstack.org/#/c/470575/
(queens)

** Changed in: nova
       Status: Confirmed => Triaged

** Also affects: nova/queens
   Importance: Undecided
       Status: New

** Also affects: nova/rocky
   Importance: Undecided
       Status: New

** Changed in: nova/queens
       Status: New => Triaged

** Changed in: nova/rocky
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1799727

Title:
  CPU_Allocation_Ratio from nova.conf doesn't update exisiting providers

Status in OpenStack Compute (nova):
  Confirmed
Status in OpenStack Compute (nova) rocky series:
  Confirmed

Bug description:
  (OpenStack 14)

  After changing the value of cpu_allocation_ratio in nova.conf from 16
  to 1 and restarting nova containers, the ProviderTree still uses the
  old value

  (A patch with extra debugging is applied to the system for
  ProviderTree information: https://review.openstack.org/#/c/597560/ )

  Nova.conf setting:

  cpu_allocation_ratio=1

  [root@compute-0 ~]# docker restart nova_compute nova_libvirt
  nova_compute
  nova_libvirt

  Inside Nova-compute.log

  2018-10-23 19:19:49.217 1 DEBUG oslo_service.service [req-
  9539f623-b342-4c5d-ab93-6ffacdbd8358 - - - - -] cpu_allocation_ratio
  = 1.0 log_opt_values /usr/lib/python2.7/site-
  packages/oslo_config/cfg.py:3023

  2018-10-23 19:19:51.990 1 DEBUG nova.scheduler.client.report [req-9490c7f4-2157-44ef-a81c-ea3e6bf9be21 - - - - -] Updating ProviderTree inventory for provider ca60934d-074d-4628-ae61-3c3bbc9e5543 from _refresh_and_get_inventory using data: {u'VCPU': {u'allocation_ratio': 16.0, u'total': 6, u'reserved': 0, u'step_size': 1, u'min_unit': 1, u'max_unit': 6}, u'MEMORY_MB': {u'allocation_ratio': 1.0, u'total': 6143, u'reserved': 4096, u'step_size': 1, u'min_unit': 1, u'max_unit': 6143}, u'DISK_GB': {u'allocation_ratio': 1.0, u'total': 19, u'reserved': 0, u'step_size': 1, u'min_unit': 1, u'max_unit': 19}} _refresh_and_get_inventory /usr/lib/python2.7/site-packages/nova/scheduler/client/report.py:754
  2018-10-23 19:19:51.990 1 DEBUG nova.compute.provider_tree [req-9490c7f4-2157-44ef-a81c-ea3e6bf9be21 - - - - -] Updating inventory in ProviderTree for provider ca60934d-074d-4628-ae61-3c3bbc9e5543 with inventory: {u'VCPU': {u'allocation_ratio': 16.0, u'total': 6, u'reserved': 0, u'step_size': 1, u'min_unit': 1, u'max_unit': 6}, u'MEMORY_MB': {u'allocation_ratio': 1.0, u'total': 6143, u'reserved': 4096, u'step_size': 1, u'min_unit': 1, u'max_unit': 6143}, u'DISK_GB': {u'allocation_ratio': 1.0, u'total': 19, u'reserved': 0, u'step_size': 1, u'min_unit': 1, u'max_unit': 19}} update_inventory /usr/lib/python2.7/site-packages/nova/compute/provider_tree.py:172

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1799727/+subscriptions


References