For per_node STONITH, have each node configure its own resources only

We have some races when creating STONITH resources because nodes are
creating resources at the same time. It turns out that, in the case of
crowbar, we can have each node configure its own resources only because
we know all nodes will run the code.
This commit is contained in:
Vincent Untz 2014-03-26 10:21:31 +01:00
parent 3e04b36985
commit 7722560153
2 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,12 @@ default[:pacemaker][:stonith][:clone][:plugin] = ""
default[:pacemaker][:stonith][:clone][:params] = {}
default[:pacemaker][:stonith][:per_node][:plugin] = ""
# This can be "all" or "self":
# - if set to "all", then every node will configure the stonith resources for
# all nodes in the cluster
# - if set to "self", then every node will configure the stonith resource for
# itself only
default[:pacemaker][:stonith][:per_node][:mode] = "all"
# This hash will contain parameters for each node. See documentation for
# default[:pacemaker][:stonith][:clone][:params] about the format.
# For instance:

View File

@ -76,6 +76,10 @@ when "per_node"
end
node[:pacemaker][:stonith][:per_node][:nodes].keys.each do |node_name|
if node[:pacemaker][:stonith][:per_node][:mode] == "self"
next unless node_name == node[:hostname]
end
stonith_resource = "stonith-#{node_name}"
params = node[:pacemaker][:stonith][:per_node][:nodes][node_name][:params]