From mboxrd@z Thu Jan 1 00:00:00 1970
From: rmccabe@sourceware.org Start service ???servicename???. If ???nodename??? is specified,
service is started on that node, otherwise it will be started on a
node chosen by service manager. Input variables:
If service was not running, it
- is started. If it was running, it is migrated to ???nodename???.
+ is started. If it was running, it is relocated to ???nodename???.
- ???servicename??? (string) ??? name of
service to manipulate
- ???nodename??? (string) ??? optional
- name of node for service to start on/ migrate to
No output variables.
On failure:
- 1 ??? service manager is not running on this
managed system
- generic ones
migrate_service
+Migrate the virtual service ???servicename??? to cluster node ???nodename.??? The virtual service ???servicename??? must be running, and xend must be running and configured to allow live migration on both nodes. +
+Input variables:
- ???servicename??? (string) ??? name of
+ the virtual service to migrate.
- ???nodename??? (string) ???
+ name of node to which the virtual service is to be migrated.
No output variables.
+On failure:
- 1 ??? service manager is not running on this
+ managed system
- generic ones
stop_service
Stop service ???servicename???. It is not an error to stop
--- conga/ricci/modules/cluster/ClusterModule.cpp 2006/11/20 23:10:58 1.6
+++ conga/ricci/modules/cluster/ClusterModule.cpp 2007/03/09 22:48:20 1.7
@@ -36,6 +36,7 @@
static VarMap set_cluster_conf(const VarMap& args);
static VarMap cluster_status(const VarMap& args);
static VarMap service_start(const VarMap& args);
+static VarMap service_migrate(const VarMap& args);
static VarMap service_stop(const VarMap& args);
static VarMap service_restart(const VarMap& args);
static VarMap fence_node(const VarMap& args);
@@ -66,6 +67,7 @@
api_1_0["start_service"] = service_start;
api_1_0["stop_service"] = service_stop;
api_1_0["restart_service"] = service_restart;
+ api_1_0["migrate_service"] = service_migrate;
api_1_0["start_node"] = start_node;
api_1_0["stop_node"] = stop_node;
@@ -168,6 +170,29 @@
}
VarMap
+service_migrate(const VarMap& args)
+{
+ String service_name, node_name;
+ try {
+ VarMap::const_iterator iter = args.find("servicename");
+ if (iter == args.end())
+ throw APIerror("missing servicename variable");
+ service_name = iter->second.get_string();
+
+ iter = args.find("nodename");
+ if (iter != args.end())
+ node_name = iter->second.get_string();
+ } catch ( String e ) {
+ throw APIerror(e);
+ }
+
+ Clusvcadm::migrate(service_name, node_name);
+
+ VarMap ret;
+ return ret;
+}
+
+VarMap
service_restart(const VarMap& args)
{
String name;
--- conga/ricci/modules/cluster/Clusvcadm.cpp 2007/03/08 06:04:12 1.9
+++ conga/ricci/modules/cluster/Clusvcadm.cpp 2007/03/09 22:48:20 1.10
@@ -72,7 +72,6 @@
-
void
Clusvcadm::start(const String& servicename,
const String& nodename)
@@ -80,7 +79,6 @@
pair, list
, list
, list