![暂存虚拟机中的逻辑卷的多路径](https://linux22.com/image/53411/%E6%9A%82%E5%AD%98%E8%99%9A%E6%8B%9F%E6%9C%BA%E4%B8%AD%E7%9A%84%E9%80%BB%E8%BE%91%E5%8D%B7%E7%9A%84%E5%A4%9A%E8%B7%AF%E5%BE%84.png)
如何在测试虚拟机时配置多路径(目的纯粹是学术性的)?
我新建了逻辑卷,修改multipath.conf
如下:
defaults {
udev_dir /dev
user_friendly_names yes
}
blacklist {
}
blacklist_exceptions {
device {
vendor "VMware,"
product "VMware Virtual S"
}
}
并multipath -v3
说:
Apr 22 03:22:24 | sdb: rev = 1.0
Apr 22 03:22:24 | sdb: h:b:t:l = 2:0:1:0
Apr 22 03:22:24 | (null): (VMware,:VMware Virtual S) vendor/product whitelisted
Apr 22 03:22:24 | sdb: serial =
Apr 22 03:22:24 | sdb: get_state
Apr 22 03:22:24 | sdb: path checker = directio (config file default)
Apr 22 03:22:24 | sdb: checker timeout = 180000 ms (sysfs setting)
Apr 22 03:22:24 | sdb: state = running
Apr 22 03:22:24 | directio: starting new request
Apr 22 03:22:24 | directio: io finished 4096/0
Apr 22 03:22:24 | sdb: state = 3
Apr 22 03:22:24 | sdb: getuid = /lib/udev/scsi_id --whitelisted --device=/dev/%n (config file default)
Apr 22 03:22:24 | /lib/udev/scsi_id exitted with 1
Apr 22 03:22:24 | error calling out /lib/udev/scsi_id --whitelisted --device=/dev/sdb
Apr 22 03:22:24 | sdb: state = running
Apr 22 03:22:24 | /lib/udev/scsi_id exitted with 1
Apr 22 03:22:24 | error calling out /lib/udev/scsi_id --whitelisted --device=/dev/sdb
Apr 22 03:22:24 | sdb: detect_prio = 1 (config file default)
Apr 22 03:22:24 | sdb: prio = const (config file default)
Apr 22 03:22:24 | sdb: const prio = 1
Apr 22 03:22:24 | dm-0: device node name blacklisted
Apr 22 03:22:24 | dm-1: device node name blacklisted
Apr 22 03:22:24 | dm-2: device node name blacklisted
===== paths list =====
uuid hcil dev dev_t pri dm_st chk_st vend/prod/rev dev_st
2:0:0:0 sda 8:0 1 undef ready VMware,,VMware Virtual S running
2:0:1:0 sdb 8:16 1 undef ready VMware,,VMware Virtual S running
[root@localhost ~]#
我想为 上的逻辑卷配置多路径/dev/sdb
。
我的黑名单是空的,为什么显示dm-0/1/2
已列入黑名单?
另外,当我lib/udev/scsi_id --whitelisted --device=/dev
手动运行时,我没有收到任何错误。不过,也没有输出或更改......
答案1
尝试这个
multipathd -k
show config
在我的系统上,似乎忽略了一个空的黑名单,除了供应商列入黑名单的设备之外,它还包含以下 devnodes 模式:
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^dcssblk[0-9]*"
它匹配“dm-”
您可以尝试将“dm-1, dm-2 ..” devnodes 添加到黑名单例外中。我从来没有尝试过。例如,我不知道如果您对多路径 dm 文件设置异常会产生什么影响。