Showing posts with label t2000. Show all posts
Showing posts with label t2000. Show all posts

Friday, 17 August 2012

Solaris mpathadm and fibre disks


We all know that SAN's provide an excellent way to centralise your storage, and any SAN in a big company is likely to require a level of redundancy in the connectivity. This entry will run through how to enable multipathing on Solaris.

This was written for Solaris 11 but should be relevant to Solaris 10.

The setup here is a T2000 running Solaris 11 with a Emulex LP10000DC HBA - thats a dual port card, connecting to a homebuilt 2u rackmount server running OpenIndiana, again with an Emulex LP10000DC. The servers are simply cross-connected port to port.


Step 1 - checking your setup


First identify your Fibre Channel devices


root@t2000:~# cfgadm -vl | ggrep -B1 fc
c4                             connected    configured   unknown
unavailable  fc-private   n        /devices/pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0:fc
c5                             connected    configured   unknown
unavailable  fc-private   n        /devices/pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0:fc


Now you know your controller, you can spot your disks. Since the SAN target has two adapters you can see two devices differing only by one number and one letter, eg c4t10000000C95187CAd0 and c5t10000000C95187CBd0

root@t2000:~# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <SEAGATE-ST973401LSUN72G-0556 cyl 14087 alt 2 hd 24 sec 424>
          /pci@780/pci@0/pci@9/scsi@0/sd@0,0
       1. c2t1d0 <FUJITSU-MAY2073RCSUN72G-0501 cyl 14087 alt 2 hd 24 sec 424>
          /pci@780/pci@0/pci@9/scsi@0/sd@1,0
       2. c4t10000000C95187CAd0 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,0
       3. c4t10000000C95187CAd1 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,1
       4. c4t10000000C95187CAd2 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,2
       5. c4t10000000C95187CAd3 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,3
       6. c4t10000000C95187CAd4 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,4
       7. c4t10000000C95187CAd5 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,5
       8. c4t10000000C95187CAd6 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,6
       9. c4t10000000C95187CAd7 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,7
      10. c4t10000000C95187CAd8 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,8
      11. c4t10000000C95187CAd9 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0/ssd@w10000000c95187ca,9
      12. c5t10000000C95187CBd0 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,0
      13. c5t10000000C95187CBd1 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,1
      14. c5t10000000C95187CBd2 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,2
      15. c5t10000000C95187CBd3 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,3
      16. c5t10000000C95187CBd4 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,4
      17. c5t10000000C95187CBd5 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,5
      18. c5t10000000C95187CBd6 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,6
      19. c5t10000000C95187CBd7 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,7
      20. c5t10000000C95187CBd8 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,8
      21. c5t10000000C95187CBd9 <OI-COMSTAR-1.0-10.00GB>
          /pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0/ssd@w10000000c95187cb,9

Step 2 - enable mpxio


The command to enable mpxio is stmsboot. From a quick look at the man page you'll see it applies to fp, mpt, mpt_sas, and iscsi storage. We don't want to multipath c2 as those are our boot disks!

To enable mpxio on the fibre channel devices, stmsboot -D fp -e

root@t2000:~# stmsboot -D fp -e
WARNING: This operation will require a reboot.
Do you want to continue ? [y/n] (default: y) y
The changes will come into effect after rebooting the system.
Reboot the system now ? [y/n] (default: y) y

As you reboot, you'll see the system reconfigure itself

Boot device: /pci@780/pci@0/pci@9/scsi@0/disk@0,0:a  File and args: 
SunOS Release 5.11 Version 11.0 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
stmsboot: Root is on ZFS
stmsboot: configuring devices

stmsboot: vfstab has been updated
stmsboot: dump on ZFS, no dumpadm update required
stmsboot: now regenerating boot archive
Hostname: t2000


Step 3 - check the results


Your fibre channel devices remain untouched...

root@t2000:~# cfgadm -vl | ggrep -B1 fc
c4                             connected    configured   unknown
unavailable  fc-private   n        /devices/pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2,1/fp@0,0:fc
c5                             connected    configured   unknown
unavailable  fc-private   n        /devices/pci@7c0/pci@0/pci@1/pci@0,2/lpfc@2/fp@0,0:fc

The format command shows the biggest change...

root@t2000:~# format 
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t600144F0ABA8000000004F311DDD0001d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311ddd0001
       1. c0t600144F0ABA8000000004F311DDF0002d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311ddf0002
       2. c0t600144F0ABA8000000004F311DE10003d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311de10003
       3. c0t600144F0ABA8000000004F311DE30004d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311de30004
       4. c0t600144F0ABA8000000004F311DE40005d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311de40005
       5. c0t600144F0ABA8000000004F311DE60006d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311de60006
       6. c0t600144F0ABA8000000004F311DE80007d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311de80007
       7. c0t600144F0ABA8000000004F311DE90008d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311de90008
       8. c0t600144F0ABA8000000004F311DEB0009d0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311deb0009
       9. c0t600144F0ABA8000000004F311DEC000Ad0 <OI-COMSTAR-1.0-10.00GB>
          /scsi_vhci/ssd@g600144f0aba8000000004f311dec000a
      10. c2t0d0 <SEAGATE-ST973401LSUN72G-0556 cyl 14087 alt 2 hd 24 sec 424>
          /pci@780/pci@0/pci@9/scsi@0/sd@0,0
      11. c2t1d0 <FUJITSU-MAY2073RCSUN72G-0501 cyl 14087 alt 2 hd 24 sec 424>
          /pci@780/pci@0/pci@9/scsi@0/sd@1,0

You can use the stmsboot -L command to view the changes in mapping, you can see that the two paths to d0 have both been mapped correctly.


root@t2000:~# stmsboot -L
non-STMS device name                    STMS device name
------------------------------------------------------------------
/dev/rdsk/c5t10000000C95187CBd9 /dev/rdsk/c0t600144F0ABA8000000004F311DEC000Ad0
/dev/rdsk/c5t10000000C95187CBd8 /dev/rdsk/c0t600144F0ABA8000000004F311DEB0009d0
/dev/rdsk/c5t10000000C95187CBd7 /dev/rdsk/c0t600144F0ABA8000000004F311DE90008d0
/dev/rdsk/c5t10000000C95187CBd6 /dev/rdsk/c0t600144F0ABA8000000004F311DE80007d0
/dev/rdsk/c5t10000000C95187CBd5 /dev/rdsk/c0t600144F0ABA8000000004F311DE60006d0
/dev/rdsk/c5t10000000C95187CBd4 /dev/rdsk/c0t600144F0ABA8000000004F311DE40005d0
/dev/rdsk/c5t10000000C95187CBd3 /dev/rdsk/c0t600144F0ABA8000000004F311DE30004d0
/dev/rdsk/c5t10000000C95187CBd2 /dev/rdsk/c0t600144F0ABA8000000004F311DE10003d0
/dev/rdsk/c5t10000000C95187CBd1 /dev/rdsk/c0t600144F0ABA8000000004F311DDF0002d0
/dev/rdsk/c5t10000000C95187CBd0 /dev/rdsk/c0t600144F0ABA8000000004F311DDD0001d0
/dev/rdsk/c4t10000000C95187CAd9 /dev/rdsk/c0t600144F0ABA8000000004F311DEC000Ad0
/dev/rdsk/c4t10000000C95187CAd8 /dev/rdsk/c0t600144F0ABA8000000004F311DEB0009d0
/dev/rdsk/c4t10000000C95187CAd7 /dev/rdsk/c0t600144F0ABA8000000004F311DE90008d0
/dev/rdsk/c4t10000000C95187CAd6 /dev/rdsk/c0t600144F0ABA8000000004F311DE80007d0
/dev/rdsk/c4t10000000C95187CAd5 /dev/rdsk/c0t600144F0ABA8000000004F311DE60006d0
/dev/rdsk/c4t10000000C95187CAd4 /dev/rdsk/c0t600144F0ABA8000000004F311DE40005d0
/dev/rdsk/c4t10000000C95187CAd3 /dev/rdsk/c0t600144F0ABA8000000004F311DE30004d0
/dev/rdsk/c4t10000000C95187CAd2 /dev/rdsk/c0t600144F0ABA8000000004F311DE10003d0
/dev/rdsk/c4t10000000C95187CAd1 /dev/rdsk/c0t600144F0ABA8000000004F311DDF0002d0
/dev/rdsk/c4t10000000C95187CAd0 /dev/rdsk/c0t600144F0ABA8000000004F311DDD0001d0

Step 4 - testing the resiliency


Check your starting point, for my setup I'd expect 2 paths, and for both to be working. 

root@t2000:~# mpathadm list lu
        /dev/rdsk/c0t600144F0ABA8000000004F311DEC000Ad0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DEB0009d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE90008d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE80007d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE60006d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE40005d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE30004d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE10003d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DDF0002d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DDD0001d0s2
                Total Path Count: 2
                Operational Path Count: 2

If I unplug one fibre and cause the system to use the disk i/o you'll see it spots one path has gone.

root@t2000:~# mpathadm list lu
        /dev/rdsk/c0t600144F0ABA8000000004F311DEC000Ad0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DEB0009d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DE90008d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DE80007d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DE60006d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DE40005d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DE30004d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DE10003d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DDF0002d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c0t600144F0ABA8000000004F311DDD0001d0s2
                Total Path Count: 1
                Operational Path Count: 1

Replug the fibre cable

root@t2000:~# mpathadm list lu
        /dev/rdsk/c0t600144F0ABA8000000004F311DEC000Ad0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DEB0009d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE90008d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE80007d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE60006d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE40005d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE30004d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DE10003d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DDF0002d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c0t600144F0ABA8000000004F311DDD0001d0s2
                Total Path Count: 2
                Operational Path Count: 2

Wednesday, 4 April 2012

Getting started with LDOMS on the T2000

Ok, this post comes in a bit late in terms of the technology, ldoms 1.3 is behind the curve and the T2000 has been put out to pasture, but hey, its all I have! The work here collates the work of others into a process that fits my need, and I'll back track and find the references to add at some point soon.

Due to the changes that came about with Oracle's takeover of Sun, this is performed using the last OpenSolaris b134 dev release. Do a stock install as you normally would. This install will form your primary ldom.

So, to get started, install the packages.

pkg install ldoms/ldomsmanager

Once installed, enable the services.

svcadm enable ldmd
svcadm enable vntsd
svcadm enable drd

Show the currently defined ldoms.

ldm list




Configure the primary ldom.

ldm add-vdiskserver primary-vds0 primary
ldm add-vconscon port-range=5000-5100 primary-vcc0 primary
ldm add-vswitch net-dev=e1000g0 primary-vsw0 primary
ldm add-vswitch net-dev=e1000g1 primary-vsw1 primary
ldm add-vswitch net-dev=e1000g2 primary-vsw2 primary
ldm add-vswitch net-dev=e1000g3 primary-vsw3 primary
ldm set-crypto 1 primary
ldm set-vpu 4 primary
ldm set-memory 1g primary
ldm add-config initial

Confirm your config is now added.

ldm list-config

Now apply your settings.

shutdown -i 6 -g 0 -y (or init 6 if you prefer)

Once the server returns, confirm the settings from above are applied.

ldm list



root@opensolaris:/etc# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      4     1G       3.8%  20m


Configure some disk backing devices.

zpool create ldompool mirror c2t2d0 c2t3d0
zfs create -V 10g ldompool/ldom1_vol1
zfs create -V 10g ldompool/ldom2_vol1


ldm add-vdiskserverdevice /dev/zvol/rdsk/ldompool/ldom1_vol1 ldom1_vol1@primary-vds0
ldm add-vdiskserverdevice /dev/zvol/rdsk/ldompool/ldom2_vol1 ldom2_vol1@primary-vds0

Add the dvd/cdrom device

ldm add-vdsdev options=ro /dev/rdsk/c3t0d0s2 cdrom@primary-vds0

Configure an actual ldom

ldm add-domain ldom1
ldm set-vcpu 8 ldom1
ldm set-mau 2 ldom1
ldm set-memory 4g ldom1
ldm add-vnet vnet0 primary-vsw0 ldom1
ldm add-vnet vnet1 primary-vsw1 ldom1
ldm add-vnet vnet2 primary-vsw2 ldom1
ldm add-vnet vnet3 primary-vsw3 ldom1
ldm add-vdisk vdisk1 ldom1_vol1@primary-vds0 ldom1
ldm add-vdisk cdrom cdrom@primary-vds0 ldom1
ldm set-variable autoboot=false ldom1
ldm set-variable boot-device=/virtual-devices@100/channel-devices@200/disk@0 ldom1
ldm bind-domain ldom1

Fire it up!

ldm start-domain ldom1