# Clustering operations

This chapter discusses how to configure cluster storage containers (referred to throughout this chapter as "cluster containers"), a feature provided by the EVMS Cluster Segment Manager (CSM).

Disks that are physically accessible from all of the nodes of the cluster can be grouped together as a single manageable entity. EVMS storage objects can then be created using storage from these containers.

Ownership is assigned to a container to make the container either private or shared. A container that is owned by any one node of the cluster is called a private container. EVMS storage objects and storage volumes created using space from a private container are accessible from only the owning node.

A container that is owned by all the nodes in a cluster is called a shared container. EVMS storage objects and storage volumes created using space from a shared container are accessible from all nodes of the cluster simultaneously.

EVMS provides the tools to convert a private container to a shared container, and a shared container to a private container. EVMS also provides the flexibility to change the ownership of a private container from one cluster node to another cluster node.

## Rules and restrictions for creating cluster containers

Note the following rules and limitations for creating cluster containers:

- Non-shared disks should not be assigned to a cluster container.

- Storage objects created on a cluster container must not span across multiple cluster containers. Currently, the EVMS Engine cannot enforce this rule, so you need to ensure that objects and volumes created from cluster storage manager segments do not span multiple containers.

- A disk should not span across cluster containers.

- RAID, snapshot, and BBR features should not be assigned to storage objects on a cluster container.

## Example: Create a private cluster container

This section tells how to create a sample private container with EVMS and provides instructions for completing the following task

> ### Create a private cluster container

> Given a system with three available shared disks (`sdd`, `sde`, and `sdf`), use the EVMS Cluster Segment Manager to combine these disk drives into a container called `Priv1` owned by `node1`.

### Using the EVMS GUI

To create a container with the EVMS GUI, follow these steps:

1. Select Actions Create Container to see a list of plug-ins that support container creation.

2. Select the Cluster Segment Manager.

3. Click Next.

   The next dialog window contains a list of storage objects that the CSM can use to create a container.

4. Select `sdd`, `sde`, and `sdf` from the list.

5. Click Next.

6. In the first pull-down menu, select the "Node Id" of the cluster node that owns this container as node1. Select Storage Type as private from the second pull-down menu.

7. Enter the name `Priv1` for the Container Name.

8. Click Create. A window opens to display the outcome.

9. Commit the changes.

### Using Ncurses

To create the private container with the Ncurses interface, follow these steps:

1. Scroll down the list using the down arrow to Create.

2. Press Enter. A submenu is displayed.

3. Scroll down until Container is highlighted.

4. Press Enter.

   A list opens of plug-ins that support container creation.

5. Scroll down with the down arrow and select Cluster Segment Manager by pressing spacebar. The plug-in you selected is marked with an "x."

6. Press Enter.

   The next submenu contains a list of disks that the Cluster Segment Manager finds acceptable to use for the creation of a container.

7. Use spacebar to select `sdd`, `sde`, and `sdf` from the list. The disks you select are marked with an "x."

8. Press Enter.

9. On the Create Storage Container - Configuration Options menu, press spacebar on the Node Id, which will provide a list of nodes to select from.

10. Press spacebar on the node `node1` and press Enter.

11. Scroll down with the down arrow and press spacebar on the Storage Type. A list of storage types opens.

12. Scroll down with the down arrow to private entry and press spacebar.

13. Press Enter.

14. Scroll down with the down arrow to Container Name and press spacebar.

    The Change Option Value menu opens and asks for the Container Name. Type in the name of the container as `Priv1`, and press Enter.

15. Press Enter to complete the operation.

### Using the CLI

An operation to create a cluster container with the CLI takes three parameters: the name of the container, the type of the container, and the nodeid to which the container belongs. On the CLI, type the following command to create the private container `Priv1`:

    create: container,CSM={name="Priv1",type="private",nodeid="node1"},sdd,sde,sdf

## Example: Create a shared cluster container

This sections tells how to create a Sample Shared Container with EVMS and provides instructions to help you complete the following task:

> ### Create a shared cluster container

> Given a system with three available shared disks (`sdd`, `sde`, and `sdf`), use the EVMS Cluster Segment Manager to combine these disk drives into a shared container called `Shar1`.

### Using the EVMS GUI

To create a shared cluster container with the EVMS GUI, follow these steps:

1. Select Actions Create Container to see a list of plug-ins that support container creation.

2. Select the Cluster Segment Manager.

3. Click Next.

   The next dialog window contains a list of storage objects that the CSM can use to create a container.

4. Select `sdd`, `sde`, and `sdf` from the list.

5. Click Next.

6. You do not need to change the "Node Id" field. Select Storage Type as shared from the second pull-down menu.

7. Enter the name `Shar1` for the Container Name.

8. Click Create. A window opens to display the outcome.

9. Commit the changes.

10. Run `evms_activate` on each of the cluster nodes so that the nodes discover the volume. This process will be automated in future releases of EVMS.

### Using Ncurses

To create a shared cluster contained with the Ncurses interface, follow these steps:

1. Scroll down the list using the down arrow to Create.

2. Press Enter. A submenu is displayed.

3. Scroll down until Container is highlighted.

4. Press Enter.

   A list opens of plug-ins that support container creation.

5. Scroll down with the down arrow and select Cluster Segment Manager by pressing spacebar. The plug-in you selected is marked with an "x."

6. Press Enter.

   The next submenu contains a list of disks that the Cluster Segment Manager finds acceptable to use for the creation of a container.

7. Use spacebar to select `sdd`, `sde`, and `sdf` from the list. The disks you select are marked with an "x."

8. Press Enter.

9. The Create Storage Container - Configuration Options menu open; ignore the "Node Id" menu.

10. Scroll down with the down arrow and press spacebar on the Storage Type. A list of storage types opens.

11. Scroll down with the down arrow to shared entry and press spacebar.

12. Press Enter.

13. Scroll down with the down arrow to Container Name and press spacebar.

    The Change Option Value menu opens and asks for the Container Name. Type in the name of the container as `Shar1`, and press Enter.

14. Press Enter to complete the operation.

### Using the CLI

Execute the following command at the CLI prompt to create a shared container `Shar1`:

    create: container,CSM={name="Shar1",type="shared"},sdd,sde,sdf

## Example: Convert a private container to a shared container

This section tells how to convert a sample private container to a shared container and provides instructions for completing the following task:

### NOTE

Exercise caution while performing this operation. Ensure that no application is using the volumes on the container on any node of the cluster.

> ### Convert a private container to shared

> Given a system with a private storage container `Priv1` owned by `evms1`, convert `Priv1` to a shared storage container with the same name.

### Using the EVMS GUI

Follow these steps to convert a private cluster container to a shared cluster container with the EVMS GUI:

1. Select Actions ModifyContainer to see a list of containers.

2. Select the container csm/Priv1 and press Next.

   A Modify Properties dialog box opens.

3. Change "Type Field" to "shared" and click Modify.

   A window opens that displays the outcome.

4. Commit the changes.

5. Run `evms_activate` on all the cluster nodes so that the nodes discover all the volumes on the `csm/Priv1` container. This process will be automated in a future release of EVMS.

### Using Ncurses

Follow these steps to convert a private cluster container to a shared cluster container with the Ncurses interface:

1. Scroll down the list using the down arrow to Modify.

2. Press Enter. A submenu is displayed.

3. Scroll down until Container is highlighted.

4. Press Enter.

   The Modify Container Properties dialog opens. Select the container `csm/Priv1` by pressing spacebar. The container you selected is marked with an "x."

5. Press Enter.

6. Use spacebar to select `sdd`, `sde`, and `sdf` from the list. The disks you select are marked with an "x."

7. Press Enter.

8. The Modify Container Properties - Configuration Options" dialog opens. Scroll down with the down arrow and press spacebar on the "Type field".

9. Press spacebar.

10. The Change Option Value dialog opens. Type `shared` and press Enter.

    The changed value is now displays in the Modify Container Properties - Configuration Options dialog.

11. Press Enter.

    The outcome of the command is displayed at the bottom of the screen.

12. Save the changes by clicking Save in the Actions pulldown menu.

13. Run `evms_activate` on all the cluster nodes so that the nodes discover all the volumes on the `csm/Priv1` container. This process will be automated in a future release of EVMS.

### Using the CLI

The `modify` command modifies the properties of a container. The first argument of the command is the object to modify, followed by its new properties. The command to convert the private container to a shared container in the example is:

    modify: csm/Priv1,type=shared

Run `evms_activate` on all the cluster nodes so that the nodes discover all the volumes on the `csm/Priv1` container. This process will be automated in a future release of EVMS.

## Example: Convert a shared container to a private container

This section tells how to convert a sample shared container to a private container and provides instructions for completing the following task:

### NOTE

Exercise caution while performing this operation. Ensure that no application is using the volumes on the container on any node of the cluster.

> ### Convert a shared container to private

> Given a system with a shared storage container `Shar1`, convert `Shar1` to a private storage container owned by node `node1` (where `node1` is the nodeid of one of the cluster nodes).

### Using the EVMS GUI

Follow these steps to convert a shared cluster container to a private cluster container with the EVMS GUI:

1. Select Actions ModifyContainer to see a list of containers.

2. Select the container csm/Shar1 and press Next.

   A Modify Properties dialog opens.

3. Change "Type Field" to "private" and the "NodeID" field to `node1`. Click Modify.

   A window opens that displays the outcome.

4. Commit the changes.

5. Run `evms_activate` on the other nodes to deactivate the volumes of the shared container on the other nodes. This process will be automated in a future release of EVMS.

### Using Ncurses

Follow these steps to convert a shared cluster container to a private cluster container with the Ncurses interface:

1. Scroll down the list using the down arrow to Modify.

2. Press Enter. A submenu is displayed.

3. Scroll down until Container is highlighted.

4. Press Enter.

   The Modify Container Properties dialog opens. Select the container `csm/Shar1` by pressing spacebar. The container you selected is marked with an "x."

5. Press Enter.

6. The Modify Container Properties - Configuration Options" dialog opens. Scroll down with the down arrow and press spacebar on the "Type" field.

7. Press spacebar.

8. The Change Option Value dialog opens. Type `private` and press Enter.

9. The Modify Container Properties - Configuration Options dialog opens. Scroll down the list to NodeId with the down arrow and press spacebar.

10. The Change Option Value dialog opens. Enter `node1` and press Enter.

11. The changed values now display in the Modify Container Properties - Configuration Options dialog. Press Enter.

    The outcome of the command is displayed at the bottom of the screen.

12. Save the changes by clicking Save in the Actions pulldown.

13. Run `evms_activate` on all the cluster nodes to deactivate the volumes of the shared container on all the other nodes. This process will be automated in a future release of EVMS.

### Using the CLI

The `modify` command modifies the properties of a container. The first argument of the command is the object to modify, followed by its new properties. The command to convert the shared container to a private container in the example is:

    modify: csm/Shar1,type=private,nodeid=node1

Run `evms_activate` on all the cluster nodes to deactivate the volumes of the shared container on all the other nodes. This process will be automated in a future release of EVMS.

## Failover and Failback of a private container on Linux-HA

EVMS supports the Linux-HA cluster manager in EVMS V2.0 and later. Support for the RSCT cluster manager is also available as of EVMS V2.1, but is not as widely tested.

### NOTE

Ensure that `evms_activate` is called in one of the startup scripts before the heartbeat daemon starts (for example, `/etc/kinit.d/heartbeat`). If `evms_activate` is not called, failover might not work correctly.

Follow these steps to set up failover and failback of a private container:

1. Add an entry in `/etc/ha.d/haresources` for each private container to be failed over. For example, if `container3` and `container4` are to be filled over together to the same node with `node1` as the owning node, add the following entry to `/etc/ha.d/haresources`:

       node1 evms_failover::container1 evms_failover::container1

   `node1` is the cluster node that owns this resource. The resource is failed over to the other node when `node1` dies.

   Similarly, if `container3` and `container4` are to be failed over together to the same node with `node2` as the owning node, then add the following entry to `/etc/ha.d/haresources`:

       node2 evms_failover::container3 evms_failover::container4

   Refer to the following source for more details on the semantics of resource groups: http://www.linux-ha.org/download/GettingStarted.html.

2. Validate that the `/etc/ha.d`, `/etc/ha.cf` and `/etc/ha.d/haresources` files are the same on all the nodes of the cluster.

3. The heartbeat cluster manager must be restarted, as follows, after the `/etc/ha.d/haresources` file has been changed:

       /etc/init.d/heartbeat restart

   NOTE

   Do not add shared containers to the list of failover resources; doing so causes EVMS to respond unpredictably.

## Remote configuration management

EVMS supports the administration of cluster nodes by any node in the cluster. For example, storage on remote cluster node `node1` can be administered from cluster node `node2`. The following sections show how to set up remote administration through the various EVMS user interfaces.

### Using the EVMS GUI

To designate node2 as a node administrator, enter this command:

    evmsgui -n node2

### Using Ncurses

To designate `node2` as a node administrator from Ncurses, follow these steps:

1. Go to the Setting pulldown menu.

2. Scroll down with the down arrow to the "Node Administered" option and press Enter.

3. The Administer Remote Node dialog opens. Select `node2` and press spacebar.

   The node you selected is marked with an "x."

4. Press Enter.

5. The "EVMS is examining your system. Please wait" dialog opens. After a while you will be switched over to the node `node2`.

### Using the CLI

To designate `node2` as a node administrator from the CLI, issue this command:

    evms -n node2