Hyper-v: Change the hyper-v error log for debug when resize failed

The error message is not sufficient enough for debug of hyper-v
when resize error occured, this patch adding the necessary info
in error log.

Closes-bug: #1238430
(cherry-picked from commit 6ee68137c5)

Change-Id: Ic8ecb8f08139face2c7bdca258de5e719d81833c
This commit is contained in:
guohliu 2013-10-11 14:35:21 +08:00 committed by Petrut Lucian
parent 9c4b57f3c1
commit 13a9f6fdf0
1 changed files with 6 additions and 2 deletions

View File

@ -171,8 +171,12 @@ class VMOps(object):
root_vhd_internal_size = root_vhd_size
if root_vhd_internal_size < base_vhd_size:
raise vmutils.HyperVException(_("Cannot resize a VHD to a "
"smaller size"))
error_msg = _("Cannot resize a VHD to a smaller size, the"
" original size is %(base_vhd_size)s, the"
" newer size is %(root_vhd_size)s"
) % {'base_vhd_size': base_vhd_size,
'root_vhd_size': root_vhd_size}
raise vmutils.HyperVException(error_msg)
elif root_vhd_internal_size > base_vhd_size:
LOG.debug(_("Resizing VHD %(root_vhd_path)s to new "
"size %(root_vhd_size)s"),