Skip to content

core: fix instance snapshot failure - #14543

Draft
shwstppr wants to merge 1 commit into
apache:mainfrom
shwstppr:fix-instancesnap-error
Draft

shwstppr wants to merge 1 commit into
apache:mainfrom
shwstppr:fix-instancesnap-error

Conversation

@shwstppr

Copy link
Copy Markdown
Contributor

Description

Fix null volume list in KVM disk-only VM snapshot commands

Populate the inherited volume list from the volume/path pairs so UEFI NVRAM backup can locate the root volume without throwing a NullPointerException.

Update the NVRAM regression test to use a real snapshot command instead of mocking the missing list.

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):

Before fix, error was seen while working with Veeam KVM and testing worker VM
image

2026-10-30 18:35:56,060 WARN  [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:ca7d2775) Caught: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "volumeObjectTos" is null
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.getRootVolume(LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.java:263)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.backupNvramIfNeeded(LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.java:232)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.takeDiskOnlyVmSnapshotOfRunningVm(LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.java:122)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.execute(LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.java:80)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.execute(LibvirtCreateDiskOnlyVMSnapshotCommandWrapper.java:59)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
        at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:2441)
        at com.cloud.agent.Agent.processRequest(Agent.java:813)
        at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:1295)
        at com.cloud.utils.nio.Task.call(Task.java:83)
        at com.cloud.utils.nio.Task.call(Task.java:29)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

How Has This Been Tested?

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

Fix null volume list in KVM disk-only VM snapshot commands

Populate the inherited volume list from the volume/path pairs so UEFI NVRAM backup can locate the root volume without throwing a NullPointerException.

Update the NVRAM regression test to use a real snapshot command instead of mocking the missing list.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 20.76%. Comparing base (72014a0) to head (905027c).
⚠️ Report is 100 commits behind head on main.

Files with missing lines Patch % Lines
...t/api/storage/CreateDiskOnlyVmSnapshotCommand.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14543      +/-   ##
============================================
+ Coverage     19.89%   20.76%   +0.87%     
- Complexity    20141    21903    +1762     
============================================
  Files          6371     6496     +125     
  Lines        576829   591606   +14777     
  Branches      70627    72583    +1956     
============================================
+ Hits         114756   122860    +8104     
- Misses       449531   455407    +5876     
- Partials      12542    13339     +797     
Flag Coverage Δ
uitests 3.88% <ø> (+0.17%) ⬆️
unittests 22.07% <50.00%> (+0.91%) ⬆️

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant