On Thu, Jan 21, 2016 at 03:10:01PM +0000, 'Viktor Bachraty' via ganeti-devel wrote: > 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])
Note that the condition here is not the condition tested for by EnsureKvmdOnNodes. (Think about a cluster with kvm enabled, but user-shutdown detection disabled; what would hapen then?) Also, wouldn't it be the better approach to pass an additional (optional) flag telling EnsureKvmdOnNodes not to report warnings if it couldn't stop the daemon? -- Klaus Aehlig Google Germany GmbH, Dienerstr. 12, 80331 Muenchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle
