resource-agents: master - rgmanager: fix bug in virsh_migrate
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: e9b6563c9f800cc606210970702f235c07f56c10
Parent: b9d2735366887418c7dbb55f534586224fbf0755
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 23 14:40:47 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Oct 26 17:21:21 2009 -0400
rgmanager: fix bug in virsh_migrate
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 2dbeb5b..4113a50 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -655,7 +655,7 @@ validate_all()
virsh_migrate()
{
- declare $target=$1
+ declare target=$1
declare rv=1
#
14 years, 8 months
cluster: STABLE3 - resource-agents: Fix smb.sh return code
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 709037b5d4d131f7bb306bb6e1ce1797e6556858
Parent: 0445e89ec97595f283fefb4633c9e8e2800a8bf6
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Mon Oct 26 17:18:33 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Oct 26 17:18:33 2009 -0400
resource-agents: Fix smb.sh return code
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/smb.sh | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/smb.sh b/rgmanager/src/resources/smb.sh
index c2a9d9d..e62678b 100644
--- a/rgmanager/src/resources/smb.sh
+++ b/rgmanager/src/resources/smb.sh
@@ -583,6 +583,9 @@ share_start_stop()
mkdir -p "$SAMBA_PID_DIR/$OCF_RESKEY_name"
mkdir -p "$SAMBA_LOCK_DIR/$OCF_RESKEY_name"
+ [ -f "$SMBD_COMMAND" ] || exit $OCF_ERR_INSTALLED
+ [ -f "$NMBD_COMMAND" ] || exit $OCF_ERR_INSTALLED
+
# Kick off the per-service smbd
$SMBD_COMMAND $smbd_options "$conf"
ret_val=$?
14 years, 8 months
cluster: RHEL55 - rgmanager: Use RG_START_RECOVER after relo failure
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4d4d992a0a861f5dca7af437009667e0284f4ce8
Parent: 2acd52b50becbf98a45746f1f43d223d4365f521
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Oct 22 16:04:23 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Oct 26 13:19:16 2009 -0400
rgmanager: Use RG_START_RECOVER after relo failure
rgmanager correctly tries to restart a service all
around the cluster in the event of failures when
using RG_ENABLE (e.g. clusvcadm -e), but if a
relocation operation fails, the service can end
up stuck in the 'recovering' state. This is because
we were not switching to the RG_START_RECOVER
operation after the first relocation attempt failed.
Resolves: rhbz530409
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/rg_state.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c
index 3660b71..0b52f09 100644
--- a/rgmanager/src/daemons/rg_state.c
+++ b/rgmanager/src/daemons/rg_state.c
@@ -1727,14 +1727,14 @@ svc_start_remote(char *svcName, int request, uint32_t target)
* @param new_owner Member who actually ends up owning the service.
*/
int
-handle_relocate_req(char *svcName, int request, int preferred_target,
+handle_relocate_req(char *svcName, int orig_request, int preferred_target,
int *new_owner)
{
cluster_member_list_t *allowed_nodes = NULL, *backup = NULL;
cman_node_t *m;
- int target = preferred_target, me = my_id();
- int ret, x;
rg_state_t svcStatus;
+ int target = preferred_target, me = my_id();
+ int ret, x, request = orig_request;
get_rg_state_local(svcName, &svcStatus);
if (svcStatus.rs_state == RG_STATE_DISABLED ||
@@ -1836,6 +1836,13 @@ handle_relocate_req(char *svcName, int request, int preferred_target,
*/
return 0;
}
+
+ /*
+ * Failed to start on that node.
+ * Use the START_RECOVER operation on subsequent
+ * attempts.
+ */
+ request = RG_START_RECOVER;
}
}
@@ -1870,6 +1877,10 @@ handle_relocate_req(char *svcName, int request, int preferred_target,
return 0;
case RG_EDEPEND:
case RG_EFAIL:
+ /* Uh oh - we failed to relocate to this node.
+ ensure that we tell the next node to start it from
+ the 'recovering' state. */
+ request = RG_START_RECOVER;
memb_mark_down(allowed_nodes, target);
continue;
case RG_EABORT:
@@ -1902,7 +1913,7 @@ handle_relocate_req(char *svcName, int request, int preferred_target,
* We got sent here from handle_start_req.
* We're DONE.
*/
- if (request == RG_START_RECOVER) {
+ if (orig_request == RG_START_RECOVER) {
_svc_stop_finish(svcName, 0, RG_STATE_STOPPED);
return RG_EFAIL;
}
14 years, 8 months
cluster: STABLE3 - rgmanager: Use RG_START_RECOVER after relo failure
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0445e89ec97595f283fefb4633c9e8e2800a8bf6
Parent: 0a84466c0450d8c4810a5db3e6fab4ec146ff78c
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Oct 22 16:04:23 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Oct 26 13:17:37 2009 -0400
rgmanager: Use RG_START_RECOVER after relo failure
rgmanager correctly tries to restart a service all
around the cluster in the event of failures when
using RG_ENABLE (e.g. clusvcadm -e), but if a
relocation operation fails, the service can end
up stuck in the 'recovering' state. This is because
we were not switching to the RG_START_RECOVER
operation after the first relocation attempt failed.
Resolves: rhbz530409
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/rg_state.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c
index ab18202..4d53e63 100644
--- a/rgmanager/src/daemons/rg_state.c
+++ b/rgmanager/src/daemons/rg_state.c
@@ -1640,14 +1640,14 @@ svc_start_remote(const char *svcName, int request, uint32_t target)
* @param new_owner Member who actually ends up owning the service.
*/
int
-handle_relocate_req(char *svcName, int request, int preferred_target,
+handle_relocate_req(char *svcName, int orig_request, int preferred_target,
int *new_owner)
{
cluster_member_list_t *allowed_nodes = NULL, *backup = NULL;
cman_node_t *m;
- int target = preferred_target, me = my_id();
- int ret, x;
rg_state_t svcStatus;
+ int target = preferred_target, me = my_id();
+ int ret, x, request = orig_request;
get_rg_state_local(svcName, &svcStatus);
if (svcStatus.rs_state == RG_STATE_DISABLED ||
@@ -1749,6 +1749,13 @@ handle_relocate_req(char *svcName, int request, int preferred_target,
*/
return 0;
}
+
+ /*
+ * Failed to start on that node.
+ * Use the START_RECOVER operation on subsequent
+ * attempts.
+ */
+ request = RG_START_RECOVER;
}
}
@@ -1783,6 +1790,10 @@ handle_relocate_req(char *svcName, int request, int preferred_target,
return 0;
case RG_EDEPEND:
case RG_EFAIL:
+ /* Uh oh - we failed to relocate to this node.
+ ensure that we tell the next node to start it from
+ the 'recovering' state. */
+ request = RG_START_RECOVER;
memb_mark_down(allowed_nodes, target);
continue;
case RG_EABORT:
@@ -1815,7 +1826,7 @@ handle_relocate_req(char *svcName, int request, int preferred_target,
* We got sent here from handle_start_req.
* We're DONE.
*/
- if (request == RG_START_RECOVER) {
+ if (orig_request == RG_START_RECOVER) {
_svc_stop_finish(svcName, 0, RG_STATE_STOPPED);
return RG_EFAIL;
}
14 years, 8 months
cluster: RHEL55 - cman: Allow re-registering of a quorum disk
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 2acd52b50becbf98a45746f1f43d223d4365f521
Parent: 25155283f4797f85fa30b95c94c8ebb7df07dcc3
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Mon Oct 26 16:02:05 2009 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Mon Oct 26 16:02:05 2009 +0000
cman: Allow re-registering of a quorum disk
cman-register_quorum_device now allows the quorum device to be be
registered, with different votes, provided the name stays the same.
This should make it easier for qdiskd to handle configuration changes
without the cluster losing quorum.
rhbz#525270
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/commands.c | 51 ++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 29a9f1f..b1b1c69 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -981,38 +981,47 @@ static int do_cmd_register_quorum_device(char *cmdbuf, int *retlen)
if (!we_are_a_cluster_member)
return -ENOENT;
- if (quorum_device)
- return -EBUSY;
-
if (strlen(name) > MAX_CLUSTER_MEMBER_NAME_LEN)
return -EINVAL;
+ /* Allow re-registering of a quorum device if the name is the same */
+ if (quorum_device && strcmp(name, quorum_device->name))
+ return -EBUSY;
+
if (find_node_by_name(name))
return -EALREADY;
memcpy(&votes, cmdbuf, sizeof(int));
- quorum_device = malloc(sizeof(struct cluster_node));
- if (!quorum_device)
- return -ENOMEM;
- memset(quorum_device, 0, sizeof(struct cluster_node));
-
- quorum_device->name = malloc(strlen(name) + 1);
- if (!quorum_device->name) {
- free(quorum_device);
- quorum_device = NULL;
- return -ENOMEM;
- }
+ if (!quorum_device)
+ {
+ quorum_device = malloc(sizeof(struct cluster_node));
+ if (!quorum_device)
+ return -ENOMEM;
+ memset(quorum_device, 0, sizeof(struct cluster_node));
+
+ quorum_device->name = malloc(strlen(name) + 1);
+ if (!quorum_device->name) {
+ free(quorum_device);
+ quorum_device = NULL;
+ return -ENOMEM;
+ }
- strcpy(quorum_device->name, name);
- quorum_device->votes = votes;
- quorum_device->state = NODESTATE_DEAD;
- gettimeofday(&quorum_device->join_time, NULL);
+ strcpy(quorum_device->name, name);
+ quorum_device->state = NODESTATE_DEAD;
+ gettimeofday(&quorum_device->join_time, NULL);
- /* Keep this list valid so it doesn't confuse other code */
- list_init(&quorum_device->addr_list);
+ /* Keep this list valid so it doesn't confuse other code */
+ list_init(&quorum_device->addr_list);
+ log_msg(LOG_INFO, "quorum device registered\n");
+ }
+ else
+ {
+ log_printf(LOG_INFO, "quorum device re-registered\n");
+ }
- log_msg(LOG_INFO, "quorum device registered\n");
+ /* Update votes even if it existed before */
+ quorum_device->votes = votes;
return 0;
}
14 years, 8 months
cluster: RHEL54 - CMAN: scsi_reserve init script correctly report failures
by rohara
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 98ef02f36056858f79abe05ae287681a377b16bc
Parent: e790e4b988f7f12a327a020244c40b5bf1969f6d
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Mon Oct 12 09:30:08 2009 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Oct 26 09:19:38 2009 -0500
CMAN: scsi_reserve init script correctly report failures
This patch adds the use of the 'failure' function to the common code
(portions of script run for every operation) such that it correctly
reports failures.
rhbz#530400
---
fence/agents/scsi/scsi_reserve | 63 +++++++++++++++++++++++++++++++--------
1 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/fence/agents/scsi/scsi_reserve b/fence/agents/scsi/scsi_reserve
index 3662b02..2f10abc 100755
--- a/fence/agents/scsi/scsi_reserve
+++ b/fence/agents/scsi/scsi_reserve
@@ -8,17 +8,53 @@
. /etc/init.d/functions
+case $1 in
+
+ start)
+ echo -n "Starting scsi_reserve:"
+ ;;
+
+ stop)
+ echo -n "Stopping scsi_reserve:"
+ ;;
+
+ restart)
+ echo -n "Restarting scsi_reserve:"
+ ;;
+
+ status)
+ ;;
+
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+
+esac
+
# read in config file if it exists
#
if [ -f /etc/sysconfig/scsi_reserve ] ; then
. /etc/sysconfig/scsi_reserve
fi
+# check for sg_persist command provided by sg3_utils package
+#
+if ! sg_persist -V &> /dev/null ; then
+ logger -t scsi_reserve \
+ "[error] unable to exec sg_persist"
+ failure
+ echo
+ exit 1
+fi
+
# check if cluster is configured for fence_scsi
#
if ! fence_scsi_test -t fence ; then
logger -t scsi_reserve \
"[error] cluster not configured for scsi reservations"
+ failure
+ echo
exit 1
fi
@@ -27,14 +63,8 @@ fi
if ! fence_scsi_test -t nodes ; then
logger -t scsi_reserve \
"[error] cluster must define nodeid for all nodes"
- exit 1
-fi
-
-# check for sg_persist command provided by sg3_utils package
-#
-if ! sg_persist -V &> /dev/null ; then
- logger -t scsi_reserve \
- "[error] unable to exec sg_persist"
+ failure
+ echo
exit 1
fi
@@ -43,6 +73,8 @@ fi
if ! cman_tool status &> /dev/null ; then
logger -t scsi_reserve \
"[error] cman does not appear to be running"
+ failure
+ echo
exit 1
fi
@@ -56,6 +88,7 @@ pv_devices=$( vgs --noheadings --options vg_attr,pv_name \
if [ -z "$pv_devices" ] ; then
logger -t scsi_reserve \
"[error] did not find devices in cluster volumes"
+ failure
exit 1
fi
@@ -78,8 +111,9 @@ do
dm_devices="$dm_devices $( ls /sys/block/${pv_dev:5}/slaves/ )"
else
logger -t scsi_reserve \
- "[error] $dev is not a multipath device"
- exit 1
+ "[error] $dev is not a multipath device"
+ failure
+ exit 1
fi
else
sg_devices="$sg_devices $pv_dev"
@@ -99,6 +133,7 @@ cluster_id=$( cman_tool status | grep -i "Cluster ID" \
if [ -z "$cluster_id" ] ; then
logger -s -t scsi_reserve \
"[error] unable to determine cluster id"
+ failure
exit 1
fi
@@ -110,6 +145,7 @@ node_id=$( cman_tool status | grep -i "Node ID" \
if [ -z "$node_id" ] ; then
logger -t scsi_reserve \
"[error] unable to determine node id"
+ failure
exit 1
fi
@@ -120,6 +156,7 @@ key=$( printf "%x%.4x" $cluster_id $node_id )
if [ -z "$key" ] ; then
logger -t scsi_reserve \
"[error] unable to generate key"
+ failure
exit 1
fi
@@ -132,7 +169,7 @@ case $1 in
error=0
count=0
- echo -n "Starting scsi_reserve:"
+ # echo -n "Starting scsi_reserve:"
for dev in $sg_devices
do
@@ -194,7 +231,7 @@ case $1 in
error=0
count=0
- echo -n "Stopping scsi_reserve:"
+ # echo -n "Stopping scsi_reserve:"
for dev in $sg_devices
do
@@ -242,7 +279,7 @@ case $1 in
error=0
count=0
- echo -n "Retarting scsi_reserve:"
+ # echo -n "Restarting scsi_reserve:"
for dev in $sg_devices
do
14 years, 8 months
cluster: STABLE3 - rgmanager: Initial commit of central proc + migration support
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0a84466c0450d8c4810a5db3e6fab4ec146ff78c
Parent: 4757639351be41c31c2001d64549b2b2fafb5666
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Oct 21 13:38:42 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 23 16:06:53 2009 -0400
rgmanager: Initial commit of central proc + migration support
This adds preliminary migration support of virtual
machines when using central processing.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/service_op.c | 85 ++++++++++++++++++++++-
rgmanager/src/daemons/slang_event.c | 59 ++++++++++++++++
rgmanager/src/resources/default_event_script.sl | 8 +-
3 files changed, 146 insertions(+), 6 deletions(-)
diff --git a/rgmanager/src/daemons/service_op.c b/rgmanager/src/daemons/service_op.c
index aa36f41..a508f1e 100644
--- a/rgmanager/src/daemons/service_op.c
+++ b/rgmanager/src/daemons/service_op.c
@@ -187,7 +187,88 @@ service_op_stop(char *svcName, int do_disable, int event_type)
/*
- TODO
- service_op_migrate()
+ service_op_migrate() - send a virtual machine to another host
+ in the cluster
*/
+int
+service_op_migrate(char *svcName,
+ int target_node)
+{
+ SmMessageSt msg;
+ int msg_ret;
+ msgctx_t ctx;
+ rg_state_t svcStatus;
+ int msgtarget = my_id();
+
+ /* Build the message header */
+ msg.sm_hdr.gh_magic = GENERIC_HDR_MAGIC;
+ msg.sm_hdr.gh_command = RG_ACTION_REQUEST;
+ msg.sm_hdr.gh_arg1 = RG_ACTION_MASTER;
+ msg.sm_hdr.gh_length = sizeof (SmMessageSt);
+
+ msg.sm_data.d_action = RG_MIGRATE;
+
+ strncpy(msg.sm_data.d_svcName, svcName,
+ sizeof(msg.sm_data.d_svcName));
+
+ msg.sm_data.d_ret = 0;
+ msg.sm_data.d_svcOwner = target_node;
+
+ /* Open a connection to the local node - it will decide what to
+ do in this case. XXX inefficient; should queue requests
+ locally and immediately forward requests otherwise */
+
+ if (get_service_state_internal(svcName, &svcStatus) < 0)
+ return RG_EFAIL;
+ if (svcStatus.rs_owner > 0) {
+ if (member_online(svcStatus.rs_owner)) {
+ msgtarget = svcStatus.rs_owner;
+ }
+
+ if (msgtarget <= 0) {
+ return RG_EFAIL;
+ }
+ }
+
+ if (msg_open(MSG_CLUSTER, msgtarget, RG_PORT, &ctx, 2)< 0) {
+ logt_print(LOG_ERR,
+ "#58: Failed opening connection to member #%d\n",
+ my_id());
+ return -1;
+ }
+
+ /* Encode */
+ swab_SmMessageSt(&msg);
+
+ /* Send stop message to the other node */
+ if (msg_send(&ctx, &msg, sizeof (SmMessageSt)) <
+ (int)sizeof (SmMessageSt)) {
+ logt_print(LOG_ERR, "Failed to send complete message\n");
+ msg_close(&ctx);
+ return -1;
+ }
+
+ /* Check the response */
+ do {
+ msg_ret = msg_receive(&ctx, &msg,
+ sizeof (SmMessageSt), 10);
+ if ((msg_ret == -1 && errno != ETIMEDOUT) ||
+ (msg_ret > 0)) {
+ break;
+ }
+ } while(1);
+ if (msg_ret != sizeof (SmMessageSt)) {
+ logt_print(LOG_WARNING, "Strange response size: %d vs %d\n",
+ msg_ret, (int)sizeof(SmMessageSt));
+ return 0; /* XXX really UNKNOWN */
+ }
+
+ /* Got a valid response from other node. */
+ msg_close(&ctx);
+
+ /* Decode */
+ swab_SmMessageSt(&msg);
+
+ return msg.sm_data.d_ret;
+}
diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c
index de8aa61..29ae9f2 100644
--- a/rgmanager/src/daemons/slang_event.c
+++ b/rgmanager/src/daemons/slang_event.c
@@ -580,6 +580,63 @@ out:
}
+static int
+sl_migrate_service(void)
+{
+ char *svcname = NULL;
+ int target_node = 0;
+ int nargs, t, newowner = 0, ret = -1;
+
+ nargs = SLang_Num_Function_Args;
+
+ /* Takes one, two, or three */
+ if (nargs != 2) {
+ SLang_verror(SL_Syntax_Error,
+ (char *)"%s: Wrong # of args (%d), must be 2: service_name target_node\n",
+ __FUNCTION__, nargs);
+ return -1;
+ }
+
+ t = SLang_peek_at_stack();
+ if (t != SLANG_INT_TYPE) {
+ SLang_verror(SL_Syntax_Error,
+ (char *)"%s: expected type %d got %d\n",
+ __FUNCTION__, SLANG_INT_TYPE, t);
+ goto out;
+ }
+
+ if (SLang_pop_integer(&target_node) < 0) {
+ SLang_verror(SL_Syntax_Error,
+ (char *)"%s: Failed to pop integer from stack!\n",
+ __FUNCTION__);
+ goto out;
+ }
+
+ t = SLang_peek_at_stack();
+ if (t != SLANG_STRING_TYPE) {
+ SLang_verror(SL_Syntax_Error,
+ (char *)"%s: expected type %d got %d\n",
+ __FUNCTION__,
+ SLANG_STRING_TYPE, t);
+ goto out;
+ }
+
+ if (SLpop_string(&svcname) < 0) {
+ goto out;
+ }
+
+ ret = service_op_migrate(svcname, target_node);
+
+ if (ret == 0)
+ ret = target_node;
+out:
+ if (svcname)
+ free(svcname);
+ _user_return = ret;
+ return ret;
+}
+
+
/* Take an array of integers given its length and
push it on to the S/Lang stack */
void
@@ -979,6 +1036,8 @@ static SLang_Intrin_Fun_Type rgmanager_slang[] =
SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_start", sl_start_service,
SLANG_INT_TYPE),
+ MAKE_INTRINSIC_0((char *)"service_migrate", sl_migrate_service,
+ SLANG_INT_TYPE),
MAKE_INTRINSIC_S((char *)"service_status", sl_service_status,
SLANG_VOID_TYPE),
MAKE_INTRINSIC_S((char *)"service_freeze", sl_service_freeze,
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index 7809b20..84e6d72 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -585,11 +585,11 @@ define default_user_event_handler()
ret = service_unfreeze(service_name);
- }
+ } else if (user_request == USER_MIGRATE) {
- %
- % todo - migrate
- %
+ ret = service_migrate(service_name, user_target);
+
+ }
return ret;
}
14 years, 8 months
cluster: STABLE3 - rgmanager: fix bug in virsh_migrate
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4757639351be41c31c2001d64549b2b2fafb5666
Parent: 18100b8bcc49b84a7eb9ad8b36237ab83d628300
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 23 14:40:47 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 23 14:40:47 2009 -0400
rgmanager: fix bug in virsh_migrate
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 2dbeb5b..4113a50 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -655,7 +655,7 @@ validate_all()
virsh_migrate()
{
- declare $target=$1
+ declare target=$1
declare rv=1
#
14 years, 8 months
rgmanager: master - rgmanager: Fix bad assertion
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdif...
Commit: 27e5a1b243b38e955d4d9a49e5a3f43d5f0bc1b1
Parent: 66ce9f84a4634282968cd8a4e2bb4dbe19a5844a
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Oct 21 15:42:10 2009 -0400
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Oct 22 07:31:14 2009 +0200
rgmanager: Fix bad assertion
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 226d05d..e064db3 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1378,8 +1378,9 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
incarnations there are. */
pthread_mutex_lock(&node->rn_resource->r_mutex);
if (node->rn_state == RES_STARTED) {
- assert(node->rn_resource->r_incarnations > 0);
- --node->rn_resource->r_incarnations;
+ assert(node->rn_resource->r_incarnations >= 0);
+ if (node->rn_resource->r_incarnations > 0)
+ --node->rn_resource->r_incarnations;
}
node->rn_flags &= ~RF_NEEDSTOP;
14 years, 8 months
resource-agents: master - oracledb ras: stop using obsoleted initlog
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: b9d2735366887418c7dbb55f534586224fbf0755
Parent: be58aeb2b0626dec8c11c81cff8723d474b9cc67
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Oct 22 07:26:25 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Oct 22 07:29:37 2009 +0200
oracledb ras: stop using obsoleted initlog
replace with logger.
Thanks to Bill Nottingham for the patch.
Fixes rhbz#530197
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
rgmanager/src/resources/oracledb.sh.in | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/rgmanager/src/resources/oracledb.sh.in b/rgmanager/src/resources/oracledb.sh.in
index 809605e..5ba3370 100644
--- a/rgmanager/src/resources/oracledb.sh.in
+++ b/rgmanager/src/resources/oracledb.sh.in
@@ -278,7 +278,7 @@ start_db()
rm -f $tmpfile
# Dump logfile to /var/log/messages
- initlog -q -c "cat $logfile"
+ logger -f $logfile
if [ $rv -ne 0 ]; then
echo "ORACLE_HOME Incorrectly set?"
@@ -326,7 +326,7 @@ stop_db()
rm -f $tmpfile
# Dump logfile to /var/log/messages
- initlog -q -c "cat $logfile"
+ logger -f $logfile
if [ $rv -ne 0 ]; then
echo "ORACLE_HOME Incorrectly set?"
@@ -362,12 +362,12 @@ force_cleanup()
# Patch from Shane Bradley to fix 471266
pids=`ps ax | grep $ORACLE_HOME | grep "ora_.*_${ORACLE_SID}" | grep -v grep | awk '{print $1}'`
- initlog -n $SCRIPT -s "<err> Not all Oracle processes exited cleanly, killing"
+ logger -t $SCRIPT "<err> Not all Oracle processes exited cleanly, killing"
for pid in $pids; do
kill -9 $pid
if [ $? -eq 0 ]; then
- initlog -n $SCRIPT -s "Killed $pid"
+ logger -t $SCRIPT "Killed $pid"
fi
done
@@ -428,7 +428,7 @@ get_db_status()
for (( i=$RESTART_RETRIES ; i; i-- )) ; do
# this db process is down - stop and
# (re)start all ora_XXXX_$ORACLE_SID processes
- initlog -q -n $SCRIPT -s "Restarting Oracle Database..."
+ logger -t $SCRIPT "Restarting Oracle Database..."
stop_db
if [ $? != 0 ] ; then
# stop failed - return 1
14 years, 8 months