11.3 Configuring the DST Shadow Volume Cluster Resource with Two Cluster-Enabled Pools

One way to set up the DST shadow volume cluster resource is to cluster-enable both pools to create separate cluster resources, then combine the secondary pool resource scripts with the primary pool resource scripts in the proper order so that secondary resources are available first for the primary resource to use.

The advantage of creating two cluster pool resources is that you can copy and paste the lines of code you need from one script to the other. In a migration scenario, you can later remove the shadow relationship and start using the secondary pool immediately as an independent pool cluster resource. The disadvantage of this approach is that the static IP address that is assigned to the secondary cluster pool resource is consumed but not used while the pool is in the shadow relationship.

For this method, you need two NSS volumes, each in its own clustered-enabled pool. For instructions for creating the clustered pools and the NSS volumes, see Section 8.2, Creating NSS Volumes to Use in the DST Shadow Volume Pair. Follow the instructions for creating shared devices and cluster-enabled pools.

When the NSS volumes and pool cluster resources are ready, perform the following tasks to create the DST shadow volume resource:

11.3.1 Creating a Shadow Volume in the Load Script

In a cluster environment, you configure the shadow volumes in the cluster load script so that it defines the NCP volume as it loads. The clustered shadow volume is not permanently defined in the /etc/opt/novell/ncpserv.conf files of each node. It is added to the server’s /etc/opt/novell/ncpserv.conf file when the system fails over to that node.

Use the following command in a cluster load script when the primary volume and the secondary volume are NSS volumes. Both NSS volumes must already exist and be mounted in NSS. In the load script, the volumes are automatically mounted in NSS when their respective pools are activated.

exit_on_error ncpcon mount primary_volumename=volID,SHADOWVOLUME=secondary_volumename

Replace volID with a value from 0 to 254 as the server volume ID to ensure that the volume has the same ID on all servers when it is mounted in a cluster resource. The volume ID must be unique across all servers in the cluster.

For example, the following command mounts the NSS volume named VOL1 with a volume ID of 254. The primary volume is an existing NSS volume named VOL1 (/media/nss/VOL1). The secondary volume is an existing NSS volume named ARCVOL (/media/nss/ARCVOL).

exit_on_error ncpcon mount VOL1=254,SHADOWVOLUME=ARCVOL

Use the Clustering plug-in for iManager to modify the load scripts. You must combine information from the load scripts for the two cluster resources to create a single load script. This process is described in the following sections.

11.3.2 Overview of Cluster Resource Setup

The cluster load scripts elsewhere in this section assume the following setup for your NSS volumes that you want to use in the clustered shadow volume. Make sure to substitute the actual information from your setup.

Setup

Primary NSS Volume

Secondary NSS Volume

Server name for node 1

server38

server38

Cluster server name for node 1

NCS1

NCS1

Cluster pool name

POOL1

ARCPOOL1

Cluster resource virtual server name

NCS1_POOL1_SERVER

NCS1_ARCPOOL1_SERVER

Cluster resource IP address

10.10.10.38

You use the IP address for the primary pool’s cluster resource for the shadow volume.

10.10.10.39

You use the secondary IP address only when managing the secondary NSS volume as an independent volume.

NSS volume name

VOL1

ARCVOL1

Volume ID on the cluster node

254

253

IMPORTANT:In the cluster load and unload scripts, the add_secondary_ipaddress and del_secondary_ipaddress commands refer to the cluster resource’s IP address that is “secondary” to the node’s actual IP address. It is not related to the DST volume’s terminology.

11.3.3 Viewing or Modifying Cluster Load and Unload Scripts

Initially, you have two load scripts and two unload scripts—one pair for each of the clustered NSS pools. You combine these scripts later to create a single load script that manages the two cluster resources so that they fail over together. For information about creating these two cluster resources, see Section 8.2, Creating NSS Volumes to Use in the DST Shadow Volume Pair.

Viewing Load and Unload Scripts for a Cluster Resource

  1. In iManager, select Clusters, then select Cluster Manager.

  2. Click the Object browser, then locate and select the cluster server node to view a list of cluster resources.

  3. Click the Name link of the primary cluster resource to go to the Cluster Pool Properties page, then click the Scripts tab to go to the Scripts page where you can view or modify the load and unload scripts for the selected cluster resource.

    For example, click the Name link for POOL1_SERVER, then click Scripts to display the load script for the primary clustered pool named POOL1.

    To view examples of the default load and unload scripts for the cluster resources, see the following:

Sample Load and Unload Scripts for the Primary Cluster Resource

The load and unload scripts in this section are samples based on the setup in Section 11.3.2, Overview of Cluster Resource Setup.

Load Script
#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
exit_on_error nss /poolact=POOL1
exit_on_error ncpcon mount VOL1=254
exit_on_error add_secondary_ipaddress 10.10.10.38
exit_on_error ncpcon bind --ncpservername=NCS1_POOL1_SERVER --ipaddress=10.10.10.38
exit 0
Unload Script
#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
ignore_error ncpcon unbind --ncpservername=NCS1_POOL1_SERVER --ipaddress=10.10.10.38
ignore_error del_secondary_ipaddress 10.10.10.38
ignore_error nss /pooldeact=POOL1
exit 0

Sample Load and Unload Scripts for the Secondary Cluster Resource

The load and unload scripts in this section are samples based on the setup in Section 11.3.2, Overview of Cluster Resource Setup. Only NCP is used as an advertising protocol on the secondary NSS pool when you cluster enable it.

Load Script
#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
exit_on_error nss /poolact=ARCPOOL1
exit_on_error ncpcon mount ARCVOL1=253
exit_on_error add_secondary_ipaddress 10.10.10.39
exit_on_error ncpcon bind --ncpservername=NCS1_ARCPOOL1_SERVER --ipaddress=10.10.10.39
exit 0
Unload Script
#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
ignore_error ncpcon unbind --ncpservername=NCS1_ARCPOOL1_SERVER --ipaddress=10.10.10.39
ignore_error del_secondary_ipaddress 10.10.10.39
ignore_error nss /pooldeact=ARCPOOL1
exit 0

11.3.4 Configuring the Load and Unload Scripts for a Shadow Volume

When working with the two volumes as a shadow volume, you must create combined load and unload scripts for the primary cluster pool resource that manages the two cluster resources together. The secondary cluster pool resource appears with a status of offline while it is being managed by the primary scripts.

IMPORTANT:You should not online the secondary cluster pool resource while the pool and its volume are being managed by the primary pool resource.

  1. Offline the primary and secondary cluster resources.

    1. In iManager, select Clusters, then select Cluster Manager.

    2. Click the Object browser, then locate and select the cluster server node to view a list of cluster resources.

    3. Select the check boxes next to the primary and secondary cluster resources.

    4. Click Offline.

  2. Copy information from the secondary load script temporarily into a text file.

    1. Click the name link of the secondary cluster resource to view its Cluster Pool Properties page, then click the Scripts tab.

    2. On the Scripts > Load Scripts page, copy the contents of the load script to a temporary text file.

    3. On the Scripts > Unload Scripts page, copy the contents of the unload script to a temporary text file.

    4. Save the temporary files.

    5. At the bottom of the Scripts page, click Cancel to return to the Cluster Manager page.

  3. Modify the load script for the primary cluster resource.

    1. Click the name link of the primary pool cluster resource to view its Cluster Pool Properties page, then click the Scripts tab.

    2. On the Scripts > Load Script page, copy information from the secondary load script into the primary load script.

      Use the Sample Load Script for a Shadow Volume as a guide for where to add the lines for each of the items.

    3. (Optional) Add a sleep command after the pool activation commands to allow both pools time to be activated before you mount the shadow volume pair.

      For example:

      sleep 10
      

      Vary the time (in seconds) according to what is needed for your system.

      IMPORTANT:If wait times are added to the load script or unload script, make sure to increase the script timeout settings accordingly. Otherwise, the script might time out while you are waiting for the action.

    4. Comment out (or remove) the individual mount commands for the primary NSS volume and secondary NSS volume by placing a pound sign (#) at the beginning of the line.

      For example:

      #exit_on_error ncpcon mount ARCVOL1=253
      #exit_on_error ncpcon mount VOL1=254
      
    5. Add the mount command for the shadow volume to the primary load script.

      exit_on_error ncpcon mount VOL1=254,shadowvolume=ARCVOL1
      
    6. If you are using shadowfs to provide the merged file tree view for Samba/CIFS users or for Linux services like rsync, you must allow time in the load script after mounting the shadow volume to allow shadowfs to become active before continuing.

      Use one of the following approaches to add a wait time:

      • Add a sleep 10 command after mount command, and vary it manually until it allows sufficient wait time for shadowfs to start.

        # If shadowfs is used, wait for shadowfs to start
        sleep 10
        
      • Add a script that varies the wait time by checking to make sure shadowfs is started.

        For example:

        # If shadowfs is used, wait for shadowfs to start
        for (( c=1; c<=10; c++ )) do
         if [ ! -d /media/shadowfs/VOLUME/._NETWARE ]; then sleep 5; fi
        done 
        

      IMPORTANT:If wait times are added to the load script or unload script, make sure to increase the script timeout settings accordingly. Otherwise, the script might time out while you are waiting for the action.

    7. Click Apply to save your changes.

      The changes do not take effect until the cluster resource is onlined.

  4. Modify the unload script for the primary cluster resource.

    1. Click the name link of the primary cluster resource to view its Cluster Pool Properties page, click the Scripts tab, then click Unload Script.

    2. On the Scripts > Unload Script page, copy information from the secondary pool’s unload script into the primary pool’s unload script.

      Use the Sample Unload Script for a DST Shadow Volume as a guide for where to add the lines for each of the items.

      IMPORTANT:Make sure to deactivate the primary pool before deactivating the secondary pool.

    3. If you are using shadowfs to provide a merged file tree view to Samba users, you must unmount the FUSE-mounted file systems that are displayed in the /media/shadowfs/VOLUME directory. Add the following line at the end of the unload script:

      #unload the volume in FUSE
      ignore_error fusermount -u /media/shadowfs/VOLUME
      
    4. Click Apply to save your changes.

  5. Online the primary load script.

    1. In iManager, select Clusters, then select Cluster Manager.

    2. Click the Object browser, then locate and select the cluster server node to view a list of cluster resources.

    3. Select the check box next to the primary cluster resource, then click Online.

    4. Select the cluster node where you want the resource to load (such as server38), then click OK.

  6. Verify that the primary cluster resource is running by going to the Clusters > Cluster Manager page.

    The primary cluster resource is Running. The secondary cluster resource is reported as Offline because you are managing that cluster resource through the primary load script.

  7. Verify that the shadow volume (VOL1) is mounted in NCP and is shadowed.

    1. On the first node in the cluster, log in to Novell Remote Manager for Linux as the root user.

    2. Select View File Systems, then verify that the secondary pool ARCPOOL1 and the NSS volume ARCVOL1 are listed under File Systems, but the secondary NSS volume is not listed under NCP Volumes.

    3. Select View File Systems > Dynamic Storage Technology Options, then verify that the primary volume is listed under Volume Information, and that its status is Shadowed.

    4. Select Manage NCP Services > Manage Shares, click NCP/NSS bindings, then verify that the NCP Accessible parameter is turned off for the secondary volume, and turned on for the primary volume.

11.3.5 Sample Load Script for a Shadow Volume

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
exit_on_error nss /poolact=ARCPOOL1
exit_on_error nss /poolact=POOL1

sleep 10 # Optional delay to make sure the pools are active before the shadow volume pair is mounted 
exit_on_error ncpcon mount VOL1=254,shadowvolume=ARCVOL1

exit_on_error add_secondary_ipaddress 10.10.10.38
exit_on_error ncpcon bind --ncpservername=NCS1_POOL1_SERVER --ipaddress=10.10.10.38
# If shadowfs is used, wait for shadowfs to start
#for (( c=1; c<=10; c++ )) do
# if [ ! -d /media/shadowfs/VOLUME/._NETWARE ]; then sleep 5; fi
#done 
exit 0

11.3.6 Sample Unload Script for a DST Shadow Volume

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
#unload the volume in FUSE
# Include the following line only if shadowfs is used
#ignore_error fusermount -u /media/shadowfs/VOL1
ignore_error ncpcon unbind --ncpservername=NCS1_POOL1_SERVER --ipaddress=10.10.10.38
ignore_error del_secondary_ipaddress 10.10.10.38
ignore_error nss /pooldeact=POOL1
ignore_error nss /pooldeact=ARCPOOL1
exit 0