Skip to content

Restrict VDDK check on filesystem only when the agent property for VDDK is set - #14688

Merged
sureshanaparti merged 2 commits into
apache:4.22from
shapeblue:422-vddk-check-issue
Nov 27, 2026
Merged

sureshanaparti merged 2 commits into
apache:4.22from
shapeblue:422-vddk-check-issue

Conversation

@nvazquez

@nvazquez nvazquez commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR restricts the filesystem check for the VDDK library only when the property vddk.lib.dir is set on agent.properties

Fixes: #13497

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?

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.32%. Comparing base (b56bbc2) to head (699f896).

Files with missing lines Patch % Lines
...ervisor/kvm/resource/LibvirtComputingResource.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14688   +/-   ##
=========================================
  Coverage     18.32%   18.32%           
+ Complexity    16644    16643    -1     
=========================================
  Files          5939     5939           
  Lines        537787   537777   -10     
  Branches      65932    65929    -3     
=========================================
- Hits          98544    98543    -1     
+ Misses       428033   428024    -9     
  Partials      11210    11210           
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests 19.41% <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 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.

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

clgtm

@blueorangutan

Copy link
Copy Markdown

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

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@timmyzhu

Copy link
Copy Markdown

I'm not an official reviewer, but I do not believe this fixes the issue. It does not address the root cause, and I don't think it'll even workaround the issue. The root cause is the vddk detection is far too slow. Doing a search of the entire filesystem is not a good design and should be avoided. My recommendation would be to remove the detection, but I'm not a cloudstack developer or maintainer.

If there's no way to remove the detection or change the detection to not scan the entire root filesystem, then this change only addresses one of the calls to detectVddkLibDir. As noted in the bug report, there's another case where detectVddkLibDir is called in the hostSupportsVddk function, and I believe this will likely cause the bug to persist. Generally, calling a host supports function is not expected to take dozens of minutes, which would occur when the detectVddkLibDir function is called within the function. Within the hostSupportsVddk function, moving the hostSupportsInstanceConversion() function call from the return to the beginning of this function could potentially workaround this issue. At minimum, this should be included in this PR and tested that it's working as expected, but it doesn't address the design issue with the detection.

@nvazquez

Copy link
Copy Markdown
Contributor Author

Thanks @timmyzhu I have missed the check on hostSupportsVddk(), I have now removed it. Please have another review when possible

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@timmyzhu

Copy link
Copy Markdown

Thanks @nvazquez! I haven't tested anything, but from looking at the code, the PR appears to address and fix the root cause of #13497.

@blueorangutan

Copy link
Copy Markdown

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

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

blueorangutan commented Nov 13, 2026 •

Copy link
Copy Markdown

[SF] Trillian test result (tid-17564)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 68930 seconds
Marvin logs: [archive removed]
Smoke tests completed. 145 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_enableHumanReadableLogs Error 0.34 test_human_readable_logs.py
test_08_upgrade_kubernetes_ha_cluster Failure 848.35 test_kubernetes_clusters.py
test_01_primary_storage_nfs Error 0.26 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.43 test_primary_storage.py
test_01_primary_storage_scope_change Error 0.17 test_primary_storage_scope.py

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

blueorangutan commented Nov 13, 2026 •

Copy link
Copy Markdown

[SF] Trillian test result (tid-17569)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 68168 seconds
Marvin logs: [archive removed]
Smoke tests completed. 146 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_enableHumanReadableLogs Error 0.20 test_human_readable_logs.py
test_08_upgrade_kubernetes_ha_cluster Failure 3673.42 test_kubernetes_clusters.py
test_02_list_cpvm_vm Failure 0.04 test_ssvm.py
test_04_cpvm_internals Failure 0.06 test_ssvm.py

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

clgtm

@blueorangutan

blueorangutan commented Nov 14, 2026 •

Copy link
Copy Markdown

[SF] Trillian test result (tid-17576)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54867 seconds
Marvin logs: [archive removed]
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

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

code lgtm

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

LGTM, here are the tested scenarios:

Host connect (the bug)

# Scenario Baseline PR
TC-01 Agent restart with the scan delay on (steps from the issue) Alert, not Up after 510 s, 6 scans, Timed out on ReadyCommand n/a
TC-02 Same as TC-01 n/a Up in 8 s, 0 scans
TC-03 reconnectHost with the scan delay on 3 scans Up in 14 s, 0 scans
TC-05 vddk.lib.dir set to a wrong path (a typo in the workaround) WARN, then 4 scans Up in 8 s, 0 scans

VDDK detection (regression and behaviour change)

# Scenario Baseline PR
TC-04 Valid vddk.lib.dir (the workaround from the issue) 0 scans, directory reported same
TC-06 VDDK fully configured host.vddk.support=true same
TC-07 VDDK installed, vddk.lib.dir not set found by the scan not found, support=false
R1 Real OpenVDDK in vddk.lib.dir, scan delay on 0 scans, support=true, 1.38.5 same
R2 Real OpenVDDK installed but not configured found by the scan not found, 0 scans

importVm VDDK check (CheckConvertInstance)

# Scenario Baseline PR
TC-08 usevddk=true, no VDDK directory set anywhere 1 scan, job fails after 124 s fails in 3 s, 0 scans
TC-09 Wrong directory passed in the API, valid one in agent.properties 1 scan fails in 3 s, 0 scans
TC-10 Valid directory passed in the API check passes same

Full imports from vCenter 8.0.3

# Scenario Baseline PR
R3 VDDK import, directory from agent.properties, then start the VM imported in 121 s, Running imported in 111 s, Running
R4 VDDK import, directory only in details[0].vddk.lib.dir imported imported
R5 No convertinstancehostid given (one host has VDDK, the other only virt-v2v) the VDDK host is chosen same
R6 vddk.transports=nbdssl and vddk.thumbprint in the import details both reach virt-v2v,

@sureshanaparti
sureshanaparti merged commit 3e05055 into apache:4.22 Nov 27, 2026
25 of 26 checks passed
@sureshanaparti
sureshanaparti deleted the 422-vddk-check-issue branch November 27, 2026 09:21
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.

Hosts get stuck in Alert state after update to cloudstack 4.22.1.0

7 participants