7.4 Managing Cluster Resources

Apart from the possibility to configure your cluster resources, the crm tool also allows you to manage existing resources. The following subsections gives you an overview.

7.4.1 Starting a New Cluster Resource

To start a new cluster resource you need the respective identifier. Proceed as follows:

  1. Log in as root and start the crm interactive shell:

    root # crm
  2. Switch to the resource level:

    crm(live)# resource
  3. Start the resource with start and press the Tab key to show all known resources:

    crm(live)resource# start ID

7.4.2 Cleaning Up Resources

A resource will be automatically restarted if it fails, but each failure raises the resource's failcount. If a migration-threshold has been set for that resource, the node will no longer be allowed to run the resource as soon as the number of failures has reached the migration threshold.

  1. Open a shell and log in as user root.

  2. Get a list of all your resources:

    root # crm resource list
      ...
    Resource Group: dlm-clvm:1
             dlm:1  (ocf::pacemaker:controld) Started 
             clvm:1 (ocf::lvm2:clvmd) Started
             cmirrord:1     (ocf::lvm2:cmirrord) Started
  3. To clean up the resource dlm, for example:

    root # crm resource cleanup dlm

7.4.3 Removing a Cluster Resource

Proceed as follows to remove a cluster resource:

  1. Log in as root and start the crm interactive shell:

    root # crm configure
  2. Run the following command to get a list of your resources:

    crm(live)# resource status

    For example, the output can look like this (whereas myIP is the relevant identifier of your resource):

    myIP    (ocf::IPaddr:heartbeat) ...
  3. Delete the resource with the relevant identifier (which implies a commit too):

    crm(live)# configure delete YOUR_ID
  4. Commit the changes:

    crm(live)# configure commit

7.4.4 Migrating a Cluster Resource

Although resources are configured to automatically fail over (or migrate) to other nodes of the cluster in the event of a hardware or software failure, you can also manually move a resource to another node in the cluster using either the Pacemaker GUI or the command line.

Use the migrate command for this task. For example, to migrate the resource ipaddress1 to a cluster node named bob, use these commands:

root # crm resource
crm(live)resource# migrate ipaddress1 bob

7.4.5 Grouping/Tagging Resources

Tags are a way to refer to multiple resources at once, without creating any colocation or ordering relationship between them. This can be useful for grouping conceptually related resources. For example, if you have several resources related to a database, create a tag called databases and add all resources related to the database to this tag:

root # crm configure databases: db1 db2 db3

This allows you to start them all with a single command:

root # crm resource start databases

Similarly, you can stop them all too:

root # crm resource stop databases

NOTE: Upgrading the CIB Syntax Version

Tags (for grouping resources) and some ACL features only work with the CIB syntax version pacemaker-2.0 or higher. For details on how to check this and upgrade the CIB version, see the instructions in the High Availability Guide for SUSE Linux Enterprise High Availability Extension 11 SP4, section Upgrading from SLE HA 11 SP3 to SLE HA 11 SP4.

7.4.6 Using Maintenance Mode

Every now and then, you need to perform testing or maintenance tasks on individual cluster components or the whole cluster—be it changing the cluster configuration, updating software packages for individual nodes, or upgrading the cluster to a higher product version.

With regard to that, High Availability Extension provides maintenance options on several levels:

Applying Maintenance Mode to your Cluster

In case you want to put the whole cluster in maintenance mode, use the following command:

root # crm configure property maintenance-mode=true
Applying Maintenance Mode to Nodes

For example, to put the node alice into maintenance mode:

root # crm node maintenance alice

The crm status command will show the maintenance mode for alice and no more resources will be allocated to that node. To remove the maintenance flag from the node, use:

root # crm node ready alice
Applying Maintenance Mode to Resources

If you need to set a specific resource into maintenance mode, use the meta command. For example, to put the resource ipaddress into maintenance mode, enter:

root # crm meta ipaddress set maintenance true

WARNING: Risk of Data Loss

If you need to execute any testing or maintenance tasks while services are running under cluster control, make sure to follow this outline:

  1. Before you start, set the individual resource, node or the whole cluster to maintenance mode. This helps to avoid unwanted side effects like resources not starting in an orderly fashion, the risk of unsynchronized CIBs across the cluster nodes or data loss.

  2. Execute your maintenance task or tests.

  3. After you have finished, remove the maintenance mode to start normal cluster operation.

For more details on what happens to the resources and the cluster while in maintenance mode, see Section 4.7, Maintenance Mode.