[UNTESTED] Fix remote node maintenance (bsc#983617)#187
[UNTESTED] Fix remote node maintenance (bsc#983617)#187aspiers wants to merge 2 commits intocrowbar:masterfrom
Conversation
We want to be able to reuse this when constructing the command for toggling maintenance mode, since when doing it for remotes, you need to specify the node name.
We need crm and crm_attribute installed on the remote nodes, and we also need to specify the pacemaker node name when toggling the mode, as explained in https://bugzilla.suse.com/show_bug.cgi?id=983617#c14
| %w(pacemaker crmsh fence-agents) | ||
| default[:pacemaker][:platform][:remote_packages] = | ||
| %w(pacemaker-remote fence-agents) | ||
| %w(pacemaker-remote pacemaker-cli crmsh fence-agents) |
There was a problem hiding this comment.
Style/WordArray: Use [] for an array of words. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylewordarray)
There was a problem hiding this comment.
I disagree with the dog here.
| def maintenance_mode? | ||
| # See https://bugzilla.suse.com/show_bug.cgi?id=870696 | ||
| !! (`crm_attribute -G -N #{pacemaker_node} -n maintenance -d off -q` =~ /^on$/) | ||
| !! (`crm_attribute -G -N #{pacemaker_node_name} -n maintenance -d off -q` =~ /^on$/) |
There was a problem hiding this comment.
Style/DoubleNegation: Avoid the use of double negation (!!). (https://github.com/bbatsov/ruby-style-guide#no-bang-bang)
Style/SpaceAfterNot: Do not leave space between ! and its argument. (https://github.com/bbatsov/ruby-style-guide#no-space-bang)
|
Reading the bug comments and the code, this makes sense to me. Unfortunately Im working on the upgrades so Im not sure I can set up an env to test this shortly. @aspiers How do you get an env running to test this? Just drop the compute nodes into the pacemaker-remote role? |
|
I got an env with this so Ill test it |
|
Tested and it seems to work ok, retriggered the build |
| def maintenance_mode? | ||
| pacemaker_node = if !node[:pacemaker].nil? && node[:pacemaker][:is_remote] | ||
| def pacemaker_node_name | ||
| if !node[:pacemaker].nil? && node[:pacemaker][:is_remote] |
There was a problem hiding this comment.
What about just if node[:pacemaker] && node[:pacemaker][:is_remote] ?
jsuchome
left a comment
There was a problem hiding this comment.
Not tested, but makes sense to me
cmurphy
left a comment
There was a problem hiding this comment.
I tested this and it seems to at least not break anything. I'm having a hard time testing that it does what it's intended to do because I think we don't currently put remote notes in maintenance mode and instead use no_crm_maintenance_mode to avoid it. But it looks good!
|
Thanks @cmurphy :-) |
|
@aspiers why is this labeled UNTESTED? I think several people already tested it |
We need
crmandcrm_attributeinstalled on the remote nodes, and we also need to specify the pacemaker node name when toggling the mode, as explained in https://bugzilla.suse.com/show_bug.cgi?id=983617#c14