9.3. Configuring persistent storage in Red Hat Enterprise Linux 5
This section is for systems with external or networked storage; that is, Fibre Channel or iSCSI 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 sections uses UUIDs to identify iSCSI 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.
- Edit the
/etc/scsi_id.configfile.- Ensure the
options=-bis line commented out.options=-b
# options=-bCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the following line:
options=-g
options=-gCopy to Clipboard Copied! Toggle word wrap Toggle overflow This option configuresudevto assume all attached SCSI devices return a UUID.
- To display the UUID for a given device run the
scsi_id -g -s /block/sd*command. For example:scsi_id -g -s /block/sd*
# scsi_id -g -s /block/sd* 3600a0b800013275100000015427b625eCopy to Clipboard Copied! Toggle word wrap Toggle overflow The output may vary from the example above. The output displays the UUID of the device/dev/sdc. - Verify the UUID output by the
scsi_id -g -s /block/sd*command is identical from computer which accesses the device. - Create a rule to name the device. Create a file named
20-names.rulesin the/etc/udev/rules.ddirectory. Add new rules to this file. All rules are added to the same file using the same format. Rules follow this format:KERNEL=="sd[a-z]", BUS=="scsi", PROGRAM="/sbin/scsi_id -g -s /block/%k", RESULT="UUID", NAME="devicename"
KERNEL=="sd[a-z]", BUS=="scsi", PROGRAM="/sbin/scsi_id -g -s /block/%k", RESULT="UUID", NAME="devicename"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace UUID and devicename with the UUID retrieved above, and a name for the device. This is a rule for the example above:KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id -g -s", RESULT="3600a0b800013275100000015427b625e", NAME="rack4row16"
KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id -g -s", RESULT="3600a0b800013275100000015427b625e", NAME="rack4row16"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Theudevdaemon now searches all devices named/dev/sd*for the UUID in the rule. Once a matching device is connected to the system the device is assigned the name from the rule. In the a device with a UUID of 3600a0b800013275100000015427b625e would appear as/dev/rack4row16. - Append this line to
/etc/rc.local:/sbin/start_udev
/sbin/start_udevCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the changes in the
/etc/scsi_id.config,/etc/udev/rules.d/20-names.rules, and/etc/rc.localfiles to all relevant hosts./sbin/start_udev
/sbin/start_udevCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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 systems.
Implementing LUN persistence in a
multipath environment requires defined alias names for your multipath devices. Each storage device has a UUID which acts as a key for the aliased names. Identify a device's UUID using the scsi_id command.
scsi_id -g -s /block/sdc
# scsi_id -g -s /block/sdc
The multipath devices will be created in the
/dev/mpath directory. In the example below 4 devices are defined in /etc/multipath.conf:
This configuration will create 4 LUNs named
/dev/mpath/oramp1, /dev/mpath/oramp2, /dev/mpath/oramp3 and /dev/mpath/oramp4. Once entered, the mapping of the devices' WWID to their new names are now persistent after rebooting.