Sun Cluster 3.0 Data Services Installation and Configuration Guide

Removing Resource Groups

To remove a resource group, you must first remove all the resources from the resource group.

Perform this procedure from any cluster node.

For additional information, see scrgadm(1M) and scswitch(1M).

How to Remove a Resource Group

  1. Become superuser on a node in the cluster.

  2. Run the following command to take the resource group offline.


    # scswitch -F -g resource-group-name
    
    -F

    Switches a resource group offline.

    -g resource-group-name

    Specifies the name of the resource group to take offline.

  3. Disable all the resources that are part of the resource group.

    You can use the scrgadm -pv command to view the resources in the resource group. Disable all the resources in the resource group to be removed.


    # scswitch -n -j resource-name
    
    -n

    Disables the resource.

    -j resource-name

    Specifies the name of the resource to disable.

    If any dependent data service resources exist in a resource group, you cannot disable the resource until you have disabled all the resources that depend on it.

  4. Remove all resources from the resource group.

    Use the following scrgadm commands to:

    • Remove the resources

    • Remove the resource group


    # scrgadm -r -j resource-name
    # scrgadm -r -g resource-group-name
    
    -r

    Removes the specified resource or resource group.

    -j resource-name

    Specifies the name of the resource to be removed.

    -g resource-group-name

    Specifies the name of the resource group to be removed.

  5. Verify that the resource group has been removed.


    # scrgadm -p
    

Example-Removing a Resource Group

This example shows how to remove a resource group (rg-1) after you have removed its resource (resource-1).


# scswitch -F -g rg-1
# scrgadm -r -j resource-1
# scrgadm -r -g rg-1