Tested proposed on Lunar
1. Start VM
2. upgrade packages # apt update -y && sudo apt upgrade -y
3. Enable proposed (multipath-tools installed by default) # cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list # Enable Ubuntu proposed archive deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe EOF
4. Install required packages # apt install -y lsscsi multipath-tools open-iscsi tgt
5. Update to proposed package # apt install -y kpartx=0.8.8-1ubuntu2.1 # apt install -y multipath-tools=0.8.8-1ubuntu2.1
6. Confirm package # apt-cache policy multipath-tools | grep Installed Installed: 0.8.8-1ubuntu2.1
7. Setup local test targets cp file to setup.sh ``` targetname="iqn.2016-11.foo.com:target.iscsi" cwd=$(pwd) testdir="/mnt/tgtmpathtest" localhost="127.0.0.1" portal="${localhost}:3260" maxpaths=4 backfn="backingfile" expectwwid="60000000000000000e00000000010001" testdisk="/dev/disk/by-id/wwn-0x${expectwwid}"
### Setup mpath devices
# Restart tgtd to make sure modules are all loaded service tgt restart || echo "Failed to restart tgt" >&2
# prep SINGLE test file truncate --size 100M ${backfn}
# create target tgtadm --lld iscsi --op new --mode target --tid 1 -T "${targetname}" # allow all to bind the target tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL # set backing file tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b "${cwd}/${backfn}"
# scan for targets (locally) iscsiadm --mode discovery --type sendtargets --portal ${localhost}
# login echo "login #1" iscsiadm --mode node --targetname "${targetname}" --portal ${portal} --login # duplicate this session (always 1) for i in $(seq 2 ${maxpaths}) do echo "extra login #${i}" iscsiadm --mode session -r 1 --op new done
udevadm settle sleep 5 # sleep a bit to allow device to be created.
# status summary echo "Status after initial setup" tgtadm --lld iscsi --mode target --op show tgtadm --lld iscsi --op show --mode conn --tid 1 iscsiadm --mode session -P 1 lsscsi -liv multipath -v3 -ll dmsetup table
echo "Test WWN should now point to DM" readlink "${testdisk}" | grep dm ``` # chmod +x setup.sh # ./setup.sh
8. Test Behavior from proposed # mpathpersist -v2 --out --register-ignore --param-sark=0x214872831999999 /dev/dm-0 75.192551 | mpatha: adding new path sda 75.194082 | mpatha: adding new path sdc 75.195587 | mpatha: adding new path sdb 75.197020 | mpatha: adding new path sdd 75.197708 | mpatha: pr message=setprstatus map mpatha 75.197859 | mpatha: message=setprstatus map mpatha reply=ok
Looks good.
9. Test failing behavior # apt install -y kpartx=0.8.8-1ubuntu2 --allow-downgrades # apt install -y multipath-tools=0.8.8-1ubuntu2 --allow-downgrades # mpathpersist -v2 --out --register-ignore --param-sark=0x214872831999999 /dev/dm-0 131.542153 | mpatha: adding new path sda 131.544790 | mpatha: adding new path sdc 131.546989 | mpatha: adding new path sdb 131.550224 | mpatha: adding new path sdd 131.551471 | mpatha: pr message=map mpatha setprstatus 131.553267 | mpatha: message=map mpatha setprstatus reply=map mpatha setprstatus: Missing argument multipath-tools v0.8.8 (03/12, 2021) CLI commands reference: list|show paths ...
Tested proposed on Lunar
1. Start VM
2. upgrade packages
# apt update -y && sudo apt upgrade -y
3. Enable proposed (multipath-tools installed by default) sources. list.d/ ubuntu- $(lsb_release -cs)-proposed.list archive. ubuntu. com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
# cat <<EOF >/etc/apt/
# Enable Ubuntu proposed archive
deb http://
EOF
4. Install required packages
# apt install -y lsscsi multipath-tools open-iscsi tgt
5. Update to proposed package 0.8.8-1ubuntu2. 1 tools=0. 8.8-1ubuntu2. 1
# apt install -y kpartx=
# apt install -y multipath-
6. Confirm package
# apt-cache policy multipath-tools | grep Installed
Installed: 0.8.8-1ubuntu2.1
7. Setup local test targets "iqn.2016- 11.foo. com:target. iscsi" "/mnt/tgtmpatht est" "127.0. 0.1" "${localhost} :3260" "backingfile" "60000000000000 000e00000000010 001" "/dev/disk/ by-id/wwn- 0x${expectwwid} "
cp file to setup.sh
```
targetname=
cwd=$(pwd)
testdir=
localhost=
portal=
maxpaths=4
backfn=
expectwwid=
testdisk=
### Setup mpath devices
# Restart tgtd to make sure modules are all loaded
service tgt restart || echo "Failed to restart tgt" >&2
# prep SINGLE test file
truncate --size 100M ${backfn}
# create target
tgtadm --lld iscsi --op new --mode target --tid 1 -T "${targetname}"
# allow all to bind the target
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
# set backing file
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b "${cwd}/${backfn}"
# scan for targets (locally)
iscsiadm --mode discovery --type sendtargets --portal ${localhost}
# login
echo "login #1"
iscsiadm --mode node --targetname "${targetname}" --portal ${portal} --login
# duplicate this session (always 1)
for i in $(seq 2 ${maxpaths})
do
echo "extra login #${i}"
iscsiadm --mode session -r 1 --op new
done
udevadm settle
sleep 5 # sleep a bit to allow device to be created.
# status summary
echo "Status after initial setup"
tgtadm --lld iscsi --mode target --op show
tgtadm --lld iscsi --op show --mode conn --tid 1
iscsiadm --mode session -P 1
lsscsi -liv
multipath -v3 -ll
dmsetup table
echo "Test WWN should now point to DM"
readlink "${testdisk}" | grep dm
```
# chmod +x setup.sh
# ./setup.sh
8. Test Behavior from proposed sark=0x21487283 1999999 /dev/dm-0
# mpathpersist -v2 --out --register-ignore --param-
75.192551 | mpatha: adding new path sda
75.194082 | mpatha: adding new path sdc
75.195587 | mpatha: adding new path sdb
75.197020 | mpatha: adding new path sdd
75.197708 | mpatha: pr message=setprstatus map mpatha
75.197859 | mpatha: message=setprstatus map mpatha reply=ok
Looks good.
9. Test failing behavior 0.8.8-1ubuntu2 --allow-downgrades tools=0. 8.8-1ubuntu2 --allow-downgrades sark=0x21487283 1999999 /dev/dm-0
# apt install -y kpartx=
# apt install -y multipath-
# mpathpersist -v2 --out --register-ignore --param-
131.542153 | mpatha: adding new path sda
131.544790 | mpatha: adding new path sdc
131.546989 | mpatha: adding new path sdb
131.550224 | mpatha: adding new path sdd
131.551471 | mpatha: pr message=map mpatha setprstatus
131.553267 | mpatha: message=map mpatha setprstatus reply=map mpatha setprstatus: Missing argument
multipath-tools v0.8.8 (03/12, 2021)
CLI commands reference:
list|show paths
...