summaryrefslogtreecommitdiffstats
path: root/nova/virt/hyperv/migrationops.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/virt/hyperv/migrationops.py')
-rw-r--r--nova/virt/hyperv/migrationops.py33
1 files changed, 21 insertions, 12 deletions
diff --git a/nova/virt/hyperv/migrationops.py b/nova/virt/hyperv/migrationops.py
index 5ce092bf3..19afdd717 100644
--- a/nova/virt/hyperv/migrationops.py
+++ b/nova/virt/hyperv/migrationops.py
@@ -71,7 +71,8 @@ class MigrationOps(object):
# Skip the config drive as the instance is already configured
if os.path.basename(disk_file).lower() != 'configdrive.vhd':
LOG.debug(_('Copying disk "%(disk_file)s" to '
- '"%(dest_path)s"') % locals())
+ '"%(dest_path)s"'),
+ {'disk_file': disk_file, 'dest_path': dest_path})
self._pathutils.copy(disk_file, dest_path)
self._pathutils.rename(instance_path, revert_path)
@@ -100,12 +101,11 @@ class MigrationOps(object):
curr_root_gb = instance['root_gb']
if new_root_gb < curr_root_gb:
- raise vmutils.VHDResizeException(_("Cannot resize the root disk "
- "to a smaller size. Current "
- "size: %(curr_root_gb)s GB. "
- "Requested size: "
- "%(new_root_gb)s GB") %
- locals())
+ raise vmutils.VHDResizeException(
+ _("Cannot resize the root disk to a smaller size. Current "
+ "size: %(curr_root_gb)s GB. Requested size: "
+ "%(new_root_gb)s GB") %
+ {'curr_root_gb': curr_root_gb, 'new_root_gb': new_root_gb})
def migrate_disk_and_power_off(self, context, instance, dest,
instance_type, network_info,
@@ -165,17 +165,23 @@ class MigrationOps(object):
os.path.basename(base_vhd_path))
try:
LOG.debug(_('Copying base disk %(base_vhd_path)s to '
- '%(base_vhd_copy_path)s'), locals())
+ '%(base_vhd_copy_path)s'),
+ {'base_vhd_path': base_vhd_path,
+ 'base_vhd_copy_path': base_vhd_copy_path})
self._pathutils.copyfile(base_vhd_path, base_vhd_copy_path)
LOG.debug(_("Reconnecting copied base VHD "
"%(base_vhd_copy_path)s and diff "
- "VHD %(diff_vhd_path)s"), locals())
+ "VHD %(diff_vhd_path)s"),
+ {'base_vhd_copy_path': base_vhd_copy_path,
+ 'diff_vhd_path': diff_vhd_path})
self._vhdutils.reconnect_parent_vhd(diff_vhd_path,
base_vhd_copy_path)
LOG.debug(_("Merging base disk %(base_vhd_copy_path)s and "
- "diff disk %(diff_vhd_path)s"), locals())
+ "diff disk %(diff_vhd_path)s"),
+ {'base_vhd_copy_path': base_vhd_copy_path,
+ 'diff_vhd_path': diff_vhd_path})
self._vhdutils.merge_vhd(diff_vhd_path, base_vhd_copy_path)
# Replace the differential VHD with the merged one
@@ -192,7 +198,8 @@ class MigrationOps(object):
# A differential VHD cannot be resized
self._merge_base_vhd(vhd_path, base_disk_path)
LOG.debug(_("Resizing disk \"%(vhd_path)s\" to new max "
- "size %(new_size)s"), locals())
+ "size %(new_size)s"),
+ {'vhd_path': vhd_path, 'new_size': new_size})
self._vhdutils.resize_vhd(vhd_path, new_size)
def _check_base_disk(self, context, instance, diff_vhd_path,
@@ -204,7 +211,9 @@ class MigrationOps(object):
if src_base_disk_path.lower() != base_vhd_path.lower():
LOG.debug(_("Reconnecting copied base VHD "
"%(base_vhd_path)s and diff "
- "VHD %(diff_vhd_path)s"), locals())
+ "VHD %(diff_vhd_path)s"),
+ {'base_vhd_path': base_vhd_path,
+ 'diff_vhd_path': diff_vhd_path})
self._vhdutils.reconnect_parent_vhd(diff_vhd_path,
base_vhd_path)