packet-block-storage
packet-block-storage copied to clipboard
Detach script does not remove device from /dev/mapper
I am currently running these scripts on NixOS. When I run the detach script the device is not removed from /dev/mapper
.
Expected:
# packet-block-storage-attach volume-652b2041
target has been set to: volume-652b2041
...
Block device /dev/mapper/volume-652b2041 is available for use
# ls /dev/mapper
control volume-652b2041
# packet-block-storage-detach volume-652b2041
Logging out iqn.2013-05.com.daterainc:tc:01:sn:3e5dbe3a64ba5d89 on 10.144.35.150
...
# ls /dev/mapper
control
Actual:
# packet-block-storage-attach volume-652b2041
target has been set to: volume-652b2041
...
Block device /dev/mapper/volume-652b2041 is available for use
# ls /dev/mapper
control volume-652b2041
# packet-block-storage-detach volume-652b2041
Logging out iqn.2013-05.com.daterainc:tc:01:sn:3e5dbe3a64ba5d89 on 10.144.35.150
...
# ls /dev/mapper
control volume-652b2041
The logs for multipathd.service
show that it is trying to remove the map before the second device has been removed so the map is still in use.
Feb 21 06:32:34 machine multipathd[12098]: sdb: remove path (uevent)
Feb 21 06:32:34 machine multipathd[12098]: volume-652b2041: load table [0 20971520 multipath 1 retain_attached_hw_handler 1 alua 1 1 round-robin 0 1 1 8:32 50]
Feb 21 06:32:34 machine multipathd[12098]: sdb [8:16]: path removed from map volume-652b2041
Feb 21 06:32:34 machine multipathd[12098]: sdc: remove path (uevent)
Feb 21 06:32:34 machine multipathd[12098]: volume-652b2041: map in use
Feb 21 06:32:34 machine multipathd[12098]: volume-652b2041: can't flush
Feb 21 06:32:34 machine multipathd[12098]: volume-652b2041: load table [0 20971520 multipath 1 retain_attached_hw_handler 1 alua 0 0]
Feb 21 06:32:34 machine multipathd[12098]: sdc [8:32]: path removed from map volume-652b2041