Creating server templates

A server template is used to define the configuration settings for a new application server. When you create a new application server, you either select the default server template or a template you previously created, that is based on another, already existing application server. The default template is used if you do not specify a different template when you create the server.

About this task

You can also use the createApplicationServerTemplate command for the AdminTask object to create a server template.

[z/OS]If you do not create any additional server templates, the defaultZOS template is used as the template for the first cluster member. This template uses the default port assignments for the z/OS® platform. If some of these ports are already defined for use elsewhere in your z/OS system, your newly created cluster member might not start, might function incorrectly, or might generate unexpected error messages. Therefore, you must resolve any port conflicts before you start this server.

Procedure

  1. In the administrative console, click Servers > Server Types > WebSphere application servers > , and then click Templates.
  2. On the Server templates page, click New.
  3. From the list of servers, select the server that you want to use to create the new template, and then click OK.
  4. Enter the name of the new template and, optionally, a description of that template that distinguishes it from your other templates.
    Avoid trouble: A server name can not contain a blank character.
  5. click OK.

Results

Your new template is on the list of server templates that you can use to create a new application server or cluster member.

What to do next

  • You can perform one of the following actions to display a list of all of the server templates that are available on your system:
    • In the administrative console, click Servers > Server Types > WebSphere application servers > , and then click Templates.
    • Issue the listServerTemplates wsadmin command.
  • Move the application server template to another system.
    There is no direct way to export or import an application server template. To move a copy of an application server template to another system, complete the following procedure.
    1. Use the following AdminTask.createApplicationServerCreate wsadmin command to create an application server from the template that you want to move to another system.
      AdminTask.createApplicationServer('<node_name>', '[-name server_name -templateName template_name ]')

      where <node_name> is the node to which you are adding the new application server, server_name is the name of the application server you are creating, and template_name is the name of the server template you are using to create the new application server.

    2. Use the following AdminTask.exportServer wsadmin command to export the new server.
      AdminTask.exportServer('[-archive c:/temp/templateExport.car -nodeName <node_name> -serverName server_name]')
      -
    3. Delete the server you just created, or exit from the wsadmin tool without saving.
    4. Move the templateExport.car file, that was created when you issued the AdminTask.exportServer, to the target system.
    5. Start the wsadmin tool on the target system, and use the following AdminTask.importServer wsadmin command to import the templateExport.car file.
      AdminTask.importServer('[-archive c:/temp/templateExport.car -nodeName <node_name> -serverInArchive server_name]')

      The server server_name now resides on the target system with unique ports. If you need to change the assigned ports, in the administrative console, click Servers > Server Types > WebSphere application servers > server_name, and then click Communications > ports.

    6. Use either the adminstrative console, or with the AdminTask.createApplicationServerTemplate wsadmin command to create a new template from the server_name application server. Then, delete the intermediate server_name application server if you no longer need this application server.
  • Specify a port range for server template creation.
    Starting ports for an application server template cannot be directly edited from the administrative console. However, a template can be converted to a server. The ports can be edited while in that form, prior to converting back to a template. To edit the starting ports for template1:
    1. Convert the template to a server. From the Application Servers panel, click New.
    2. Enter a node and a sever name (for example, tmpServer), and then click Next.
    3. Select the template1 template to use for server creation, and then click Next. You can optionally select Generate Unique Ports.
    4. Click Finish to create the tmpServer.
    5. Under Application servers, select tmpServer.
    6. Under Communications, click Ports.
    7. Select each endpoint and set a starting port. Click OK after each.
    8. Click Application servers > Server Templates and then click New.
    9. Select tmpServer as the basis for a new server. Click OK and select a template name.

    The new template has the starting ports as defined in tmpServer. The tmpServer server name can now be deleted, as can the initial template1 template if it is not needed.