welcome: please sign in
location: ISCSI

iSCSI SAN Project

Progress

"Layered" Progress

Recovering from a Network Error

NOP-Out commands are sent periodically to the iSCSI device. These commands are more or less the SCSI equivalent of a ping. If they fail the multipath layer can be used to switch over to another block device (path to the target). Commands can also be queued (128 commands are kept in queue by default). Additionally, a session retry counter will periodically try to reconnect to a downed session.

Goals

Production Machines utilizing iSCSI block devices

iSCSI Configuration

Configuration for Open-iSCSI is kept in /etc/iscsi/* as iscsid.conf & initatorname.iscsi.

Random names which identify each node can be generated with iscsi-name and anything after the colon may be modified for human-legibility.

InitiatorName=iqn.2005-03.org.open-iscsi:b62920e68c2csandbox

The Open-iSCSI model requires running the iscsid service, initially discovering the iSCSI services on the network and logging on to available services.

/sbin/iscsid - start the service iscsiadm -m node -l - login to services. With four paths this will render 4x(available services) block devices in /dev

To create && attach iSCSI storage one must assign the host an initiator name, "initiate" to the storage array, map the host to a virtual disk (on the array), and then the host must log in.

After mounting if multipath is to be setup to configure failover and a virtual device which will represent the multiple paths to the identical target. The system will utilize this virtual device for all block operations.

iscsisandbox iscsi # iscsiadm -m discovery -t sendtargets -p 192.168.0.80
192.168.0.83:3260,2 iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06
192.168.0.80:3260,1 iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06
192.168.0.82:3260,2 iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06
192.168.0.81:3260,1 iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06

And to login...

iscsisandbox iscsi # iscsiadm -m node -l
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.82,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.81,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.83,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.80,3260]
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.82,3260]: successful
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.81,3260]: successful
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.83,3260]: successful
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.6001e4f00025c3af0000000047a2bf06, portal: 192.168.0.80,3260]: successful

DM_Multipath Configuration

Identifying Devices

Cute little one liner:

for DSK in /dev/sd?; do echo "${DSK}: $(scsi_id -g -u -s /block/${DSK##*/}) \
   ($(scsi_id -g -u -s /block/${DSK##*/} | wc -m))"; done | sort -uk 2

Gives us:

/dev/sdd: 36001e4f00025c3af0000000000000000 (34)
/dev/sda: 36001e4f00025c3af000005f5481ed1e2 (34)
/dev/sdb: 36001e4f00025cad90000000000000000 (34)

Which we edit into our /etc/multipath.conf...

blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^hd[a-z][[0-9]*]"
        devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
        devnode "^sda[0-9]*"
        device {
                vender Dell.*
                product Universal.*
        }
        device {
                vender Dell.*
                product Virtual.*
        }
}
defaults {
        getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
}
devices {
        device {
                vendor DELL*
                product MD3000*
                path_grouping_policy failover
                getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
                features "1 queue_if_no_path"
                path_checker rdac
                prio_callout "/sbin/mpath_prio_tpc /dev/%n"
                hardware_handler        "1 rdac"
        }
}
multipaths {
        multipath {
                wwid            36001e4f00025c3af000005f5481ed1e2
                alias           zimbra
                path_grouping_policy    failover
                path_checker    tur
        }
}

Now how easily we can identify and work with our devices:

[root@zimbra etc]# service multipathd start
Starting multipathd daemon:                                [  OK  ]
[root@zimbra etc]# ls /dev/mapper/
control        dell0          dell0p1        dell1          rootvg-lvroot  rootvg-lvswap  zimbra
[root@zimbra etc]# mkfs.ext3 /dev/mapper/zimbra
[root@zimbra zimbra]# mount /dev/mapper/zimbra /opt/zimbra/

SAN Management

Coming Soon!

Clustering Services

DRBD (Duplicated, Replicated Block Device

DRBD :allows all hard-disk writes to a given device to be mirrored over the network to a second server. The practical upshot of which is that when combined with a heart-beat monitoring service we can keep entire servers at hot spares.

Testing Failover

Splitbrain

Splitbrain :When both pair think the other has gone online and becomes the primary which results in two sets of modified data.

Master Down

Slave Down

====Backups?==== ===Will DRBD / Disk mirroring be enough to fail-over servers seamlessly?===

GFS (Global File System)

GFS :is a product of redhat clustering services. It allows multiple machines to access a shared storage pool like an iSCSI SAN simultaneously with proper locking to ensure all data is kept consistent.

iscsisandbox gfs #  mkfs.gfs -t playground:sandbox -p lock_dlm -j2 /dev/mapper/sandbox
This will destroy any data on /dev/mapper/sandbox.
  It appears to contain a GFS filesystem.

Are you sure you want to proceed? [y/n] y

Device:                    /dev/mapper/sandbox
Blocksize:                 4096
Filesystem Size:           5177000
Journals:                  2
Resource Groups:           80
Locking Protocol:          lock_dlm
Lock Table:                playground:sandbox

Syncing...
All Done


CategoryDocumentation

ISCSI (last edited 2013-12-12 13:33:45 by meyersh)