[Pkg-ganeti-devel] [ganeti] 07/10: Fix failover from dead nodes when using extstorage
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Oct 3 14:44:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch debian/stable/stretch
in repository ganeti.
commit 38c9efaf129146c3391e295eeb7fe0d2778a9151
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date: Fri Jun 30 16:07:26 2017 +0300
Fix failover from dead nodes when using extstorage
Backport upstream commit 115325faa.
Closes: #864756
---
debian/patches/fix-failover-from-dead-node.patch | 63 ++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 64 insertions(+)
diff --git a/debian/patches/fix-failover-from-dead-node.patch b/debian/patches/fix-failover-from-dead-node.patch
new file mode 100644
index 0000000..f00cca4
--- /dev/null
+++ b/debian/patches/fix-failover-from-dead-node.patch
@@ -0,0 +1,63 @@
+From 115325faaec341b04190bfce92d3fb53b3ca2c4c Mon Sep 17 00:00:00 2001
+From: Dimitris Aragiorgis <dimara at arrikto.com>
+Date: Wed, 20 Jan 2016 18:37:14 +0200
+Subject: [PATCH] Fix failover in case the source node is offline
+
+Commit ff74b60 closes instance disks on the source node before
+doing a failover. In case the node is offline this is not possible.
+This patch proceeds with the failover in case the source node
+is offline or the --ingore-consistency flag is set. Reduce also
+some config lookups for the node's name.
+
+This fixes Issue #1162.
+
+Signed-off-by: Dimitris Aragiorgis <dimara at arrikto.com>
+Reviewed-by: Hrvoje Ribicic <riba at google.com>
+
+diff --git a/lib/cmdlib/instance_migration.py b/lib/cmdlib/instance_migration.py
+index ca64afb35..b93b334da 100644
+--- a/lib/cmdlib/instance_migration.py
++++ b/lib/cmdlib/instance_migration.py
+@@ -539,27 +539,35 @@ class TLMigrateInstance(Tasklet):
+ else:
+ mode = "in shared mode"
+
++ node_name = self.cfg.GetNodeName(node_uuid)
++
+ self.feedback_fn("* opening instance disks on node %s %s" %
+- (self.cfg.GetNodeName(node_uuid), mode))
++ (node_name, mode))
+
+ disks = self.cfg.GetInstanceDisks(self.instance.uuid)
+ result = self.rpc.call_blockdev_open(node_uuid, self.instance.name,
+ (disks, self.instance), exclusive)
+- result.Raise("Cannot open disks on node %s" %
+- self.cfg.GetNodeName(node_uuid))
++ result.Raise("Cannot open instance disks on node %s" % node_name)
+
+ def _CloseInstanceDisks(self, node_uuid):
+ """Close instance disks.
+
+ """
+- self.feedback_fn("* closing instance disks on node %s" %
+- self.cfg.GetNodeName(node_uuid))
++ node_name = self.cfg.GetNodeName(node_uuid)
++
++ self.feedback_fn("* closing instance disks on node %s" % node_name)
+
+ disks = self.cfg.GetInstanceDisks(self.instance.uuid)
+ result = self.rpc.call_blockdev_close(node_uuid, self.instance.name,
+ (disks, self.instance))
+- result.Raise("Cannot close instance disks on node %s" %
+- self.cfg.GetNodeName(node_uuid))
++ msg = result.fail_msg
++ if msg:
++ if result.offline or self.ignore_consistency:
++ self.lu.LogWarning("Could not close instance disks on node %s,"
++ " proceeding anyway" % node_name)
++ else:
++ raise errors.OpExecError("Cannot close instance disks on node %s: %s" %
++ (node_name, msg))
+
+ def _GoStandalone(self):
+ """Disconnect from the network.
diff --git a/debian/patches/series b/debian/patches/series
index f2bf4cb..9a9337e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,4 @@ fix-ssh-key-renewal-on-single-node-clusters.patch
set-defaults-for-ssh-type-bits.patch
use-hv-class-to-check-for-migration.patch
do-not-specify-socat-ssl-method.patch
+fix-failover-from-dead-node.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list