17.6 Sample Scripts for a DST Pool Cluster Resource

The cluster scripts in this section assume the following setup for NSS volumes in the clustered DST volume pair. Ensure that you use the actual information from your setup.

Setup

Primary NSS Volume

Secondary NSS Volume

Server name for node 1

server38

server38

Cluster name for node 1

NCS1

NCS1

Cluster pool name

POOL1

ARCPOOL1

NSS volume name

VOL1

ARCVOL1

Cluster resource virtual server name

NCS1-POOL1-SERVER

Cluster resource IP address

10.10.10.38

Volume ID on the cluster node

254

17.6.1 Sample Load Script for a DST Shadow Volume

The following is a sample load script for a DST pool cluster resource.

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# activate the secondary pool
exit_on_error nss /poolact=ARCPOOL1

# activate the primary pool
exit_on_error nss /poolact=POOL1

# Optional delay to allow time for pools to activate before mounting the volume
sleep 10

#comment out the original volume mount command
#exit_on_error ncpcon mount VOL1=254

# Use the ncpcon mount command to create the shadow volume on mount
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

#This line is added if OES CIFS is used as an advertising protocol
#exit_on_error novcifs --add '--vserver=".cn=NCS1-POOL1-SERVER.ou=ncs.o=novell.t=AVALON_TREE."' 
         --ip-addr=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

17.6.2 Sample Unload Script

The following is a sample unload script for a DST pool cluster resource.

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# This line is added if OES CIFS is used as an advertising protocol
#ignore_error novcifs --remove '--vserver=".cn=NCS1-POOL1-SERVER.ou=ncs.o=novell.t=AVALON_TREE."' --ip-addr=10.10.10.38 

# If shadowfs is used, unload the volume in FUSE 
#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

# Deactivate the primary pool
ignore_error nss /pooldeact=POOL1

# Deactivate the secondary pool
ignore_error nss /pooldeact=ARCPOOL1

exit 0

17.6.3 Sample Monitor Script for a DST Volume

The following is a sample unload script for a DST pool cluster resource.

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# Check the status of the secondary pool
exit_on_error status_fs /dev/pool/ARCPOOL1 /opt/novell/nss/mnt/.pools/ARCPOOL1 nsspool

# Check the status of the primary pool
exit_on_error status_fs /dev/pool/POOL1 /opt/novell/nss/mnt/.pools/POOL1 nsspool

exit_on_error status_secondary_ipaddress 10.10.10.38

# Check the status of the primary volume. Do not check secondary volume.
exit_on_error ncpcon volume VOL1

# This line is added if OES CIFS is used as an advertising protocol
#exit_on_error rcnovell-cifs monitor

exit 0