Veritas Cluster I/O Fencing, Part 2

Solaris, UNIX, vcs

To follow up from part 1, this post will go into a bit more detail how to set up your I/O fencing for your cluster. This example is using Solaris 10 and VCS 5.0.

Before you continue, you need to have your three coordinator disks and all your data disks visible to all the cluster nodes. All these disks should have the SCSI-3 Persistent Reservation bit set. Put your three coordinator disks into their own disk group. I call mine dgvxfencoord.

1. Testing your shared disks
VCS includes a tool to test weather your disks have the SCSI-3 PR bit set, called vxfentsthdw. You only need to run this on one node in the cluster, and using ssh/rsh, the tool will perform the tests for all the nodes. You’ll need to set up ssh keys (or .rhosts) so root on your first cluster node can log into the other cluster nodes with no password – this is just temporary so our testing will work. If you use rsh, just use the -n flag with vxfentsthdw.The easiest way to use this tool is to specify disk groups to test. For example:

# /opt/VRTSvcs/vxfen/bin/vxfentsthdw -g dgvxfencoord

This will test every disk in the dgvxfencoord disk group, reading/writing keys to the disks, locking them for exclusive use by each member of the cluster. You should see “PASSED” after each test.

While testing your data disks, you may want to use the -r flag, to use non-destructive testing, if you have data on your disks already:

/opt/VRTSvcs/vxfen/bin/vxfentsthdw -r -g datadg

Once your tests indicate that SCSI-3 Persistent Reservations are working, you’re ready to move on. Your diskgroup with the coordinator disks never needs to be imported at all, since there are no file systems or other data on them.

vxdg deport dgvxfencoord
vxdg -t import dgvxfencoord #(turns off automatic importing when system starts)
vxdg -g dgvxfencoord set coordinator=on
vxdg deport dgvxfencoord

2. Perform these steps on each node of the cluster to set up I/O Fencing
I’m a big fan of copy and paste from online documentation, so here you go. This will tell the vx fencing kernel driver to use a diskgroup of “dgvxfencoord” for the coordinator disks, tell it to use SCSI-3 with dynamic multipathing, and will then restart the vx fencing service.

echo “dgvxfencoord” > /etc/vxfendg
cp /etc/vxfen.d/vxfenmode_scsi3_dmp /etc/vxfenmode
/etc/init.d/vxfen stop
/etc/init.d/vxfen start

3. VCS Configuration
So once you have the vx fencing driver set up, you have to tell your cluster to use it. First, stop your cluster and resources:

haconf -dump -makero
hastop -all

Then hand-edit the main.cf file in /opt/VRTSvcs/conf/config. Insert one line within the cluster definition block. Here’s an example:

cluster BIG-CLUSTER4
UserNames = { admin = “cERpdxPmHpzS.” }
Administrators = { admin }
ClusterAddress = “192.168.65.144″
UseFence = SCSI3
)

Once you insert your line, it’s a good idea to check the syntax of main.cf:

hacf -verify /etc/VRTSvcs/conf/config

Then, copy the updated main.cf file from this node to the other nodes using your preferred method – rcp, scp, ftp, whatever.

Then on each node, “hastart”.

You can verify the fencing configuration with this:

#/sbin/vxfenadm -d

I/O Fencing Cluster Information:
================================

Fencing Protocol Version: 201
Fencing Mode: SCSI3
Fencing SCSI3 Disk Policy: dmp
Cluster Members:

* 0 (server1)
1 (server2)

RFSM State Information:
node 0 in state 8 (running)
node 1 in state 8 (running)

4. Testing your fencing setup
You’ll want to test this before going into production. I have used a few methods to test this, but these are the easiest.

1. If you have physical access to your server
Unplug the two heartbeat links and the public network link. Fencing should kick in and the nodes will all race for those cooridator disks. The winner will take control, and the other cluster nodes will panic and reboot. Have a console connection on the nodes to verify.

2. If you have switch access, or access to someone who does
An easy thing to do is to disable the network ports corresponding to the heartbeats and public network link. Almost the same as #1.

3. If you want to perform the test by yourself and have no physical access
Set up scripts to change the speed/duplex on the NICs running your heartbeats and public network. Do this from the serial console, so you don’t lose access obviously (I’ve done similar things – quite a few times). Once your switch is still auto/auto and your NIC is forced to 10-half with no auto-negotiation, communication will be impossible and effectively you’ve severed your links.

Happy clustering!

  • Share/Bookmark
4 Comments

Veritas Cluster I/O Fencing, Part 1

vcs

So you’ve got your Veritas Cluster up and running. There’s one advanced feature that really puts the icing on the cake in my mind: I/O Fencing.

Here’s a scenario: There is a partial power outage, IOS upgrade failure, spanning tree loop, or anything else that can cause multiple network switch failures in your data center. Because of this, your cluster nodes can no longer communicate using ANY of their heartbeat links, or public network. Without I/O fencing enabled, each node would believe all the other nodes were “down”, and try to perform a failover and run all the defined service groups in the cluster. Multiple nodes trying to read/write to the same storage may result in data corruption, and this is your worst case scenario. I/O fencing will help here.

There is a SCSI-3 feature called “SCSI-3 Persistent Reservation”, which allows cluster nodes to write “keys” to shared disks, effectively locking the disk for exclusive use by a node.

Ask your storage administrator to enable SCSI-3 Persistent Reservation on each LUN you are assigned. On some arrays, this is the default behavior, but others require you to turn on the feature per LUN.

All the cluster nodes must be assigned three small “coordinator disks”, which serve as a locking mechanism for the shared storage. Just three shared disks per cluster, and all nodes must have access to them.

In the same scenario above, when the heartbeats go down and nodes are thought to be “offline”, each surviving node will race for control of the coordinator disks, ejecting any other nodes’ keys and writing their own key to the disk, locking other nodes out.

If there is more than one surviving node in the cluster, the “loser” of the race will actually panic and reboot. That’s not a typo – the node will kernel panic and reboot. This is the only sure way to ensure the node will not proceed and potentially corrupt data on the shared storage.

Consult your VCS documentation for the setup steps to enable I/O Fencing. I will be posting a “part 2″ also, with my abbreviated version to get it up and running.

  • Share/Bookmark
No Comments

Unable to shrink VXFS volume

Solaris, UNIX

Never seen this before. This volume is about 50% full, total size 300GB. I tried defragging the file system with fsadm, but didn’t seem to help. I even unmounted it, mounted it somewhere else and immediately tried the resize again – still the same error. I know there are no open files on the file system.

server# vxresize -g rootdg perforce 285g
UX:vxfs fsadm: ERROR: V-3-20343: cannot shrink /dev/vx/rdsk/rootdg/perforce - blocks are currently in use.
VxVM vxresize ERROR V-5-1-7514 Problem running fsadm command for volume perforce, in diskgroup rootdg

I may have to backup/newfs/restore on this one. Too lazy to open a Symantec case because it’s not a big priority.

  • Share/Bookmark
No Comments

Sparse vs. Whole-root Zones patching times

Solaris, UNIX

Someone had a question for me – does patching a sparse zone take less time than patching a whole-root zone? My first instinct was “yes”, because there would be much less data to copy into each zone, as some file systems like /usr are shared with the global zone. I decided to test both scenarios.

Here is the procedure I used:

Rebooted server to clear inode cache, memory pages, etc. With 3 whole-root zones installed, used PCA (http://www.par.univie.ac.at/solaris/pca/), and patched, adding 106 patches to the system. Rebooted, removed the zones and backed out the 106 patches. Rebooted and installed 3 sparse zones and performed the same patching again.

Patching whole-root zones: 88 minutes to install 106 patches

Patching sparse zones: 72 minutes to install 106 patches

Hmm not all that different. Not quite what I expected, but good to know.

Setup : SunFire V440, using all local disk/ SVM mirrored, 4GB RAM, Solaris 10 update 4, patching to the EIS May 2008 level.

UPDATE: I patched the server without any zones also, and it took only 30 minutes. My sub-par math tells me each sparse zone took 14 minutes to patch, and each whole root took 19 minutes.

  • Share/Bookmark
No Comments

Mounting soft partitions from network boot?

Solaris, UNIX

Let’s say you hosed your root partition and have to boot from CD or network. You have data on soft partitions you need to access, which aren’t very easily accessible, because  they are…well..soft. Here’s the answer. Just import the SVM configuration from the root disk and mount it up.

# mount -o ro /dev/dsk/c0t0d0s0 /a
# cp /a/kernel/drv/md.conf /kernel/drv/md.conf
# umount /a
# update_drv -fmd
Cannot unload module: md
Will be unloaded upon reboot.
Forcing update of md.conf.
devfsadm: mkdir fialed for /dev 0xled: Read-only file system
devfsadm: inst_sync failed for /etc/path_to_inst.1359: Read-only file system
devfsadm: WARNING: failed to update /etc/path_to_inst
# metainit -r
# mount /dev/md/dsk/d52 /mnt #(soft partition)
  • Share/Bookmark
2 Comments

en_US.utf-8 locale in Solaris 10

Solaris, UNIX

We were missing this locale on our Solaris machines, and some developers needed it for new applications. It turns out our Jumpstart server wasn’t installing the package that contains the locale: SUNWeu8os

Once installed, it shows up in the “locale -a” list.

  • Share/Bookmark
No Comments
« Older Posts
Newer Posts »