6 Defining and Managing Cloud Policies

This chapter describes the process to define policies for different target types and perform specific actions on virtualization targets. It contains the following sections:

6.1 Managing Cloud Policies

Cloud management policies are rules that a EM_CLOUD_ADMINISTRATOR can define to take certain actions based on either performance metric thresholds or based on a schedule. You can create your own policies or use the ready-to-use policies. The ready-to-use policies provided by Oracle cannot be edited but you can do a create like cloning of the policy and then edit it as required.

Note:

A self service user (EM_SSA_USER) can also create cloud policies for the services for which he has been granted access..

There are two kinds of cloud management polices: Performance-based policies and Schedule-based policies. Performance policies are based on the performance metrics of a specific type of target. Schedule based policies are executed based on the schedule you have defined. You can group one or more policies together to form policy groups. You can:

  • View and Monitor Cloud Policies

  • Define a new policy which can be of the following types:

    • Performance Policy

    • Schedule Policy

  • Activate or Deactivate a Policy

  • Define Policy Groups

6.2 Viewing Cloud Policies

You can view all the cloud policies and policy groups from the Cloud Policy Home page. You can view details like the status of the policy, type of policy, action type, policy associations and the schedule for the policy.

  1. Log in to Enterprise Manager as a user with the EM_CLOUD_ADMINISTRATOR role and from the Enterprise menu, select Cloud, then select Infrastructure Policies.

    Note:

    if you have logged into as a user with the EM_SSA_USER role, click the Policies tab in the Infrastructure Cloud Self Service Portal.
  2. On the Policy Home page, you will see a list of a policies that you own and for which you have administration privileges.

    Figure 6-1 Cloud Policies

    Cloud Policies
  3. Select a policy from the table. The policy details including the type of policy, performance (rule, action, action description), or schedule (schedule, action and action description), the status, date on which it was created, and the target type are displayed.

  4. You can perform the following actions on this page:

    • Create: To create a new policy, from the Create menu, select either of the following:

    • Create Like: Select a policy and click Create Like to make a copy of an existing policy.

    • Edit: Select a policy and click Edit to launch the Edit Policy wizard. You can modify the description of the policy and add metrics to the policy. You cannot change the name of the policy, the type of policy, the target with which the policy is associated, and the actions that can be performed.

    • Activate or Deactivate a Policy: See Section 6.6, "Activating and Deactivating Policies".

    • Create Policy Associations: In the Associations region, you can view a list of targets that have been associated with a selected policy. A policy can be associated with one or more targets. Click Add. In the Search and Select: Targets window, choose a target and click Select to associate the target with the policy. After you have associated one or more targets with the policy, you can:

      • Click on a target to drill down to the Policies page for the target. See Section 6.3, "Viewing Policies for a Target".

      • Select a target and click View History to view the Policy Action History.

      • Select a policy and click Remove to delete the associations for the policy.

    • Note:

      • Associations cannot be added for inactive policies.

      • The View History option is not available for users with the EM_SSA_USER role.

6.3 Viewing Policies for a Target

After you have associated a target with a policy, you can view all policies that can be associated with a target on the Policies page.

To view policies that can be associated with a selected target, follow these steps:

  1. Navigate to the Cloud Policies page.

  2. Select a policy from the list of active policies in the list. In the Associations region, click on a target link to drill down to the Policies page for the target.

    Figure 6-2 Policies - Target

    Policies - Target
  3. All policies that can be associated with the selected target are listed on this page. For each policy, the type of policy association that has been defined is displayed. This can be:

    • Standalone

    • Template Collection

    • Policy Group

    For each policy, the following details are displayed:

    • Name and description of the policy.

    • The type of policy which can be Schedule or Performance.

    • The policy association method. A policy can be associated with a standalone association, template collection, a policy group or a combination of the three.

    • The General section displays details like status of the policy, the number of associations, the date on which the policy was created, and the type of policy.

    • The Policy Action History region shows the history of associations for this target.

      Note:

      • The history of policy associations is displayed only for users with the EM_CLOUD_ADMINISTRATOR role.

      • The Policy Action History region is blank if the action has a Failed status.

  4. For policies that are active, you can do the following:

    • Select a policy and click Associate to associate it with the target.

    • Select a policy that has already been associated and click Disassociate to delete the policy association.

6.4 Defining a Performance Policy

Performance policies are formed based on the performance metrics of a specific target type and its associated targets. You can create conditions and rules for the policy based on the metrics.

To define a performance policy, follow these steps:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. On the Policy Home page, you will see a list of policies that you own and for which you have administration privileges.

  3. From the Create menu, select Performance Policy.

  4. In the General Information page, enter the name and description of the policy. Select the Target Type with which the policy is to be associated.

    Figure 6-3 Create Performance Policy - General

    Create Performance Policy: General
  5. Click Next. In the Rule page, select a metric from the right panel and click Add to Definition, or drag and drop metric from the Metrics column to the Definition column. Specify the condition, value, and number of occurrences. In the Match radio button, you can select

    • All: All conditions must be met before the policy is executed on the target.

    • Any: Any of the conditions must be met for the policy to be executed.

    Figure 6-4 Create Performance Policy - Rule

    Create Performance Policy: Rule
  6. Click Next. Specify the action to be performed when the policy condition is met. The list of available actions can vary depending on the selected target type.

    If notifications are disabled, you will see the following message:

    Notification action is currently disabled. Contact your system administrator to set up the email server information.

    Figure 6-5 Create Performance Policy - Action

    Create Performance Policy: Action
  7. Review the policy and click Save to define this policy and return to the Policy Home page.

    Note:

    After you have defined the policy, you can associate one or more targets with the policy.

6.5 Defining a Schedule-Based Policy

Schedules based on policies are based on a predefined schedule. To define a schedule-based policy, follow these steps:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. On the Policy Home page, you will see a list of a policies that you own and for which you have administration privileges. From the Create menu, select Schedule Policy.

    Figure 6-6 Create Schedule Policy

    Create Schedule Policy
  3. In the Create Schedule Policy page, enter the name, description of the policy, and the Target Type with which the policy is to be associated.

  4. Specify the Grace Period, frequency, and schedule for the policy.

  5. When the policy conditions are met, the policy is executed as per the schedule on the selected target. The list of available actions can vary depending on the target type with which the policy is associated.

  6. Click Save to define this policy.

    Note:

    After you have defined the policy, you can associate one or more targets with the policy.

6.6 Activating and Deactivating Policies

Once a policy is defined, it becomes active and can be applied to one or more targets. You can deactivate an active policy by following these steps:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. On the Policy Home page, you will see a list of a policies that you own and have administration privileges.

  3. Select a policy from the table and click Deactivate. The policy is deactivated and the status of the policy is marked as Inactive. You cannot associate this policy to any target until it is activated and its current associations will be suspended for further evaluations.

Once a policy is deactivated, it is marked as Inactive. To activate an Inactive Policy, select the policy from the table and click Activate. In the confirmation window, click Activate again. The policy is now marked as Active.

6.7 Viewing Policy Groups

A policy group is a collection of policies that can be applied together and evaluated to generate a compliance score. To view the policy groups, follow these steps:

  1. Log in to Enterprise Manager as a user with the EM_CLOUD_ADMINISTRATOR role and from the Enterprise menu, select Cloud, then select Infrastructure Policies.

    Note:

    if you have logged into as a user with the EM_SSA_USER role, click the Policies tab in the Infrastructure Cloud Self Service Portal.
  2. The Cloud Policies page appears. Click on the Policy Groups tab.

    Figure 6-7 Policy Groups

    Viewing Policy Groups
  3. The list of policy groups that have already been defined are displayed. You can do the following:

    • Create a Policy Group: See Section 6.8, "Creating a Policy Group".

    • Create Like: Select a policy group and click Create Like to make a copy of an existing policy group.

    • Edit: Select a policy group and click Edit to launch the Edit Policy Group wizard. You can add or remove policies from the policy group. You cannot modify the name of the policy group.

    • Delete: Select a policy group and click Delete. When a policy group is deleted, all associations defined for the policy group will also be deleted.

      Note:

      You can edit or delete policy groups that you have created or for which you have the privileges.
    • Create Policy Group Associations: Click the Associations tab in the Policy Group region, to view a list of targets that have been associated with the selected policy group.

      Figure 6-8 Policy Group: Associations

      Policy Group: Associations

      A policy group can be associated with one or more targets. Click Add. In the Search and Select: Targets window, choose a target and click Select to associate the target with the policy group. After you have associated one or more targets with the policy group, you can:

      • Click on a target to drill down to the Policies page for the target. See Section 6.3, "Viewing Policies for a Target".

      • Select a target and click View History to view the Policy Group Action History.

      • Select a target and click Remove to delete the policy group association.

    • View Policies: Click the Policies Included tab in the Policy Group region to view the list of policies included in the policy group.

      Figure 6-9 Policy Group: Policies Included

      Policy Group: Policies Included

6.8 Creating a Policy Group

To define a policy group, follow these steps:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. Click on the Policy Groups tab. On the Policy Groups page, you will see a list of a policy groups that have been defined.

  3. Click Create. The Create Policy Group page appears.

    Figure 6-10 Policy Group: Create

    Policy Group: Create
  4. Click Add. A list of policies that can be added to the policy group are displayed. Select one or more policies from the list and click Select.

  5. The selected policies will be added to the policy group. Click OK to save this policy group.

  6. Click OK to save this policy group.

6.8.1 Example 1

If you want to shut down a guest virtual machine every Friday at 6:00 pm and restart it every Monday at 9:00 pm, you can create policies as follows:

6.8.1.1 Policy for Shutting Down Guest Virtual Machine

To shut down a guest virtual machine every Friday, you can set up the policy as follows:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. In the Cloud Policies page, select Schedule Policy from the Create menu. In the Create Schedule Policy page, enter the following details:

    • Enter a name and description for the policy.

    • Select the Target Type as Oracle VM Guest.

    • Select Stop in the Policy Action field.

    • In the Start field, specify the date and time from which this policy should be effective.

    • In the Repeat field, select Specific Days of the Week and select Friday in the Days of Week checkbox.

    Figure 6-11 Create Schedule Policy (Example 1)

    Create Schedule Policy (Example 2)
  3. Click OK to save this policy and return to the Cloud Policies page.

6.8.1.2 Policy for Starting Up Guest Virtual Machine

To start a guest virtual machine every Monday, navigate to the Cloud Policy page and select the policy you just created. Perform the following steps:

  1. Click Create Like to make a copy of the policy.

  2. In the Cloud Policies page, select Schedule Policy from the Create menu. In the Create Schedule Policy page, enter the following details:

    • Enter a name and description for the policy.

    • Select the Target Type as Oracle VM Guest.

    • Select Start in the Policy Action field.

    • In the Start field, specify the date and time from which this policy should be effective.

    • In the Repeat field, select Specific Days of the Week and select Monday in the Days of Week checkbox.

  3. Click OK to save this policy and return to the Cloud Policies page.

6.8.1.3 Creating a Policy Group (Start Up and Shut Down)

After defining the two policies for the guest virtual machine target type, you can combine these policies into a policy group and associate these policies to one or more targets. To create a policy group, follow these steps:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. On the Cloud Policies page, click the Policy Groups tab.

  3. Click Create. The Cloud Policy Group page appears.

  4. Enter a name and description for the group.

  5. Click Add and select the two schedule policies that you have created.

  6. Click OK to return to the Cloud Policies page and click on the Policy Group that you have created.

  7. The details of the policy group that you have created such as the name of the policy group, number of policies associated with this group, number of targets associated, and so on are displayed.

  8. Click the Policies Included tab in the bottom region to view the policies associated with this policy group.

  9. Click the Associations tab to view the list of guest virtual machines associated with this policy. Click Add to associate more guest virtual machines with this policy group.

  10. When this policy group is active, the guest virtual machines associated with the policies are shut down and started up as per the schedule.

6.8.2 Example 2

Suppose you want to define a policy group for an Oracle Tier Instance target where the tier instance is scaled down to 1 every Friday and scaled up to 2 every Monday. You can create the following policies:

6.8.2.1 Policy to Scale Down a Tier Instance

To scale down a tier instance every Friday, you can set up a performance policy as follows:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. In the Cloud Policies page, select Schedule Policy from the Create menu. The Create Schedule Policy page appears.

    Figure 6-12 Schedule Policy Example I

    Schedule Policy Example I
  3. Enter a name and description for the policy and specify the following details:

    • Target Type: Select the Tier Instance target type.

    • Policy Action: Select the Scale Down policy action.

    • Repeat: In the Repeat field, select Specify Days of the Week.

    • Days of the Week: Select Friday here.

  4. Click OK to save the policy.

6.8.2.2 Policy to Scale Up a Tier Instance

To scale down a tier instance every Friday, you can set up a performance policy as follows:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. In the Cloud Policies page, select Schedule Policy from the Create menu. The Create Schedule Policy page appears.

    Figure 6-13 Schedule Policy Example II

    Schedule Policy Example II
  3. Enter a name and description for the policy and specify the following details:

    • Target Type: Select the Tier Instance target type.

    • Policy Action: Select the Scale Up policy action.

    • Action Parameters: Enter 2 for the Number of Nodes parameter.

    • Repeat: In the Repeat field, select Specify Days of the Week.

    • Days of the Week: Select Monday here.

  4. Click OK to save the policy.

6.8.2.3 Creating a Policy Group (Scale Up and Scale Down)

After defining the two policies for the Oracle Tier Instance target type, you can combine these policies into a policy group and associate these policies to one or more targets. To create a policy group, follow these steps:

  1. Depending on your user role, use the menu options to navigate to the Infrastructure Policies page.

  2. On the Cloud Policies page, click the Policy Groups tab.

  3. Click Create. The Cloud Policy Group page appears.

  4. Enter a name and description for the group.

  5. Click Add and select the two schedule policies that you have created.

  6. Click OK to return to the Cloud Policies page and click on the Policy Group that you have created.

6.9 DRS and DPM Policies

The Dynamic Resource Scheduling (DRS) and Distributed Power Management (DPM) policies are automated policies that improve quality of service and reduce power consumption by dynamically relocating running virtual machines within a server pool based on the load.

Dynamic Resource Scheduling (DRS) policies provide real-time monitoring of Oracle VM Server utilization to rebalance a server pool and provide consistent resources to the running virtual machines. DRS migrates VMs away from heavily loaded Oracle VM Servers to those servers with more resources available.

Distributed Power Management (DPM) policies optimize the server pool for minimum power consumption. DPM complements DRS by reducing the number of powered-on servers in the pool when there are periods of low resource utilization. It can automatically power-on capacity as needed when resource utilization ramps up.

To set up a DRS / DPM policy, follow these steps:

  1. Log in as a user with the EM_CLOUD_ADMINISTRATOR role, and from the Enterprise menu, select Cloud, then select Infrastructure Home.

  2. Right click on a VM Server Pool target in the left panel and select Manage DRS/DPM Policies. Click Configure. The Configure DRS/DPM General page appears.

    Figure 6-14 Configure DRS/DPM: General

    Configure DRS/DPM: General Page
  3. Select the Policy Type. This can be:

    • Distributed Resource Scheduler: Select this policy type to optimize virtual machine resource utilization in a server pool.

    • Distributed Power Management: Select this policy type to increase the consolidation ratio to use fewer Oracle VM Servers during periods of relative low resource utilization.

  4. Specify the Time Period (Minutes). This is the time period for the policy job to run. This sets the policy job to run every n minutes, for example, 10 sets the policy job to run every 10 minutes. You can enter a number between 1 and 60.

  5. Click Add in the Virtual Servers region to add one or more virtual server targets for which the policy is to be enabled.

  6. Specify the Constraints for the Virtual Server CPU as follows:

    • Enable: Set this field to enable or disable logging of CPU performance and utilization.

    • Threshold: The maximum amount of CPU percentage usage allowed before the policy must be enacted. You can enter between 0 and 99.

  7. Click Next. The Configure DRS/DPM Network page appears.

    Figure 6-15 Configure DRS/DPM Policies: Network

    Configure DRS/DPM Policies: Network Page
  8. Select the Enable checkbox to indicate whether the policy is to be enabled on the network, and select the threshold at which the policy is to be enacted for the network.

  9. Click Apply.

Note:

Once the policy is created, it is enabled and applicable to all the virtual server pool targets that have been included in the policy. To disable the DRS/DPM policy, create a schedule based policy for the Oracle VM Server Pool target type and in the Policy Action field, select Disable DRS/DPM policies. See Section 6.5, "Defining a Schedule-Based Policy" for more details on creating a schedule based policy. You can enable the policy by editing the Schedule Policy and select Enable DRS or Enable DPM as necessary.

6.9.1 Creating Automated DRS and DPM Policies

You can create automated DRS or DPM policies by following these steps:

  1. Log in as a user with the EM_CLOUD_ADMINISTRATOR role and from the Enterprise menu, select Cloud, then select Infrastructure Policies.

  2. From the Create menu, select Schedule Policy.

  3. In the Create Schedule Policy page, enter a name and description for the policy.

  4. Select Oracle VM Server Pool as the Target Type.

  5. Select Enable DRS or Enable DPM Policy from the Policy Action field.

  6. Specify the schedule and frequency for the policy and click OK to save the policy.

  7. In the Cloud Policies page, select the policy you have created and click Add in the Associations region.

  8. Select the Oracle VM Server Pool target with which the policy is to be associated and click Select.

  9. The DRM or DPM policy is now automatically enabled for the selected target.