Revision 12a0cfbe lib/cmdlib.py

b/lib/cmdlib.py
2659 2659
    # distribute new instance config to the other nodes
2660 2660
    self.cfg.AddInstance(instance)
2661 2661

  
2662
    feedback_fn("* activating the instance's disks on target node")
2663
    logger.Info("Starting instance %s on node %s" %
2664
                (instance.name, target_node))
2665

  
2666
    disks_ok, dummy = _AssembleInstanceDisks(instance, self.cfg,
2667
                                             ignore_secondaries=True)
2668
    if not disks_ok:
2669
      _ShutdownInstanceDisks(instance, self.cfg)
2670
      raise errors.OpExecError("Can't activate the instance's disks")
2662
    # Only start the instance if it's marked as up
2663
    if instance.status == "up":
2664
      feedback_fn("* activating the instance's disks on target node")
2665
      logger.Info("Starting instance %s on node %s" %
2666
                  (instance.name, target_node))
2667

  
2668
      disks_ok, dummy = _AssembleInstanceDisks(instance, self.cfg,
2669
                                               ignore_secondaries=True)
2670
      if not disks_ok:
2671
        _ShutdownInstanceDisks(instance, self.cfg)
2672
        raise errors.OpExecError("Can't activate the instance's disks")
2671 2673

  
2672
    feedback_fn("* starting the instance on the target node")
2673
    if not rpc.call_instance_start(target_node, instance, None):
2674
      _ShutdownInstanceDisks(instance, self.cfg)
2675
      raise errors.OpExecError("Could not start instance %s on node %s." %
2676
                               (instance.name, target_node))
2674
      feedback_fn("* starting the instance on the target node")
2675
      if not rpc.call_instance_start(target_node, instance, None):
2676
        _ShutdownInstanceDisks(instance, self.cfg)
2677
        raise errors.OpExecError("Could not start instance %s on node %s." %
2678
                                 (instance.name, target_node))
2677 2679

  
2678 2680

  
2679 2681
def _CreateBlockDevOnPrimary(cfg, node, instance, device, info):

Also available in: Unified diff