Skip to content

fix: clean up first try disks before arch fallback retry - #14376

Open
Damans227 wants to merge 1 commit into
apache:mainfrom
Damans227:fix-sysvm-arch-fallback-root-volume
Open

Damans227 wants to merge 1 commit into
apache:mainfrom
Damans227:fix-sysvm-arch-fallback-root-volume

Conversation

@Damans227

@Damans227 Damans227 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #14235

When a system vm cant be placed on hosts of the preferred architecture, it retries with the other architecture's template. The first try had already made a root disk and network cards for the vm, and nothing removed them. So the vm ended up with two root disks on the same slot and could not start on any host. This removes the first try's disks and network cards before the retry, for both the secondary storage vm and the console proxy.

Test:

KVM lab with one x86 cluster and one disabled aarch64 cluster, an aarch64 system vm template, and system.vm.preferred.architecture=aarch64. Destroy the console proxy so a new one is made. It cant be placed on aarch64, so it retries with the x86 template.

Also added a unit test for the new cleanup step. VirtualMachineManagerImplTest, ConsoleProxyManagerImplTest, SecondaryStorageManagerImplTest and SecondaryStorageManagerTest pass.

Before: the new console proxy keeps both root disks on slot 0 and every start fails:

Allocating Instance from Template: Template {"id":202,"name":"SystemVM Template (KVM) aarch64"} with hostname: v-4-VM and 3 networks
Unable to allocate proxy Console VM instance {"id":4,"instanceName":"v-4-VM"} with Template {"id":202,"name":"SystemVM Template (KVM) aarch64"}
Allocating Instance from Template: Template {"id":3,"name":"SystemVM Template (KVM)"} with hostname: v-4-VM and 3 networks
Unable to start VM on Host {"id":2,"name":"pr14376-n87-kvm-ol8-kvm2"} due to XML error: target 'vda' duplicated for disk sources '/mnt/8a552ad2-a4fe-375e-b1d1-803e4116c517/11d0ae80-ab12-4641-9970-968d3694d415' and '/mnt/ca52e25a-47cf-3f9d-ab89-96187f87b007/b017ec29-bf06-4aa5-987d-cff96135743c'

volume  vm      device_id  state  template
4       v-4-VM  0          Ready  202 (aarch64)
5       v-4-VM  0          Ready  3 (x86)

After: the aarch64 disk is removed before the retry. The console proxy gets one root disk and starts:

volume  vm      device_id  state    template
8       v-6-VM  0          Destroy  202 (aarch64)
9       v-6-VM  0          Ready    3 (x86)

v-6-VM  Running

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.21%. Comparing base (68cff97) to head (6bf7f24).

Files with missing lines Patch % Lines
...om/cloud/consoleproxy/ConsoleProxyManagerImpl.java 0.00% 1 Missing ⚠️
.../secondarystorage/SecondaryStorageManagerImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #14376   +/-   ##
=========================================
  Coverage     20.21%   20.21%           
- Complexity    20750    20751    +1     
=========================================
  Files          6426     6426           
  Lines        580181   580188    +7     
  Branches      71033    71033           
=========================================
+ Hits         117287   117291    +4     
- Misses       450180   450183    +3     
  Partials      12714    12714           
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 21.51% <71.42%> (+<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 19495

@blueorangutan

Copy link
Copy Markdown

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

@Damans227
Damans227 marked this pull request as ready for review October 9, 2026 17:20
@Damans227
Damans227 requested review from nvazquez and shwstppr October 9, 2026 17:20

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.

Multi-arch zone: system VM arch-fallback leaves an orphaned ROOT volume, making the system VM unstartable on every host

2 participants