Revision dd279568

b/lib/backend.py
845 845
  running_instances = GetInstanceList([instance.hypervisor])
846 846

  
847 847
  if instance.name in running_instances:
848
    return True
848
    return (True, "Already running")
849 849

  
850 850
  try:
851 851
    block_devices = _GatherAndLinkBlockDevs(instance)
......
853 853
    hyper.StartInstance(instance, block_devices, extra_args)
854 854
  except errors.BlockDeviceError, err:
855 855
    logging.exception("Failed to start instance")
856
    return False
856
    return (False, "Block device error: %s" % str(err))
857 857
  except errors.HypervisorError, err:
858 858
    logging.exception("Failed to start instance")
859 859
    _RemoveBlockDevLinks(instance.name, instance.disks)
860
    return False
860
    return (False, "Hypervisor error: %s" % str(err))
861 861

  
862
  return True
862
  return (True, "Instance started successfully")
863 863

  
864 864

  
865 865
def ShutdownInstance(instance):
b/lib/cmdlib.py
2627 2627
    _StartInstanceDisks(self, instance, force)
2628 2628

  
2629 2629
    result = self.rpc.call_instance_start(node_current, instance, extra_args)
2630
    if result.failed or not result.data:
2630
    msg = result.RemoteFailMsg()
2631
    if msg:
2631 2632
      _ShutdownInstanceDisks(self, instance)
2632
      raise errors.OpExecError("Could not start instance")
2633
      raise errors.OpExecError("Could not start instance: %s" % msg)
2633 2634

  
2634 2635

  
2635 2636
class LURebootInstance(LogicalUnit):
......
2702 2703
      _ShutdownInstanceDisks(self, instance)
2703 2704
      _StartInstanceDisks(self, instance, ignore_secondaries)
2704 2705
      result = self.rpc.call_instance_start(node_current, instance, extra_args)
2705
      if result.failed or not result.data:
2706
      msg = result.RemoteFailMsg()
2707
      if msg:
2706 2708
        _ShutdownInstanceDisks(self, instance)
2707
        raise errors.OpExecError("Could not start instance for full reboot")
2709
        raise errors.OpExecError("Could not start instance for"
2710
                                 " full reboot: %s" % msg)
2708 2711

  
2709 2712
    self.cfg.MarkInstanceUp(instance.name)
2710 2713

  
......
3373 3376

  
3374 3377
      feedback_fn("* starting the instance on the target node")
3375 3378
      result = self.rpc.call_instance_start(target_node, instance, None)
3376
      if result.failed or not result.data:
3379
      msg = result.RemoteFailMsg()
3380
      if msg:
3377 3381
        _ShutdownInstanceDisks(self, instance)
3378
        raise errors.OpExecError("Could not start instance %s on node %s." %
3379
                                 (instance.name, target_node))
3382
        raise errors.OpExecError("Could not start instance %s on node %s: %s" %
3383
                                 (instance.name, target_node, msg))
3380 3384

  
3381 3385

  
3382 3386
class LUMigrateInstance(LogicalUnit):
......
4537 4541
      logging.info("Starting instance %s on node %s", instance, pnode_name)
4538 4542
      feedback_fn("* starting instance...")
4539 4543
      result = self.rpc.call_instance_start(pnode_name, iobj, None)
4540
      result.Raise()
4541
      if not result.data:
4542
        raise errors.OpExecError("Could not start instance")
4544
      msg = result.RemoteFailMsg()
4545
      if msg:
4546
        raise errors.OpExecError("Could not start instance: %s" % msg)
4543 4547

  
4544 4548

  
4545 4549
class LUConnectConsole(NoHooksLU):
......
5905 5909
    finally:
5906 5910
      if self.op.shutdown and instance.status == "up":
5907 5911
        result = self.rpc.call_instance_start(src_node, instance, None)
5908
        if result.failed or not result.data:
5912
        msg = result.RemoteFailMsg()
5913
        if msg:
5909 5914
          _ShutdownInstanceDisks(self, instance)
5910
          raise errors.OpExecError("Could not start instance")
5915
          raise errors.OpExecError("Could not start instance: %s" % msg)
5911 5916

  
5912 5917
    # TODO: check for size
5913 5918

  

Also available in: Unified diff