4 Configuring Resource Group Templates

Resource group templates are particularly useful in a Software-as-a-Service environment where WebLogic Server Multitenant (MT) activates the same applications and resources multiple times, once per domain partition.

Note:

WebLogic Server Multitenant domain partitions, resource groups, resource group templates, virtual targets, and Resource Consumption Management are deprecated in WebLogic Server 12.2.1.4.0 and will be removed in the next release.

This chapter includes the following sections:

About Resource Group Templates

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. Some of the information about such resources is the same across all domain partitions, while some of it, such as the attributes of a Java Message Service (JMS) queue or of a database 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 Oracle WebLogic Server Administration Console, then you can clone (copy) 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.

For more information about resource group templates, see 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 only 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, then 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

    • Java Database Connectivity (JDBC)

    • Messaging

    • Mail sessions

    • Persistent stores

    • Foreign Java Naming and Directory (JNDI) providers

    • OSGi frameworks

    • Diagnostics

  • Notes

Resource Group Templates and Overrides

Overriding resources lets you 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 the 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 more information about resource overrides, see Configuring Resource Overrides. For information about 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 its 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, plan to use the values from Table 4-1.

Table 4-1 Example Pluggable Databases

PDB Name User name/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. Go 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 4-1 enter pdb1.example.com.

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

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

  6. Create your three partitions from Table 4-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 4-1.

    To do this using Oracle Enterprise Manager Fusion Middleware Control, go 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

Creating a new resource group template provides only its basic structure. After you create a resource group template, you must configure its resources.

To create a new resource group template:

  1. Go 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.

For information about configuring resource group templates, see Configuring Resource Group Templates: Main Steps and WLST Examples.

Creating Resource Groups: WLST Example

The example does the following:

  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. Creates 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, then 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

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

For detailed information about configuring resource group templates, see the following tasks:

Configuring Resource Group Template Deployment Settings

To view and define resource group template deployment settings:

  1. Select the resource group template that 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.

See Deploying Applications to Resource Group Templates.

Configuring Resource Group Template Services Settings

This section includes the following tasks:

Configuring 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 that you want to configure.
  2. Go 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

    • Stream chunk size

  3. Create or delete the system data sources as needed.
  4. Save your changes.
Configuring Resource Group Template JMS settings
Configuring 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 that you want to configure.
  2. Go 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 or 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.

See Configuring Messaging.

Configuring 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 that you want to configure.
  2. Go 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.

See Configuring Messaging.

Configuring JMS Resource Settings

To monitor the resource settings for a resource group template:

  1. Select the resource group template that you want to configure.
  2. Go 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 about configuring existing JMS resources, see Configuring Messaging.

Configuring JMS Module Settings

To configure the JMS modules for a resource group template:

  1. Select the resource group template that you want to configure.
  2. Go 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.

See Configuring Messaging.

Configuring Messaging Bridges

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

  1. Select the resource group template that you want to configure.
  2. Go 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.

See Configuring Messaging.

Configuring JMS Bridge Destinations

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

  1. Select the resource group template that you want to configure.
  2. Go 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.

See Configuring Messaging.

Configuring Path Services

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

  1. Select the resource group template that you want to configure.
  2. Go 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.

See Configuring Messaging.

Configuring 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 that you want to configure.
  2. Go 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.

Configuring 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 that you want to configure.
  2. Go 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.

See Configuring Messaging.

Configuring 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 that you want to configure.
  2. Go 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.

See Configuring and Programming JNDI.

Configuring 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 that you want to configure.
  2. Go 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.

See Monitoring and Debugging Partitions.

Configuring Resource Group Template Notes

To create notes for a resource group template:

  1. Select the resource group that you want to configure.
  2. Go to Notes.
  3. Enter your notes.
  4. Save your changes.

Configuring Resource Group Template: WLST Example

The example does the following:

  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. Creates 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, then 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 Resource Group Templates: Main Steps and WLST Examples

Deleting a resource group template permanently removes it from the domain's configuration. When you delete a resource group template, all of the applications deployed to the resource group template are undeployed. You cannot delete a resource group template that is being referenced by one or more resource groups. You must first remove the references to the resource group template before you can delete it.

  1. Select the referencing resource groups of the resource group template that you want to delete.

  2. Delete the resource groups.

  3. Delete the resource group template.

Deleting Resource Group Templates: WLST Example

The example does the following:

  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, then 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