Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

Red Hat Enterprise Linux 6 Essentials eBook now available in PDF and ePub formats for only $9.99
RHEL 6 Essentials contains 40 chapters and over 250 pages.

28.2. Configuring persistent storage in Red Hat Enterprise Linux 6

This section is for systems with external or networked storage; for example, Fibre Channel, iSCSI, or SRP based storage devices. It is recommended that those systems have persistent device names configured for your hosts. This assists live migration as well as providing consistent device names and storage for multiple virtualized systems.
Universally Unique Identifiers (UUIDs) are a standardized method for identifying computers and devices in distributed computing environments. This section uses UUIDs to identify iSCSI, SRP, or Fibre Channel LUNs. UUIDs persist after restarts, disconnection and device swaps. The UUID is similar to a label on the device.
Systems which are not running multipath must use Single path configuration. Systems running multipath can use Multiple path configuration.
Single path configuration
This procedure implements LUN device persistence using udev. Only use this procedure for hosts which are not using multipath.
  1. Edit the /etc/scsi_id.config file.
    1. Add the following line:
      options=--whitelisted --replace-whitespace
      
      This sets the default options for scsi_id, ensuring returned UUIDs contains no spaces. The IET iSCSI target otherwise returns spaces in UUIDs, which can cause problems.
  2. To display the UUID for a given device run the scsi_id --whitelisted --replace-whitespace --device=/dev/sd* command. For example:
    # scsi_id --whitelisted --replace-whitespace --device=/dev/sdc
    1IET_00010001
    
    The output may vary from the example above. The output in this example displays the UUID of the device /dev/sdc.
  3. Verify the UUID output from the scsi_id --whitelisted --replace-whitespace --device=/dev/sd* command is correct and as expected.
  4. Create a rule to name the device. Create a file named 20-names.rules in the /etc/udev/rules.d directory. Add new rules to this file. All rules are added to the same file using the same format. Rules follow this format:
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id --whitelisted --replace-whitespace /dev/$name", RESULT=="UUID", NAME="devicename"
    
    Replace UUID and devicename with the UUID retrieved above, and a name for the device. This is an example for the rule above for three example iSCSI luns:
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id --whitelisted --replace-whitespace /dev/$name", RESULT=="1IET_00010001", NAME="rack4row16lun1"
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id --whitelisted --replace-whitespace /dev/$name", RESULT=="1IET_00010002", NAME="rack4row16lun2"
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id --whitelisted --replace-whitespace /dev/$name", RESULT=="1IET_00010003", NAME="rack4row16lun3"
    
    The udev daemon now searches all devices named /dev/sd* for a matching UUID in the rules. When a matching device is connected to the system the device is assigned the name from the rule. For example:
    # ls -la /dev/rack4row16*
    brw-rw---- 1 root disk 8, 18 May 25 23:35 /dev/rack4row16lun1
    brw-rw---- 1 root disk 8, 34 May 25 23:35 /dev/rack4row16lun2
    brw-rw---- 1 root disk 8, 50 May 25 23:35 /dev/rack4row16lun3
    
  5. Copy the changes in /etc/scsi_id.config and /etc/udev/rules.d/20-names.rules to all relevant hosts.
Networked storage devices with configured rules now have persistent names on all hosts where the files were updated This means you can migrate guests between hosts using the shared storage and the guests can access the storage devices in their configuration files.
Multiple path configuration
The multipath package is used for systems with more than one physical path from the computer to storage devices. multipath provides fault tolerance, fail-over and enhanced performance for network storage devices attached to Red Hat Enterprise Linux 6 systems.
Implementing LUN persistence in a multipath environment requires defined alias names for your multipath devices. Each storage device has a UUID, also known as a World Wide Identifier or WWID, which acts as a key for the aliased names.
This procedure implements LUN device persistence using the multipath daemon.
  1. Determine the World Wide Identifier of each device using the scsi_id --whitelisted --replace-whitespace --device=/dev/sd* command:
    # scsi_id --whitelisted --replace-whitespace --device=/dev/sde
    1IET_00010004
    # scsi_id --whitelisted --replace-whitespace --device=/dev/sdf
    1IET_00010005
    # scsi_id --whitelisted --replace-whitespace --device=/dev/sdg
    1IET_00010006
    # scsi_id --whitelisted --replace-whitespace --device=/dev/sdh
    1IET_00010007
    
  2. Create the multipath configuration file, /etc/multipath.conf. In it create a defaults section, and disable the user_friendly_names option unless you have a specific need for it. It is also a good idea to configure the default arguments for the getuid_callout option. This is generally a useful start:
    defaults {
            user_friendly_names no
            getuid_callout      "/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/%n"
    }
    
  3. Below the defaults section add a multipaths section (note the plural spelling). In this section add each of the WWIDs identified from the scsi_id command above. For example:
    multipaths {
            multipath {
                    wwid                    1IET_00010004
                    alias                   oramp1
            }
    
            multipath {
                    wwid                    1IET_00010005
                    alias                   oramp2
            }
    
            multipath {
                    wwid                    1IET_00010006
                    alias                   oramp3
            }
    
            multipath {
                    wwid                    1IET_00010007
                    alias                   oramp4
            }
    }
    
    Multipath devices are created in the /dev/mapper directory. The above example will create 4 LUNs named /dev/mapper/oramp1, /dev/mapper/oramp2, /dev/mapper/oramp3 and /dev/mapper/oramp4.
  4. Enable the multipathd daemon to start at system boot.
    # chkconfig multipathd on
    # chkconfig --list multipathd
    multipathd      0:off   1:off   2:on    3:on    4:on    5:on    6:off
    
  5. The mapping of these device WWIDs to their alias names will now persist across reboots. For example:
    # ls -la /dev/mapper/oramp*
    brw-rw---- 1 root disk 253, 6 May 26 00:17 /dev/mapper/oramp1
    brw-rw---- 1 root disk 253, 7 May 26 00:17 /dev/mapper/oramp2
    brw-rw---- 1 root disk 253, 8 May 26 00:17 /dev/mapper/oramp3
    brw-rw---- 1 root disk 253, 9 May 26 00:17 /dev/mapper/oramp4
    # multipath -ll
    oramp1 (1IET_00010004) dm-6 IET,VIRTUAL-DISK
    size=20.0G features='0' hwhandler='0' wp=rw
    |-+- policy='round-robin 0' prio=1 status=active
    | `- 8:0:0:4  sde  8:64   active ready running
    `-+- policy='round-robin 0' prio=1 status=enabled
      `- 9:0:0:4  sdbl 67:240 active ready running
    oramp3 (1IET_00010006) dm-8 IET,VIRTUAL-DISK
    size=20.0G features='0' hwhandler='0' wp=rw
    |-+- policy='round-robin 0' prio=1 status=active
    | `- 8:0:0:6  sdg  8:96   active ready running
    `-+- policy='round-robin 0' prio=1 status=enabled
      `- 9:0:0:6  sdbn 68:16  active ready running
    oramp2 (1IET_00010005) dm-7 IET,VIRTUAL-DISK
    size=20.0G features='0' hwhandler='0' wp=rw
    |-+- policy='round-robin 0' prio=1 status=active
    | `- 8:0:0:5  sdf  8:80   active ready running
    `-+- policy='round-robin 0' prio=1 status=enabled
      `- 9:0:0:5  sdbm 68:0   active ready running
    oramp4 (1IET_00010007) dm-9 IET,VIRTUAL-DISK
    size=20.0G features='0' hwhandler='0' wp=rw
    |-+- policy='round-robin 0' prio=1 status=active
    | `- 8:0:0:7  sdh  8:112  active ready running
    `-+- policy='round-robin 0' prio=1 status=enabled
      `- 9:0:0:7  sdbo 68:32  active ready running
    

 
 
  Published under the terms of the Creative Commons License Design by Interspire