Skip to content

Instantly share code, notes, and snippets.

@hunzo
Last active April 29, 2024 05:35
Show Gist options
  • Save hunzo/7a176f21b4f4d304e1062cab6f048d21 to your computer and use it in GitHub Desktop.
Save hunzo/7a176f21b4f4d304e1062cab6f048d21 to your computer and use it in GitHub Desktop.
connect san with proxmox

SAN FC Multipath configuration

install multipath-tools

apt-get update
apt-get install multipath-tools lsscsi multipath-tools-boot

list wwids get wwwid

lsscsi -i -s
# /lib/udev/scsi_id -g -u -d /dev/sdx

rescan wwids

rescan-scsi-bus.sh

Create File /etc/multipath.conf

  • /etc/multipath.conf
defaults {
        polling_interval        2
        path_selector           "round-robin 0"
        path_grouping_policy    multibus
        uid_attribute           ID_SERIAL
        rr_min_io               100
        failback                immediate
        no_path_retry           queue
        user_friendly_names     yes
}

blacklist {
        wwid .*
}

blacklist_exceptions {
        wwid "360060160a5e03a00e1c9ae218ea3e911"
}

multipaths {
  multipath {
        wwid "360060160a5e03a00e1c9ae218ea3e911"
        alias emc-lun
  }
}

add wwids /etc/multipath/wwids

multipath -a 360060160a5e03a00e1c9ae218ea3e911

restart multipath-tools

systemctl restart multipath-tools.service

host multipath

multipath -ll

update multipath scan wwids after reboot

apt install --reinstall multipath-tools-boot

create lvm pv

pvcreate /dev/mapper/emc-san

create lvm vg

vgcreate lvm_emc_san /dev/mapper/emc-san

info

  • link
  • gdisk (GPT fdisk)

error

  • 'libdevmapper: ioctl/libdm-iface.c(1980): device-mapper: reload ioctl on 35566777712345678 (253:6) failed: Device or resource busy' fix-error

List HBA

lspci -nn |egrep -i "fibre|hba"

List HBA

lspci -nn |egrep -i "fibre|hba"

List HBA host port

ls -l /sys/class/fc_host
  • ex.
lrwxrwxrwx 1 root root 0 Apr 27 14:37 host12 -> ../../devices/pci0000:00/0000:00:02.2/0000:05:00.0/host12/fc_host/host12
lrwxrwxrwx 1 root root 0 Apr 27 14:37 host13 -> ../../devices/pci0000:00/0000:00:03.2/0000:06:00.0/host13/fc_host/host13

Get wwn

cat /sys/class/fc_host/host13/port_name
cat /sys/class/fc_host/host12/port_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment