Merge "fix clod_migrate problem"

This commit is contained in:
Jenkins
2017-06-07 10:26:13 +00:00
committed by Gerrit Code Review

View File

@@ -105,7 +105,7 @@ class NovaHelper(object):
% (volume.id, status, timeout)) % (volume.id, status, timeout))
return volume.status == status return volume.status == status
def watcher_non_live_migrate_instance(self, instance_id, node_id, def watcher_non_live_migrate_instance(self, instance_id, dest_hostname,
keep_original_image_name=True): keep_original_image_name=True):
"""This method migrates a given instance """This method migrates a given instance
@@ -268,7 +268,7 @@ class NovaHelper(object):
# We create the new instance from # We create the new instance from
# the intermediate image of the original instance # the intermediate image of the original instance
new_instance = self. \ new_instance = self. \
create_instance(node_id, create_instance(dest_hostname,
instance_name, instance_name,
image_uuid, image_uuid,
flavor_name, flavor_name,
@@ -573,6 +573,9 @@ class NovaHelper(object):
if not instance: if not instance:
LOG.debug("Instance not found: %s" % instance_id) LOG.debug("Instance not found: %s" % instance_id)
return False return False
elif getattr(instance, 'OS-EXT-STS:vm_state') == "stopped":
LOG.debug("Instance has been stopped: %s" % instance_id)
return True
else: else:
self.nova.servers.stop(instance_id) self.nova.servers.stop(instance_id)