Skip to content

storage: test large volumes#437

Merged
stormi merged 5 commits into
masterfrom
gln/storage-volume-size-support-vzxu
May 12, 2026
Merged

storage: test large volumes#437
stormi merged 5 commits into
masterfrom
gln/storage-volume-size-support-vzxu

Conversation

@glehmann
Copy link
Copy Markdown
Member

@glehmann glehmann commented Mar 26, 2026

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" (this PR) → storage: 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 #498migration: 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 March 26, 2026 08:21
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from 01c5e43 to 859fc5c Compare March 26, 2026 08:26
@glehmann glehmann force-pushed the gln/storage-debugger-xva-retention-uxrt branch from 12bb98b to a57c109 Compare March 26, 2026 08:26
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from 859fc5c to 4cd93f5 Compare March 26, 2026 08:28
Comment thread tests/storage/lvm/test_lvm_sr.py
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from 4cd93f5 to 346eff1 Compare March 27, 2026 10:06
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch 2 times, most recently from 5d3fa9b to d96b2a9 Compare March 30, 2026 11:27
@glehmann glehmann force-pushed the gln/storage-debugger-xva-retention-uxrt branch 2 times, most recently from 080ee74 to c130ebc Compare March 31, 2026 18:27
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from d96b2a9 to a11ecb2 Compare March 31, 2026 18:27
@glehmann glehmann changed the title storage: test large volumes gln/storage-volume-size-support-vzxu Mar 31, 2026
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch 2 times, most recently from 9b0818e to 5800d41 Compare March 31, 2026 20:36
@glehmann glehmann changed the title gln/storage-volume-size-support-vzxu storage: test large volumes Apr 6, 2026
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch 2 times, most recently from a6a78f3 to 0f07c9b Compare April 7, 2026 13:32
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from f4248cf to eb0eac0 Compare April 15, 2026 16:18
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch 2 times, most recently from 9ade0b0 to a63e581 Compare April 17, 2026 13:52
@glehmann glehmann force-pushed the gln/storage-debugger-xva-retention-uxrt branch from cd1c5d4 to 27d715c Compare April 17, 2026 13:52
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from a63e581 to d7826f6 Compare April 21, 2026 06:08
@glehmann glehmann force-pushed the gln/storage-debugger-xva-retention-uxrt branch from 27d715c to aeaca44 Compare April 24, 2026 14:57
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from d7826f6 to a29798c Compare April 24, 2026 14:57
@glehmann glehmann force-pushed the gln/storage-debugger-xva-retention-uxrt branch from aeaca44 to b2250b7 Compare April 29, 2026 17:39
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from a29798c to 9d399c6 Compare April 29, 2026 17:39
glehmann added 5 commits May 11, 2026 17:48
Add pytest command-line option to configure default test VDI sizes,
enabling testing of large volumes supported by the new qcow2 feature.
The default remains 1GiB to avoid hardware requirements; larger sizes
will be added as new jobs in jobs.py.

Changes:
- Add parse_size() to handle size string parsing (e.g., '2.5TiB', '1GiB')
- Remove hardcoded integrity checksums to adapt to any volume size
- Introduce randstream() helper to keep code compact and extract checksums
- Update all storage fixtures to use configurable volume_size

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
At module or package scope, we may have a vdi still hanging around, using the
space we may need for another test

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
With larger volume sizes, the exported images may not fit in /tmp.
The large_temp_dir fixture still defaults to /tmp when no nfs configuration
is available, to keep the tests runnable, with small volume sizes, without
a nfs server.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Resize test VM's VDI to match the --volume-size parameter to support testing
with different volume sizes. Dynamically calculate expected XVA sizes and
handle filesystem resizing on Alpine systems.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Remove hardcoded 'xvdb' device name and use the device name returned by
vm.connect_vdi() to support flexible device naming.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann glehmann force-pushed the gln/storage-debugger-xva-retention-uxrt branch from b2250b7 to 3470670 Compare May 11, 2026 15:49
@glehmann glehmann force-pushed the gln/storage-volume-size-support-vzxu branch from 9d399c6 to 2d28eea Compare May 11, 2026 15:49
Base automatically changed from gln/storage-debugger-xva-retention-uxrt to master May 12, 2026 12:32
Comment thread tests/storage/storage.py
# to ensure we can export and import large xva images
randstream(vm, 'generate --size 500MiB /root/data')
randstream(vm, 'validate --expected-checksum 24e905d6 /root/data')
is_alpine = vm.ssh_with_result('apk --version').returncode == 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use the method exposed by VM to get the package manager.

Comment thread tests/storage/storage.py
Comment on lines +239 to +251
if is_alpine:
# growpart is not available in alpine 3.12
# vm.ssh('apk add cloud-utils-growpart e2fsprogs-extra')
vm.ssh('apk add gawk util-linux e2fsprogs-extra')
vm.ssh('wget https://raw.githubusercontent.com/canonical/cloud-utils/main/bin/growpart -O /usr/bin/growpart')
vm.ssh('chmod +x /usr/bin/growpart')
# TODO: maybe use `findmnt -no SOURCE /` from util-linux to get the blockdevice mounted on /
growpart_returncode = vm.ssh_with_result('growpart /dev/xvda 3').returncode
assert growpart_returncode in [0, 1] # growpart returns 1 if the size is already the expected one
vm.ssh('resize2fs /dev/xvda3')
stream_size = volume_size // 2
else:
stream_size = 500 * MiB
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's improve the VM object so that it can grow partitions on a wider variety of OSes (RHEL-like, debian...)

Copy link
Copy Markdown
Contributor

@Lankou66 Lankou66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stormi stormi merged commit a650506 into master May 12, 2026
9 checks passed
@stormi stormi deleted the gln/storage-volume-size-support-vzxu branch May 12, 2026 12:49
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.

5 participants