Public bug reported:

VM resize and confirm on the same host fails with custom resources, as the old 
resources are not deallocated after 'confirmResize'.
Steps to reproduce:
- boot a VM with old_flavor
- resize to new_flavor to the same host
- send confirmResize
- check usages and compare with new_flavor, and there will be double 
allocations (old_flavor + new_flavor)

Related Nova log:
2017-08-29 16:22:22,666 INFO [nova.api.openstack.placement.requestlog] 
127.0.0.1 "GET /placement/allocations/8d989deb-860e-4ade-a581-a01b819b6297" 
status: 200 len: 326 microversion: 1.0
    2017-08-29 16:22:22,666 DEBUG [nova.scheduler.client.report] Current 
allocations for instance: {u'5f7fdb12-9866-4534-b0ce-ba60b14f37cb': 
{u'resources': {u'CUSTOM_MAGIC': 256}, u'generation': 4}, u'
60b3f076-ebd9-499e-a9d0-83013320505c': {u'resources': {u'MEMORY_MB': 3072, 
u'DISK_GB': 60, u'VCPU': 2}, u'generation': 3}, 
u'c522247d-e8ee-4f6c-848d-367eb99885d6': {u'resources': {u'CUSTOM_MAGIC': 256}
, u'generation': 4}}
    2017-08-29 16:22:22,666 DEBUG [nova.scheduler.client.report] Instance 
8d989deb-860e-4ade-a581-a01b819b6297 has resources on 1 compute nodes
    2017-08-29 16:22:22,666 DEBUG [nova.scheduler.client.report] Original 
resources from same-host allocation: {u'MEMORY_MB': 3072, u'DISK_GB': 60, 
u'VCPU': 2}
    2017-08-29 16:22:22,667 DEBUG [nova.scheduler.client.report] Subtracting 
old resources from same-host allocation: {u'MEMORY_MB': 1024, u'DISK_GB': 40, 
u'VCPU': 1, u'CUSTOM_MAGIC': -256}
    2017-08-29 16:22:22,667 DEBUG [nova.scheduler.client.report] Sending 
updated allocation [{'resource_provider': {'uuid': 
u'5f7fdb12-9866-4534-b0ce-ba60b14f37cb'}, 'resources': {u'CUSTOM_MAGIC': 256}
}, {'resource_provider': {'uuid': u'c522247d-e8ee-4f6c-848d-367eb99885d6'}, 
'resources': {u'CUSTOM_MAGIC': 256}}, {'resource_provider': {'uuid': 
'60b3f076-ebd9-499e-a9d0-83013320505c'}, 'resources': {u
'MEMORY_MB': 1024, u'DISK_GB': 40, u'VCPU': 1, u'CUSTOM_MAGIC': -256}}] for 
instance 8d989deb-860e-4ade-a581-a01b819b6297 after removing resources for 
60b3f076-ebd9-499e-a9d0-83013320505c.
    2017-08-29 16:22:22,667 DEBUG [nova.api.openstack.placement.requestlog] 
Starting request: 127.0.0.1 "PUT 
/placement/allocations/8d989deb-860e-4ade-a581-a01b819b6297"
    2017-08-29 16:22:22,670 DEBUG [nova.api.openstack.placement.wsgi_wrapper] 
Placement API returning an error response: JSON does not validate: -256 is less 
than the minimum of 1
    
    Failed validating 'minimum' in 
schema['properties']['allocations']['items']['properties']['resources']['patternProperties']['^[0-9A-Z_]+$']:
        {'minimum': 1, 'type': 'integer'}
    
    On instance['allocations'][2]['resources'][u'CUSTOM_MAGIC']:
        -256
    2017-08-29 16:22:22,671 INFO [nova.api.openstack.placement.requestlog] 
127.0.0.1 "PUT /placement/allocations/8d989deb-860e-4ade-a581-a01b819b6297" 
status: 400 len: 532 microversion: 1.10
    2017-08-29 16:22:22,671 WARNING [nova.scheduler.client.report] Failed to 
save allocation for 8d989deb-860e-4ade-a581-a01b819b6297. Got HTTP 400: <html>
     <head>
      <title>400 Bad Request</title>
     </head>
     <body>
      <h1>400 Bad Request</h1>
      The server could not comply with the request since it is either malformed 
or otherwise incorrect.<br /><br />
    JSON does not validate: -256 is less than the minimum of 1
    
    Failed validating 'minimum' in 
schema['properties']['allocations']['items']['properties']['resources']['patternProperties']['^[0-9A-Z_]+$']:
        {'minimum': 1, 'type': 'integer'}
    
    On instance['allocations'][2]['resources'][u'CUSTOM_MAGIC']:
        -256
    
     </body>
    </html>

** 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/1713739

Title:
  VM resize and confirm on  the same host fails with custom resources

Status in OpenStack Compute (nova):
  New

Bug description:
  VM resize and confirm on the same host fails with custom resources, as the 
old resources are not deallocated after 'confirmResize'.
  Steps to reproduce:
  - boot a VM with old_flavor
  - resize to new_flavor to the same host
  - send confirmResize
  - check usages and compare with new_flavor, and there will be double 
allocations (old_flavor + new_flavor)

  Related Nova log:
  2017-08-29 16:22:22,666 INFO [nova.api.openstack.placement.requestlog] 
127.0.0.1 "GET /placement/allocations/8d989deb-860e-4ade-a581-a01b819b6297" 
status: 200 len: 326 microversion: 1.0
      2017-08-29 16:22:22,666 DEBUG [nova.scheduler.client.report] Current 
allocations for instance: {u'5f7fdb12-9866-4534-b0ce-ba60b14f37cb': 
{u'resources': {u'CUSTOM_MAGIC': 256}, u'generation': 4}, u'
  60b3f076-ebd9-499e-a9d0-83013320505c': {u'resources': {u'MEMORY_MB': 3072, 
u'DISK_GB': 60, u'VCPU': 2}, u'generation': 3}, 
u'c522247d-e8ee-4f6c-848d-367eb99885d6': {u'resources': {u'CUSTOM_MAGIC': 256}
  , u'generation': 4}}
      2017-08-29 16:22:22,666 DEBUG [nova.scheduler.client.report] Instance 
8d989deb-860e-4ade-a581-a01b819b6297 has resources on 1 compute nodes
      2017-08-29 16:22:22,666 DEBUG [nova.scheduler.client.report] Original 
resources from same-host allocation: {u'MEMORY_MB': 3072, u'DISK_GB': 60, 
u'VCPU': 2}
      2017-08-29 16:22:22,667 DEBUG [nova.scheduler.client.report] Subtracting 
old resources from same-host allocation: {u'MEMORY_MB': 1024, u'DISK_GB': 40, 
u'VCPU': 1, u'CUSTOM_MAGIC': -256}
      2017-08-29 16:22:22,667 DEBUG [nova.scheduler.client.report] Sending 
updated allocation [{'resource_provider': {'uuid': 
u'5f7fdb12-9866-4534-b0ce-ba60b14f37cb'}, 'resources': {u'CUSTOM_MAGIC': 256}
  }, {'resource_provider': {'uuid': u'c522247d-e8ee-4f6c-848d-367eb99885d6'}, 
'resources': {u'CUSTOM_MAGIC': 256}}, {'resource_provider': {'uuid': 
'60b3f076-ebd9-499e-a9d0-83013320505c'}, 'resources': {u
  'MEMORY_MB': 1024, u'DISK_GB': 40, u'VCPU': 1, u'CUSTOM_MAGIC': -256}}] for 
instance 8d989deb-860e-4ade-a581-a01b819b6297 after removing resources for 
60b3f076-ebd9-499e-a9d0-83013320505c.
      2017-08-29 16:22:22,667 DEBUG [nova.api.openstack.placement.requestlog] 
Starting request: 127.0.0.1 "PUT 
/placement/allocations/8d989deb-860e-4ade-a581-a01b819b6297"
      2017-08-29 16:22:22,670 DEBUG [nova.api.openstack.placement.wsgi_wrapper] 
Placement API returning an error response: JSON does not validate: -256 is less 
than the minimum of 1
      
      Failed validating 'minimum' in 
schema['properties']['allocations']['items']['properties']['resources']['patternProperties']['^[0-9A-Z_]+$']:
          {'minimum': 1, 'type': 'integer'}
      
      On instance['allocations'][2]['resources'][u'CUSTOM_MAGIC']:
          -256
      2017-08-29 16:22:22,671 INFO [nova.api.openstack.placement.requestlog] 
127.0.0.1 "PUT /placement/allocations/8d989deb-860e-4ade-a581-a01b819b6297" 
status: 400 len: 532 microversion: 1.10
      2017-08-29 16:22:22,671 WARNING [nova.scheduler.client.report] Failed to 
save allocation for 8d989deb-860e-4ade-a581-a01b819b6297. Got HTTP 400: <html>
       <head>
        <title>400 Bad Request</title>
       </head>
       <body>
        <h1>400 Bad Request</h1>
        The server could not comply with the request since it is either 
malformed or otherwise incorrect.<br /><br />
      JSON does not validate: -256 is less than the minimum of 1
      
      Failed validating 'minimum' in 
schema['properties']['allocations']['items']['properties']['resources']['patternProperties']['^[0-9A-Z_]+$']:
          {'minimum': 1, 'type': 'integer'}
      
      On instance['allocations'][2]['resources'][u'CUSTOM_MAGIC']:
          -256
      
       </body>
      </html>

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1713739/+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