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.
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.
In iManager, select Clusters > My Clusters, then select the cluster.
Click the name link of the LVM volume group cluster resource to open its Cluster Resource Properties page, then click the Scripts tab.
Modify the LVM resource’s load script:
On the Scripts tab, click Load Script.
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 (_).
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
Verify the order of the commands against the Sample LVM Resource Load Script with an NCP Volume.
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.
Modify the LVM resource’s unload script:
On the Scripts tab, click Unload Script.
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.
Under the ncpcon unbind command, add a line to dismount the NCP volume:
# dismount the NCP volume ignore_error ncpcon dismount $NCP_VOLUME
Verify the order of the commands against the Sample LVM Resource Unload Script with an NCP Volume.
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.
Modify the LVM resource’s monitor script:
On the Scripts tab, click Monitor Script.
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.
Verify the order of the commands against the Sample LVM Resource Monitor Script with an NCP Volume.
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.
At the bottom of the Properties dialog box, click OK to save your changes.
Activate the modified scripts by taking the resource offline and bringing it online.
Click the Cluster Manager tab.
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.
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.
Verify that a clustered NCP Volume object appears in the Browse panel in iManager.
In the iManager toolbar, click the View Objects icon.
In the left panel, click Browse.
Browse to the cluster container to see the NCP volume, such as clus1_CLUSTERVG01.
Verify the NCP volume by using the Manage NCP Services plug-in for OES Remote Manager:
Log in as the root user to OES Remote Manager.
Select Manage NCP Services, then select Manage Shares.
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.
Click the Information (i) icon to the left of the NCP volume to view details about the NCP volume and mount point.
Exit OES Remote Manager.
Use the following procedure to create an NCP volume object on the NCP virtual server you created in Section 13.5, Creating a Virtual Server Object for an LVM Volume Group Cluster Resource
Log in to iManager as a cluster administrator.
Select Directory Administration > Create Object.
On the Create Object page, select Volume, then click OK.
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. |
After the Volume object is successfully created, click OK to dismiss the confirmation message.
Verify that the object is accessible.
In the iManager toolbar, select the View Objects icon.
Browse in the Tree view to locate and view information about the NCP volume’s Volume object.
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. |
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
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
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 10.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