If we have a KVM cluster and user shutdown detection is off, then we still want to ensure that ganeti-kvmd is off. What I had in mind is to make sure that 'enabled_hypervisors' acts as a master switch - if it's off, KVM related code shouldn't be even invoked (unless we just turned that switch off and want the cluster react accordingly - but that is handled in LUClusterSetParams using the 'ensure_kvmd' flag). I'm happy to add a flag to disable the warning messages on KVM clusters. Does this solution sound right?
On Thu, Jan 21, 2016 at 3:35 PM, Klaus Aehlig <[email protected]> wrote: > 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 >
