Creating a server using scripting

Use the commands in the ServerManagement command group for the AdminTask object or the AdminServerManagement script library to create a new application server, web server, proxy server, or generic server.

Before you begin

There are three ways to complete this task. This topic uses the AdminConfig object and the commands for the AdminTask object to create a new server configuration. Alternatively, you can use the scripts in the AdminServerManagement script library to create an application server, web server, proxy server, or generic server.

Procedure

  1. Start the wsadmin scripting tool.
  2. Obtain the configuration ID of the node object.

    [Updated in July 2011] The following examples obtain the configuration ID of the node object and assign it to the node variable. In these examples, node_name is the name of the node to which you are adding the new server, server_name is the name of the server you are creating, template_name is the name of the template you want used to create the server. The AdminTask.createApplicationServer() command requires you to specify a node name. The node name must be enclosed within single quotation marks. The AdminConfig.create() command requires you to specify the configuration ID of the node object. If you do not know the configuration ID, run the AdminConfig.getid('/Node:node_name') command to obtain that information. [Updated in July 2011]

    jul2011

    • Using Jacl:
      set node [$AdminConfig getid /Node:node_name/]
    • Using Jython:
      node = AdminConfig.getid('/Node:node_name/')
      [Updated in July 2011] To display the configuration ID of the node object, run the following command:
      print node
      [Updated in July 2011]
      jul2011
  3. Determine whether to use the AdminConfig or AdminTask object to create the server.
  4. Create the server.
    • The following example uses the commands for the AdminTask object to create a server:
      Using the AdminTask object:
      • Using Jacl:

        $AdminTask createApplicationServer node_name 
        {-name server_name –templateName template_name}
      • Using Jython:

        AdminTask.createApplicationServer('node_name', 
        ['-name', 'server_name', '-templateName', 'template_name'])
    • [Updated in September 2011] The following example uses the AdminConfig object to create a server. In these examples, node is the node variable to which the configuration ID of the node object is assigned.
      Using the AdminConfig object:
      • Using Jacl:

        $AdminConfig create Server $node {{name server_name}}
      • Using Jython:

        AdminConfig.create('Server', node, ['name', 'server_name'])
      [Updated in September 2011]
      sep2011
  5. Save the configuration changes.
    Use the following command example to save your configuration changes:
    AdminConfig.save()



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms of Use | Feedback

Last updatedLast updated: Sep 19, 2011 7:16:32 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-express-iseries&topic=txml_createserver
File name: txml_createserver.html