Revision 3b61ee44

b/lib/cmdlib.py
7199 7199
      self.feedback_fn("* checking disk consistency between source and target")
7200 7200
      for dev in instance.disks:
7201 7201
        # for drbd, these are drbd over lvm
7202
        if not _CheckDiskConsistency(self, dev, target_node, False):
7203
          if not self.ignore_consistency:
7202
        if not _CheckDiskConsistency(self.lu, dev, target_node, False):
7203
          if primary_node.offline:
7204
            self.feedback_fn("Node %s is offline, ignoring degraded disk %s on"
7205
                             " target node %s" %
7206
                             (primary_node.name, dev.iv_name, target_node))
7207
          elif not self.ignore_consistency:
7204 7208
            raise errors.OpExecError("Disk %s is degraded on target node,"
7205 7209
                                     " aborting failover" % dev.iv_name)
7206 7210
    else:
......
7226 7230
                                 (instance.name, source_node, msg))
7227 7231

  
7228 7232
    self.feedback_fn("* deactivating the instance's disks on source node")
7229
    if not _ShutdownInstanceDisks(self, instance, ignore_primary=True):
7230
      raise errors.OpExecError("Can't shut down the instance's disks.")
7233
    if not _ShutdownInstanceDisks(self.lu, instance, ignore_primary=True):
7234
      raise errors.OpExecError("Can't shut down the instance's disks")
7231 7235

  
7232 7236
    instance.primary_node = target_node
7233 7237
    # distribute new instance config to the other nodes
......
7235 7239

  
7236 7240
    # Only start the instance if it's marked as up
7237 7241
    if instance.admin_up:
7238
      self.feedback_fn("* activating the instance's disks on target node")
7242
      self.feedback_fn("* activating the instance's disks on target node %s" %
7243
                       target_node)
7239 7244
      logging.info("Starting instance %s on node %s",
7240 7245
                   instance.name, target_node)
7241 7246

  
7242
      disks_ok, _ = _AssembleInstanceDisks(self, instance,
7247
      disks_ok, _ = _AssembleInstanceDisks(self.lu, instance,
7243 7248
                                           ignore_secondaries=True)
7244 7249
      if not disks_ok:
7245
        _ShutdownInstanceDisks(self, instance)
7250
        _ShutdownInstanceDisks(self.lu, instance)
7246 7251
        raise errors.OpExecError("Can't activate the instance's disks")
7247 7252

  
7248
      self.feedback_fn("* starting the instance on the target node")
7253
      self.feedback_fn("* starting the instance on the target node %s" %
7254
                       target_node)
7249 7255
      result = self.rpc.call_instance_start(target_node, instance, None, None,
7250 7256
                                            False)
7251 7257
      msg = result.fail_msg
7252 7258
      if msg:
7253
        _ShutdownInstanceDisks(self, instance)
7259
        _ShutdownInstanceDisks(self.lu, instance)
7254 7260
        raise errors.OpExecError("Could not start instance %s on node %s: %s" %
7255 7261
                                 (instance.name, target_node, msg))
7256 7262

  

Also available in: Unified diff