Description
===========
In case of a failed evacuation attempt the status of the migration is 'accepted' instead of 'failed' so the manager tries to delete the instance.
Steps to reproduce
==================
The following functional test reproduces the bug: https://review.openstack.org/#/c/498482/
What it does: initiate evacuation when no valid host is available and evacuation fails, but nova manager still tries to delete the instance.
Logs:
2017-08-29 19:11:15,751 ERROR [oslo_messaging.rpc.server] Exception during message handling
NoValidHost: No valid host was found. There are not enough hosts available.
2017-08-29 19:11:16,103 INFO [nova.tests.functional.test_servers] Running periodic for compute1 (host1)
2017-08-29 19:11:16,115 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/4e8e23ff-0c52-4cf7-8356-d9fa88536316/aggregates" status: 200 len: 18 microversion: 1.1
2017-08-29 19:11:16,120 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/4e8e23ff-0c52-4cf7-8356-d9fa88536316/inventories" status: 200 len: 401 microversion: 1.0
2017-08-29 19:11:16,131 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/4e8e23ff-0c52-4cf7-8356-d9fa88536316/allocations" status: 200 len: 152 microversion: 1.0
2017-08-29 19:11:16,138 INFO [nova.compute.resource_tracker] Final resource view: name=host1 phys_ram=8192MB used_ram=1024MB phys_disk=1028GB used_disk=1GB total_vcpus=10 used_vcpus=1 pci_stats=[]
2017-08-29 19:11:16,146 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/4e8e23ff-0c52-4cf7-8356-d9fa88536316/aggregates" status: 200 len: 18 microversion: 1.1
2017-08-29 19:11:16,151 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/4e8e23ff-0c52-4cf7-8356-d9fa88536316/inventories" status: 200 len: 401 microversion: 1.0
2017-08-29 19:11:16,152 INFO [nova.tests.functional.test_servers] Running periodic for compute2 (host2)
2017-08-29 19:11:16,163 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/531b1ce8-def1-455d-95b3-4140665d956f/aggregates" status: 200 len: 18 microversion: 1.1
2017-08-29 19:11:16,168 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/531b1ce8-def1-455d-95b3-4140665d956f/inventories" status: 200 len: 401 microversion: 1.0
2017-08-29 19:11:16,176 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/531b1ce8-def1-455d-95b3-4140665d956f/allocations" status: 200 len: 54 microversion: 1.0
2017-08-29 19:11:16,184 INFO [nova.compute.resource_tracker] Final resource view: name=host2 phys_ram=8192MB used_ram=512MB phys_disk=1028GB used_disk=0GB total_vcpus=10 used_vcpus=0 pci_stats=[]
2017-08-29 19:11:16,192 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/531b1ce8-def1-455d-95b3-4140665d956f/aggregates" status: 200 len: 18 microversion: 1.1
2017-08-29 19:11:16,197 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "GET /placement/resource_providers/531b1ce8-def1-455d-95b3-4140665d956f/inventories" status: 200 len: 401 microversion: 1.0
2017-08-29 19:11:16,198 INFO [nova.tests.functional.test_servers] Finished with periodics
2017-08-29 19:11:16,255 INFO [nova.api.openstack.requestlog] 127.0.0.1 "GET /v2.1/6f70656e737461636b20342065766572/servers/5058200c-478e-4449-88c1-906fdd572662" status: 200 len: 1875 microversion: 2.53 time: 0.056198
2017-08-29 19:11:16,262 INFO [nova.api.openstack.requestlog] 127.0.0.1 "GET /v2.1/6f70656e737461636b20342065766572/os-migrations" status: 200 len: 373 microversion: 2.53 time: 0.004618
2017-08-29 19:11:16,280 INFO [nova.api.openstack.requestlog] 127.0.0.1 "PUT /v2.1/6f70656e737461636b20342065766572/os-services/c269bc74-4720-4de4-a6e5-889080b892a0" status: 200 len: 245 microversion: 2.53 time: 0.016442
2017-08-29 19:11:16,281 INFO [nova.service] Starting compute node (version 16.0.0)
2017-08-29 19:11:16,296 INFO [nova.compute.manager] Deleting instance as it has been evacuated from this host
Description
===========
In case of a failed evacuation attempt the status of the migration is 'accepted' instead of 'failed' so the manager tries to delete the instance.
Steps to reproduce /review. openstack. org/#/c/ 498482/
==================
The following functional test reproduces the bug: https:/
What it does: initiate evacuation when no valid host is available and evacuation fails, but nova manager still tries to delete the instance.
Logs:
2017-08-29 19:11:15,751 ERROR [oslo_messaging .rpc.server] Exception during message handling functional. test_servers] Running periodic for compute1 (host1) openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 4e8e23ff- 0c52-4cf7- 8356-d9fa885363 16/aggregates" status: 200 len: 18 microversion: 1.1 openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 4e8e23ff- 0c52-4cf7- 8356-d9fa885363 16/inventories" status: 200 len: 401 microversion: 1.0 openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 4e8e23ff- 0c52-4cf7- 8356-d9fa885363 16/allocations" status: 200 len: 152 microversion: 1.0 resource_ tracker] Final resource view: name=host1 phys_ram=8192MB used_ram=1024MB phys_disk=1028GB used_disk=1GB total_vcpus=10 used_vcpus=1 pci_stats=[] openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 4e8e23ff- 0c52-4cf7- 8356-d9fa885363 16/aggregates" status: 200 len: 18 microversion: 1.1 openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 4e8e23ff- 0c52-4cf7- 8356-d9fa885363 16/inventories" status: 200 len: 401 microversion: 1.0 functional. test_servers] Running periodic for compute2 (host2) openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 531b1ce8- def1-455d- 95b3-4140665d95 6f/aggregates" status: 200 len: 18 microversion: 1.1 openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 531b1ce8- def1-455d- 95b3-4140665d95 6f/inventories" status: 200 len: 401 microversion: 1.0 openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 531b1ce8- def1-455d- 95b3-4140665d95 6f/allocations" status: 200 len: 54 microversion: 1.0 resource_ tracker] Final resource view: name=host2 phys_ram=8192MB used_ram=512MB phys_disk=1028GB used_disk=0GB total_vcpus=10 used_vcpus=0 pci_stats=[] openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 531b1ce8- def1-455d- 95b3-4140665d95 6f/aggregates" status: 200 len: 18 microversion: 1.1 openstack. placement. requestlog] 127.0.0.1 "GET /placement/ resource_ providers/ 531b1ce8- def1-455d- 95b3-4140665d95 6f/inventories" status: 200 len: 401 microversion: 1.0 functional. test_servers] Finished with periodics openstack. requestlog] 127.0.0.1 "GET /v2.1/6f70656e7 37461636b203420 65766572/ servers/ 5058200c- 478e-4449- 88c1-906fdd5726 62" status: 200 len: 1875 microversion: 2.53 time: 0.056198 openstack. requestlog] 127.0.0.1 "GET /v2.1/6f70656e7 37461636b203420 65766572/ os-migrations" status: 200 len: 373 microversion: 2.53 time: 0.004618 openstack. requestlog] 127.0.0.1 "PUT /v2.1/6f70656e7 37461636b203420 65766572/ os-services/ c269bc74- 4720-4de4- a6e5-889080b892 a0" status: 200 len: 245 microversion: 2.53 time: 0.016442 manager] Deleting instance as it has been evacuated from this host
NoValidHost: No valid host was found. There are not enough hosts available.
2017-08-29 19:11:16,103 INFO [nova.tests.
2017-08-29 19:11:16,115 INFO [nova.api.
2017-08-29 19:11:16,120 INFO [nova.api.
2017-08-29 19:11:16,131 INFO [nova.api.
2017-08-29 19:11:16,138 INFO [nova.compute.
2017-08-29 19:11:16,146 INFO [nova.api.
2017-08-29 19:11:16,151 INFO [nova.api.
2017-08-29 19:11:16,152 INFO [nova.tests.
2017-08-29 19:11:16,163 INFO [nova.api.
2017-08-29 19:11:16,168 INFO [nova.api.
2017-08-29 19:11:16,176 INFO [nova.api.
2017-08-29 19:11:16,184 INFO [nova.compute.
2017-08-29 19:11:16,192 INFO [nova.api.
2017-08-29 19:11:16,197 INFO [nova.api.
2017-08-29 19:11:16,198 INFO [nova.tests.
2017-08-29 19:11:16,255 INFO [nova.api.
2017-08-29 19:11:16,262 INFO [nova.api.
2017-08-29 19:11:16,280 INFO [nova.api.
2017-08-29 19:11:16,281 INFO [nova.service] Starting compute node (version 16.0.0)
2017-08-29 19:11:16,296 INFO [nova.compute.