Know about Disksets
Before going to the basic understanding of the disksets let us first know the necessity for disksets in solaris there are many prime reasons people prefer for going into disksets
- Availability
- Redundancy
- Efficiency
Availability: Disksets are more reliable under sun cluster environment but not limited to HA they are even highly available out of the HA concept as well (Fail over Configuration)
Redundancy: Always a first and foremost term when it comes to disk management .this can be achieved via disksets with RAID being built over the disks from the disksets
Efficiency: This can be spoken in two terms on the aspect of system administration ,with help of disksets we can efficiently organize the metadevices under diskgroups ,reuse the same metadevices on the different host(metaimport) , same diskset could be reused on another node via metaimport ,provided if the disk are externally connected (storage).This sometimes happens in cases like if the RAIDs are needed to be maintained and used on a diifernt system in other words if we want to use the same LUNS on other system . So far, I have not tried but will be doing this very soon, we will share the same as soon as possible on gurkulindia
Requirement:
If availability comes as a first choice as a sys admin then the prime requirement for an disksets to be created under solaris volume manager is this ,The disk used should be visible on two hosts with the same device number and the shared disk should always use the same device driver by this is not applicable when the disksets are not multiowned by the hosts
Before primarily getting into creation of disksets we will focus on the terminologies
Local Disksets:
As name specifies disksets containing disk locally on the system .This belongs to specific host .
Named Disksets:
Back again Named disksets are again of two types 1)Shared 2)Autotake disk sets
Shared Disk Sets :
As name specifies it is been shared on multiple host.It is available to all the nodes but only the master (Owner) can access it In cluster environment the ownership of the shared disk gets transferred to another when the master node is no more alive ,this is called multiowner disk set .This achieved along with the “Device Group” which will be under sun cluster control .
Autotake Disksets:
The autotake diskset concept was initiated after solaris9 .Prior to that SVM did nto support auto mount of the Fs that are created on volumes from the diskset through /etc/vfstab,So we had to manually issue a command to make the Fs on diskset to be accessible .With autotake feature enabled the Fs can be made to be accessed at the time of boot
How does disksets function :
Disksets under SVM should be created and administered with disksuite commands After the disks are added to a set, the diskset can be reserved or released by hosts in the diskset. When a diskset is reserved by a host, the other host in the diskset cannot access the data on the drives in the diskset. To perform maintenance on a diskset, a host must be the owner of the diskset or have reserved the diskset. A host takes implicit ownership of the diskset by putting the first drives into the set.
The SCSI reserve command is issued to each drive in the diskset to reserve it for exclusive use by the current host. Each drive in the diskset is probed once every second to determine that it is still reserved.
Important points to be noted
1) SVM places state database replicas on eash disk in the set on slice 7 automatically
2) When the disk is added to the disk set it automatically re-partitions
3) When it comes to autotake feature the SVM automatically mounts the volumes based on /etc/vfstab and hence the disk set must be associated with only one host
4) There is another very good concept in disksets which involves metaimport we would come again on this in our later writing queue
Now time for a basic tutorial on how to create a diskset
I have the following disk being used c2t2d0,c2t1d0.My hostname is test01 and the diskset name am going to use is test01_dg
Step 1 :Creation of diskset
# metaset -s test01_dg -a -h test01
#
Here –s specifies the diskset name –a specifies add –h specifies hostname
And verify the created diskset
# metaset -s test01_dg
Set name = test01_dg, Set number = 1
Host Owner
test01
#
From the above oputput we can see that the diskset has been created but no disks are still added to the diskset
Step 2 :Adding a disk into the diskset
Only disks that meet the following conditions can be added to a diskset:
1) The disk must not be in use in a volume or hot spare pool.
2) The disk must not contain a state database replica.
3) The disk must not be currently mounted, swapped on, or otherwise opened for use by an
application.
Syntax is
# metaset -s test01_dg -a c2t2d0
# metaset -s test01_dg -a c2t1d0
And verify backagain
# metaset -s test01_dg
Set name = test01_dg, Set number = 1
Host Owner
test01 Yes
Drive Dbase
c2t2d0 Yes
c2t1d0 Yes
Step 3: After this now diskset is in place ,who is going to own him? , we need to tell the OS about the owner of the diskset nowin principle it’s the host who needs to own the diskset ,from the syntax above we have created the diskset test01_dg with host test01 ,and its obvious that owner of the diskset is host test01 ,fine we need to tell the SVM that he is the owner so we need to execute the below on the host tes01
# metaset -s test01_dg -t -f
#
With this the basic diskset administration is done from now on we are moving onto creating of metadevices using the diskset
Step 4: Now creating concat onto which we we are creating a one way mirroring and soft partioning it
# metainit -s test01_dg d101 2 1 c2t1d0s0 1 c2t2d0s0
test01_dg/d101: Concat/Stripe is setup
#
To check the status of the metadevice in the diskset
# metastat -s test01_dg d101
test01_dg/d101: Concat/Stripe
Size: 8331264 blocks (4.0 GB)
Stripe 0:
Device Start Block Dbase Reloc
c2t1d0s0 0 No Yes
Stripe 1:
Device Start Block Dbase Reloc
c2t2d0s0 0 No Yes
Device Relocation Information:
Device Reloc Device ID
c2t1d0 Yes id1,sd@n6000c29032d976cdeccd0c29937101ee
c2t2d0 Yes id1,sd@n6000c2922c2df555a0534f32b2536b2a
#
Step 5:Creating a oneway mirror d100 from the concat d101
#metainit -s test01_dg d100 -m d101
test01_dg/d100: Mirror is setup
#
Step 6:Create softpartion from the mirror and creating the FS
#metainit -s test01_dg d112 -p d100 1G
d112: Soft Partition is setup
#
#metainit -s test01_dg d111 -p d100 1G
d111: Soft Partition is setup
#
#newfs /dev/md/test01_dg/rdsk/d112
/dev/md/test01_dg/rdsk/d112: Unable to find Media type. Proceeding with system determined parameters.
Warning: 9216 sector(s) in last cylinder unallocated
/dev/md/test01_dg/rdsk/d112: 2107392 sectors in 104 cylinders of 24 tracks, 848 sectors
1029.0MB in 26 cyl groups (4 c/g, 39.75MB/g, 19008 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 82288, 164544, 246800, 329056, 411312, 493568, 575824, 658080, 740336,
1316128, 1398384, 1480640, 1562896, 1645152, 1727408, 1809664, 1891920,
1974176, 2056432
#newfs /dev/md/test01_dg/rdsk/d111
newfs: construct a new file system /dev/md/test01_dg/rdsk/d111: (y/n)? y
/dev/md/test01_dg/rdsk/d111: 2097152 sectors in 128 cylinders of 64 tracks, 256 sectors
1024.0MB in 26 cyl groups (5 c/g, 40.00MB/g, 19136 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 82208, 164384, 246560, 328736, 410912, 493088, 575264, 657440, 739616,
1314848, 1397024, 1479200, 1561376, 1643552, 1725728, 1807904, 1890080,
1972256, 2054432,now mount the device onto /application_test and /logs_test
# mount /dev/md/test01_dg/dsk/d112 /application_test
# mount /dev/md/test01_dg/dsk/d111 /logs_test
#
Lets stop and scroll back again a bit above on concept called autotake ,here we have created the diskset and the vfstab entry has been made and the FS has been successfully mounted but this will not let your Fs to be mounted every time at boot remember the concept of “autotake” .So we need to enable the autotake option and tell the SVM that the Fs needs to be mounted at the time of boot .Never forget the “mount at boot” field to be marked “yes” in vfstab 8-)
Step 7:
# metaset -s test01_dg -A enable
#
and now check for the diskset status
# metaset -s test01_dg
Set name = test01_dg, Set number = 1
Host Ownertest01 Yes (auto)
Drive Dbase
c2t2d0 Yes
c2t1d0 Yes
#
thats it
This is an simple know how concepts on disksets .. Still further more to come on with disksets in sun clusters and import concept ..Keep reading our posts .Thanks for your support .Queries are welcomed .
@Michael, really apprecite your efforts. This is very nice post for people to get started with Metasets in SVM. Though its not only used in SUN clusters but some of the small clients use metaset instead of VXVM to avoid License costs of veritas.
Hi Yogesh
how are you
Hello Raghu Bhai, I am fine, how r u?..Nice to see you on our gurkulindia.
@Yogesh thnk u so much !!
hi very helpful to learn new idea from your admin page thank u so much Mr.Yogesh
Hi one clarification why will we use -m and -p option in mirror pls let me know
Hi yogesh,
Kindly post cluster troublshooting so that handle some live issue for cluster
Regards
Yogesh Sahni