Commit 24a40d57 authored by Iustin Pop's avatar Iustin Pop
Browse files

More sane handling of errors during failover

Currently we ignore errors on instance shutdown (on the source node)
during instance failover. We should do this only if the user gave a
command line options allowing this, as it's a dangerous thing to do.

This patch fixes this by using the same "--ignore-consistency" option
for deciding whether to continue or abort. It also expands a bit the man
page.

Reviewed-by: imsnah
parent 50ff9a7a
......@@ -2527,9 +2527,13 @@ class LUFailoverInstance(LogicalUnit):
(instance.name, source_node))
if not rpc.call_instance_shutdown(source_node, instance):
logger.Error("Could not shutdown instance %s on node %s. Proceeding"
" anyway. Please make sure node %s is down" %
(instance.name, source_node, source_node))
if self.op.ignore_consistency:
logger.Error("Could not shutdown instance %s on node %s. Proceeding"
" anyway. Please make sure node %s is down" %
(instance.name, source_node, source_node))
else:
raise errors.OpExecError("Could not shutdown instance %s on node %s" %
(instance.name, source_node))
feedback_fn("* deactivating the instance's disks on source node")
if not _ShutdownInstanceDisks(instance, self.cfg, ignore_primary=True):
......
......@@ -813,7 +813,10 @@ node1.example.com:sdb:/dev/md1
disks before failing over the instance. If you are trying to
migrate instances off a dead node, this will fail. Use the
<option>--ignore-consistency</option> option for this
purpose.
purpose. Note that this option can be dangerous as errors in
shutting down the instance will be ignored, resulting in
possibly having the instance running on two machines in
parallel (on disconnected DRBD drives).
</para>
<para>
......
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