-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy path65-multipath.rules
31 lines (23 loc) · 1.11 KB
/
65-multipath.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SUBSYSTEM!="block", GOTO="end_mpath"
# like in 62-multipath.rules
ENV{nompath}=="?*", GOTO="end_mpath"
IMPORT{db}="DM_MULTIPATH_DEVICE_PATH"
ACTION=="add", ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="count_mpath"
ACTION=="remove", ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="count_mpath"
IMPORT{db}="DM_ACTION"
ACTION=="change", ENV{DM_ACTION}=="PATH_REINSTATED", GOTO="count_mpath"
ACTION=="change", ENV{DM_ACTION}=="PATH_FAILED", GOTO="count_mpath"
IMPORT{db}="CH_MULTIPATH"
# MP device removed, count
ACTION=="remove", ENV{CH_MULTIPATH}=="1", GOTO="count_mpath"
# Already counted so just ensure the symlinks are present
ENV{CH_MULTIPATH}=="1", GOTO="symlinks"
# Check added or changed for being multipath
ACTION=="add|change", PROGRAM=="/bin/bash -c '/sbin/dmsetup table -j %M -m %m | /bin/grep multipath'", ENV{CH_MULTIPATH}="1"
ENV{CH_MULTIPATH}=="1", GOTO="count_mpath"
GOTO="end_mpath"
LABEL="count_mpath"
ACTION=="*", RUN+="/opt/xensource/libexec/kickpipe mpathcount"
LABEL="symlinks"
ACTION=="add|change", PROGRAM="/sbin/dmsetup info -c -o name --noheadings -j %M -m %m", SYMLINK+="disk/by-scsid/%c/mapper"
LABEL="end_mpath"