Skip to content

Commit 6a33237

Browse files
committed
Exclude the local disks of nested hosts from the used_wwns set
This fixes some tests where one host uses RAID1 and another does not. Signed-off-by: Vincent Michel <vincent.michel@vates.tech>
1 parent eb4bb4d commit 6a33237

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

conftest.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,23 @@ def _host_disks(host: Host, hosts_cli_disks: list[DiskDevName] | None) -> Iterab
450450
}
451451
# Cross-host deduplication: a LUN in use on any host (same WWN) is unavailable on all hosts.
452452
# This matters for shared FC/iSCSI LUNs visible on multiple hosts simultaneously.
453+
# Note that local disks on nested hosts end up with the following WWNs:
454+
# - uuid.00000000-0000-0000-0000-000000000001
455+
# - uuid.00000000-0000-0000-0000-000000000002
456+
# - and so on
457+
# Those are obviously not shared among hosts, so we need to exclude them from `used_wwns`.
458+
# This is especially important for tests where one host has its system installed on disk 1,
459+
# and another host has its system installed on disk 1 and 2 using RAID1 (in this case, disk 2
460+
# of the first host **is** available although it shares the same WWN with disk 2 of host 2
461+
# which **is not** available). We can safely assume that any disk with a WWN starting with
462+
# "uuid.00000000-0000-0000-0000-" comes from a local disk on a nested host, and consequently
463+
# are never shared with other hosts. As such, we can exclude them from `used_wwns` so that
464+
# they are not incorrectly detected as shared.
453465
used_wwns = {
454466
disk.wwn
455467
for host_disks in ret.values()
456468
for disk in host_disks
457-
if disk.wwn and not disk.available
469+
if disk.wwn and not disk.available and not disk.wwn.startswith("uuid.00000000-0000-0000-0000-")
458470
}
459471
if used_wwns:
460472
logging.debug("cross-host used WWNs: %s", used_wwns)

0 commit comments

Comments
 (0)