Tuesday, March 13, 2012

solaris volume manager diskset in local zone

I usually choose zfs volume when I need present raw devices in solaris 10 local zones, however, in certain scenarios ZFS is not a good fit. One of the example is the /tempdb file systems in Sybase 12.5 or Sybase 15. There is no directio semantic in ZFS and Sybase /tempdb could not work properly on ZFS files system (poor performance v.s. UFS) In such cases, I need present at least the /tempdb file systems as UFS. In order to make the disks portable (transferred to another zone/system) I usually put them in Solaris Volume Manager diskset (metaset) so that it can be moved (export/import) if needed.

Another advantage using metaset instead of plain ufs mount is the volume management provided by SVM allows me to migrate volume online to other storage later on without rebooting/reconfiguring servers. This is usually true when SAN disks are hardware raid and thus only appears to be single disk under solaris (no software volume management if not under ZFS). I usually put the disk in a single plex mirror device and then create soft partition on top of the mirror device. It gives me more flexibility should I need migrate data using volume management features.

For example:
# metaset -s Syb01MS -a -A enable -h host1 (to create metaset Syb01MS on host1, auto import at reboot)
# metaset -s Syb01MS -a c5t6xxxd0 (add disk, the disk will automatically relabeled with only s0 and s7 )
# metainit -s Syb01MS d1 1 1 c5t6xxxd0s0 ( create a single plex submirror d1)
# metainit -s Syb01MS d0 -m d1 (create a single plex mirror device d0)
# metainit -s Syb01MS d11 -p d0 32g ( starting to create soft partitions on top of meta device d0, some are raw volumes, some can be UFS file systems)

Following are some examples in zonecfg info:

fs:
dir: /tempdb01
special: /dev/md/Syb01MS/dsk/d71
raw: /dev/md/Syb01MS/rdsk/d71
type: ufs
options: [rw]
......
device
match: /dev/md/shared/1/rdsk/d*
device
match: /dev/md/Syb01MS/rdsk/d*
.....

The metaset Syb01MS contains all disks needed for the sybase instance in local zone. The raw volumes are presented by adding two entries for device directive. The /dev/md/shared/1/... is a must, since the metaset name is a symbolic link to the metaset number (1 in this case) under /dev/md/shared/. In this way, the raw devices will show up in local zones as expected. What is more, I will manually create a directory and put another set of symbolic links and pointing to these device entries (raw volume), such as:

# ls -l /SybDev01
total 44
lrwxrwxrwx 1 sybase sybase 24 May 17 2011 DATA01 -> /dev/md/shared/1/rdsk/d11
lrwxrwxrwx 1 sybase sybase 24 May 17 2011 DATA02 -> /dev/md/shared/1/rdsk/d12
.......

It will give sysadmin more flexibility should we need make any changes of the underlying devices later.

No comments:

Post a Comment