Tuesday, August 18, 2009

Removing and unregistering a diskset from Sun Cluster

Today I realized that the procedure "How to Remove and Unregister a Device Group (Solaris Volume Manager)" lacks a specific example.
Lets assume the following diskset configuration on a Sun Cluster with two nodes named cluster01 and cluster02:
# cat /etc/lvm/md.tab
test_ds/d1 -m test_ds/d10
test_ds/d10 1 1 /dev/did/rdsk/d4s0

# metaset -s test_ds -a -h cluster01 cluster02
# metaset -s test_ds -a /dev/did/rdsk/d4
# metaset -s test_ds -a -m cluster01 cluster02
# metainit test_ds/d10
test_ds/d10: Concat/Stripe is setup
# metainit test_ds/d1test_ds/d1: Mirror is setup
# cldg show
=== Device Groups === Device Group Name: test_ds Type: SVM failback: false Node List: cluster01, cluster02 preferenced: true numsecondaries: 1 diskset name: test_ds
# cldg status
=== And now assume you want to remove and unregister this diskset again. Generally speaking you want to make sure prior to perform this, that
no file system is mounted on any node from this diskset
no entry on any node for this diskset is active in /etc/vfstab
no SUNW.HAStoragePlus resource is using this diskset or a file system from this diskset
Find out on which node the diskset is primary/online:
# cldg status
=== Cluster Device Groups ===--- Device Group Status ---Device Group Name Primary Secondary Status----------------- ------- --------- ------test_ds cluster01 cluster02 Online
Perform all following on the node where the diskset is primary/online (here: pplanet1):
Remove all metadevices on that diskset:
# metaclear -s test_ds -a
test_ds/d1: Mirror is clearedtest_ds/d10: Concat/Stripe is cleared

Remove all devices from that diskset (you need the -f option for the last one):
# metaset -s test_ds -d -f /dev/did/rdsk/d4

On a two node cluster, if mediators are configured, remove them:
# metaset -s test_ds -d -m pplanet1 pplanet2
For all nodes (but the node where the diskset is primary last) perform:
# metaset -s test_ds -d -h cluster02
# metaset -s test_ds -d -h cluster01
In /var/adm/messages you see the following after the last command:
Jun 2 02:21:33 cluster01 Cluster.Framework: [ID 801593 daemon.notice] stdout: no longer primary for test_ds
And you can confirm that the diskset is now removed and unregistered:
# cldg list#

No comments: