GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — kvm: remove the partial RBD image when a template copy fails by weizhouapache · Pull Request #14393 · apache/cloudstack

Conversation

@weizhouapache

@weizhouapache weizhouapache commented Oct 13, 2026

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@weizhouapache
kvm: remove the partial RBD image when a template copy fails
c9575e0
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
@boring-cyborg boring-cyborg Bot added the component:kvm label Oct 13, 2026
@weizhouapache

weizhouapache commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

@blueorangutan package

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@blueorangutan

blueorangutan commented Oct 13, 2026

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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).
⚠️ Report is 26 commits behind head on 4.22.

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@blueorangutan

blueorangutan commented Oct 13, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@weizhouapache
weizhouapache marked this pull request as ready for review October 13, 2026 18:40
@weizhouapache weizhouapache added the component:ceph label Oct 13, 2026
@weizhouapache weizhouapache added this to the 4.22.2 milestone Oct 13, 2026
@weizhouapache weizhouapache mentioned this pull request Oct 13, 2026
[WIP] Ceph improvements shapeblue/cloudstack#147
Draft
3 of 14 tasks
Damans227
Damans227 reviewed Oct 14, 2026
View reviewed changes
Comment thread ...ns/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
logger.error("Failed to convert from {} to RBD image {} the error was: {}", srcFilename, rbdDestPath, maskRbdKey(e.getMessage()));
newDisk = null;
if (destCreatedByCopy) {
removeRbdImageQuietly(destPool, name);

@Damans227 Damans227 Oct 14, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

what happens on a timeout? qemu-img gets killed, so ceph still sees it on the image for about 30s and the remove here likely fails with "image has watchers"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Damans227
Damans227 reviewed Oct 14, 2026
View reviewed changes
Comment thread ...ns/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
String srcFilename = srcFile != null ? srcFile.getFileName() : null;
String destFilename = destFile != null ? destFile.getFileName() : null;
logger.error(String.format("Failed to convert from %s to %s the error was: %s", srcFilename, destFilename, e.getMessage()));
logger.error("Failed to convert from {} to RBD image {} the error was: {}", srcFilename, rbdDestPath, maskRbdKey(e.getMessage()));

@Damans227 Damans227 Oct 14, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

should the rbd to rbd copy further down get the same fix? it still logs the key and leaves the image behind when it fails

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@weizhouapache weizhouapache mentioned this pull request Oct 16, 2026
KVM: volume migration on Ceph RBD, and between RBD, NFS, SharedMountPoint and local pools #14426
Draft
2 of 14 tasks
@nvazquez nvazquez modified the milestones: 4.22.2, 4.22.3 Nov 9, 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

Reviewers

1 more reviewer
@Damans227 Damans227 Damans227 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

component:ceph component:kvm

Projects

None yet

Milestone

4.22.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@weizhouapache @blueorangutan @Damans227 @nvazquez
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.