Damans227 opened a new pull request, #14861:
URL: https://github.com/apache/cloudstack/pull/14861
Fixes #14860
A multipath map that has lost all its paths still passes the block device
check, so CloudStack skips discovery and hands the dead disk to the VM or to
the template copy. This treats a map with no active paths as not connected, and
connectVolume.sh now flushes such a map before scanning so it gets rebuilt. The
wait loop also checks the device directly instead of calling back into the
connect path.
- isConnected() also checks that multipath -ll shows an active ready path
- connectVolume.sh flushes a map with no active paths before scanning
- waitForDiskToBecomeAvailable() checks the device directly and keeps
retrying instead of stopping after one try
If the dead map cant be flushed because something still holds it open, the
attach does not succeed on the dead disk. It keeps retrying with a warning in
agent.log until the existing retry limit runs out.
### Test:
KVM host with a FlashArray FibreChannel volume. Attach it to a VM, hold the
map open on the host (`sleep 10800 < /dev/mapper/3<wwid> &`), detach it so the
map is left with no paths, then attach it again.
**Before:** attach succeeds on the dead map.
3624a937049646854b0ae410b0001171b dm-10 ##,##
0 bytes copied
vdb /dev/mapper/3624a937049646854b0ae410b0001171b

**After:** while the map is held, the agent refuses it instead of attaching
it:
WARN [kvm.storage.MultipathSCSIAdapterBase] Device
/dev/mapper/3624a937049646854b0ae410b0001171b exists but has no active paths,
treating it as not connected
Once the map is released, connectVolume.sh flushes it, rescans, and the
attach finishes on a healthy map:
18:08:56 CS_SCSI_VOL_FIND: 624a937049646854b0ae410b0001171b awaiting
disk path ... not available yet, triggering scan
18:09:03 CS_SCSI_VOL_FIND: 624a937049646854b0ae410b0001171b successfully
discovered and available
3624a937049646854b0ae410b0001171b dm-10 PURE,FlashArray
1048576 bytes (1.0 MB, 1.0 MiB) copied


Also added unit tests for the connected check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]