diff --git a/lib/backend.py b/lib/backend.py index c1723004c476e86617d7fc085a63cdb0d9e4f3e6..830607ed608c0b1631151455ff392f7307c352ec 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -977,8 +977,10 @@ def InstanceReboot(instance, reboot_type, extra_args): return (False, msg) elif reboot_type == constants.INSTANCE_REBOOT_HARD: try: - InstanceShutdown(instance) - StartInstance(instance, extra_args) + stop_result = InstanceShutdown(instance) + if not stop_result[0]: + return stop_result + return StartInstance(instance, extra_args) except errors.HypervisorError, err: msg = "Failed to hard reboot instance %s: %s" % (instance.name, err) logging.error(msg) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 8347140b8687170e889cc4c0f465b5a7a80b1674..c2f2c9386bbb07e6d005e8f8cc325e66acd8e2b9 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2795,6 +2795,8 @@ class LURebootInstance(LogicalUnit): if reboot_type in [constants.INSTANCE_REBOOT_SOFT, constants.INSTANCE_REBOOT_HARD]: + for disk in instance.disks: + self.cfg.SetDiskID(disk, node_current) result = self.rpc.call_instance_reboot(node_current, instance, reboot_type, extra_args) msg = result.RemoteFailMsg()