# WLOC Administration Console Online Help

# Define and assign policies

WLOC policies specify deployment and runtime requirements (constraints or rules) for a service and actions to take when the service operates outside of the constraints. These policies define service level agreements (SLAs) for your services. For example, you can define a policy that increases the amount of memory available if the memory requirements for a specific JVM grows beyond a specified number of MBs. See also Defining Policies.

Policy Types

You can define the following types of policies:

Policy Type | Description
--- | ---
Deployment | Deploy or undeploy services or processes based on specific events or resource agreements. The deployment policies ensure that the minimum deployment requirements are satisfied when the JVM starts.
Runtime | Monitor application processes and trigger actions when SLAs are not being met.
Administration | Send notifications based on an event or system health and performance.

Constraints and Actions

Each policy consists of two parts:

- Single constraint or rule

- Action or action pipeline

A constraint (or rule) specifies a deployment or runtime requirement for a service or process group. Typically, constraints are defined in terms of attributes on JMX objects. WLOC provides a set of named constraints (via a preconfigured Smart Pack) that can be used to simplify the policy declarations. You can configure additional constraints based on run-time or calendar-based values.

An action is a Java class that can run in the WLOC Controller or in an Agent. WLOC provides a collection of actions that you configure. These actions can display alert messages in the Console, send notifications, start and stop a service, or request additional computing resources from hypervisor software. You can combine actions into an action pipeline, which specifies a sequence of actions to invoke. You can create policies that invoke actions or action pipelines, or you can invoke actions and action pipelines directly from the WLOC Administration Console.

You can configure an action or action pipeline to require your confirmation before it begins executing. When an adjudicated action requires your input, the WLOC Administration Console raises an alert. If you are logged into the WLOC Administration Console at the time that the adjudication request is sent, a pop-up displays requesting your confirmation (if popups are enabled, as described in Set console preferences). Additionally, the request appears on the Pending Approvals tab on the Events page and a message displays in the Tasks and Events viewer indicating that there is a pending approval (until there are no more pending approvals). For more information about viewing events and pending approvals, see Monitor events.

Scope of a Policy

Each policy constraint and action that you define is designed to apply in a specific scope: global (system), service, or process group. You do not explicitly specify the scope when adding constraints and actions. However, when assigining the policy, you should be careful to match constraints and actions that share the same scope, and assign the policy to a component that shares the same scope. The WLOC Administration Console wil help guide you through the assignment process. For a summary of contraints and actions by scope, see Defining Policies.

Note: Notification actions can be matched with any type of constraint. You can assign a component with a higher-level scope to a policy with a lower-level scope. For example, you can assign process group scoped policy to a service. In this case, the policy applies to all process groups in the service.

See Define constraints for information about the actions that are valid for each type of constraint.

Steps to Define Policies

The following list the main steps for defining SLAs and actions to take when services perform outside of configured constraints:

1. Define the actions, action pipelines, and constraints for the policies, as described in the following sections:

   - Define constraints

   - Define constraints using named constraints (Smart Pack)

   - Define custom metrics

   - Define actions

   - Define action pipelines

2. Perform one or more of the following tasks, as required:

   - Assign policies to services

   - Quickly define and assign process policies based on MBean attributes

   - Run actions

   - Run action pipelines

   - Approve or deny actions

Related Tasks

- Modify constraints
- Modify actions
- Modify action pipelines
- Delete constraints
- Delete actions
- Delete action pipelines
- Unassign a policy