Skip to content

kvm: remove the partial RBD image when a template copy fails - #14393

Open
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-rbd-remove-partial-image-on-copy-failure
Open

weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-rbd-remove-partial-image-on-copy-failure

Conversation

@weizhouapache

Copy link
Copy Markdown
Member

Description

When qemu-img convert into an RBD pool failed or timed out, the half-written image was left behind. Every later copy of the same template then failed with "rbd create: File exists", so deployments from that template broke on the pool until the image was removed by hand.

  • check whether the destination RBD image exists before converting, and refuse to overwrite it, as it may be a complete image used by clones
  • remove the image again if the copy created it and then failed
  • do not print the Ceph key in the "Failed to convert" error

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?

When qemu-img convert into an RBD pool failed or timed out, the half-written
image was left behind. Every later copy of the same template then failed with
"rbd create: File exists", so deployments from that template broke on the pool
until the image was removed by hand.

- check whether the destination RBD image exists before converting, and refuse
  to overwrite it, as it may be a complete image used by clones
- remove the image again if the copy created it and then failed
- do not print the Ceph key in the "Failed to convert" error
@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

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.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 6.12245% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.02%. Comparing base (dfff32e) to head (c9575e0).

Files with missing lines Patch % Lines
.../hypervisor/kvm/storage/LibvirtStorageAdaptor.java 6.12% 46 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14393   +/-   ##
=========================================
  Coverage     18.01%   18.02%           
- Complexity    16265    16272    +7     
=========================================
  Files          5936     5936           
  Lines        536395   536442   +47     
  Branches      65701    65705    +4     
=========================================
+ Hits          96658    96695   +37     
- Misses       428710   428719    +9     
- Partials      11027    11028    +1     
Flag Coverage Δ
uitests 4.04% <ø> (ø)
unittests 19.09% <6.12%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache
weizhouapache marked this pull request as ready for review October 13, 2026 18:40
@weizhouapache weizhouapache added this to the 4.22.2 milestone Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants