Skip to main content

skip to main content

developerWorks  >  Grid computing | Tivoli  >

Orchestrating grid workloads -- neither feast nor famine

Move servers in and out of grids with IBM Tivoli Intelligent Orchestrator

developerWorks


Listing 1. Allocate DataSynapse Server Workflow
##################################################################################
#                                                                                                                                             #
# DataSynapse AddServer:                                                                                                        #
#                                                                                                                                             #
# Add a DataSynapse Server to a cluster                                                                                    #
#                                                                                                                                             #
# Inputs:                                                                                                                                  #
#   ClusterID - The id of the cluster to which the server is to be added                                           #
#   ServerID  - The server which will be added to the cluster (can be null)                                       #
#                                                                                                                                            #
# Outputs:                                                                                                                               #
#   ServerID - The server which has been added to the cluster                                                      #
#                                                                                                                                            #
##################################################################################
workflow DataSynapse_AddServer(in ClusterID, inout ServerID) implements Cluster.AddServer LocaleInsensitive 
##################################################################################
# Variable Definitions                                                                                                                #
#                                                                                                                                             #
# Directorvar - The name of the Datasynapse director variable defined in the DCM                           #
# Poolid      - The Pool associated with the Cluster                                                                      #
# Requestid   - The id Orchestrator associated with this request                                                   #
# ReturnCode  - The Return code from the DataSynapse_Start command                                      #
# DirectorID  - The  name of the Datasynapse director this engine will access                                #
#                                                                                                                                             #
##################################################################################
  var Poolid
  var Requestid
  var ReturnCode
  var Directorvar = "Director"
  var DirectorID
  # Get The request ID (Needed by the RM calls)
  Get_Current_Deployment_Request_Id(Requestid)
  # Use Get_Cluster_Attributes to retrieve the Pool associated with this cluster
  Get_Cluster_Attributes(<null>, <null>, ClusterID, <null>, <null>, <null>, <null>, <null>, <null>, <null>, Poolid, <null>, <null>,
 <null>, <null>, <null>)
  # Get a server from the free pool
  My_Allocate_Server(ClusterID, Poolid, Requestid, ServerID)
  # Find the name of the DataSynapse Director that this server will use when starting	
  Get_DCM_Property(<null>, ClusterID, Directorvar, DirectorID)
  try
  	# Start the DataSynapse Engine Daemon on the server
  	DataSynapse_Start(ServerID, DirectorID, ReturnCode)
    RM_Add_Server(ClusterID, Requestid, ServerID)
  catch DataSynapseError msg
  	# The DataSynapse_Start threw an error got to find another server
    DataSynapse_AddServer(ClusterID,ServerID)
  endtry

Return to article.