Public bug reported: Upstream master
The SQL that joins the allocations to the inventory for _check_capacity_exceeded was incorrect. It was doing a left outer join with the allocations which meant we got resource accounting in an NxN matrix with all inventory. 1 2 3 4 5 6 7 8 9 10 2016-09-06 12:12:10.978 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 0, 4, 0, 16.0, Decimal('0')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.979 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 0, 4, 0, 16.0, Decimal('11')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.979 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 0, 4, 0, 16.0, Decimal('704')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.980 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 1, 15947, 512, 1.5, Decimal('0')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.980 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 1, 15947, 512, 1.5, Decimal('11')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.981 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 1, 15947, 512, 1.5, Decimal('704')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.981 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 2, 218, 0, 1.0, Decimal('0')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.982 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 2, 218, 0, 1.0, Decimal('11')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.983 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 2, 218, 0, 1.0, Decimal('704')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.983 WARNING nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Attempting to allocate 1 for VCPU. Currently using 704, amount available 64.0 The Decimal allocation for memory ('704') is reported here against CPU and Disk resources in addition to Memory. Depending on the order rows are returned, these get squashed in a dict later, and we end up with the wrong usage record for CPU. ** Affects: nova Importance: Undecided Status: New -- 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/1620736 Title: Incorrect SQL in placement API causes spurious InvalidAllocationCapacityExceeded error Status in OpenStack Compute (nova): New Bug description: Upstream master The SQL that joins the allocations to the inventory for _check_capacity_exceeded was incorrect. It was doing a left outer join with the allocations which meant we got resource accounting in an NxN matrix with all inventory. 1 2 3 4 5 6 7 8 9 10 2016-09-06 12:12:10.978 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 0, 4, 0, 16.0, Decimal('0')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.979 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 0, 4, 0, 16.0, Decimal('11')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.979 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 0, 4, 0, 16.0, Decimal('704')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.980 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 1, 15947, 512, 1.5, Decimal('0')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.980 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 1, 15947, 512, 1.5, Decimal('11')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.981 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 1, 15947, 512, 1.5, Decimal('704')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.981 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 2, 218, 0, 1.0, Decimal('0')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.982 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 2, 218, 0, 1.0, Decimal('11')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.983 DEBUG nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Allocation Record: (1, u'62b97cd4-5dc8-45d9-89ad-988273895635', 324, 2, 218, 0, 1.0, Decimal('704')) from (pid=32242) _check_capacity_exceeded /opt/stack/nova/nova/objects/resource_provider.py:706 2016-09-06 12:12:10.983 WARNING nova.objects.resource_provider [req-299c61e7-fc99-4cdc-b633-dc20d5886367 placement service] Attempting to allocate 1 for VCPU. Currently using 704, amount available 64.0 The Decimal allocation for memory ('704') is reported here against CPU and Disk resources in addition to Memory. Depending on the order rows are returned, these get squashed in a dict later, and we end up with the wrong usage record for CPU. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1620736/+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