IBM / ubiquity

Ubiquity
Apache License 2.0
90 stars 26 forks source link

Feature/ub 1941 unmount fix #299

Closed 27149chen closed 5 years ago

27149chen commented 5 years ago

Description of the issue There is an issue with the new rescan method introduced in PR #294 that the unmount didn't clean up the physical devices. More detail : In the new cleanup proceduce, we get the multipath devices belonging to the same volume from multipath -ll output, but it happens in ActionAfterDetach, before that, a multipath -f is called, which will remove the volume record from the multipath -ll output. So that we can't get what we want, and the command "echo 1 > /sys/block/sdx/device/delete" won't be called. It will lead to stale info (stale paths in /dev/disk/by-path/) on host.

Description of the optimal solution Origin order of flex unmount is:

  1. Flush the multipth device: multipath -f mpathx
  2. Unmap the volume from storage
  3. Rescan iscsi session
  4. resan-scsi-bus.sh -r

Change the order of the flex unmount as follow:

  1. Rescan iscsi session if it is a iscsi host
  2. Flush the multipth device: multipath -f mpathx
  3. Remove the devices: echo 1 > /sys/block/sdx/device/delete
  4. Unmap the volume from storage

This change is Reviewable

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 66.484% when pulling 25032d0ffeac37c1c1154b312f0d12ffc4722310 on feature/UB-1941_unmount_fix into 8e7f868b72916540a728ed4fce86d0aaefafc76f on dev.