conga/ricci docs/cluster_api.html modules/clus ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-03-09 22:49:37
Modified files:
ricci/docs : cluster_api.html
ricci/modules/cluster: ClusterModule.cpp Clusvcadm.cpp
Clusvcadm.h
Log message:
- Fix virt service disable and relocate.
- Add a "migrate" ricci call to allow for the bifurcation of relocation and live migration for virt services.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/cluster_api.html.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterModule.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Clusvcadm.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.2&r2=1.7.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Clusvcadm.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1
ricci/docs/cluster_api.html +14 -2
@@ -75,15 +75,27 @@ <P>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. <BR>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???. </P> <P>Input variables:<BR>- ???servicename??? (string) ??? name of service to manipulate<BR>- ???nodename??? (string) ??? optional - name of node for service to start on/ migrate to</P> + name of node for service to start on / relocate to</P> <P>No output variables.</P> <P>On failure:<BR>- 1 ??? service manager is not running on this managed system<BR>- generic ones</P> </UL> + <LI><P>migrate_service</P> + <UL> + <P>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. + </P> + <P>Input variables:<BR>- ???servicename??? (string) ??? name of + the virtual service to migrate.<BR>- ???nodename??? (string) ??? + name of node to which the virtual service is to be migrated.</P> + <P>No output variables.</P> + <P>On failure:<BR>- 1 ??? service manager is not running on this + managed system<BR>- generic ones</P> + </UL> + <LI><P>stop_service</P> <UL> <P>Stop service ???servicename???. It is not an error to stop
ricci/modules/cluster/ClusterModule.cpp +25 -0
@@ -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;
ricci/modules/cluster/Clusvcadm.cpp +70 -9
123 lines not on this page · raw message
ricci/modules/cluster/Clusvcadm.h +3 -4
@@ -30,11 +30,10 @@class Clusvcadm { public: - static void start(const String& servicename, - const String& nodename); - static void stop(const String& servicename); + static void start(const String& servicename, const String& nodename); + static void migrate(const String& servicename, const String& nodename); static void restart(const String& servicename); - + static void stop(const String& servicename); };