A.4 SBD Utility

The SBD utility (sbdutil) allows you to create, find, or view a OES Cluster Services SBD partition.

IMPORTANT:The cluster SBD partition is not required unless you have shared storage in the cluster.

We recommend that you carve out a LUN/disk of 20 MB in size for 512 byte device and 80 MB for 4096 (4Kn) byte device to use for the SBD. If you mirror the SBD, you need to carve out a separate LUN/disk of equal size to use. Before you begin, each of these small disks must be initialized and marked as shareable for clustering. You can initialize the device by using the OES Storage Services (NSS) Management Utility (nssmu(8)) or the Storage plug-in to iManager. The NSS utility called ncsinit(8) is available for initializing a device and setting it to a shared state.

A.4.1 Syntax

sbdutil [-c|-f|-i|-I|-v|-Z|-E|-r][-d device] [-p partition] [-n cluster_name] [-s size][-k filename][-m filename]   

sbdutil -c -d device [-s [size][-Z] [-n cluster_name]
sbdutil -f [-s] [-n cluster_name]
sbdutil -i -p partition [-s] [-n cluster_name]
sbdutil -I
sbdutil -v [all<slotnumber>] [-p partition] [-s] [-n cluster_name]
sbdutil -r -weg [-R resource_name] [-N node_name] [-A time] [-B time][-x filename] [-j filename] [-u filename]
sbdutil -E -k filename
sbdutil -m filename

Log in to a node in the cluster where you want to create the SBD partition, then enter the command at a terminal console as the root user or any other user in admin or ncsgroup. If the command succeeds, the partition name is printed. See Section A.4.3, Return Value for more information.

A.4.2 Options

-c

Create an SBD partition. This option requires at least one device to be specified. You can create a mirrored SBD by supplying more than one device with multiple instances of the -d option.

IMPORTANT:Do not create an SBD partition for a cluster that already has an SBD partition. If you need to re-create the SBD for a cluster, delete its existing SBD first.

To delete an SBD:

  1. Enter cluster down at the server console of one cluster server.

    This causes all cluster servers to leave the cluster.

  2. Delete the SBD partition.

    You can use nssmu or other utilities to delete the SBD partition.

-f

Find the SBD partition.

-i

Initializes the SBD partition except the cluster event logs. If there is information in the sbdutil -v view from old nodes that have been removed from the cluster, you can run sbdutil -i to initialize the view. This can be done without any issues while the cluster is running.

-I

Initializes the entire SBD partition.

-v

View the used slots on the SBD partition.

Optional Paremeters:

  1. all: To view all the slots on the SBD partition.

  2. slotnumber: To view the specified number of slots of the SBD partition.

-d <device>

The device where you want to create an SBD partition. You can create a mirrored SBD by supplying more than one device with multiple instances of the -d option. Specify only the base (leaf) names (such as sdb or mpathd) with the -d option.

-p <partition>

Use this partition instead of searching for one.

-n <cluster_name>

Use the specified cluster name instead of getting the name from cluster.xml. If this option is not specified, the SBD partition is named by default with the cluster name that is found in the cluster.xml file on the node.

-s

Assume the device is a shared disk system instead of checking cluster.xml. An optional partition size (in MB) can also be specified when creating a partition (-c). The default size is 8 MB. Some of the allocated space is used for storing metadata such as the partition table and MBR (master boot record) for the partition.

Specify the size as -1 to use all free space on the device. This option allows OES Cluster Services to use a whole disk/LUN (or LUNs) that you set aside for SBD.

-Z

Use the entire device when creating a partition by using (\-c) option.

-E

To backup the cluster event logs in the specified format.

-k file_name

or.

--raw

To export the cluster event logs that are backed up to a file in a raw format. To be used along with the -E option.

-m file_name

or

--restore

To restore the backed up cluster event logs to a newly created sbd partition. It is highly recommended to perform the following sequence when restoring logs:

  1. Cluster is down.

  2. Restore cluster event logs. Any existing cluster event logs in the partition are over-ridden.

-r

Prints all log entries from the oldest to the newest.

Options Used with -r

-R resource_name

Prints the log entires of the specified resource.

-N node_name

Prints the log entries of the specified node.

-w -e -g

Prints the warning, error, and normal log entries respectively.

-A time

Prints the log entries after the specified time.

-B time

Prints the log entries before the specified time.

-x

or

--xml

Exports the log in XML format.

-j

or

--json

Exports the log in json format.

-u

or

--csv

Exports the log in CSV format.

A.4.3 Return Value

If the command succeeds, it prints the partition name to the screen and returns "0". Otherwise, no partition name is printed out, and a non-zero error code is returned.

You can use "echo $?" at the end of the command to check the return code:

/opt/novell/ncs/bin/sbdutil -c -n <cluster_name> -d <device> -d <device> -s <size>; echo $?

Examples

The following example demonstrates a successful command where the mycluster1.sbd partition is created:

/opt/novell/ncs/bin/sbdutil -c -n mycluster1 -d MD_EMC_001G_A -d MD_EMC_001G_B -s -1; echo $?
/dev/nss/mycluster1.sbd
0 

The following example demonstrates a failed command where no partition is created, and a non-zero error code is returned:

/opt/novell/ncs/bin/sbdutil -c -n mycluster1 -d MD_EMC_001G_A -d MD_EMC_001G_B -s 2048; echo $?

2

A.4.4 Examples

This program normally runs as root on a node in the cluster that will be using the SBD.

sbdutil -f

This tells you whether an SBD partition exists and identifies the device on the SAN where the SBD partition is located.

sbdutil -c -n mycluster1 -d sdb -s -1

Creates an SBD partition for the cluster named mycluster1 on the LUN /dev/sdb. The size is set to use all of the free space on the device.

sbdutil -c -n mycluster1 -d sdb -d sdc

Creates a mirrored SBD partition for the cluster named mycluster1 on the LUN /dev/sdb with the mirror on /dev/sdc.

sbdutil -r

Lets you view recent cluster events. Events can be node specific (a node joined or left the cluster) or they can be resource specific (a resource changed state from loading to running).

Sample output:

Mon Sep 15 15:41:36 2014 Node 'CG-04' Joined at epoch 5Mon Sep 15
15:41:37 2014 Resource 'Master_IP_Address_Resource' Running on CG-01
sbdutil -r -w -R resource1 -R resource2 -A '10 days ago' -B '12/31/2019 14:23'

Prints the warning log entries of resource1 and resource2 from 10 days ago till the time 14:23 on 31st December, 2019.

sbdutil -r -R POOL1_SERVER -B '2020-01-20 15:37:44'

Sample output:

Mon Jan 20 15:33:12 2020 Resource 'POOL1_SERVER' NDS Sync
Mon Jan 20 15:36:18 2020 Resource 'POOL1_SERVER' Offline
Mon Jan 20 15:36:18 2020 Resource 'POOL1_SERVER' Offline
sbdutil -r -R POOL1_SERVER -A '2020-01-20 15:33:12' -B '2020-01-20 15:37:44'

Sample output:

Mon Jan 20 15:36:18 2020 Resource 'POOL1_SERVER' Offline
Mon Jan 20 15:36:18 2020 Resource 'POOL1_SERVER' Offline
sbdutil -r -R CP5_SERVER --xml logs.xml --json logs.json

This command exports the event logs of the resource 'CP5_SERVER' in xml and json file formats.

sbdutil -v7 or sbdutil -v 7

This command allows you to view the first 7 slots of the SBD partition.

sbdutil -E --raw backup_logs / sbdutil -E -k backup_logs

This command takes a backup of the event logs into backup_logs which can be later used for restoration purposes.

sbdutil -m backup_logs

This command restores the event logs to SBD Partition.