PVE为FC存储设置多路径
查看LUN和路径ls -l /dev/disk/by-path
示例:
root@pve41-22:~# ls -l /dev/disk/by-path
total 0
lrwxrwxrwx 1 root root 9 Sep 18 12:57 pci-0000:00:1f.2-ata-6 -> ../../sr0
lrwxrwxrwx 1 root root 9 Sep 18 12:57 pci-0000:00:1f.2-ata-6.0 -> ../../sr0
lrwxrwxrwx 1 root root 9 Sep 18 12:57 pci-0000:03:00.0-scsi-0:2:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep 18 12:57 pci-0000:03:00.0-scsi-0:2:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep 18 12:57 pci-0000:03:00.0-scsi-0:2:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep 18 12:57 pci-0000:03:00.0-scsi-0:2:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 9 Sep 18 12:57 pci-0000:84:00.0-fc-0x5000d3100148dc05-lun-1 -> ../../sdb
lrwxrwxrwx 1 root root 9 Sep 18 12:57 pci-0000:84:00.0-fc-0x5000d3100148dc06-lun-1 -> ../../sdc
设置多路径工具
安装软件包apt install multipath-tools
查看设备的WWID,如果WWID相同,表示同一设备的多路径/lib/udev/scsi_id -g -u -d /dev/sdX
示例:
root@pve41-22:~# /lib/udev/scsi_id -g -u -d /dev/sdb
36000d3100148dc000000000000000010
root@pve41-22:~# /lib/udev/scsi_id -g -u -d /dev/sdc
36000d3100148dc000000000000000010
将WWID添加到/etc/multipath/wwids文件multipath -a <WWID>
示例:multipath -a 36000d3100148dc000000000000000010
设置生效multipath -r
查看设备状态multipath -ll
示例:
root@pve41-22:~# multipath -ll
36000d3100148dc000000000000000010 dm-5 COMPELNT,Compellent Vol
size=4.0T features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
|- 11:0:1:1 sdc 8:32 active ready running
`- 11:0:0:1 sdb 8:16 active ready running
在系统启动早期设置多路径
安装软件包apt install multipath-tools-boot
安装此软件包后,/etc/multipath.conf和/etc/multipath/wwids将复制到initramfs中。因此,在对这些文件进行任何更改(例如,通过运行 multipath -a WWID)后,需要重新生成 initramfsupdate-initramfs -u -k all
后续步骤
1. 创建PV、VG、LV
2. 格式化LV
3. 手动挂载测试,然后设置fstab自动挂载