Commit fac30cea authored by Faidon Liambotis's avatar Faidon Liambotis Committed by Michael Hanselmann
Browse files

Fix OS creation's error handling when pausing sync

Commit 41e1e79e

 introduced a feature in which when wait_for_sync is not
set, DRBD sync is paused during the OS installation.

Doing so, however, broke OS creation's error handling: the result value
from the instance_os_add RPC call was overwritten by the one of the
blockdev_pause_resume_sync call before there was a chance for it to
be raised and thus masking possible errors in the OS creation.

Note that the wipe method, from which the pause technique was inspired,
does not suffer from this bug.
Signed-off-by: default avatarFaidon Liambotis <faidon@noc.grnet.gr>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 6804faa0
......@@ -8967,8 +8967,9 @@ class LUInstanceCreate(LogicalUnit):
feedback_fn("* running the instance OS create scripts...")
# FIXME: pass debug option from opcode to backend
result = self.rpc.call_instance_os_add(pnode_name, iobj, False,
self.op.debug_level)
os_add_result = \
self.rpc.call_instance_os_add(pnode_name, iobj, False,
self.op.debug_level)
if pause_sync:
feedback_fn("* resuming disk sync")
result = self.rpc.call_blockdev_pause_resume_sync(pnode_name,
......@@ -8978,8 +8979,8 @@ class LUInstanceCreate(LogicalUnit):
logging.warn("resume-sync of instance %s for disk %d failed",
instance, idx)
result.Raise("Could not add os for instance %s"
" on node %s" % (instance, pnode_name))
os_add_result.Raise("Could not add os for instance %s"
" on node %s" % (instance, pnode_name))
elif self.op.mode == constants.INSTANCE_IMPORT:
feedback_fn("* running the instance OS import scripts...")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment