Skip to content

storage: free space for XVA import by destroying source VM first#471

Merged
Millefeuille42 merged 1 commit into
masterfrom
gln/fix-xva-import-space-pslw
May 12, 2026
Merged

storage: free space for XVA import by destroying source VM first#471
Millefeuille42 merged 1 commit into
masterfrom
gln/fix-xva-import-space-pslw

Conversation

@glehmann
Copy link
Copy Markdown
Member

@glehmann glehmann commented Apr 13, 2026

The test wasn't working properly with tick provisioning: in that case
the space from the source VM may be required to be able to import the
image.

Signed-off-by: Gaëtan Lehmann gaetan.lehmann@vates.tech

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" (this PR) → storage: 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

Comment thread tests/storage/storage.py
Comment thread tests/storage/storage.py Outdated

def xva_export_import(vm: VM, compression: XVACompression, temp_large_dir: str, defer: Defer):
def xva_export_import(host: Host, sr: SR, vm_ref: str, compression: XVACompression, temp_large_dir: str, defer: Defer):
vm = host.import_vm(vm_ref, sr.uuid, True)
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.

I don't think this works if vm_ref is a UUID. Would copying or cloning imported_vm instead be good enough for this test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, it should be good enough. I've updated the implementation.

@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from 604cee5 to 8427358 Compare April 15, 2026 16:18
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from 263b859 to 81ce353 Compare April 15, 2026 16:18
@glehmann glehmann changed the title storage: free some space by destroying the VM before importing the image in xva_export_import storage: free space for XVA import by destroying source VM first Apr 16, 2026
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from 81ce353 to d273947 Compare April 16, 2026 18:00
Comment thread tests/storage/storage.py
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from d273947 to f244985 Compare April 16, 2026 18:38
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.

looks good to me

@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from f244985 to e3515aa Compare April 17, 2026 13:52
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from 1f54a73 to 75e6d68 Compare April 17, 2026 13:52
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from e3515aa to 3806fe9 Compare April 21, 2026 06:08
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch 2 times, most recently from 0070121 to 0dabee2 Compare April 21, 2026 12:47
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from 3806fe9 to 150f448 Compare April 21, 2026 12:47
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from 0dabee2 to e5fefdf Compare April 21, 2026 13:24
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from 150f448 to 067a161 Compare April 21, 2026 13:24
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from e5fefdf to 75addb1 Compare April 21, 2026 14:03
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch 2 times, most recently from 352e955 to 9facd7c Compare April 24, 2026 14:55
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from 75addb1 to 254b633 Compare April 24, 2026 14:55
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from 9facd7c to ce6bf19 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/storage-lvmohba-tests-rxnv branch from 254b633 to 848fda3 Compare April 29, 2026 17:39
@dinhngtu dinhngtu removed the request for review from a team May 4, 2026 13:20
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from 848fda3 to eb57567 Compare May 11, 2026 15:48
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from ce6bf19 to b2f50eb Compare May 11, 2026 15:48
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from b2f50eb to 3ee475f Compare May 12, 2026 13:16
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from eb57567 to a0a7ef1 Compare May 12, 2026 13:16
Refactor xva_export_import to create the VM during the test and destroy it
before importing the exported image, freeing space for thick-provisioned SRs.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann glehmann force-pushed the gln/storage-lvmohba-tests-rxnv branch from a0a7ef1 to 1f002f0 Compare May 12, 2026 13:23
@glehmann glehmann force-pushed the gln/fix-xva-import-space-pslw branch from 3ee475f to 7a8a2d7 Compare May 12, 2026 13:23
Base automatically changed from gln/storage-lvmohba-tests-rxnv to master May 12, 2026 13:26
@Millefeuille42 Millefeuille42 merged commit 6fc5820 into master May 12, 2026
9 checks passed
@Millefeuille42 Millefeuille42 deleted the gln/fix-xva-import-space-pslw branch May 12, 2026 13:29
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.

4 participants