check task_state in the live_migrate_instance
If server migration fails, the while loop will not break until retry to 0, we can check the task_state to avoid this situation. Closes-Bug: #1728476 Change-Id: I07e1048eb736263a261456ee78c96fee9db13cb5
This commit is contained in:
@@ -478,6 +478,9 @@ class NovaHelper(object):
|
||||
'OS-EXT-SRV-ATTR:host') != dest_hostname \
|
||||
and retry:
|
||||
instance = self.nova.servers.get(instance.id)
|
||||
if not getattr(instance, 'OS-EXT-STS:task_state'):
|
||||
LOG.debug("Instance task state: %s is null" % instance_id)
|
||||
break
|
||||
LOG.debug(
|
||||
'Waiting the migration of {0} to {1}'.format(
|
||||
instance,
|
||||
|
||||
Reference in New Issue
Block a user