Commit ae48ac32 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix some bugs in reboot

There are two issues fixed in this patch:
  - first, the recent RPC changes caused loss of data in hard reboot
    type; we weren't reporting any results from the stop/start instance
  - second, in soft or hard reboots, we didn't initialized the disk
    physical ID; based on the last state of the instance's disks, this
    can create a failure in identifying the disks

After this patch, burnin works again with reboot, and reports errors

Reviewed-by: imsnah
parent 2e39ab98
......@@ -977,8 +977,10 @@ def InstanceReboot(instance, reboot_type, extra_args):
return (False, msg)
elif reboot_type == constants.INSTANCE_REBOOT_HARD:
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" % (, err)
......@@ -2795,6 +2795,8 @@ class LURebootInstance(LogicalUnit):
if reboot_type in [constants.INSTANCE_REBOOT_SOFT,
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()
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