Sun Cluster Data Services Planning and Administration Guide for Solaris OS

Upgrading a Resource Type

Upgrading a resource type enables you to use new features that are introduced in the new version of the resource type. A new version of a resource type might differ from a previous version in the following ways.

Upgrading a resource type involves the tasks that are explained in the following sections:

  1. How to Install and Register an Upgrade of a Resource Type

  2. How to Migrate Existing Resources to a New Version of the Resource Type

ProcedureHow to Install and Register an Upgrade of a Resource Type

The instructions that follow explain how to use the scrgadm(1M) command to perform this task. However, you are not restricted to using the scrgadm command for this task. Instead of the scrgadm command, you can use SunPlex Manager or the Resource Group option of the scsetup(1M) command to perform this task.

Before You Begin

Consult the documentation for the resource type to determine what you must do before installing the upgrade package on a node. One action from the following list will be required:

If you must reboot the node in noncluster mode, prevent a loss of service by performing a rolling upgrade. In a rolling upgrade, you install the package on each node individually while leaving the remaining nodes running in cluster mode.

Steps
  1. Become superuser or assume an equivalent role.

  2. Install the package for the resource type upgrade on all cluster nodes where instances of the resource type are to be brought online.

  3. Register the new version of the resource type.

    To ensure that the correct version of the resource type is registered, you must specify the following information:

    • The resource type name

    • The resource type registration (RTR) file that defines the resource type


    # scrgadm -a -t resource-type-name -f path-to-new-rtr-file
    

    The format of the resource type name is as follows:

    vendor-id.base-rt-name:rt-version
    

    For an explanation of this format, see Format of Resource Type Names.

  4. Display the newly registered resource type.


    # scrgadm -pv -t resource-type-name
    
  5. If necessary, set the Installed_nodes property to the nodes where the package for the resource type upgrade is installed.

    You must perform this step if the package for the resource type upgrade is not installed on all cluster nodes.

    The nodelist property of all resource groups that contain instances of the resource type must be a subset of the Installed_nodes property of the resource type.


    # scrgadm -c -t resource-type -h installed-node-list
    

ProcedureHow to Migrate Existing Resources to a New Version of the Resource Type

The instructions that follow explain how to use the scrgadm(1M) command to perform this task. However, you are not restricted to using the scrgadm command for this task. Instead of the scrgadm command, you can use SunPlex Manager or the Resource Group option of the scsetup(1M) command to perform this task.

Before You Begin

Consult the instructions for upgrading the resource type to determine when you can migrate resources to a new version of the resource type.

The instructions might state that you cannot upgrade your existing version of the resource. If you cannot migrate the resource, consider the following alternatives:

Steps
  1. Become superuser or assume an equivalent role.

  2. For each resource of the resource type that is to be migrated, change the state of the resource or its resource group to the appropriate state.

    • If you can migrate the resource at any time, no action is required.

    • If you can migrate the resource only when the resource is unmonitored, type the following command:


      # scswitch -M -n -j resource
      
    • If you can migrate the resource only when the resource is offline, type the following command:


      # scswitch -n -j resource
      

      Note –

      If other resources depend on the resource that you are migrating, this step fails. In this situation, consult the error message that is printed to determine the names of the dependent resources. Then repeat this step, specifying a comma-separated list that contains the resource that you are migrating and any dependent resources.


    • If you can migrate the resource only when the resource is disabled, type the following command:


      # scswitch -n -j resource
      

      Note –

      If other resources depend on the resource that you are migrating, this step fails. In this situation, consult the error message that is printed to determine the names of the dependent resources. Then repeat this step, specifying a comma-separated list that contains the resource that you are migrating and any dependent resources.


    • If you can migrate the resource only when the resource group is unmanaged, type the following commands:


      # scswitch -n -j resource-list
      # scswitch -F -g resource-group
      # scswitch -u -g resource-group
      

      The replaceable items in these commands are as follows:

      resource-list

      Specifies a comma-separated list of all resources in the resource group that is to be unmanaged.

      resource-group

      Specifies the resource group that is to be unmanaged.


      Note –

      You can specify the resources in resource-list in any order. The scswitch command disables the resources in the order that is required to satisfy dependencies between the resources, regardless of their order in resource-list.


  3. For each resource of the resource type that is to be migrated, change the Type_version property to the new version.

    If necessary, set other properties of the same resource to appropriate values in the same command. To set these properties, specify additional -x options or -y options in the command.

    To determine whether you are required to set other properties, consult the instructions for upgrading the resource type. You might be required to set other properties for the following reasons:

    • An extension property has been introduced in the new version of the resource type.

    • The default value of an existing property has been changed in the new version of the resource type.


    # scrgadm -c -j resource -y Type_version=new-version \
    [-x extension-property=new-value][ -y standard-property=new-value]

    Note –

    If the existing version of the resource type does not support upgrades to the new version, this step fails.


  4. Restore the previous state of the resource or resource group by reversing the command that you typed in Step 2.

    • If you can migrate the resource at any time, no action is required.


      Note –

      After migrating a resource that can be migrated at any time, the resource probe might not display the correct resource type version. In this situation, disable and re-enable the resource's fault monitor to ensure that the resource probe displays the correct resource type version.


    • If you can migrate the resource only when the resource is unmonitored, type the following command:


      # scswitch -M -e -j resource
      
    • If you can migrate the resource only when the resource is offline, type the following command:


      # scswitch -e -j resource
      

      Note –

      If you disabled in Step 2 other resources that depend on the resource that you are migrating, enable the dependent resources also.


    • If you can migrate the resource only when the resource is disabled, type the following command:


      # scswitch -e -j resource
      

      Note –

      If you disabled in Step 2 other resources that depend on the resource that you are migrating, enable the dependent resources also.


    • If you can migrate the resource only when the resource group is unmanaged, type the following commands:


      # scswitch -e -j resource-list
      # scswitch -o -g resource-group
      # scswitch -z -g resource-group
      

Example 2–2 Migrating a Resource That Can Be Migrated Only When Offline

This example shows the migration of a resource that can be migrated only when the resource is offline. The new resource type package contains methods that are located in new paths. Because the methods are not overwritten during the installation, the resource does not need to be disabled until after the upgraded resource type is installed.

The characteristics of the resource in this example are as follows:

This example assumes that the upgrade package is already installed on all cluster nodes according to the supplier's directions.


# scrgadm -a -t myrt -f /opt/XYZmyrt/etc/XYZ.myrt
# scswitch -n -j myresource
# scrgadm -c -j myresource -y Type_version=2.0
# scswitch -e -j myresource


Example 2–3 Migrating a Resource That Can Be Migrated Only When Unmonitored

This example shows the migration of a resource that can be migrated only when the resource is unmonitored. The new resource type package contains only the monitor and RTR file. Because the monitor is overwritten during installation, monitoring of the resource must be disabled before the upgrade package is installed.

The characteristics of the resource in this example are as follows:

The following operations are performed in this example.

  1. Before the upgrade package is installed, the following command is run to disable monitoring of the resource:


    # scswitch -M -n -j myresource
    
  2. The upgrade package is installed on all cluster nodes according to the supplier's directions.

  3. To register the new version of the resource type, the following command is run:


    # scrgadm -a -t myrt -f /opt/XYZmyrt/etc/XYZ.myrt
    
  4. To change the Type_version property to the new version, the following command is run:


    # scrgadm -c -j myresource -y Type_version=2.0
    
  5. To enable monitoring of the resource after its migration, the following command is run:


    # scswitch -M -e -j myresource