FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

kvm: fix vm deployment from RAW template by weizhouapache · Pull Request #10880 · apache/cloudstack · GitHub

Repository navigation

kvm: fix vm deployment from RAW template - #10880

Merged
weizhouapache merged 2 commits into
apache:mainfrom
weizhouapache:4.21-fix-kvm-raw-template
May 19, 2025
Merged

weizhouapache merged 2 commits into
apache:mainfrom
weizhouapache:4.21-fix-kvm-raw-template

Conversation

Copy link
Copy Markdown
Member

Description

This PR fixes the vm deployment if template is RAW.

2025-05-16T09:32:39,205 ERROR [kvm.storage.LibvirtStorageAdaptor] (AgentRequest-Handler-2:[]) (logid:9d528179) Failed to convert [/mnt/71c96d7c-9e42-5184-83e3-0786cfa3e7d2/34cbcd76-aafb-53a9-9ad3-1596ce9389ff.raw] to [/mnt/db98865f-20d0-30d8-bcad-bec75452cb56/e1eceab0-863a-46c2-b0a2-100a2fbf3d09] due to: [qemu-img: Source lacks bitmap support]. org.apache.cloudstack.utils.qemu.QemuImgException: qemu-img: Source lacks bitmap support
        at org.apache.cloudstack.utils.qemu.QemuImg.convert(QemuImg.java:477)
        at com.cloud.hypervisor.kvm.storage.LibvirtStorageAdaptor.copyPhysicalDisk(LibvirtStorageAdaptor.java:1613)
        at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.copyPhysicalDisk(KVMStoragePoolManager.java:459)

RAW does not support bitmaps.

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?

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

Copy link
Copy Markdown
Member Author

related to #9270
this might not be the best solution, but it just works.

it fixes the smoke test failures

cc @JoaoJandre @DaanHoogland @Pearl1594

Copy link
Copy Markdown
Member Author

@blueorangutan package

codecov Bot commented May 16, 2025 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 16.39%. Comparing base (64828f6) to head (9905760).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
.../hypervisor/kvm/storage/LibvirtStorageAdaptor.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10880      +/-   ##
============================================
- Coverage     16.40%   16.39%   -0.02%     
+ Complexity    13630    13626       -4     
============================================
  Files          5705     5708       +3     
  Lines        503722   504063     +341     
  Branches      61034    61103      +69     
============================================
+ Hits          82647    82651       +4     
- Misses       411889   412214     +325     
- Partials       9186     9198      +12     
Flag Coverage Δ
uitests 3.99% <ø> (ø)
unittests 17.25% <0.00%> (-0.02%) ⬇️

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.

Copy link
Copy Markdown
Member Author

@blueorangutan package

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

JoaoJandre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good catch @weizhouapache !

…/storage/LibvirtStorageAdaptor.java

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>

Copy link
Copy Markdown
Member Author

@blueorangutan package

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

Copy link
Copy Markdown
Member Author

@blueorangutan test

Copy link
Copy Markdown

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

yadvr added this to the 4.21.0 milestone May 16, 2025

DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

code ltgm

weizhouapache marked this pull request as ready for review May 16, 2025 14:16

Copy link
Copy Markdown
Contributor

@weizhouapache is this worth a smoke test?

Copy link
Copy Markdown
Member Author

@weizhouapache is this worth a smoke test?

yes, test_network failed as it uses ubuntu 22 cloud image which is raw format.

Copy link
Copy Markdown
Contributor

Hey @weizhouapache I randomly stumbled upon another bug on the convert using --bitmaps. I'm still investigating how to best fix it, but I believe that we could add the fix in this PR, as it is in the same workflow. I'll try to get back to this on monday.

Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_04_extract_Iso Failure 1.12 test_iso.py
test_03_ping_in_ssvm_success Failure 15.57 test_diagnostics.py
test_05_ping_in_cpvm_success Failure 15.53 test_diagnostics.py

Copy link
Copy Markdown
Member Author

Hey @weizhouapache I randomly stumbled upon another bug on the convert using --bitmaps. I'm still investigating how to best fix it, but I believe that we could add the fix in this PR, as it is in the same workflow. I'll try to get back to this on monday.

thanks @JoaoJandre

Copy link
Copy Markdown
Contributor

@weizhouapache so the bug I had found was when using very old images, they would not support bitmaps and the copy process would throw me this error:

Failed to convert [/mnt/b59eff0f-5b97-37ed-a513-9e1983d1d19b/2784ec51-4776-4b03-9a85-198c465e7d25] to [/mnt/a66f48f5-13c6-3676-b320-a15d32bbf32f/2784ec51-4776-4b03-9a85-198c465e7d25] due to: [qemu-img: Source lacks bitmap support]. org.apache.cloudstack.utils.qemu.QemuImgException: qemu-img: Source lacks bitmap support

Looking at the Qemu-img source code (see https://github.com/qemu/qemu/blob/master/block/qcow2-bitmap.c#L1767), this error is thrown when the IMG version is lower then 3. So I've added a check to verify it before adding the --bitmaps option: version.txt (I can't upload .patch files due to a github bug apparently)

Copy link
Copy Markdown
Member Author

@weizhouapache so the bug I had found was when using very old images, they would not support bitmaps and the copy process would throw me this error:

Failed to convert [/mnt/b59eff0f-5b97-37ed-a513-9e1983d1d19b/2784ec51-4776-4b03-9a85-198c465e7d25] to [/mnt/a66f48f5-13c6-3676-b320-a15d32bbf32f/2784ec51-4776-4b03-9a85-198c465e7d25] due to: [qemu-img: Source lacks bitmap support]. org.apache.cloudstack.utils.qemu.QemuImgException: qemu-img: Source lacks bitmap support

Looking at the Qemu-img source code (see https://github.com/qemu/qemu/blob/master/block/qcow2-bitmap.c#L1767), this error is thrown when the IMG version is lower then 3. So I've added a check to verify it before adding the --bitmaps option: version.txt (I can't upload .patch files due to a github bug apparently)

@JoaoJandre
Good finding. Maybe we can merge this PR (if it is still needed ), then you create another PR for your changes ?

Copy link
Copy Markdown
Contributor

@weizhouapache so the bug I had found was when using very old images, they would not support bitmaps and the copy process would throw me this error:

Failed to convert [/mnt/b59eff0f-5b97-37ed-a513-9e1983d1d19b/2784ec51-4776-4b03-9a85-198c465e7d25] to [/mnt/a66f48f5-13c6-3676-b320-a15d32bbf32f/2784ec51-4776-4b03-9a85-198c465e7d25] due to: [qemu-img: Source lacks bitmap support]. org.apache.cloudstack.utils.qemu.QemuImgException: qemu-img: Source lacks bitmap support

Looking at the Qemu-img source code (see https://github.com/qemu/qemu/blob/master/block/qcow2-bitmap.c#L1767), this error is thrown when the IMG version is lower then 3. So I've added a check to verify it before adding the --bitmaps option: version.txt (I can't upload .patch files due to a github bug apparently)

@JoaoJandre Good finding. Maybe we can merge this PR (if it is still needed ), then you create another PR for your changes ?

If you want to leave both contexts separated, I'm ok with it. I'll open a PR with the patch once this PR is merged.

Copy link
Copy Markdown
Member Author

the smoke test test_network uses template with RAW format.
It passed in last trillian test, which proved this PR worked.

merging

weizhouapache merged commit 96b8e23 into apache:main May 19, 2025
DaanHoogland deleted the 4.21-fix-kvm-raw-template branch May 20, 2025 06:43
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
* kvm: fix vm deployment from RAW template

* Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>

---------

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL