5 Configuring Resource Group Templates

This chapter describes how to configure resource group templates. The chapter refers to the Fusion Middleware, WebLogic Server, Coherence, and Oracle Traffic Director documentation sets and online for additional information as appropriate.

This chapter includes the following sections:

Configuring Resource Templates Groups: Overview

A resource group template is a named, domain-level collection of deployable resources intended to be used as a pattern by multiple resource groups. Each resource group that refers to ("references") a given template will have its own runtime copies of the resources defined in the template.

A resource group template is a convenient way to define and replicate resources for multiple tenants. Resource group templates make it very easy to deploy the same collection of applications and resources to multiple domain partitions.

Resource group templates are particularly useful in a SaaS environment where WebLogic Server Multitenant (MT) activates the same applications and resources multiple times, once per domain partition. Some of the information about such resources is the same across all domain partitions, while some of it, such as the attributes of a JMS queue or of a DB connection, varies from one partition to another.

You can create a resource group template in two ways:

  • Create a new resource group template. This creates the basic structure for the resource group template. You must then edit this resource group template as needed.

  • If you are using the WLS Administration Console, you can clone an existing resource group template. The configuration is copied from the template to the new resource group template. You must then edit and override values from the resource group template as needed.

This section describes the following topics:

What is the Difference Between a Resource Group Template and a Resource Group?

One major difference between resource group templates and resource groups is that resource group templates do not have targets. Because resource group templates are intended to be used as a pattern by multiple resource groups, possibly in many partitions, any target-specific information will most likely be unique to the resource group.

Therefore:

  • If you deploy applications to the resource group template, you cannot start the applications until the resource group template is referenced by a resource group.

  • You cannot start or stop a resource group template.

What is in a Resource Group Template?

Resource group templates are based on the ResourceGroupTemplateMBean and can include the following resources:

  • General (name)

  • Deployments

  • Services

    • JDBC

    • Messaging

    • Mail sessions

    • Persistent stores

    • Foreign JNDI providers

    • OSGi frameworks

    • Diagnostics

  • Notes

Resource Group Templates and Overrides

Resource overriding allows you to customize resources at the partition level.

You override resource settings that are derived from a resource group template as follows: 

  1. Create the resource group template.

  2. Deploy applications to the resource group template as needed.

  3. Define services in the resource group template as needed.

  4. Create a partition and then create a resource group that references the resource group template.

  5. Override values from the resource group template in the resource group.

You can override resource definitions in partitions using override configuration MBeans, resource deployment plans, and partition-specific application deployment plans. For a complete description of resource overrides, see Configuring Resource Overrides. For information on application overrides, see Deploying Applications to Partition Resource Groups.

Resource Group Template Example

Assume that you have a SaaS environment, and that you want to run an instance of a specific business application in three different partitions. This business application requires a pluggable database, which means you need one pluggable database per partition because each application instance needs it's own data isolated from the other application instances.

Assume further that the configuration for the pluggable databases will be identical for the three partitions, with the exception of the database name, user name, and password. For these values, you plan to use the values from Table 5-1.

Table 5-1 Example Pluggable Databases

PDB Name Username/Password For Use by

pdb1.example.com

pdbuser1/pdbuser1

Partition1

pdb2.example.com

pdbuser2/pdbuser2

Partition2

pdb3.example.com

pdbuser3/pdbuser3

Partition3


To configure your resource group template, follow these steps.

  1. Create a resource group template.

  2. Navigate to Services > JDBC.

  3. Create a JDBC system data source. For the purpose of this example, create a generic data source.

  4. Enter the configuration values for the JDBC data source.

  5. For the connection properties, use the following values.

    You will override these values in the resource groups that reference this resource group template. However, by entering initial values here you can test the database connection.

    • Enter the database name. For example, from Table 5-1 enter pdb1.example.com.

    • Enter the database user name. For example, from Table 5-1 enter pdbuser1.

    • Enter the password. For example, from Table 5-1 enter pdbuser1.

  6. Create your three partitions from Table 5-1, with resource groups based on the resource group template.

  7. For Partition1, you do not have to override any of the JDBC data source values because you used the correct values in the resource group template.

  8. For Partition2 and Partition3, override the database name, user name, and password with the correct values from Table 5-1.

    To do this using FMWC, navigate to Domain Partitions > Partition > Resource Overrides, as described in "WebLogic Server Resource Overrides" in Administering Oracle WebLogic Server with Fusion Middleware Control.

Creating Resource Group Templates: Main Steps and WLST Examples

To create a new resource group template:

  1. Navigate to Domain > Environment > Resource Group Templates.

  2. Create a new resource group template. The name must be unique in the domain.

These tasks are described in "Create resource group templates" in Administering Oracle WebLogic Server with Fusion Middleware Control.

The initial resource group template configuration is a basic skeleton and you must configure it before you can use it. The tasks include configuring JDBC system data sources, JMS servers and resources, foreign JNDI providers, and so forth.

See Configuring Resource Group Templates: Main Steps and WLST Examples for more information.

Creating Resource Groups: WLST Example

The following example:

  1. Creates a domain partition.

  2. Creates a virtual target.

  3. Sets the host name and URI prefix for the virtual target.

  4. Adds the virtual target as an available target in the partition.

  5. Creates the resource group.

  6. Adds the virtual target to the resource group.

  7. Create a resource group template.

  8. Associates the resource group with the resource group template.

  9. Activates the changes.

  10. Starts the partition.

    Note:

    If this is the first partition created in production mode, you must restart the Administration Server before you can start the partition.
# Create Pep partition resource group, and resource group template
edit()
startEdit()
wls:/base_domain/edit/ !> domain=getMBean('/')
wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep')
wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('VirtualTarget-0')
wls:/base_domain/edit/ !> vt.setHostNames(jarray.array([String('localhost')],String))
wls:/base_domain/edit/ !> vt.setUriPrefix('/foo')
wls:/base_domain/edit/ !> peppart.addAvailableTarget(vt)
wls:/base_domain/edit/ !> peprg=peppart.createResourceGroup('TestRG')
wls:/base_domain/edit/ !> peprg.addTarget(vt)
wls:/base_domain/edit/ !> peprgt=domain.createResourceGroupTemplate('TestRGT')
wls:/base_domain/edit/ !> peprg.setResourceGroupTemplate(peprgt)
wls:/base_domain/edit/ !> activate()
wls:/base_domain/edit/ !> startPartitionWait(peppart) 

Configuring Resource Group Templates: Main Steps and WLST Examples

This section describes how to configure resource group templates.

This section includes the following tasks:

Configure Resource Group Template Deployment Settings

To view and define resource group template deployment settings:

  1. Select the resource group template you want to configure.

  2. You can take the following deployment actions:

    • Deploy

    • Redeploy

    • Undeploy

    • Fetch deployment plan

  3. Save your changes.

These tasks are described in "Configure resource group template deployments" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Deploying Applications to Resource Group Templates.

Configure Resource Group Template Services Settings

This section describes how to configure resource group template services settings. The following topics are described:

Configure Resource Group Template JDBC Settings

To view configuration settings for the JDBC system resources that have been created in this resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > JDBC.

    The read-only JDBC information for a resource group includes:

    • Name

    • JNDI Name

    • Type

    • Algorithm Type

    • Row Prefetch Enabled

    • Row Prefetch Size

    • S team Chunk Size

  3. Create or delete the system data sources as needed.

  4. Save your changes.

For more information, see Configuring JDBC.

Configure Resource Group Template JMS settings

This section describes how to configure resource group template JMS settings.

This section includes the following tasks:

Configure JMS Server Settings

To view configuration settings for the JMS servers that have been created for this resource group template:

  1. Select the resource group you want to configure.

  2. Navigate to Services > Messaging > JMS Servers.

    The following read-only information is available for JMS servers already configured in this resource group template:

    • Name

    • Health

    • Health Reason

    • Persistent Store

    • Temporary Template Name

    • Bytes Maximum

    • Messages Maximum

    • Bytes Threshold High

    • Bytes Threshold Low

    • Messages Threshold High

  3. Create an delete JMS servers as needed.

  4. Save your changes.

These tasks are described in "WebLogic Server Messaging" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure SAF Agent Settings

To view configuration settings for the store-and-forward (SAF) agents that have been created for this resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Messaging > SAF Agents.

    The following read-only information is available for the SAF agents configured in this resource group template:

    • Name

    • Agent Type

    • Persistent Store

  3. Create or delete SAF Agents as needed.

  4. Save your changes.

These tasks are described in "Configure SAF Agent Settings" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure JMS Resource Settings

To monitor the resource settings for a resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Messaging > JMS Resources.

    The following read-only information is available for the JMS resources configured in this resource group template:

    • Name

    • Type

    • JMS Module Name

    • JNDI Name

    • Subdeployment

  3. Create or delete JMS resources as needed.

  4. Save your changes.

These tasks are described in "Configure SAF Agent Settings" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For information on configuring existing JMS resources, see Configuring Messaging.

Configure JMS Module Settings

To configure the JMS modules for a resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Messaging > JMS Modules > JMS Modules.

    The following read-only information is available for the JMS modules configured in this resource group template:

    • Name

    • Queues

    • Topics

    • Connection Factories

    • Distributed Queues

    • Distributed Topics

    • Foreign Servers

    • Quotas

    • SAF Error Handlers

    • SAF Imported Destinations

    • SAF Remote Contexts

    • Templates

    • Uniform Distributed Queues

    • Uniform Distributed Topics

    • Destination Keys

    • Type

  3. Create or delete JMS modules as needed.

  4. Save your changes.

These tasks are described in "Configure JMS module settings" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure Messaging Bridges

To configure the messaging bridge settings for a resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Messaging > Messaging Bridges.

    The following read-only information is available for the messaging bridges configured in this resource group template:

    • Name

    • Source Bridge Destination

    • Target Bridge Destination

  3. Create or delete messaging bridges as needed.

  4. Save your changes.

These tasks are described in "Configure messaging bridges" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure JMS Bridge Destinations

To configure the JMS bridge destination settings for a resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Messaging > Bridge Destinations.

    The following read-only information is available for the JMS bridge destinations configured in this resource group template:

    • Name

    • Adapter JNDI Name

  3. Create or delete JMS bridge destinations as needed.

  4. Save your changes.

These tasks are described in "Configure JMS bridge destinations" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure Path Services

To configure the path services settings for a resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Messaging > Path Services.

    The following read-only information is available for the path services configured in this resource group template:

    • Name

    • Persistent Store

  3. Create or delete path services as needed.

  4. Save your changes.

These tasks are described in "Configure path services" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure Resource Group Mail Session Settings

To view configuration settings for the mail sessions that have been created in this resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Mail.

    The following read-only information is available for mail sessions configured in this resource group template:

    • Name

    • JNDI Name

  3. Create or delete mail sessions as needed.

  4. Save your changes.

These tasks are described in "WebLogic Server Mail Sessions" in Administering Oracle WebLogic Server with Fusion Middleware Control.

Configure Resource Group Persistent Store Settings

To view configuration settings for the persistent stores that have been created in this resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Persistent Stores.

    The following read-only information is available for the persistent stores configured in this resource group template:

    • Name

    • Type

  3. Create or delete persistent stores as needed.

  4. Save your changes.

These tasks are described in "WebLogic Server Persistent Stores" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring Messaging.

Configure Resource Group Foreign JNDI Provider Settings

To view configuration settings for the foreign JNDI providers that have been created in this resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Foreign JNDI Providers.

    The following read-only information is available for the foreign JNDI providers configured in this resource group template:

    • Name

    • Initial Context Factory

    • Provider URL

    • User

    • Targets

  3. Create or delete foreign JNDI providers as needed.

  4. Save your changes.

These tasks are described in "WebLogic Server Foreign JNDI Providers" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Configuring and Programming JNDI.

Configure Resource Group Diagnostic System Module Settings

To view configuration settings for the diagnostic system modules that have been created in this resource group template:

  1. Select the resource group template you want to configure.

  2. Navigate to Services > Diagnostics.

    The following read-only information is available for the diagnostic system modules configured in this resource group template:

    • Name

    • Description

    • Targets

  3. Create or delete diagnostic system modules as needed.

  4. Save your changes.

These tasks are described in "WebLogic Server Diagnostics" in Administering Oracle WebLogic Server with Fusion Middleware Control.

For more information, see Monitoring and Debugging Partitions.

Configure Resource Group Template Notes

To create notes for a resource group template:

  1. Select the resource group you want to configure.

  2. Navigate to Notes.

  3. Enter your notes.

  4. Save your changes.

Configuring Resource Group Template: WLST Example

The following example:

  1. Creates a domain partition.

  2. Creates a virtual target.

  3. Sets the host name and URI prefix for the virtual target.

  4. Adds the virtual target as an available target in the partition.

  5. Creates the resource group.

  6. Adds the virtual target to the resource group.

  7. Create a resource group template.

  8. Deploys the application MySimpleEjb to the resource group template.

  9. Associates the resource group with the resource group template.

  10. Activates the changes.

  11. Starts the partition.

    Note:

    If this is the first partition created in production mode, you must restart the Administration Server before you can start the partition.
# Create Pep partition resource group, and resource group template
edit()
startEdit()
wls:/base_domain/edit/ !> domain=getMBean('/')
wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep')
wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('VirtualTarget-0')
wls:/base_domain/edit/ !> vt.setHostNames(jarray.array([String('localhost')],String))
wls:/base_domain/edit/ !> vt.setUriPrefix('/foo')
wls:/base_domain/edit/ !> peppart.addAvailableTarget(vt)
wls:/base_domain/edit/ !> peprg=peppart.createResourceGroup('TestRG')
wls:/base_domain/edit/ !> peprg.addTarget(vt)
wls:/base_domain/edit/ !> peprgt=domain.createResourceGroupTemplate('TestRGT')
wls:/base_domain/edit/ !> deploy(appName='MySimpleEJB', path='c:/webservices/MySimpleEjb.jar', resourceGroupTemplate='TestRGT')
wls:/base_domain/edit/ !> peprg.setResourceGroupTemplate(peprgt)
wls:/base_domain/edit/ !> activate()
wls:/base_domain/edit/ !> startPartitionWait(peppart) 

Deleting a Resource Group Template: Main Steps and WLST Examples

If a resource group template is referenced by resource groups, you need to remove the references before deleting this resource group template.

  1. Select the resource group you want to delete.

  2. Delete the resource group.

Deleting Resource Group Templates: WLST Example

The following example:

  1. Creates a domain partition.

  2. Creates a virtual target.

  3. Sets the host name and URI prefix for the virtual target.

  4. Adds the virtual target as an available target in the partition.

  5. Creates the resource group.

  6. Adds the virtual target to the resource group.

  7. Create a resource group template.

  8. Associates the resource group with the resource group template.

  9. Unsets the resource group template from the resource group.

  10. Deletes the resource group template from the domain.

  11. Activates the changes.

  12. Starts the partition.

    Note:

    If this is the first partition created in production mode, you must restart the Administration Server before you can start the partition.
# Create Pep partition resource group, and resource group template
edit()
startEdit()
wls:/base_domain/edit/ !> domain=getMBean('/')
wls:/base_domain/edit/ !> peppart=domain.createPartition('Pep')
wls:/base_domain/edit/ !> vt=domain.createVirtualTarget('VirtualTarget-0')
wls:/base_domain/edit/ !> vt.setHostNames(jarray.array([String('localhost')],String))
wls:/base_domain/edit/ !> vt.setUriPrefix('/foo')
wls:/base_domain/edit/ !> peppart.addAvailableTarget(vt)
wls:/base_domain/edit/ !> peprg=peppart.createResourceGroup('TestRG')
wls:/base_domain/edit/ !> peprg.addTarget(vt)
wls:/base_domain/edit/ !> peprgt=domain.createResourceGroupTemplate('TestRGT')
wls:/base_domain/edit/ !> peprg.setResourceGroupTemplate(peprgt)
wls:/base_domain/edit/ !> peprg.unSet('ResourceGroupTemplate')
wls:/base_domain/edit/ !> domain.destroyResourceGroupTemplate(peprgt)
wls:/base_domain/edit/ !> activate()
wls:/base_domain/edit/ !> startPartitionWait(peppart) 

Configuring Resource Group Templates: Related Tasks and Links

See the following sections for additional information related to resource group templates: