Skip to content

conditional import in case we are using xcpng 8.3 - #13692

Closed
DaanHoogland wants to merge 1 commit into
4.22from
ghi13292-xen-lvhdutil
Closed

DaanHoogland wants to merge 1 commit into
4.22from
ghi13292-xen-lvhdutil

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #13292

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?

@DaanHoogland DaanHoogland changed the title conditional import conditional import in case we are using xcpng 8.3 Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.69%. Comparing base (0339f31) to head (afb5eed).
⚠️ Report is 1 commits behind head on 4.22.

Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #13692   +/-   ##
=========================================
  Coverage     17.69%   17.69%           
- Complexity    15833    15835    +2     
=========================================
  Files          5925     5925           
  Lines        533534   533534           
  Branches      65273    65273           
=========================================
+ Hits          94421    94428    +7     
+ Misses       428434   428429    -5     
+ Partials      10679    10677    -2     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.77% <ø> (+<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.

@DaanHoogland
DaanHoogland requested a review from Pearl1594 July 24, 2026 14:13
@Pearl1594

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@Pearl1594 Pearl1594 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

code lgtm.

@sonarqubecloud

Copy link
Copy Markdown

@blueorangutan

Copy link
Copy Markdown

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

@prashanthr2

Copy link
Copy Markdown
Contributor

@DaanHoogland @Pearl1594

The latest commit has fixed the issue with SystemVM's with fully patched xcp-ng 8.3

However, we see certain operations failing

  1. Creating template from volume
  2. Create template from snapshot.

Failure seen in the xensource.log on xcp-ng is below

Aug 14 12:00:38 ref-trl-12214-x-mol9-prashanth-reddy-xs1 xapi: [error||6364 :::80|dispatch:host.call_plugin D:eb5bec0c5ac1|backtrace] host.call_plugin R:c6658c7122b8 failed with exception Server_error(XENAPI_PLUGIN_FAILURE, [ non-zero exit; ; Traceback (most recent call last):\x0A  File "/etc/xapi.d/plugins/vmopsSnapshot", line 34, in <module>\x0A    import lvhdutil\x0AModuleNotFoundError: No module named 'lvhdutil'\x0A ])
Aug 14 12:00:38 ref-trl-12214-x-mol9-prashanth-reddy-xs1 xapi: [error||6364 :::80|dispatch:host.call_plugin D:eb5bec0c5ac1|backtrace] Raised Server_error(XENAPI_PLUGIN_FAILURE, [ non-zero exit; ; Traceback (most recent call last):\x0A  File "/etc/xapi.d/plugins/vmopsSnapshot", line 34, in <module>\x0A    import lvhdutil\x0AModuleNotFoundError: No module named 'lvhdutil'\x0A ])

I think we need to have guard fix in vmopsSnapshot as well.

Note: this is only fix for xcp-ng 8.3 with SM module reverted. For future versions of xcp-ng ( where lvhdutil is removed), we need fix as suggested here #13292 (comment)

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@prashanthr2 , are these issues arising from this fix?
if not let’s adress them in new issues/PRs
if so, please explain further why we cannot merge this?

@DaanHoogland DaanHoogland moved this from Backlog to conflict/waiting in CloudStack Testing Sep 1, 2026
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

ping @prashanthr2

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a user has faced the changes today, and confirmed this PR fixed the issue

@weizhouapache

Copy link
Copy Markdown
Member

@DaanHoogland @Pearl1594

The latest commit has fixed the issue with SystemVM's with fully patched xcp-ng 8.3

However, we see certain operations failing

  1. Creating template from volume
  2. Create template from snapshot.

Failure seen in the xensource.log on xcp-ng is below

Aug 14 12:00:38 ref-trl-12214-x-mol9-prashanth-reddy-xs1 xapi: [error||6364 :::80|dispatch:host.call_plugin D:eb5bec0c5ac1|backtrace] host.call_plugin R:c6658c7122b8 failed with exception Server_error(XENAPI_PLUGIN_FAILURE, [ non-zero exit; ; Traceback (most recent call last):\x0A  File "/etc/xapi.d/plugins/vmopsSnapshot", line 34, in <module>\x0A    import lvhdutil\x0AModuleNotFoundError: No module named 'lvhdutil'\x0A ])
Aug 14 12:00:38 ref-trl-12214-x-mol9-prashanth-reddy-xs1 xapi: [error||6364 :::80|dispatch:host.call_plugin D:eb5bec0c5ac1|backtrace] Raised Server_error(XENAPI_PLUGIN_FAILURE, [ non-zero exit; ; Traceback (most recent call last):\x0A  File "/etc/xapi.d/plugins/vmopsSnapshot", line 34, in <module>\x0A    import lvhdutil\x0AModuleNotFoundError: No module named 'lvhdutil'\x0A ])

I think we need to have guard fix in vmopsSnapshot as well.

Note: this is only fix for xcp-ng 8.3 with SM module reverted. For future versions of xcp-ng ( where lvhdutil is removed), we need fix as suggested here #13292 (comment)

@DaanHoogland
I think @prashanthr2 is right, the changes need to be applied on other files too

# git grep lvhdutil
scripts/vm/hypervisor/xenserver/cloud-plugin-storage:import lvhdutil
scripts/vm/hypervisor/xenserver/cloud-plugin-storage:        primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
scripts/vm/hypervisor/xenserver/cloud-plugin-storage:        return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
scripts/vm/hypervisor/xenserver/cloud-plugin-storage:        vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
scripts/vm/hypervisor/xenserver/cloud-plugin-storage:            parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
scripts/vm/hypervisor/xenserver/vmopsSnapshot:import lvhdutil
scripts/vm/hypervisor/xenserver/vmopsSnapshot:        vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
scripts/vm/hypervisor/xenserver/vmopsSnapshot:            parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
scripts/vm/hypervisor/xenserver/vmopsSnapshot:        primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
scripts/vm/hypervisor/xenserver/vmopsSnapshot:        return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:import lvhdutil
scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:        primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:        return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:        vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:            parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:import lvhdutil
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:        vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:            parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:        primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:        return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)

just a note that these changes only bypass the lvhdutil import issue. lvhdutil is still used in some cases, so we may need to further investigate the potential impact of not importing it.

ideally, all usage of lvhdutil could eventually be replaced with other methods. Perhaps @olivierlambert could provide some advice on this.

@weizhouapache
weizhouapache self-requested a review September 10, 2026 08:21
@mvds-bbtk

Copy link
Copy Markdown

Thanks for providing this fix but for production use this is merely a very temporary workaround since a lot of functionality is lost that depends on lvhdutil. The loss of the ability to create templates from volumes or snapshots or taking snapshots all together means a serious degradation of operations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

6 participants