SAN/iSCSI Administration

This page contains administration guidelines and commands for iSCSI exports on the CSL SAN.

Adding an iSCSI LUN
This is used to add a new iSCSI LUN to the SAN.

ZVOL creation
All of the iSCSI exports on the SAN are currently backed by ZVOL block devices. ZVOLs provide much better performance than using raw datafiles over top of a normal filesystem and are easily expanded and managed using ZFS.

For ease of management, related ZVOLs are typically grouped underneath a ZFS filesystem. First we create the filesystem, then we create each of the ZVOLs beneath it. For most VMs, you will need two ZVOLs; one for the root partition and one for swap.

iSCSI Exports
iSCSI Exports are currently done using the LIO iSCSI Target managed through Pacemaker. Therefore, we need to add the new LUNs to Pacemaker which will handle bringing them online on the appropriate host.

First you need to generate a unique value for each LUN to use as an SCSI ID. We use the first half of the md5 hash of the LUN's name as a reliably unique value.

You will also need a LUN number for each LUN you are adding; these are generally assigned starting from 0 and incrementing with each LUN added. To get the highest numbered LUN currently in the cluster run and read through the configuration.

Now its time to add the LUNs to the cluster configuration. This will be done using a Shadow CIB (a cloned copy of the configuration). This is *IMPORTANT* because if the entire configuration is not added at once, the cluster may behave unexpectedly.

First we create the new Shadow CIB

Next we create the iSCSILogicalUnit configurations; make sure to adjust the LUN number, scsi_sn, and path values appropriately.

Next, you need to add the new iSCSILogicalUnits to the apocalypse-luns resource group to ensure that they are appropriate managed in conjunction with the rest of the iSCSI system.

Finally, commit the configuration changes to the Shadow CIB and leave the configuration submenu:

At this point if you have any questions, now is a very good time to ask someone to double-check your configuration before you crash the SAN. Otherwise, if you are VERY sure you know what you're doing, commit the changes to the live configuration.

You can now start the cluster monitor and make sure your new resources have started:

Finally, each VM Server needs to be told to rescan for iSCSI LUN changes. IMPORTANT - DO NOT restart iscsid or you will crash all of the VMs on the server; rather use the following command to instruct iscsid to scan for changes.

Multipath Configuration
Multipath now needs to be configured on the client servers. This is most easily done on one server and then copied to the others. On one of the client servers, run:

Then, for each LUN you are adding, run:

For each LUN, add an entry in /etc/multipath.conf similar to the following; replacing the WWID with the value returned above, and the alias with the name of the LUN.

Next for each LUN, you need to remove the temporary multipath alias (which defaults to the WWID) by running:

Finally, re-run the  command to regenerate the multipath devices with the new aliases.

You should now have an entry in /dev/mapper/ for each LUN you added to the SAN. Once you have verified that everything is working, you need to replicate this configuration across the other systems connected to the SAN. Copy the updated /etc/multipath.conf to them, then run:

See the main SAN article for a list of systems currently connected to the SAN via iSCSI.