summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepti Kulkarni <deepti@vyatta.com>2011-07-27 07:51:19 -0700
committerDeepti Kulkarni <deepti@vyatta.com>2011-07-27 07:51:19 -0700
commit74e4822d68cf554bbc5ab62b528591ab3b117bc7 (patch)
tree2c297931b91c7b49206ad413e49d77ab7e5794d3
parentabab1d813c09c5765e1ecab963e6cdab524ec527 (diff)
downloadvyatta-cluster-74e4822d68cf554bbc5ab62b528591ab3b117bc7.tar.gz
vyatta-cluster-74e4822d68cf554bbc5ab62b528591ab3b117bc7.zip
Added op-mode commands
1 - force cluster active 2 - force cluster standby
-rw-r--r--templates-op/force/cluster/active/node.def14
-rw-r--r--templates-op/force/cluster/node.def1
-rw-r--r--templates-op/force/cluster/standby/node.def3
3 files changed, 18 insertions, 0 deletions
diff --git a/templates-op/force/cluster/active/node.def b/templates-op/force/cluster/active/node.def
new file mode 100644
index 0000000..d610277
--- /dev/null
+++ b/templates-op/force/cluster/active/node.def
@@ -0,0 +1,14 @@
+help: Attempt to take over cluster resources and become the active node
+run: local -a grp ;
+ local -a params ;
+ eval "grp=($(cli-shell-api listActiveNodes cluster group))"
+ if [ -n "$grp" ]; then
+ params=($(cli-shell-api returnActiveValue cluster group $grp auto-failback))
+ if [ "$params" == "true" ]; then
+ echo "Warning: Auto-failback is configured."
+ fi
+ sudo /usr/share/heartbeat/hb_takeover >&/dev/null
+ echo "Requesting to take over cluster resources."
+ else
+ echo "Clustering is not configured."
+ fi
diff --git a/templates-op/force/cluster/node.def b/templates-op/force/cluster/node.def
new file mode 100644
index 0000000..3a29d81
--- /dev/null
+++ b/templates-op/force/cluster/node.def
@@ -0,0 +1 @@
+help: Force a cluster state transition
diff --git a/templates-op/force/cluster/standby/node.def b/templates-op/force/cluster/standby/node.def
new file mode 100644
index 0000000..3490960
--- /dev/null
+++ b/templates-op/force/cluster/standby/node.def
@@ -0,0 +1,3 @@
+help: Release cluster resources and allow a remote to become master
+run: sudo /usr/share/heartbeat/hb_standby >&/dev/null
+ echo "Attempting to release cluster resources."