fence-agents: RHEL6 - fence_cisco_ucs: Respect "delay" option
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=068f61...
Commit: 068f61c638b2ef88badfd1a5d89b92cc77c4df14
Parent: 7925014f449fe751b93dbc3bd6cf1d847d047d0e
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Jun 26 13:46:58 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Jun 26 13:46:58 2013 +0200
fence_cisco_ucs: Respect "delay" option
Resolves: rhbz#896603
---
fence/agents/cisco_ucs/fence_cisco_ucs.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py
index eda6aed..19b2086 100644
--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py
+++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py
@@ -117,6 +117,9 @@ used with Cisco UCS to fence machines."
show_docs(options, docs)
### Login
+ if options["-o"] in ["off", "reboot"]:
+ time.sleep(int(options["-f"]))
+
res = send_command(options, "<aaaLogin inName=\"" + options["-l"] + "\" inPassword=\"" + options["-p"] + "\" />")
result = re_cookie.search(res)
if (result == None):
10 years, 10 months
fence-agents: RHEL6 - fence_ipmilan: Fix manual page for HP iLO3, HP iLO4
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=792501...
Commit: 7925014f449fe751b93dbc3bd6cf1d847d047d0e
Parent: 715b34f9c3770b46f49dfd20e3aaef9dfd461596
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Nov 5 11:39:15 2012 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Jun 26 13:44:55 2013 +0200
fence_ipmilan: Fix manual page for HP iLO3, HP iLO4
Resolves: rhbz#872308
---
fence/agents/ipmilan/ipmilan.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index d1a0530..1eb733e 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -903,14 +903,14 @@ static void print_xml_metadata(char *pname) {
printf("%s\n","<?xml version=\"1.0\" ?>");
printf("%s%s%s\n","<resource-agent name=\"",pname,"\" shortdesc=\"Fence agent for IPMI over LAN\">");
- printf("<symlink name=\"fence_ilo3\" shortdesc=\"Fence agent for HP iLO2\"/>\n");
+ printf("<symlink name=\"fence_ilo3\" shortdesc=\"Fence agent for HP iLO3\"/>\n");
printf("<symlink name=\"fence_idrac\" shortdesc=\"Fence agent for Dell iDRAC\"/>\n");
printf("<symlink name=\"fence_imm\" shortdesc=\"Fence agent for IBM Integrated Management Module\"/>\n");
printf("<longdesc>\n");
printf("fence_ipmilan is an I/O Fencing agent which can be used with "
"machines controlled by IPMI. This agent calls support software "
"using ipmitool (http://ipmitool.sf.net/).\n\n"
- "To use fence_ipmilan with HP iLO 3 you have to enable lanplus "
+ "To use fence_ipmilan with HP iLO 3 or HP iLO 4 you have to enable lanplus "
"option (lanplus / -P) and increase wait after operation to "
"4 seconds (power_wait=4 / -T 4)");
printf("</longdesc>\n");
10 years, 10 months
dlm: master - dlm_controld: unify fence delay variations
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=2548250de3991f1...
Commit: 2548250de3991f1f0aca297bbd072b525a132841
Parent: f367c91ac4f4f8012456f4916c0c99b00d8569c4
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 25 13:18:47 2013 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jun 25 13:18:47 2013 -0500
dlm_controld: unify fence delay variations
The fence delay period begins after a node joins the
cluster or joins the daemon cpg. Apply this delay
to both startup and normal fencing.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/daemon_cpg.c | 15 +++++++--------
dlm_controld/dlm_daemon.h | 2 +-
dlm_controld/member.c | 2 +-
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 0db48f5..d88cd46 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -107,7 +107,6 @@ static int daemon_remove_count;
static int daemon_ringid_wait;
static struct cpg_ring_id daemon_ringid;
static int daemon_fence_pid;
-static uint64_t daemon_last_join_monotime;
static uint32_t last_join_seq;
static uint32_t send_fipu_seq;
static int wait_clear_fipu;
@@ -868,15 +867,15 @@ static void daemon_fence_work(void)
if (!opt(enable_startup_fencing_ind))
continue;
- if (!daemon_last_join_monotime) {
- log_debug("fence startup %d wait for confchg", node->nodeid);
+ if (!fence_delay_begin) {
+ log_debug("fence startup %d wait for initial delay", node->nodeid);
continue;
}
- if (monotime() - daemon_last_join_monotime < opt(post_join_delay_ind)) {
+ if (monotime() - fence_delay_begin < opt(post_join_delay_ind)) {
log_debug("fence startup %d delay %d from %llu",
node->nodeid, opt(post_join_delay_ind),
- (unsigned long long)daemon_last_join_monotime);
+ (unsigned long long)fence_delay_begin);
retry = 1;
continue;
}
@@ -959,10 +958,10 @@ static void daemon_fence_work(void)
time between it joining the cluster (giving cluster quorum)
and joining the daemon cpg, which allows it to bypass fencing */
- if (monotime() - cluster_last_join_monotime < opt(post_join_delay_ind)) {
+ if (monotime() - fence_delay_begin < opt(post_join_delay_ind)) {
log_debug("fence request %d delay %d from %llu",
node->nodeid, opt(post_join_delay_ind),
- (unsigned long long)cluster_last_join_monotime);
+ (unsigned long long)fence_delay_begin);
node->delay_fencing = 1;
retry = 1;
continue;
@@ -2042,7 +2041,7 @@ static void confchg_cb_daemon(cpg_handle_t handle,
node->daemon_member = 1;
node->daemon_add_time = now;
- daemon_last_join_monotime = now;
+ fence_delay_begin = now;
last_join_seq++;
/* a joining node shows prev members in joined list */
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index dbe22ba..62508ea 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -171,7 +171,7 @@ EXTERN int plock_ci;
EXTERN struct list_head lockspaces;
EXTERN int cluster_quorate;
EXTERN int cluster_two_node;
-EXTERN uint64_t cluster_last_join_monotime;
+EXTERN uint64_t fence_delay_begin;
EXTERN uint64_t cluster_quorate_monotime;
EXTERN uint64_t cluster_joined_monotime;
EXTERN uint64_t cluster_joined_walltime;
diff --git a/dlm_controld/member.c b/dlm_controld/member.c
index fca3248..d4031ee 100644
--- a/dlm_controld/member.c
+++ b/dlm_controld/member.c
@@ -151,7 +151,7 @@ static void quorum_callback(quorum_handle_t h, uint32_t quorate,
quorum_nodes[i], cluster_ringid_seq);
add_cluster_node(quorum_nodes[i], now);
- cluster_last_join_monotime = now;
+ fence_delay_begin = now;
err = corosync_cfg_get_node_addrs(ch, quorum_nodes[i],
MAX_NODE_ADDRESSES,
10 years, 10 months
dlm: master - dlm_controld: exclude fencing work during set_protocol
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=f367c91ac4f4f80...
Commit: f367c91ac4f4f8012456f4916c0c99b00d8569c4
Parent: 5bdbe083ed23abc955309ea23fd6f008852b05b8
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 25 11:02:22 2013 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jun 25 11:08:24 2013 -0500
dlm_controld: exclude fencing work during set_protocol
During set_protocol we only want to process protocol
messages, and only process fencing status later during
main daemon processing.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/daemon_cpg.c | 26 ++++++++++++++++++++++++--
dlm_controld/dlm_daemon.h | 1 +
dlm_controld/main.c | 4 ++++
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 0758560..0db48f5 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -766,6 +766,9 @@ static void daemon_fence_work(void)
int retry = 0;
uint32_t flags;
+ if (!daemon_fence_allow)
+ return;
+
if (daemon_ringid_wait) {
/* We've seen a nodedown confchg callback, but not the
corresponding ringid callback. */
@@ -1811,6 +1814,7 @@ int set_protocol(void)
{
struct protocol proto;
struct pollfd pollfd;
+ cs_error_t error;
int sent_proposal = 0;
int rv;
@@ -1860,8 +1864,17 @@ int set_protocol(void)
return -1;
}
- if (pollfd.revents & POLLIN)
- process_cpg_daemon(0);
+ if (pollfd.revents & POLLIN) {
+ /*
+ * don't use process_cpg_daemon() because we only want to
+ * dispatch one thing at a time because we only want to
+ * handling protocol related things here.
+ */
+
+ error = cpg_dispatch(cpg_handle_daemon, CS_DISPATCH_ONE);
+ if (error != CS_OK)
+ log_error("daemon cpg_dispatch one error %d", error);
+ }
if (pollfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
log_error("set_protocol poll revents %u",
pollfd.revents);
@@ -1927,6 +1940,15 @@ static void deliver_cb_daemon(cpg_handle_t handle,
hd = (struct dlm_header *)data;
dlm_header_in(hd);
+ if (!daemon_fence_allow && hd->type != DLM_MSG_PROTOCOL) {
+ /* don't think this will happen; if it does we may
+ need to verify that it's correct to ignore these
+ messages instead of saving them to process after
+ allow is set */
+ log_debug("deliver_cb_daemon ignore non proto msg %d", hd->type);
+ return;
+ }
+
switch (hd->type) {
case DLM_MSG_PROTOCOL:
receive_protocol(hd, len);
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 11a4777..dbe22ba 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -162,6 +162,7 @@ EXTERN int daemon_quit;
EXTERN int cluster_down;
EXTERN int poll_lockspaces;
EXTERN unsigned int retry_fencing;
+EXTERN int daemon_fence_allow;
EXTERN int poll_fs;
EXTERN int poll_ignore_plock;
EXTERN int poll_drop_plock;
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 8fb16ef..287b82d 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1021,6 +1021,10 @@ static void loop(void)
sd_notify(0, "READY=1");
#endif
+ /* We want to wait for our protocol to be set before
+ we start to process fencing. */
+ daemon_fence_allow = 1;
+
for (;;) {
rv = poll(pollfd, client_maxi + 1, poll_timeout);
if (rv == -1 && errno == EINTR) {
10 years, 10 months
dlm: master - dlm_controld: daemon_fence_work should wait for confchg
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=5bdbe083ed23abc...
Commit: 5bdbe083ed23abc955309ea23fd6f008852b05b8
Parent: 41f4121768ab4948898945007f49168acfac6c9f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 25 11:04:49 2013 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jun 25 11:04:49 2013 -0500
dlm_controld: daemon_fence_work should wait for confchg
If daemon_last_join_monotime has not yet been initialized
by the first confchg, then daemon_fence_work() should
wait for that to happen.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/daemon_cpg.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 8c4cff2..0758560 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -865,6 +865,11 @@ static void daemon_fence_work(void)
if (!opt(enable_startup_fencing_ind))
continue;
+ if (!daemon_last_join_monotime) {
+ log_debug("fence startup %d wait for confchg", node->nodeid);
+ continue;
+ }
+
if (monotime() - daemon_last_join_monotime < opt(post_join_delay_ind)) {
log_debug("fence startup %d delay %d from %llu",
node->nodeid, opt(post_join_delay_ind),
10 years, 10 months
cluster: RHEL510 - fencing: fix error introduced by be4ffa1bed23328a36b182b69c1c355abb7e16af
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=6d807b2d391...
Commit: 6d807b2d391332fbe401735603d6193a65a7aa3f
Parent: be593c8577d5c405facb5a454f5d934c3f9fb23b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Jun 17 18:01:00 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Jun 17 18:01:00 2013 +0200
fencing: fix error introduced by be4ffa1bed23328a36b182b69c1c355abb7e16af
Problem occurs when cmd line is not a list but a single variable. This patch
makes list from non-lists and solves this problem. Problem do not occur in 4.x versions
as there all cmd-lines can be only lists.
Resolves: rhbz#886612
---
fence/agents/lib/fencing.py.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index d1e43da..80f727b 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -959,6 +959,9 @@ def fence_login(options):
try:
conn.send_eol(options["-p"])
+ if type(options["-c"]) is not list:
+ options["-c"] = [ options["-c"] ]
+
valid_password = conn.log_expect(options, [ re_login_string ] + options["-c"], int(options["-Y"]))
if valid_password == 0:
## password is invalid or we have to change EOL separator
10 years, 10 months
cluster: RHEL510 - rgmanager: Fix improper use of cman_get_node()
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=be593c8577d...
Commit: be593c8577d5c405facb5a454f5d934c3f9fb23b
Parent: 75f10d2cb456040124adf819adbe077d9954b320
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Jun 13 14:54:30 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Jun 13 14:58:03 2013 -0400
rgmanager: Fix improper use of cman_get_node()
Fix an improper use of cman_get_node() where the function is used to
get a node by id without first zeroing the cman_node_t struct.
Resolves: rhbz#889098
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/rg_event.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c
index 606d41b..fe532d7 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -227,6 +227,7 @@ node_fenced(int nodeid)
* if CMAN has admitted a node back in to the cluster,
* then we can stop waiting for fencing (#527777)
*/
+ memset(&node, 0, sizeof(node));
if (cman_get_node(ch, nodeid, &node) < 0)
goto out;
10 years, 10 months
fence-agents: master - fence_dummy: An option to add random delay to start of this fence agents
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=fd4710...
Commit: fd471013bdda9202b045ebbfd00edeb734c41f13
Parent: ecc2155cb2f27376034d6524d97d8e207e395588
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 7 17:16:14 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 7 17:17:44 2013 +0200
fence_dummy: An option to add random delay to start of this fence agents
Previously -R was used but this should be used for password script for SNMP, now -r is used.
Functionality was added only now.
---
fence/agents/dummy/fence_dummy.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/fence/agents/dummy/fence_dummy.py b/fence/agents/dummy/fence_dummy.py
index e24a0cc..d5bb748 100644
--- a/fence/agents/dummy/fence_dummy.py
+++ b/fence/agents/dummy/fence_dummy.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import sys, re, pexpect, exceptions
+import sys, re, pexpect, exceptions, random
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
@@ -82,7 +82,7 @@ def main():
}
all_opt["random_sleep_range"] = {
- "getopt" : "R:",
+ "getopt" : "r:",
"longopt" : "random_sleep_range",
"help":"--random_sleep_range=[seconds] Issue a sleep between 1 and [seconds]",
"required" : "0",
@@ -113,6 +113,13 @@ def main():
docs["vendorurl"] = "http://www.example.com"
show_docs(options, docs)
+ # random sleep for testing
+ if options.has_key("--random_sleep_range"):
+ val = int(options["--random_sleep_range"])
+ ran = random.randint(1, val)
+ sys.stderr.write("random sleep for %d seconds\n" % ran)
+ time.sleep(ran)
+
if options["--type"] == "fail":
result = fence_action(None, options, set_power_status_fail, get_power_status_fail, get_outlets_fail)
else:
10 years, 10 months
fence-agents: master - fencing: Improve work with invalid power states
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=ecc215...
Commit: ecc2155cb2f27376034d6524d97d8e207e395588
Parent: 23850c66d9caf7d61dc4217ffae66a79b516fdff
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 7 12:58:18 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 7 13:02:29 2013 +0200
fencing: Improve work with invalid power states
Previously, status for N ports was OFF if all of these nodes where off
and it differs when of these ports were ON. This did not work properly
when fence agents responeded with 'unknown' values. This patches fixes
this issue and if at least one value is non-OFF then status is not-OFF too.
---
fence/agents/lib/fencing.py.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 8be5f31..12521de 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -742,7 +742,7 @@ def get_multi_power_fn(tn, options, get_power_fn):
options["--plug"] = plug
plug_status = get_power_fn(tn, options)
- if plug_status == "on":
+ if plug_status != "off":
status = plug_status
else:
status = get_power_fn(tn, options)
10 years, 10 months
fence-agents: master - fencing: Actions to set power status are not working properly for fence agents without --plug
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=23850c...
Commit: 23850c66d9caf7d61dc4217ffae66a79b516fdff
Parent: 3d9e3cf41f11da188e3f927ceb4b9f39435bc0a9
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 7 12:57:29 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 7 13:02:25 2013 +0200
fencing: Actions to set power status are not working properly for fence agents without --plug
The bug was introduced when support for multiple ports was added.
commit 0097e806545d722270b739f31a754d65994b18c9
---
fence/agents/lib/fencing.py.py | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 1424111..8be5f31 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -750,14 +750,17 @@ def get_multi_power_fn(tn, options, get_power_fn):
return status
def set_multi_power_fn(tn, options, set_power_fn):
- for plug in options["--plugs"]:
- try:
- options["--uuid"] = str(uuid.UUID(plug))
- except ValueError:
- pass
- except KeyError:
- pass
- options["--plug"] = plug
+ if options.has_key("--plugs"):
+ for plug in options["--plugs"]:
+ try:
+ options["--uuid"] = str(uuid.UUID(plug))
+ except ValueError:
+ pass
+ except KeyError:
+ pass
+ options["--plug"] = plug
+ set_power_fn(tn, options)
+ else:
set_power_fn(tn, options)
10 years, 10 months