EnsureKvmdOnNodes is called in both LUClusterSetParams, LUNodeSetParams
to make sure ganeti-kvmd is running/stopped according to the desired
configuration. While in cluster config changes we want this to be
executed among other cases when the enabled_hypervisors list changes, on
node config changes we don't need to execute this unless KVM is enabled.

Signed-off-by: Viktor Bachraty <[email protected]>
---
 lib/cmdlib/node.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/cmdlib/node.py b/lib/cmdlib/node.py
index ddae675..9c04494 100644
--- a/lib/cmdlib/node.py
+++ b/lib/cmdlib/node.py
@@ -469,7 +469,9 @@ class LUNodeAdd(LogicalUnit):
     else:
       self.cfg.RemoveNodeFromCandidateCerts(self.new_node.uuid, warn_fn=None)
 
-    EnsureKvmdOnNodes(self, feedback_fn, nodes=[self.new_node.uuid])
+    # Only ensure Kvmd on nodes if KVM hypervisor is enabled
+    if constants.HT_KVM in self.cfg.GetClusterInfo().enabled_hypervisors:
+      EnsureKvmdOnNodes(self, feedback_fn, nodes=[self.new_node.uuid])
 
     # Update SSH setup of all nodes
     if self.op.node_setup:
@@ -857,7 +859,9 @@ class LUNodeSetParams(LogicalUnit):
       if self.old_role == self._ROLE_CANDIDATE:
         RemoveNodeCertFromCandidateCerts(self.cfg, node.uuid)
 
-    EnsureKvmdOnNodes(self, feedback_fn, nodes=[node.uuid])
+    # Only ensure Kvmd on nodes if KVM hypervisor is enabled
+    if constants.HT_KVM in self.cfg.GetClusterInfo().enabled_hypervisors:
+      EnsureKvmdOnNodes(self, feedback_fn, nodes=[node.uuid])
 
     # this will trigger job queue propagation or cleanup if the mc
     # flag changed
-- 
2.7.0.rc3.207.g0ac5344

Reply via email to