Skip to content

Enhance block device management#498

Open
glehmann wants to merge 3 commits into
masterfrom
gln/block-device-enhancement-and-lun-deduplication-rqtm
Open

Enhance block device management#498
glehmann wants to merge 3 commits into
masterfrom
gln/block-device-enhancement-and-lun-deduplication-rqtm

Conversation

@glehmann
Copy link
Copy Markdown
Member

@glehmann glehmann commented Apr 24, 2026

Some block devices may be used to build other devices (mdadm, lvm) or be accessible on multiple hosts, but only usable on a single one at a time (fc, iscsi).

This PR is part of a tree containing 19 PRs:

  1. master
  2. storage: avoid removing the xva/vdi before going in the debugger #436master
  3. storage: test large volumes #437storage: avoid removing the xva/vdi before going in the debugger #436
  4. host: include mdadm RAID devices in disk detection #447storage: test large volumes #437
  5. Update randstream to 0.5.0 #446host: include mdadm RAID devices in disk detection #447
  6. storage: Avoid writing the whole device in coalesce tests #449Update randstream to 0.5.0 #446
  7. storage: avoid writing the whole device in migration tests #450storage: Avoid writing the whole device in coalesce tests #449
  8. xva/vdi: only write a small data amount in large volumes for faster tests #452storage: avoid writing the whole device in migration tests #450
  9. storage: test full device write #453xva/vdi: only write a small data amount in large volumes for faster tests #452
  10. storage: test that we can't create a vdi over its max allowed size #454storage: test full device write #453
  11. storage: add jobs for large volume tests #461storage: test that we can't create a vdi over its max allowed size #454
  12. skip large volume tests for zvol and nfsv4 #464storage: add jobs for large volume tests #461
  13. storage: add comprehensive tests for lvmohba storage repositories #470skip large volume tests for zvol and nfsv4 #464
  14. storage: free space for XVA import by destroying source VM first #471storage: add comprehensive tests for lvmohba storage repositories #470
  15. storage: limit data written per VDI with --write-volume-cap #481storage: free space for XVA import by destroying source VM first #471
  16. Add Packer configuration to build a minimal Alpine 3.23 UEFI VM for XCP-ng tests #523storage: limit data written per VDI with --write-volume-cap #481
  17. migration: create a xfs sr on the second host for intra/cross-pool migration #497storage: limit data written per VDI with --write-volume-cap #481
  18. "Enhance block device management" (this PR) → migration: create a xfs sr on the second host for intra/cross-pool migration #497
  19. Add VHD_MAX and QCOW2_MAX symbolic size constants #500Enhance block device management #498
  20. partially_populate_device: align span positions to block size for better performance #509Add VHD_MAX and QCOW2_MAX symbolic size constants #500

@glehmann glehmann requested review from a team as code owners April 24, 2026 14:57
@glehmann glehmann changed the title gln/block-device-enhancement-and-lun-deduplication-rqtm Enhance block device management Apr 24, 2026
@glehmann glehmann force-pushed the gln/block-device-enhancement-and-lun-deduplication-rqtm branch 2 times, most recently from f101a3f to ede9108 Compare April 29, 2026 17:38
@glehmann glehmann requested a review from a team as a code owner April 29, 2026 17:38
@glehmann glehmann force-pushed the gln/migration-test-cleanup-and-setup-lvmv branch from e0dd6d1 to edb6dbf Compare April 29, 2026 17:39
@glehmann glehmann force-pushed the gln/migration-test-cleanup-and-setup-lvmv branch from edb6dbf to 36bfb8c Compare May 11, 2026 15:49
@glehmann glehmann force-pushed the gln/block-device-enhancement-and-lun-deduplication-rqtm branch from ede9108 to 483adb0 Compare May 11, 2026 15:49
@glehmann glehmann force-pushed the gln/migration-test-cleanup-and-setup-lvmv branch from 36bfb8c to bc1eab6 Compare May 12, 2026 13:16
@glehmann glehmann force-pushed the gln/block-device-enhancement-and-lun-deduplication-rqtm branch from 483adb0 to 1960a93 Compare May 12, 2026 13:16
@glehmann glehmann force-pushed the gln/migration-test-cleanup-and-setup-lvmv branch from bc1eab6 to be2cd1f Compare May 12, 2026 13:23
@glehmann glehmann force-pushed the gln/block-device-enhancement-and-lun-deduplication-rqtm branch from 1960a93 to 8f39146 Compare May 12, 2026 13:23
Base automatically changed from gln/migration-test-cleanup-and-setup-lvmv to master May 12, 2026 13:46
@Millefeuille42 Millefeuille42 self-requested a review May 12, 2026 13:47
@Lankou66 Lankou66 requested review from Lankou66 and removed request for Millefeuille42 May 12, 2026 13:47
@Millefeuille42 Millefeuille42 self-requested a review May 12, 2026 13:58
@glehmann glehmann force-pushed the gln/block-device-enhancement-and-lun-deduplication-rqtm branch from 8f39146 to 2710827 Compare May 12, 2026 17:08
glehmann added 3 commits May 13, 2026 15:58
Replace the BlockDeviceInfo TypedDict and the per-call disk_is_available()
check with a dataclass that includes availability as a field, determined once
at scan time using mountpoint, mdadm, LVM, and ZFS checks. Extend enumeration
to cover mdadm arrays and multipath devices in addition to local disks. Update
all callers to use attribute access instead of dict subscript.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
zpool destroy removes the pool but leaves ZFS member signatures and the
partition table on disk, causing the device to appear in use on the next
test run.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Add a WWN field to BlockDeviceInfo (populated from lsblk for local disks,
and from the DM alias for mpath devices). In the disks fixture, use WWNs to:

- Mark a LUN unavailable on all hosts if it is already in use on any host
  (cross-host deduplication for shared FC/iSCSI LUNs).
- Sort LUNs listed in LVMOHBA_DEVICE_CONFIG or LVMOISCSI_DEVICE_CONFIG to
  the end of each host's disk list, so they are only selected by other tests
  when no other disk is available.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann glehmann force-pushed the gln/block-device-enhancement-and-lun-deduplication-rqtm branch from 2710827 to 9f88dc5 Compare May 13, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants