Tuesday, March 30, 2010

Removing and Unregistering a Disk Group from Sun Cluster

Lets see, how to remove a disk group from Sun Cluster running veritas volume manager. It was a bit surprising for me to see very little of this topic posted in the net, though, I did came across couple of posts for removing device groups with SVM.

Environment is a 3.1 Sun Cluster running VxVM. Normally, one would see this type of a request associated with removal of resource group or migration of applications from the server.

Make sure

a) no filesystems are mounted from the disk group.

b) Entries are not there in vfstab

In order to remove the disk group from the cluster control, you need to bring the device group offline from cluster control and then un-register the disk group from cluster.

1. Make sure no mounted file systems of the disk groups are present.

2. Make sure no entries are present in /etc/vfstab.

3. Make sure the volumes are removed ; # vxedit -g -rf rm

4. Sync the cluster ; # scconf -c -D name=,sync

5. Offline the disk group. ; # scswitch -F -D

6. Un-Register the disk group ; # scconf -r -D name=

7. Once the diskgroup is offline, Sun Cluster deports the disk group. You need to import the dg again and destroy it.

# vxdg import ; # vxdg destroy

Adding Filesystem resource to Sun Cluster

There is a task to add couple of filesystems to the cluster. When I had a look at the config, I realised that each file system is configured as a hastp resource. This somewhat makes my job easier. I Just have to create the volume, make it cluster aware & enable it on Sun Cluster. Lets see how can we make this happen.

1. Create volume ; # vxassist -g testdg make testvol 25g


2. Make entries in /etc/vfstab


3. Update the cluster ; # scconf -c -D name=testdg, sync


4. Create the filesystem ; # newfs /dev/vx/rdsk/testdg/testvol


5. Register it in sun cluster ; # scrgadm -a -j testvol-res -t SUNW.HAStoragePlus -g test-rg -x FileSystemMountPoints=/global/oracle/testvol -x AffinityOn=True


6. enable the resource ; # scswitch -e -j testvol-res


7. Verify the filesystems mounted.

Quorum devices in sun cluster

A quorum device is a disk shared by two or more nodes in the cluster to establish a quorum for the cluster to run. Cluster operates only when a quorum of votes is available. Quorum devices are necessary to protect the cluster from split brain and amnesia situations. Each quorum device must be connected to at least two nodes.

Adding a quorum device automatically configures node-to-device paths for the nodes attached to the device. Later, if we add more nodes to the cluster, we might need to update these paths by removing then adding back the quorum device.

A SCSI quorum device is considered to be any Sun Cluster supported attached storage which connected to two or more nodes of the cluster. Dual-ported SCSI-2 disks may be used as quorum devices in two-node
clusters. However, clusters with more than two nodes require that SCSI-3 PGR disks be used for all disks with more than two node-to-disk paths. We can use a disk containing user data or one that is a member of device group as a quorum device.

Quorum Arithmetic

Quorum equation states that a cluster must have the total number of configured votes, divided by two ( Remainders are discarded ) plus one.

Q = ( TQV /2 + 1 )

TQV – Total Quorum votes

Key to understanding quorum is learning how votes are assigned and counted. Each node in a configured cluster has one ( 1 ) quorum vote. Each shared storage device configured as quorum device has votes totaling the number of connected devices minus one QD = ( TQD – 1 ). For folks who need better understanding like me, it is the number of servers the quorum device is connected minus one. If the quorum device is connected to 3 servers, then quorum devices’ vote will be two ( 2 ).

Ownership of a quorum device is decided by SCSI reservations which will be dealt at a later post. Just for better understanding I am now posting couple of outputs which are for two node and three node cluster. One can do his or her own math to understand the quorum arithmetic disscussed above.

Two-node cluster

phys-host1 # scstat -q

– Quorum Summary –

Quorum votes possible: 3
Quorum votes needed: 2
Quorum votes present: 3

– Quorum Votes by Node –

Node Name Present Possible Status
———– ——– ——– ——
Node votes: phys-host1 1 1 Online
Node votes: phys-host2 1 1 Online

– Quorum Votes by Device –

Device Name Present Possible Status
———– ——- ——– ——
Device votes: /dev/did/rdsk/d101s2 1 1 Online

Three-node cluster

phys-host1:> /usr/cluster/bin/scstat -q

– Quorum Summary –

Quorum votes possible: 7
Quorum votes needed: 4
Quorum votes present: 7

– Quorum Votes by Node –

Node Name Present Possible Status
——— ——- ——– ——
Node votes: phys-host1 1 1 Online
Node votes: phys-host2 1 1 Online
Node votes: phys-host3 1 1 Online

– Quorum Votes by Device –

Device Name Present Possible Status
———– ——- ——– ——
Device votes: /dev/did/rdsk/d200s2 2 2 Online
Device votes: /dev/did/rdsk/d199s2

Solaris L3 Level Questions

These are some of the L3 level unix interview questions…


1. How do you replace a failed boot disk under meta in solaris? Step by step explanation?
2. How do you remove meta only for the root slice? remaining slices should run under meta?
3. what you would do if you want to replace a slice using metareplace option?
4. what is the significance of 51% state database replicas in SVM?
5. what are the common errors you find in Solaris Volume manager?
6. You have a boot disk under svm, the machine fails to boot and remains in ok prompt? what could be the possible reason?
7. metastat -p shows a metavolume needs replacement. Metavolume is a single way mirror only. Actually you find disk and metavolumes are ok and I/O is happening to the filesystems… how will you remove the metareplace message that comes out of metastat.
8. How to create a shared disk group in VxVM?
9. What is the difference between private and public regions in Veritas Volume manager?
10. what would you do if the private region of a particular disk group is full? What are the design considerations for the size of private region in Vxvm disk group?
11. How to replace a corrupt private region? in vxvm 3.5 and greater versions…
12. How would you convert a volume from gen to fsgen? why should you do that?
13. How can you unencapsulate a boot disk in VxVM?
14. How to identify multiple paths for a disk.
15. What is the difference between Vxdmp and EMC powerpath?
16. vxdisk -o alldgs list o/p shows some disk groups in braces… What does that signify?
17. what are the various layouts that are available in VxVM?
18.What is a layered volume? how to create it using vxmake?
19.How to quickly mirror a volume, if the volume is empty?
20. How to grow a volume?
21. What is the difference between failing and failed disks?
22. How to replace a failed disk in Veritas?
23. Plex is in a disabled state. How will you recover? what are the steps to follow?
24.what is the difference between detached and disassociate state of plexes?
25. Whats the boot process of VxVM?
26. Whats the difference between SVM and VxVM? What would you recommend to your clients? why?
27.What are the various clusters you have worked on?
28. Which cluster is better VCS or Sun cluster?
29. Compare and contrast VCS and Sun Cluster.
30.how will you start VCS service? What are the configuration files in VCS?
31. How would switch a service group?
32. How would you freeze a service group?
33. What is a Split brain scenario ?