Setup ISCSI, Multipath, and LVM

  1. Make sure the iscsi and multipath are installed/

     $ apt install open-iscsi multipath-tools multipath-tools-boot
    
  2. Discover the targets on the storage device from the client system for all of the interfaces on the storage device.

     $ iscsiadm --mode discoverydb \
         --type sendtargets \
         --portal 172.25.9.50 \
         --discover
     $ iscsiadm --mode discoverydb \
         --type sendtargets \
         --portal 172.25.9.51 \
         --discover
     $ iscsiadm --mode discoverydb \
         --type sendtargets \
         --portal 172.25.9.52 \
         --discover
     $ iscsiadm --mode discoverydb \
         --type sendtargets \
         --portal 172.25.9.53 \
         --discover
    
  3. Create a host on the storage device and connect it to a storage array. On the Pure UI this is done by navigating to Storage->Hosts and clicking on the + on the right hand side. Be sure to add the iqn from the file /etc/iscsi/initiatorname.iscsi to the host.

  4. Login to each path to the storage device from the client system.

     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.50:3260 \
         --login
     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.51:3260 \
         --login
     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.52:3260 \
         --login
     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.53:3260 \
         --login
    
  5. Set autostart for each iscsi path.

     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.50:3260 --op update -n node.startup -v automatic
     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.51:3260 --op update -n node.startup -v automatic
     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.52:3260 --op update -n node.startup -v automatic
     $ iscsiadm --mode node \
         --target iqn.2010-06.com.purestorage:flasharray.12c2d725bb3f0481 \
         --portal 172.25.9.53:3260 --op update -n node.startup -v automatic
    
  6. Use multipath devices to create LVM physical devices and add them to a LVM volume group.

     $ multipath -ll
     mpatha (3624a93701eef310e71f740dc000117d0) dm-2 PURE,FlashArray
     size=4.0T features='0' hwhandler='1 alua' wp=rw
     `-+- policy='service-time 0' prio=50 status=active
       |- 14:0:0:254 sdc 8:32 active ready running
       |- 15:0:0:254 sdd 8:48 active ready running
       |- 16:0:0:254 sde 8:64 active ready running
       `- 17:0:0:254 sdf 8:80 active ready running
     $ pvcreate /dev/mapper/mpatha
     $ vgextend vg_xen_shared /dev/mapper/mpatha
    
  7. If the device is to be mounted directly create a partition with parted, make a file system, and update /etc/fstab.

    $ pvcreate /dev/mapper/mpathb-part1 $ vgcreate vg_backup /dev/mapper/mpathb-part1 $ lvcreate -l 100%VG -n backup vg_backup $ parted / (parted) mklabel gpt (parted) mkpart primary ext4 0 100% Ignore/Cancel? I (parted) quit $ mkfs -t ext4 /dev/mapper/vg_backup-backup1 $ edit /etc/fstab $ grep vg_backup /etc/fstab /dev/vg_backup/backup /srv/backup ext4 defaults,noatime,_netdev 0 2

Trouble Shooting

mpath Device Missing From multipath

If the iscsi devices have appear but multipath has not mapped them then it is likely that the wwid is not being scanned by multipath into its configuration files in /etc/multipath.

  1. Use udevadm to discover the WWIDs. Make sure you scan all the devices to ensure they are actually what you intend.

     # udevadm info --query=all --name /dev/sdf | grep ID_SERIAL
     E: ID_SERIAL=36e843b699dd3878d245cd46f6d8f4ddf
     E: ID_SERIAL_SHORT=6e843b699dd3878d245cd46f6d8f4ddf
     # udevadm info --query=all --name /dev/sdg | grep ID_SERIAL
     E: ID_SERIAL=36e843b699dd3878d245cd46f6d8f4ddf
     E: ID_SERIAL_SHORT=6e843b699dd3878d245cd46f6d8f4ddf
    
  2. Add the WWIDs manually to the multipath configuration.

     $ cd /etc/multipath
     $ edit bindgings wwids
    
  3. Restart multipathd.

     $ systemctl restart multipathd