Generating a configuration template

Generating a configuration template from an existing Websphere Application Server cell and uploading it to Code Station is required before deploying the configuration template. You use the Middleware Configuration for WebSphere® plug-in to generate the template.

Before you begin

Procedure

  1. Install the Middleware Configuration for WebSphere plug-in to your system. You can use a Windows or a Linux system. To install this plug-in, see Installing plug-ins.
  2. Unzip the plug-in.
  3. Install the Version 6 UrbanCode Deploy command line client tool.

    To install the tool, download the udclient.zip file to the system on which you want to use the tool. You can download the file from the IBM® UrbanCode Deploy server by clicking Help > Tools and then clicking IBM UrbanCode Deploy Client. You can also find the file in the folder server_install/opt/tomcat/webapps/ROOT/tools/, where server_install is the installation folder for the server.

  4. Run the genWASTemplate script to discover and import the configuration of an existing cell.

    The script imports configuration data from the cell and cluster scopes.

    The script generates one configuration template for the cell plus one configuration template for each discovered cluster. The generation process can take several minutes or longer, depending on the cell.

    The script does not import applications.

    For full usage information, execute genAMCTemplate with no options.

    The following command uses line breaks for readability. Do not use them. If you are on a Windows system, use genWASTemplate.bat.

    ./genWASTemplate.sh 
    -environment myenv 
    -osuser root 
    -ospassword rootpswd 
    -washost washost.mydomain.com 
    -port 8887 
    -soapClientProperties 
    -tmplname mytmplname 
    -profilePath /opt/IBM/was85twonode/AppServer/profiles/dmgr

    During execution, the genWASTemplate script creates a promote.properties file and pauses to allow you to add tokens to the file.

    1. Add tokens to the properties file when the script pauses. Tokens are used in places where the user is expected to provide information during deployment.
      1. Open the properties file:
        <plug-in_home>/user/environments/myenv/cells/85/promote.properties
      2. Enter one token per line in the form name=value. A commented token appears in the file.
        # UatDbName=uat.db.com   
        # this will tokenize all "uat.db.com" strings read from WebSphere 
          so that when the template is instantiated, the value for UatDbName 
          from the Environment Property Definition is used to apply the configuration 
          template to the live cell.
      3. Save the file and exit the editor.
      4. Press Enter in the command window where the script is running. The script then continues.
  5. Start UrbanCode Deploy if it is not already running.
  6. Import the component template provided for Middleware Configuration for WebSphere. Do the following in UrbanCode Deploy. The <plugin_home> directory is the top directory where you unzipped the downloaded UrbanCode Deploy plug-ins.
    1. Click the Components tab.
    2. Click the Templates tab.
    3. Click Import Templates.
    4. Select <plugin_home>/jsonTemplates/Middleware Configuration for WebSphere.json . This template becomes the default template for the remaining process. You may use another template if you choose. It must already exist in UrbanCode Deploy.
  7. Run the createUCDObjects script to upload one of the generated templates to Code Station.

    Choose the template for the cell or cluster for the application you want to manage.

    For full usage information, execute createUCDObjects with no options.

    The script attempts to do the following:,

    • create a component if it does not exist
    • create a new version for the component
    • upload files to the new version. The directory for the files to upload is specified by -ucdBaseTmplDir

    The following command uses line breaks for readability. Do not use them. If you are on a Windows system, use createUCDObjects.bat.

    ./createUCDObjects.sh 
    -ucdBaseTmplDir /home/myuser/workspaces/rafw-head/user/templates/environments/<tmpl-name> 
    -ucdBin /home/myuser/udclient/udclient  # use udclient.cmd on Windows
    -ucdCompName App1Comp 
    -ucdPass admin 
    -ucdTempl redcellTempl 
    -ucdTmplVer 1.0 
    -ucdUrl https://myhost.mydomain.com:8443 
    -ucdUser admin
  8. Go to the application properties for your application.
    1. Go to Applications > application-name.
    2. Click Configuration.
    3. Click Application Properties.
  9. Add a property for each token you created in the promote.properties when you ran the genWASTemplate script. Be sure to create a property for each token you specified. Creating a property at this level automatically creates the property in each environment for the application.
    1. In the Application Properties section, click Add Property.
    2. Name the property websphere.keyname The keyname corresponds to the key name you entered for the token. The websphere prefix is used as a filter properties that are to be used for token replacement.
    3. Repeat for each token.
  10. Set the property values for each token-derived property in each application environment. When you deploy the application, the environment specifies different properties for the environment.

    For example, if you use a different JDBC resource in the QA environment and Production environment for the application, you would do the following:

    1. Add a token when you run the genWASTemplate script, for example myappjdbchost=foo.mycom.com.
    2. Run createUCDObjects script.
    3. Add a websphere.myappjdbchost property to the application properties.
    4. Edit the environment properties for each environment to specify the host to use for JDBC resources in that environment. The host is specified as the value for property myappjdbchost.
      • QA environment (example): myappjdbchost is set to qa.mycom.com
      • Production environment (example): myappjdbchost is set to production.mycom.com

    Use the following procedure to change the environment property values in each environment.

    1. Go to Applications > application-name.
    2. Click Environments.
    3. Click the environment name.
    4. Click the Configuration tab.
    5. Click Environment Properties in the left panel.
    6. Scroll down to the Component Environment Properties section. The tokens you created appear as properties. Each key uses the default value you specified for the token.
    7. Edit the property value. Specify the value to be used in this environment.

Feedback