26.12. Configuring LUN Persistence

26.12. Configuring LUN Persistence

This section covers how to implement LUN persistence in guests and on the host machine with and without multipath.

Implementing LUN persistence without multipath

If your system is not using multipath, you can use udev to implement LUN persistence. Before implementing LUN persistence in your system, ensure that you acquire the proper UUIDs. Once you acquire these, you can configure LUN persistence by editing the scsi_id file that resides in the /etc directory. Once you have this file open in a text editor, you must comment out this line: If your system is not using multipath, you can use udev to implement LUN persistence. Before implementing LUN persistence in your system, ensure that you acquire the proper UUIDs. Once you acquire these, you can configure LUN persistence by editing the scsi_id file that resides in the /etc directory. Once you have this file open in a text editor, you must comment out this line:

# options=-b

Then replace it with this parameter:

# options=-g

This tells udev to monitor all system SCSI devices for returning UUIDs. To determine the system UUIDs, type:

# scsi_id  -g  -s  /block/sdc

The output should resemble the following:

# scsi_id -g -s /block/sdc
*3600a0b80001327510000015427b625e*

This long string of characters is the UUID. To get the device names to key off the UUID, check each device path to ensure that the UUID number is the same for each device. The UUIDs do not change when you add a new device to your system. Once you have checked the device paths, you must create rules for the device naming. To create these rules, you must edit the 20-names.rules file that resides in the /etc/udev/rules.d directory. The device naming rules you create here should follow this format:

# KERNEL="sd*",  BUS="scsi",  PROGRAM="sbin/scsi_id", RESULT="UUID", NAME="devicename"

Replace your existing UUID and devicename with the above UUID retrieved entry. So the rule should resemble the following:

 KERNEL="sd*",  BUS="scsi",  PROGRAM="sbin/scsi_id", RESULT="3600a0b80001327510000015427b625e
", NAME="mydevicename"

This causes the system to enable all devices that match /dev/sd* to inspect the given UUID. When it finds a matching device, it creates a device node called /dev/devicename. For this example, the device node is /dev/mydevice . Finally, you need to append the rc.local file that resides in the /etc directory with this path:

/sbin/start_udev

Implementing LUN persistence with multipath

To implement lun persistence in a multipath environment, you must define the alias names for the multipath devices. For this example, you must define four device aliases by editing the multipath.conf file that resides in the /etc/ directory:

multipath  {  
             wwid       3600a0b80001327510000015427b625e
             alias      oramp1
}
multipath  {  
             wwid       3600a0b80001327510000015427b6
             alias      oramp2
}
multipath  {  
             wwid       3600a0b80001327510000015427b625e
             alias      oramp3
}
multipath  {  
             wwid       3600a0b80001327510000015427b625e
             alias      oramp4
}

This defines 4 LUNs: /dev/mpath/oramp1, /dev/mpath/oramp2, /dev/mpath/oramp3, and dev/mpath/oramp4. The devices will reside in the /dev/mpath directory. These lun names are persistent over reboots as it creates the alias names on the wwid of the LUNs.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.