14.6 Enabling NCP File Access for a Clustered LVM Volume

After you create an NCP virtual server object for the clustered LVM volume, you can enable NCP file access to a clustered LVM volume by adding NCP commands to the load, unload, and monitor script.

14.6.1 Adding NCP Volume Commands to the Resource Scripts

After you have created an NCS:NCP Server object and the Volume object for the NCP volume, you can add NCP file access for users by adding NCP volume commands to the resource’s load, unload, and monitor scripts.

  1. In iManager, select Clusters > My Clusters, then select the cluster.

  2. Click the name link of the LVM volume group cluster resource to open its Cluster Resource Properties page, then click the Scripts tab.

  3. Modify the LVM resource’s load script:

    1. On the Scripts tab, click Load Script.

    2. At the end of the definition area, add the following lines to define the NCP volume name:

      # define NCP volume name
      NCP_VOLUME=CLUSTERVOL01
      

      Replace the NCP server name with the name for your virtual NCP server. NCP volume names can be up to 14 alphanumeric characters. Supported characters are A to Z, 0 to 9, and underscores (_).

    3. After the add_secondary_ipaddress command line, add a line to mount the NCP volume:

      # mount the NCP volume
      exit_on_error ncpcon mount $NCP_VOLUME=251,PATH=$MOUNT_POINT
      
    4. Verify the order of the commands against the Sample LVM Resource Load Script with an NCP Volume.

    5. Click Apply to save your changes.

      The script changes are not active until the next time the cluster resource is taken offline, and then brought online. Do not active the script changes at this time.

  4. Modify the LVM resource’s unload script:

    1. On the Scripts tab, click Unload Script.

    2. At the end of the definition area, add the following lines to define the NCP volume name:

      # define NCP volume name
      NCP_VOLUME=CLUSTERVOL01
      

      Specify the same volume name that you used in the load script.

    3. Under the ncpcon unbind command, add a line to dismount the NCP volume:

      # dismount the NCP volume
      ignore_error ncpcon dismount $NCP_VOLUME
      
    4. Verify the order of the commands against the Sample LVM Resource Unload Script with an NCP Volume.

    5. Click Apply to save your changes.

      The script changes are not active until the next time the cluster resource is taken offline, and then brought online.

  5. Modify the LVM resource’s monitor script:

    1. On the Scripts tab, click Monitor Script.

    2. At the end of the definition area, add the following lines to define the NCP volume name:

      # define NCP volume name
      NCP_VOLUME=CLUSTERVOL01
      

      Specify the same volume name that you used in the load script.

    3. Verify the order of the commands against the Sample LVM Resource Monitor Script with an NCP Volume.

    4. Click Apply to save your changes.

      The script changes are not active until the next time the cluster resource is taken offline, and then brought online.

  6. At the bottom of the Properties dialog box, click OK to save your changes.

  7. Activate the modified scripts by taking the resource offline and bringing it online.

    1. Click the Cluster Manager tab.

    2. Select the check box next to the LVM volume group cluster resource, then click Offline.

      Wait until the resource is reports an Offline status before continuing.

    3. Select the check box next to the LVM volume group cluster resource, then click Online.

      Wait until the resource is reports an Online status before continuing.

  8. Verify that a clustered NCP Volume object appears in the Browse panel in iManager.

    1. In the iManager toolbar, click the View Objects icon.

    2. In the left panel, click Browse.

    3. Browse to the cluster container to see the NCP volume, such as clus1_CLUSTERVG01.

  9. Verify the NCP volume by using the Manage NCP Services plug-in for Novell Remote Manager:

    1. Log in as the root user to Novell Remote Manager.

    2. Select Manage NCP Services, then select Manage Shares.

    3. Locate the NCP volume in the Active Shares list.

      The clustered NCP volume is defined in the LVM volume group cluster resource load script. The NCP volume is mounted when you bring the resource online, and dismounted when you take the resource offline. You do not use the Mount and Unmount buttons in this interface.

    4. Click the Information (i) icon to the left of the NCP volume to view details about the NCP volume and mount point.

    5. Exit Novell Remote Manager.

14.6.2 Creating a Shared NCP Volume Object

Use the following procedure to create an NCP volume object on the NCP virtual server you created in Section 14.5, Creating a Virtual Server Object for an LVM Volume Group Cluster Resource

  1. Log in to iManager as a cluster administrator.

  2. Select Directory Administration > Create Object.

  3. On the Create Object page, select Volume, then click OK.

  4. On the Create Volume page, complete the following information, then click OK.

    Parameter

    Action

    Volume name

    Specify the name that you defined in the load script in the format <cluster_name>_<ncp_volumen_name>, such as cluster1_CLUSTERVOL01.

    Host server

    Browse to select the NCP virtual server object for the LVM cluster resource, such as cluster1-clustervg01-server.

    Context

    Browse to select the context where you want to create the Volume object for the NCP volume, such as novell.

    Host resource name

    From the drop-down list of available NCP volumes on the server, select the NCP volume that you defined in the load script, such as CLUSTERVOL01.

  5. After the Volume object is successfully created, click OK to dismiss the confirmation message.

  6. Verify that the object is accessible.

    1. In the iManager toolbar, select the View Objects icon.

    2. Browse in the Tree view to locate and view information about the NCP volume’s Volume object.

14.6.3 Sample LVM Resource Scripts Enabled for NCP File Access

This section contains sample scripts for the Generic LVM resource where commands have been added to bind and unbind an NCP Virtual Server object with the resource IP address and to mount and dismount an NCP volume for the Linux file system.

The sample scripts in this section use the following sample parameters. Ensure that you replace the sample values with your values.

Parameter

Sample Value

RESOURCE_IP

10.10.10.136

MOUNT_FS

ext3

VOLGROUP_NAME

clustervg01

MOUNT_DEV

/dev/$VOLGROUP_NAME/clustervol01

MOUNT_POINT

/mnt/clustervol01

NCP_SERVER

clus1-clustervg01-server

NCP_VOLUME

CLUSTERVOL01

Volume ID

251

Ensure that the volume ID that you assign to the NCP volume is unique across all nodes in the cluster. Clustered NCP volume IDs are assigned from 254 to 0, in descending order.

Sample LVM Resource Load Script with an NCP Volume

Use the following sample load script to complete the fields for your LVM volume group cluster resource that has an NCP virtual server and an NCP volume:

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

# define the IP address
RESOURCE_IP=10.10.10.136
# define the file system type
MOUNT_FS=ext3
# define the volume group name
VOLGROUP_NAME=clustervg01
# define the device
MOUNT_DEV=/dev/$VOLGROUP_NAME/clustervol01
# define the mount point
MOUNT_POINT=/mnt/clustervol01

# define NCP server name
NCP_SERVER=cluster1-clustervg01-server
# define NCP volume name
NCP_VOLUME=CLUSTERVOL01

# activate the volume group
exit_on_error vgchange -a ey $VOLGROUP_NAME

# create the mount point on the node if it does not exist
ignore_error mkdir -p $MOUNT_POINT

# mount the file system
exit_on_error mount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

# mount the NCP volume
exit_on_error ncpcon mount $NCP_VOLUME=251,PATH=$MOUNT_POINT

# add the IP address
exit_on_error add_secondary_ipaddress $RESOURCE_IP

# bind the NCP server name
exit_on_error ncpcon bind --ncpservername=$NCP_SERVER --ipaddress=$RESOURCE_IP

exit 0

Sample LVM Resource Unload Script with an NCP Volume

Use the following sample unload script to complete the fields for your LVM volume group cluster resource that has an NCP virtual server and an NCP volume:

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

# define the IP address
RESOURCE_IP=10.10.10.136
# define the file system type
MOUNT_FS=ext3
# define the volume group name
VOLGROUP_NAME=clustervg01
# define the device
MOUNT_DEV=/dev/$VOLGROUP_NAME/clustervol01
# define the mount point
MOUNT_POINT=/mnt/clustervol01

# define NCP server name
NCP_SERVER=cluster1-clustervg01-server
# define NCP volume name
NCP_VOLUME=CLUSTERVOL01

# unbind the NCP server name
ignore_error ncpcon unbind --ncpservername=$NCP_SERVER --ipaddress=$RESOURCE_IP

# del the IP address
ignore_error del_secondary_ipaddress $RESOURCE_IP

# dismount the NCP volume
ignore_error ncpcon dismount $NCP_VOLUME

# unmount the Linux volume
sleep 10 # if not using SMS for backup, please comment out this line
exit_on_error umount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

#deactivate the volume group
exit_on_error vgchange -a n $VOLGROUP_NAME

exit 0

Sample LVM Resource Monitor Script with an NCP Volume

Use the following sample monitor script to complete the fields for your LVM volume group cluster resource that has an NCP virtual server and an NCP volume. To use the script, you must also enable monitoring for the resource. See Section 11.7, Enabling Monitoring and Configuring the Monitor Script.

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

# define the IP address
RESOURCE_IP=10.10.10.136
# define the file system type
MOUNT_FS=ext3
# define the volume group name
VOLGROUP_NAME=clustervg01
# define the device
MOUNT_DEV=/dev/$VOLGROUP_NAME/clustervol01
# define the mount point
MOUNT_POINT=/mnt/clustervol01

# define NCP server name
NCP_SERVER=cluster1-clustervg01-server
# define NCP volume name
NCP_VOLUME=CLUSTERVOL01

# check the logical volume
exit_on_error status_lv $MOUNT_DEV
 
# test the file system
exit_on_error status_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS
 
# status the IP address
exit_on_error status_secondary_ipaddress $RESOURCE_IP

# check the status of NCP services
rcndsd status
  if test $? != 0; then
     exit_on_error rcndsd restart
  fi
sleep 5

exit 0