Create server templates
A server template is used to define the configuration settings for a new application server. When we create a new application server, you either select the default server template or a template we previously created, based on another, already existing application server. The default template is used if we do not specify a different template when we create the server.
We can also use the createApplicationServerTemplate command for the AdminTask object to create a server template.
(ZOS) If we 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, the newly created cluster member might not start, might function incorrectly, or might generate unexpected error messages. Therefore, we must resolve any port conflicts before starting this server.
Tasks
- In the administrative console, click...
Servers > Server Types > WebSphere application servers > > Templates.
- On the Server templates page, click New.
- From the list of servers, select the server to use to create the new template> OK.
- Enter the name of the new template and, optionally, a description of that template that distinguishes it from your other templates.
A server name can not contain a blank character..
- click OK.
Your new template is on the list of server templates we can use to create a new application server or cluster member.
What to do next
- We can perform one of the following actions to display a list of all of the server templates available on the system:
- In the administrative console, click...
Servers > Server Types > WebSphere application servers > > 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.
- Use the following AdminTask.createApplicationServerCreate wsadmin command to create an application server from the template to move to another system.
AdminTask.createApplicationServer('node', '[-name server -templateName template_name ]')where node is the node to which we are adding the new application server, server is the name of the application server we are creating, and template_name is the name of the server template we are using to create the new application server.
- Use the following AdminTask.exportServer wsadmin command to export the new server.
AdminTask.exportServer('[-archive c:/temp/templateExport.car -nodeName node -serverName server]')-- Use the AdminTask.importServerdelete wsadmin command to exit from the wsadmin tool without saving.
- Move the templateExport.car file, created when we issued the AdminTask.exportServer, to the target system.
- 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 -serverInArchive server]')The server server now resides on the target system with unique ports. To change the assigned ports, in the administrative console, click...
Servers > Server Types > WebSphere application servers > server> Communications > ports.
- Use either the adminstrative console, or with the AdminTask.createApplicationServerTemplate wsadmin command to create a new template from the server application server. Then, delete the intermediate server application server if we 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:
- Convert the template to a server. From the Application Servers panel, click New.
- Enter a node and a sever name (for example, tmpServer), and then click Next.
- Select the template1 template to use for server creation> Next. We can optionally select Generate Unique Ports.
- Click Finish to create the tmpServer.
- Under Application servers, select tmpServer.
- Under Communications, click Ports.
- Select each endpoint and set a starting port. Click OK after each.
- Click Application servers > Server Templates and then click New.
- 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.
Subtopics
- Server template options
Select the server that we want used to create a new server template. Server templates are copies of server configuration data that can be used as a starting point for creating new servers.- Server templates collection
View the list of server templates that exist on the system.- Server template settings
Specify a name and description for the new server template that we are creating. The new template is created based on the configuration of the selected server.
Deleting server templates Commands for the AdminTask object