Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Nov 5, 2025

Description

Fixes #10589

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Preallocation flag added after changes,

2025-11-05 11:47:33,315 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Executing command [qemu-img create -o preallocation=full -f qcow2 /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 8589934592 ].
2025-11-05 11:49:07,780 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Successfully executed process [476300] for command [qemu-img create -o preallocation=full -f qcow2 /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 8589934592 ].
2025-11-05 11:49:07,781 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Executing command [qemu-img info -U /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 ].
2025-11-05 11:49:07,805 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Successfully executed process [476358] for command [qemu-img info -U /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 ].
2025-11-05 11:49:07,822 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Executing command [qemu-img convert -O qcow2 -o preallocation=full -U --image-opts driver=qcow2,file.filename=/mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/0abce4b6-b562-11f0-9bc2-1e008f00039b /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 ].
2025-11-05 11:50:49,386 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Successfully executed process [476361] for command [qemu-img convert -O qcow2 -o preallocation=full -U --image-opts driver=qcow2,file.filename=/mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/0abce4b6-b562-11f0-9bc2-1e008f00039b /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 ].
2025-11-05 11:50:49,387 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Executing command [qemu-img resize -o preallocation=full /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 10737418240 ].
2025-11-05 11:50:49,395 WARN  [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Execution of process [476480] for command [qemu-img resize -o preallocation=full /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 10737418240 ] failed.
2025-11-05 11:50:49,395 DEBUG [utils.script.Script] (AgentRequest-Handler-4:[]) (logid:729511e8) Exit value of process [476480] for command [qemu-img resize -o preallocation=full /mnt/ea3a10a7-49cb-3d72-bcc3-dec41ebecb7a/6e320e64-0621-43f5-ac4c-9a0f60201f03 10737418240 ] is [1].

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (671d8ad) to head (5934307).
⚠️ Report is 31 commits behind head on 4.22.

Files with missing lines Patch % Lines
...java/org/apache/cloudstack/utils/qemu/QemuImg.java 0.00% 32 Missing ⚠️
.../hypervisor/kvm/storage/LibvirtStorageAdaptor.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #11986   +/-   ##
=========================================
  Coverage     17.55%   17.56%           
- Complexity    15536    15551   +15     
=========================================
  Files          5909     5910    +1     
  Lines        529118   529147   +29     
  Branches      64627    64636    +9     
=========================================
+ Hits          92902    92959   +57     
+ Misses       425761   425731   -30     
- Partials      10455    10457    +2     
Flag Coverage Δ
uitests 3.58% <ø> (+<0.01%) ⬆️
unittests 18.63% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr shwstppr closed this Nov 6, 2025
@shwstppr shwstppr marked this pull request as ready for review November 6, 2025 08:53
@shwstppr shwstppr reopened this Nov 6, 2025
@shwstppr
Copy link
Contributor Author

shwstppr commented Nov 6, 2025

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

not tested

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15650

@weizhouapache
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@shwstppr shwstppr closed this Nov 6, 2025
@shwstppr shwstppr reopened this Nov 6, 2025
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

Fixes apache#10589

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@RosiKyu RosiKyu removed their assignment Dec 12, 2025
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

Thanks @RosiKyu for the tests. I've added the change to fix params

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 16024

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16037

Copy link
Collaborator

@RosiKyu RosiKyu left a comment

Choose a reason for hiding this comment

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

LGTM. Disk is fully preallocated as expected.

[root@ref-trl-10404-k-Mol9-rositsa-kyuchukova-kvm1 ~]# grep "415f694d-49f0-4bb6-b188-e95397dbc334" /var/log/cloudstack/agent/agent.log | grep "qemu-img"
2025-12-15 14:57:10,767 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Executing command [qemu-img create -o preallocation=full -f qcow2 /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 10737418240 ].
2025-12-15 14:58:28,079 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Successfully executed process [31759] for command [qemu-img create -o preallocation=full -f qcow2 /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 10737418240 ].
2025-12-15 14:58:28,081 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Executing command [qemu-img info -U /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 ].
2025-12-15 14:58:28,108 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Successfully executed process [31790] for command [qemu-img info -U /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 ].
2025-12-15 14:58:28,115 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Executing command [qemu-img convert -O qcow2 -o preallocation=full -U --image-opts driver=qcow2,file.filename=/mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/8d81fd6f-5aed-4993-af36-a16d0a7e61b9 /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 ].
2025-12-15 14:59:51,906 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Successfully executed process [31793] for command [qemu-img convert -O qcow2 -o preallocation=full -U --image-opts driver=qcow2,file.filename=/mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/8d81fd6f-5aed-4993-af36-a16d0a7e61b9 /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 ].
2025-12-15 14:59:51,907 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Executing command [qemu-img resize --preallocation=full /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 10737418240 ].
2025-12-15 14:59:52,026 WARN  [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Execution of process [31853] for command [qemu-img resize --preallocation=full /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 10737418240 ] failed.
2025-12-15 14:59:52,026 DEBUG [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Exit value of process [31853] for command [qemu-img resize --preallocation=full /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 10737418240 ] is [1].
2025-12-15 14:59:52,026 WARN  [utils.script.Script] (AgentRequest-Handler-1:[]) (logid:96111c19) Process [31853] for command [qemu-img resize --preallocation=full /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334 10737418240 ] encountered the error: [qemu-img: Preallocation can only be used for growing images].
[root@ref-trl-10404-k-Mol9-rositsa-kyuchukova-kvm1 ~]# ls -lsh /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334
12G -rw-r--r--. 1 root root 11G Dec 15 15:07 /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334
[root@ref-trl-10404-k-Mol9-rositsa-kyuchukova-kvm1 ~]# 
[root@ref-trl-10404-k-Mol9-rositsa-kyuchukova-kvm1 ~]# 
[root@ref-trl-10404-k-Mol9-rositsa-kyuchukova-kvm1 ~]# qemu-img info -U /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334
image: /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334
file format: qcow2
virtual size: 10 GiB (10737418240 bytes)
disk size: 11 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false
Child node '/file':
    filename: /mnt/4680c43f-b2ce-3c6f-887e-9a923b277f01/415f694d-49f0-4bb6-b188-e95397dbc334
    protocol type: file
    file length: 10 GiB (10739318784 bytes)
    disk size: 11 GiB

@weizhouapache
Copy link
Member

thanks @RosiKyu for testing!

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14998)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54178 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11986-t14998-kvm-ol8.zip
Smoke tests completed. 148 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_03_deploy_and_scale_kubernetes_cluster Failure 25.62 test_kubernetes_clusters.py

@DaanHoogland
Copy link
Contributor

@shwstppr , can you look at the remaining regression test failure. The title suggests it is related.

@DaanHoogland
Copy link
Contributor

@shwstppr , can you look at the remaining regression test failure. The title suggests it is related.

maybe not but, it is also in #11962 (comment) (definately not related.

@shwstppr
Copy link
Contributor Author

@DaanHoogland looked into the test logs, failure is not related,

jobresult : {errorcode : 530, errortext : "Resource limits prevent scaling the cluster: Maximum amount of resources of Type = \'cpu\', tag = \'null\' for Account Name = test-a-TestKubernetesCluster-LKO3MF in Domain Id = 1 is exceeded: Account Resource Limit = 40, Current Account Resource Amount = 4, Current Account Resource Reservation = 0, Requested Resource Amount = 2000."}

@DaanHoogland DaanHoogland merged commit e08e66d into apache:4.22 Dec 17, 2025
24 of 27 checks passed
@DaanHoogland DaanHoogland deleted the fix-fatdisk-resize branch December 17, 2025 12:03
DaanHoogland pushed a commit that referenced this pull request Dec 22, 2025
* 4.22:
  Update templateConfig.sh to not break with directorys with space on t… (#10898)
  Fix VM and volume metrics listing regressions (#12284)
  packaging: use latest cmk release link directly (#11429)
  api:rename RegisterCmd.java => RegisterUserKeyCmd.java (#12259)
  Prioritize copying templates from other secondary storages instead of downloading them (#10363)
  Show time correctly in the backup schedule UI  (#12012)
  kvm: use preallocation option for fat disk resize (#11986)
  Python exception processing static routes fixed (#11967)
  KVM memballooning requires free page reporting and autodeflate (#11932)
  api: create/register/upload template with empty template tag (#12234)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jan 21, 2026
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
sandeeplocharla pushed a commit to NetApp/cloudstack that referenced this pull request Feb 6, 2026
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Image resize for fat type of disk does not preallocate additional space

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.