nova migrate instance failed due to availability zone

Bug #1735406 reported by Henry
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Henry

Bug Description

Reproduce steps:
1.Create an instance with an invalid availability_zone but the right hostname;
 nova boot --availability_zone invalid_az:right_host
2.Migrate the instance
  nova --debug migrate instance_uuid

This qeustion has been discussed in https://bugs.launchpad.net/nova/+bug/1431194 and https://bugs.launchpad.net/nova/+bug/1444841, while it also occurs in recently version.
I'll begin by stating the problems again:
We create an instance with ”--availability_zone“ to specify which host to build VM.
In compute/api.py, it would not check whether specified an invalid AZ value, it focuses on the force-host and VM can be created successfully.
The problem is when migrating or resizeing VM nova-schedule would report no valid host like this:

DEBUG (session:640) POST call to compute for http://10.2.1.244:8774/v2.1/servers/0552ff93-bab1-4d08-b357-6190563ce0d8/action used request id req-c1a7f1d6-ea00-4304-9d30-c711047d9c74
DEBUG (shell:959) No valid host was found. No valid host found for cold migrate (HTTP 400) (Request-ID: req-c1a7f1d6-ea00-4304-9d30-c711047d9c74)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/novaclient/shell.py", line 957, in main
    OpenStackComputeShell().main(argv)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/shell.py", line 879, in main
    args.func(self.cs, args)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/shell.py", line 2028, in do_migrate
    server.migrate()
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 330, in migrate
    return self.manager.migrate(self)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1558, in migrate
    return self._action('migrate', server)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1908, in _action
    info=info, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v2/servers.py", line 1919, in _action_return_resp_and_body
    return self.api.client.post(url, body=body)
  File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 223, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 80, in request
    raise exceptions.from_response(resp, body, url, method)
BadRequest: No valid host was found. No valid host found for cold migrate (HTTP 400) (Request-ID: req-c1a7f1d6-ea00-4304-9d30-c711047d9c74)
ERROR (BadRequest): No valid host was found. No valid host found for cold migrate (HTTP 400) (Request-ID: req-c1a7f1d6-ea00-4304-9d30-c711047d9c74)

The root cause scheduler use the availability_zone which was from instance property by createing,
actually, it would be different from OS-EXT-AZ:availability_zone which can be saw by nova show.

So,the way to make it more appropriate:
Providing availability_zone where the instance is actually in for scheduler to migrate.

Henry (guanzy)
Changed in nova:
assignee: nobody → Henry (guanzy)
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

Set the status to 'In Progress' because this report has an assignee.

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/525034

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/525034

Revision history for this message
Abhinay (abhinay111) wrote :

Is this bug still being worked on?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.