Buscador

lunes, 17 de enero de 2011

Multipath Red hat y Suse

Multipath Setup
  • First off, make sure your storage array is supported by multipath. From my knowledge, all of the major vendors are, but you may have one that isn't on the list. My setup is RedHat 5.4 with an EMC CX array which is convenient as multipath has integrated support for the CLARiiON line. The key section to note from your vendor is any special device entry under /etc/multipath.conf they may need.

  • Next is to ensure multipath is installed. For RedHat this is in the package device-mapper-multipath, for SuSE it is multipath-tools. Do a package search for multipath and you should find it.

  • 1) Make sure you have the packages needed by RHEL, otherwise install them.
rpm -q device-mapper
rpm -q device-mappermultipath
yum install device-mapper
yum install device-mapper-multipath
  • 2) Install QLogic Drivers if needed, or utilize RHEL drivers. In my case I am using HP C-Class blades with Qlogic HBA cards. HP drivers can be found at the HP site, driver is called hp_sansurfer. I am utilizing RHEL built in drivers, but you can install the HP/QLogic drivers as follows: (http://www.qlogic.com/Pages/default.aspx)
rpm -Uvh hp_sansurfer-5.0.1b45-1.x86_64.rpm
  • 3) If Qlogic HBA, install the SanSurfer CLI, this is very useful program for doing things with QLogic HBA cards, it can be downloaded at QLogic website, install as follows:
rpm -Uvh scli-1.7.3-14.i386.rpm
  • 4) Install NetApp Host Utilities Kit, the package is a tar.gz file, you can find it at the now site http://now.netapp.com.
Open it and run the install shell script
netapp_linux_host_utilities_5_0.tar.gz
  • 5) Once Everything is installed on the host, create the LUN and ZONE it from the NetApp, Brocade(SAN Fabric),Host
To find your WWPNs, use the scli as follows:
# scli –i all
// Use the WWPN numbers for the iGroup and Brocade Aliases
  • 6) Once it has been Zoned and mapped correctly, verify if your RHEL host can see it.
// Rescan HBA for new SAN Luns

# modprobe -r qla2xxx
# modprobe qla2xxx
// Check the kernel can see it
# cat /proc/scsi/scsi
# fdisk –lu
  • 7) Utilize NetApp tools to see LUN connectivity
// Check your host and utilities see the LUNs
[root@server ~]# sanlun lun show
controller:          lun-pathname          device filename  adapter  protocol          lun size                                      lun state
NETAPPFILER:  /vol/servervol/serverlun  /dev/sdf         host6    FCP          100g (107374182                             400)   GOOD
NETAPPFILER:  /vol/servervol/serverlun  /dev/sda         host4    FCP          100g (107374182                             400)   GOOD
NETAPPFILER:  /vol/servervol/serverlun  /dev/sde         host6    FCP          100g (107374182                             400)   GOOD
NETAPPFILER:  /vol/servervol/serverlun  /dev/sdc         host5    FCP          100g (107374182                             400)   GOOD
NETAPPFILER:  /vol/servervol/serverlun  /dev/sdd         host5    FCP          100g (107374182                             400)   GOOD
NETAPPFILER:  /vol/servervol/serverlun  /dev/sdb         host4    FCP          100g (107374182                             400)   GOOD
 
  • 8 ) Utilize NetApp tools to check multipathing, not set yet
[root@server ~]# sanlun lun show -p
NETAPPFILER:/vol/servervol/serverlun (LUN 0)                Lun state: GOOD
Lun Size:    100g (107374182400) Controller_CF_State: Cluster Enabled
Protocol: FCP           Controller Partner: NETAPPFILER2
Multipath-provider: NONE
--------- ---------- ------- ------------ --------------------------------------------- ---------------
   sanlun Controller                                                            Primary         Partner
   path         Path   /dev/         Host                                    Controller      Controller
   state        type    node          HBA                                          port            port
--------- ---------- ------- ------------ --------------------------------------------- ---------------
     GOOD  primary       sdf        host6                                            0c              --
     GOOD  secondary     sda        host4                                            --              0c
     GOOD  secondary     sde        host6                                            --              0c
     GOOD  secondary     sdc        host5                                            --              0d
     GOOD  primary       sdd        host5                                            0d              --
     GOOD  primary       sdb        host4  

0c              --


  • Optional Configuration
Now if you have a different storage array you may also have to add the vendor specified devices entry, perhaps something like this:

defaults
{
        user_friendly_names yes
        max_fds max
        queue_without_daemon no
}
blacklist {
        ###devnode "*"
           devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
           devnode "^hd[a-z]"
           devnode "^cciss!c[0-9]d[0-9]*"  # Note the cciss, usual in HP
}
multipaths {
        multipath {
                wwid    360a98000486e57674834527533455570    # You found this
                alias   netapp # This is how you want to name the device in your host
                               # server LUN on NETAPPFILER
        }
}
devices
{
        device
        {
        vendor "NETAPP"
        product "LUN"
        getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
        prio_callout "/sbin/mpath_prio_ontap /dev/%n"
        features "1 queue_if_no_path"
        hardware_handler "0"
        path_grouping_policy group_by_prio
        failback immediate
        rr_weight uniform
        rr_min_io 128
        path_checker directio
        flush_on_last_del yes
}
}

This is only an example, check with your vendor. If they support multipath, they have documentation with the correct entry for the current features and models.


Attribute Description
vendor Specifies the vendor name of the storage device to which the device attributes apply, for example COMPAQ.
product Specifies the product name of the storage device to which the device attributes apply, for example HSV110 (C)COMPAQ.
product_blacklist Specifies a regular expression used to blacklist devices by product.
path_grouping_policy
Specifies the default path grouping policy to apply to unspecified multipaths. Possible values include:
failover = 1 path per priority group
multibus = all valid paths in 1 priority group
group_by_serial = 1 priority group per detected serial number
group_by_prio = 1 priority group per path priority value
group_by_node_name = 1 priority group per target node name
getuid_callout Specifies the default program and arguments to call out to obtain a unique path identifier. An absolute path is required.
prio_callout Specifies the the default program and arguments to call out to obtain a path weight. Weights are summed for each path group to determine the next path group to use in case of failue. "none" is a valid value.
path_checker Specifies the default method used to determine the state of the paths. Possible values include readsector0 and tur, emc_clariion, hp_sw, and directio.
path_selector Specifies the default algorithm to use in determining what path to use for the next I/O operation.
failback
Specifies path group failback.
A value of 0 or immediate specifies that as soon as there is a path group whith a higher priority than the current path group the system switches to that path group.
A numeric value greater than zero specifies deferred failback, expressed in seconds.
A value of manual specifies that failback can happen only with operator intervention.
features The extra features of multipath devices. The only existing feature is queue_if_no_path, which is the same as setting no_path_retry to queue.
hardware_handler Specifies a module that will be used to perform hardware specific actions when switching path groups or handling I/O errors. Possible values include 0, 1 emc, and 1 rdac. The default value is 0.
rr_min_io Specifies the number of I/O requests to route to a path before switching to the next path in the current path group. The default value is 1000.
rr_weight
If set to priorities, then instead of sending rr_min_io requests to a path before calling selector to choose the next path, the number of requests to send is determined by rr_min_io times the path's priority, as determined by the prio_callout program. Currently, there are priority callouts only for devices that use the group_by_prio path grouping policy, which means that all the paths in a path group will always have the same priority.
If set to uniform, all path weights are equal. The default value is uniform.
no_path_retry
A numeric value for this attribute specifies the number of times the system should attempt to use a failed path before disabling queueing.
A value of fail indicates immediate failure, without queuing.
A value of queue indicates that queuing should not stop until the path is fixed.
The default value is (null).
  • Multipath Daemon
The last step is to get the daemon running. Its job is to reconfigure paths when something breaks or when a link is put back in service.

Under RedHat / SuSE this is relatively simple to do:
chkconfig multipathd on

You can validate this with:
chkconfig --list multipathd

And finally startup the daemon immediately with:
service multipathd start
- or -
/etc/init.d/multipathd start



  • For example, the output of a multipath command might appear as follows:
mpath1 (3600d0230003228bc000339414edb8101) [size=10 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [prio=1][active]
 \_ 2:0:0:6 sdb 8:16 [active][ready]
\_ round-robin 0 [prio=1][enabled]
 \_ 3:0:0:6 sdc 8:64 [active][ready]

Option Description
-l Display the current multipath configuration gathered from sysfs and the device mapper.
-ll Display the current multipath configuration gathered from sysfs, the device mapper, and all other avilable components onthe system.
-f device Remove the named multipath device.
-F Remove all multipath devices.

  • You can use the dmsetup command to find out which device mapper entries match the multipathed devices. The following command displays all the device mapper devices and their major and minor numbers. The minor numbers determine the name of the dm device. For example, a minor number of 3 corresponds to the multipathed device /dev/dm-3.
# dmsetup ls
mpath2  (253, 4)
mpath4p1        (253, 12)
mpath5p1        (253, 11)
mpath1  (253, 3)
mpath6p1        (253, 14)
mpath7p1        (253, 13)
mpath0  (253, 2)
mpath7  (253, 9)
mpath6  (253, 8)
VolGroup00-LogVol01     (253, 1)
mpath5  (253, 7)
VolGroup00-LogVol00     (253, 0)
mpath4  (253, 6)
mpath1p1        (253, 10)
mpath3  (253, 5)


Host bus adapter time-outs are typically set up for non-multipath IO environments, because the only alternative would be to error out the IO and propagate the error to the application. However, with Multipath IO, some faults (like cable failures) should be propagated upwards as fast as possible so that the multipath IO layer can quickly take action and redirect the IO to another, healthy path.
To configure time-outs for your host bus adapter, add the appropriate options to /etc/modprobe.conf.local. For the QLogic 2xxx family of host bus adapters, for example, the following settings are recommended:
options qla2xxx qlport_down_retry=1 ql2xfailover=0 ql2xretrycount=5

  • Detectar disco!!
          echo "- - -" > /sys/class/scsi_host/host0/scan
          echo "- - -" > /sys/class/scsi_host/host1/scan
  • Borrar disco!! 
     echo 1 > /sys/block/sdX/device/delete
     echo 1 > /sys/block/sdY/device/delete

No hay comentarios:

Publicar un comentario