Public bug reported:

When a VM boots using non-local disk, it tries to send an allocation of 
'DISK_GB': 0. This violates the default min_unit of 1 and causes an error that 
looks like this:

[req-858cbed4-c113-45e8-94e3-1d8ee64f9de0 488c2b05a66b441199f4c1dca7accd5b 
3fa5b55ecc154427b636119f0920d252 - default default] Bad inventory
Traceback (most recent call last):
  File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/placement/handlers/allocation.py",
 line 253, in set_allocations
    allocations.create_all()
  File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 
226, in wrapper
    return fn(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nova/objects/resource_provider.py", 
line 1050, in create_all
    self._set_allocations(self._context, self.objects)
  File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", 
line 894, in wrapper
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nova/objects/resource_provider.py", 
line 1011, in _set_allocations
    before_gens = _check_capacity_exceeded(conn, allocs)
  File "/usr/lib/python2.7/site-packages/nova/objects/resource_provider.py", 
line 921, in _check_capacity_exceeded
    resource_provider=rp_uuid)
InvalidAllocationConstraintsViolated: Unable to create allocation for 'DISK_GB' 
on resource provider 'f9398126-d0e8-4cf8-ae45-9103a88aa13d'. The requested 
amount would violate inventory constraints.

The causing code is at
https://github.com/openstack/nova/blob/474c2ef28234dacc658e9a78762cac66ef7fe334/nova/scheduler/client/report.py#L105

The correct fix is probably that whenever the value of any resource
class is zero, don't send that resource class in the dict.

** Affects: nova
     Importance: Medium
     Assignee: Chris Dent (cdent)
         Status: Triaged


** Tags: placement scheduler

-- 
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/1647316

Title:
  scheduler report client sends allocations with value of zero,
  violating min_unit

Status in OpenStack Compute (nova):
  Triaged

Bug description:
  
  When a VM boots using non-local disk, it tries to send an allocation of 
'DISK_GB': 0. This violates the default min_unit of 1 and causes an error that 
looks like this:

  [req-858cbed4-c113-45e8-94e3-1d8ee64f9de0 488c2b05a66b441199f4c1dca7accd5b 
3fa5b55ecc154427b636119f0920d252 - default default] Bad inventory
  Traceback (most recent call last):
    File 
"/usr/lib/python2.7/site-packages/nova/api/openstack/placement/handlers/allocation.py",
 line 253, in set_allocations
      allocations.create_all()
    File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 
226, in wrapper
      return fn(self, *args, **kwargs)
    File "/usr/lib/python2.7/site-packages/nova/objects/resource_provider.py", 
line 1050, in create_all
      self._set_allocations(self._context, self.objects)
    File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", 
line 894, in wrapper
      return fn(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/nova/objects/resource_provider.py", 
line 1011, in _set_allocations
      before_gens = _check_capacity_exceeded(conn, allocs)
    File "/usr/lib/python2.7/site-packages/nova/objects/resource_provider.py", 
line 921, in _check_capacity_exceeded
      resource_provider=rp_uuid)
  InvalidAllocationConstraintsViolated: Unable to create allocation for 
'DISK_GB' on resource provider 'f9398126-d0e8-4cf8-ae45-9103a88aa13d'. The 
requested amount would violate inventory constraints.

  The causing code is at
  
https://github.com/openstack/nova/blob/474c2ef28234dacc658e9a78762cac66ef7fe334/nova/scheduler/client/report.py#L105

  The correct fix is probably that whenever the value of any resource
  class is zero, don't send that resource class in the dict.

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to