marți, 17 noiembrie 2009

HBAs on Solaris/ Linux

In case of servers connected to Fiber Channel Storage, sometimes you are required to provide informations about the Host Bus Adapters like WWN. There are two types of WWNs on a HBA; a node WWN (WWNN), which is shared by all ports on a host bus adapter, and a port WWN (WWPN), which is unique to each port.

On Solaris, you can use fcinfo.
root@testhost ~$ fcinfo hba-port
HBA Port WWN: 10000000c9722f6a
OS Device Name: /dev/cfg/c5
Manufacturer: Emulex
Model: LPe11002-S
Firmware Version: 2.80a4 (Z3F2.80A4)
FCode/BIOS Version: 1.50a9
Serial Number: 0999BG0-07510003DZ
Driver Name: emlxs
Driver Version: 2.31o (2008.10.20.14.00)
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: not established
Node WWN: 20000000c9722f6a
HBA Port WWN: 10000000c9722f69
OS Device Name: /dev/cfg/c3
Manufacturer: Emulex
Model: LPe11002-S
Firmware Version: 2.80a4 (Z3F2.80A4)
FCode/BIOS Version: 1.50a9
Serial Number: 0999BG0-07510003DZ
Driver Name: emlxs
Driver Version: 2.31o (2008.10.20.14.00)
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 20000000c9722f69


So there you have it, all needed informations. As you can see one is online and one is offline. The offline can mean that it has been unconfigured trough cfgadm or there is no link. See cfgadm link on how to unconfigure and configure a disk.

You can also do prtconf -vp or prtpicl -v and search for the need information by looking for wwn.

On Linux you can just use systool. As you can see below, Linux stores alot of useful information in /sys/class/ that can all be viewed with systool -av -c [class]
root@testhost# systool -av -c fc_host
Class = "fc_host"

Class Device = "host3"
Class Device path = "/sys/class/fc_host/host3"
active_fc4s = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
fabric_name = "0x1000080088a04a7f"
issue_lip =
maxframe_size = "2048 bytes"
node_name = "0x20000000c9775d9c"
port_id = "0x651813"
port_name = "0x10000000c9775d9c"
port_state = "Online"
port_type = "NPort (fabric via point-to-point)"
speed = "2 Gbit"
supported_classes = "Class 3"
supported_fc4s = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit"
tgtid_bind_type = "wwpn (World Wide Port Name)"
uevent =

Device = "host3"
Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/host3"
uevent = store method only

vineri, 13 noiembrie 2009

Soft Partitions

As you might know, in Solaris trough the usual method of formatting your drives/storage you can only make 8 slices ( usually 2 represents the whole disk).

The problem comes when you don't actually know how many partitions you will need in the future. This is where Soft Partitions come in.

Using metainit you can have up to 8192 Soft Partitions,but by default you can have d0-d127. To have more you would have to change the Solaris Volume Manager( SVM) configurations. More details here.

There are 2 ways to create Soft Partitions:
1.#metainit metadevice_name -e c#t#d#s# size
With this you can assign a metadevice to a portion of the maximum storage a slice has. So a good idea is to create with format a single mountable ( wm flags ) slice that stores all the storage and then allocate it to different metadevices as needed. Let's say you have 10GB of space and you want 3 partitions each of 3GB and 1GB leftover. Simple:
ex:
#metainit d30 -p c1t0d0s0 3G
#metainit d31 -p c1t0d0s0 3G
#metainit d32 -p c1t0d0s0 3G
You can check it all afterwards with metastat. Downside is it doesn't tell you how much storage you have used out of your total storage. When you will run out of storage, it will just say:
metainit: testhost: d39: not enough space available for request
You can grow your soft partitions size later as explained below. Don't forget to newfs the partitions and mount and add them to /etc/vfstab

2.#metainit metadevice_name -p -e c#t#d# size

With the -e option you assign the whole disk device to one Soft Partition. Let's say you have /dev/dsk/c0t0d0 with 10GB of space, but initially you only want to use 2GB of space
ex:
#metainit d3 -p -e /dev/dsk/c0t0d0 2G

This will create 2 slices on the disk: one with almost all the storage and another that one with at least 4MB of data containing a "state database replica"

Later on you can expand this soft partition using
#mount /dev/md/dsk/d3 /data
#metattach d3 8g
#growfs -M /data /dev/md/rdsk/d3