[Pkg-ganeti-devel] [ganeti] 09/12: Fix pre-migration version compatibility check

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Tue Jun 27 08:23:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit 68e5f5e2a1fa481e40b7fa8842bd34657502c36a
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Mon May 29 11:47:53 2017 +0300

    Fix pre-migration version compatibility check
    
    Do not instantiate a Hypervisor object to check for migration
    compatibility. VersionsSafeForMigration() is a static method and
    instantiating a Hypervisor on the master leads to unexpected results due
    to e.g. EnsureDirs() running as non-root on Debian. Use the hypervisor
    class instead.
---
 debian/patches/series                              |  1 +
 .../use-hv-class-to-check-for-migration.patch      | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 7494ea1..ea4d6e5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@ snap-server-1.0-compat
 non-DSA-SSH-key-support.patch
 fix-ssh-key-renewal-on-single-node-clusters.patch
 set-defaults-for-ssh-type-bits.patch
+use-hv-class-to-check-for-migration.patch
diff --git a/debian/patches/use-hv-class-to-check-for-migration.patch b/debian/patches/use-hv-class-to-check-for-migration.patch
new file mode 100644
index 0000000..1710ab3
--- /dev/null
+++ b/debian/patches/use-hv-class-to-check-for-migration.patch
@@ -0,0 +1,31 @@
+From 93000ef9b540a243e420e73eb860c62a1322d5d8 Mon Sep 17 00:00:00 2001
+From: Apollon Oikonomopoulos <apoikos at debian.org>
+Date: Thu, 25 May 2017 16:13:30 +0300
+Subject: [PATCH 2/3] Do not instantiate an HV object to query for migration
+ safety
+
+hv.VersionsSafeForMigration is a static method. There is no reason to
+instatiate hypervisor objects to query for migration safety, just get
+the class and call the static method. Without this change, hypervisors
+are initialized on the master, causing side-effects (e.g. EnsureDirs)
+that might fail on systems where jobs are not run as root.
+---
+ lib/cmdlib/instance_migration.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/cmdlib/instance_migration.py b/lib/cmdlib/instance_migration.py
+index ca64afb35..1e500fdbc 100644
+--- a/lib/cmdlib/instance_migration.py
++++ b/lib/cmdlib/instance_migration.py
+@@ -738,7 +738,7 @@ class TLMigrateInstance(Tasklet):
+         self.feedback_fn("* warning: hypervisor version mismatch between"
+                          " source (%s) and target (%s) node" %
+                          (src_version, dst_version))
+-        hv = hypervisor.GetHypervisor(self.instance.hypervisor)
++        hv = hypervisor.GetHypervisorClass(self.instance.hypervisor)
+         if hv.VersionsSafeForMigration(src_version, dst_version):
+           self.feedback_fn("  migrating from hypervisor version %s to %s should"
+                            " be safe" % (src_version, dst_version))
+-- 
+2.11.0
+

-- 
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