Skip to content

Conversation

weizhouapache
Copy link
Member

Description

This PR fixes #11673

Steps to reproduce the issue

  • deploy vm in kvm environments
  • create vm snapshot
  • delete the vm snapshot by `qemu-img snapshot -d
  • stop the vm
  • delete the vm snapshot on cloudstack GUI

Prior to this PR

2025-09-19T12:14:05,455 DEBUG [utils.script.Script] (Script-7:[]) (logid:) Piped commands executed successfully
2025-09-19T12:14:05,455 DEBUG [utils.script.Script] (AgentRequest-Handler-2:[]) (logid:) Executing command [/usr/bin/qemu-img snapshot -d i-2-23-VM_VS_20250919102815 /mnt/92a06402-16ab-35e8-950e-d84499c5e942/57c64582-aa4b-4329-bf18-9bcb14dffd57 ].
2025-09-19T12:14:05,594 WARN  [utils.script.Script] (AgentRequest-Handler-2:[]) (logid:) Execution of process [983177] for command [/usr/bin/qemu-img snapshot -d i-2-23-VM_VS_20250919102815 /mnt/92a06402-16ab-35e8-950e-d84499c5e942/57c64582-aa4b-4329-bf18-9bcb14dffd57 ] failed.
2025-09-19T12:14:05,594 DEBUG [utils.script.Script] (AgentRequest-Handler-2:[]) (logid:) Exit value of process [983177] for command [/usr/bin/qemu-img snapshot -d i-2-23-VM_VS_20250919102815 /mnt/92a06402-16ab-35e8-950e-d84499c5e942/57c64582-aa4b-4329-bf18-9bcb14dffd57 ] is [1].
2025-09-19T12:14:05,594 WARN  [utils.script.Script] (AgentRequest-Handler-2:[]) (logid:) Process [983177] for command [/usr/bin/qemu-img snapshot -d i-2-23-VM_VS_20250919102815 /mnt/92a06402-16ab-35e8-950e-d84499c5e942/57c64582-aa4b-4329-bf18-9bcb14dffd57 ] encountered the error: [1].
2025-09-19T12:14:05,595 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Seq 1-8671962557478622109:  { Ans: , MgmtId: 32986372244225, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.DeleteVMSnapshotAnswer":{"result":"false","details":"Delete VM Snapshot Failed due to can not remove snapshot from image file /mnt/92a06402-16ab-35e8-950e-d84499c5e942/57c64582-aa4b-4329-bf18-9bcb14dffd57 : 1","wait":"0","bypassHostMaintenance":"false"}}] }

With this PR

2025-09-19T12:59:29,526 DEBUG [utils.script.Script] (Script-9:[]) (logid:) Piped commands executed successfully
2025-09-19T12:59:29,527 DEBUG [resource.wrapper.LibvirtDeleteVMSnapshotCommandWrapper] (AgentRequest-Handler-5:[]) (logid:) qemu_img_snapshot =
2025-09-19T12:59:29,528 INFO  [resource.wrapper.LibvirtDeleteVMSnapshotCommandWrapper] (AgentRequest-Handler-5:[]) (logid:) Cannot find snapshot i-2-23-VM_VS_20250919102815 in file /mnt/92a06402-16ab-35e8-950e-d84499c5e942/57c64582-aa4b-4329-bf18-9bcb14dffd57, return true

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?

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@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

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (9167cd3) to head (8cfa064).
⚠️ Report is 10 commits behind head on 4.20.

Files with missing lines Patch % Lines
...wrapper/LibvirtDeleteVMSnapshotCommandWrapper.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11687      +/-   ##
============================================
- Coverage     16.17%   16.17%   -0.01%     
  Complexity    13297    13297              
============================================
  Files          5656     5656              
  Lines        498151   498151              
  Branches      60441    60441              
============================================
- Hits          80589    80587       -2     
- Misses       408589   408591       +2     
  Partials       8973     8973              
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.03% <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.

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache 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-14400)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53352 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11687-t14400-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache 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-14417)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53319 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11687-t14417-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

lgtm. didn't test.

Copy link

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM
Tested, resolves the reported issue.

@weizhouapache
Copy link
Member Author

merging based on approvals and manual test by @rajujith

thanks all

@weizhouapache weizhouapache merged commit 36cfd76 into apache:4.20 Sep 24, 2025
41 of 43 checks passed
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.

Unable to delete Instance snapshot in "Error' state on stopped Instances
6 participants