Skip to content

kvm: iSCSI cleanup improvements - #14834

Open
winterhazel wants to merge 1 commit into
apache:mainfrom
winterhazel:fix-iscsi-cleanup
Open

winterhazel wants to merge 1 commit into
apache:mainfrom
winterhazel:fix-iscsi-cleanup

Conversation

@winterhazel

Copy link
Copy Markdown
Member

Description

IscsiStorageCleanupMonitor compares /dev/disk/by-path entries with libvirt disk paths using String.equals. Due to this, adapters that write identity-stable aliases into the XML (for example ONTAP by-id/wwn paths) never match, so LUNs that are still in use are treated as stale and can be logged out.

This PR fixes the issue by resolving both the collected by-path entries and the VM disk paths to their backing kernel block devices, and matching on that identity. Additionally, it also contains a few adjustments to the iSCSI cleanup monitor:

  • Route inactive cleanup through KVMStoragePoolManager so the adaptor owning the alias handles it, and provide by-id and mapper aliases in a deterministic order.
  • Harden IscsiAdmStorageAdaptor so it claims only well-formed iSCSI by-path entries.
  • Make unresolved paths non-blocking by ignoring missing aliases, protecting existing but unidentifiable iSCSI entries without blocking other cleanups, and skipping a round only when a VM disk alias cannot be identified.

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

How Has This Been Tested?

Tests are still pending.

@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.65022% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.84%. Comparing base (278bde2) to head (789c51e).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...rvisor/kvm/storage/IscsiStorageCleanupMonitor.java 87.73% 17 Missing and 9 partials ⚠️
.../hypervisor/kvm/storage/KVMStoragePoolManager.java 0.00% 4 Missing ⚠️
...ervisor/kvm/resource/LibvirtComputingResource.java 0.00% 1 Missing ⚠️
...hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14834      +/-   ##
============================================
+ Coverage     20.78%   20.84%   +0.06%     
- Complexity    20857    20985     +128     
============================================
  Files          6053     6053              
  Lines        548230   548628     +398     
  Branches      73237    78700    +5463     
============================================
+ Hits         113928   114366     +438     
+ Misses       420955   420886      -69     
- Partials      13347    13376      +29     
Flag Coverage Δ
uitests 3.86% <ø> (-0.01%) ⬇️
unittests 22.28% <85.65%> (+0.06%) ⬆️

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 20139

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