Skip to content

Conversation

rg9975
Copy link

@rg9975 rg9975 commented Jun 23, 2025

Description

This PR fixes various issues in the fiberchannel/adaptive storage provider, including adding an optional interface for handling connecting disks in a 3 step process to improve performance on VMs with a large number of disks to connect. One additional change is included to provide an option to disable the fixed string prefix added to autoscale VMs to allow for longer generated names. A couple of small annotations were added to help builds when running in an m2e-compatible IDE.

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?

Code has been tested and used in live environment with appropriate storage appliances.

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

Code has been tested and used in live environment with appropriate storage appliances.

Copy link

codecov bot commented Jun 23, 2025

Codecov Report

❌ Patch coverage is 1.52091% with 259 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (f24b175) to head (017a332).
⚠️ Report is 29 commits behind head on 4.20.

Files with missing lines Patch % Lines
...pervisor/kvm/storage/MultipathSCSIAdapterBase.java 0.00% 133 Missing ⚠️
.../datastore/driver/AdaptiveDataStoreDriverImpl.java 0.00% 55 Missing ⚠️
.../hypervisor/kvm/storage/KVMStoragePoolManager.java 0.00% 54 Missing ⚠️
...ud/hypervisor/kvm/storage/KVMStorageProcessor.java 0.00% 11 Missing ⚠️
...ava/com/cloud/network/as/AutoScaleManagerImpl.java 33.33% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11071      +/-   ##
============================================
- Coverage     16.17%   16.17%   -0.01%     
- Complexity    13284    13296      +12     
============================================
  Files          5656     5656              
  Lines        498015   498264     +249     
  Branches      60406    60446      +40     
============================================
+ Hits          80538    80570      +32     
- Misses       408514   408729     +215     
- Partials       8963     8965       +2     
Flag Coverage Δ
uitests 4.00% <ø> (-0.01%) ⬇️
unittests 17.02% <1.52%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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 review from rp-, vishesh92 and Copilot and removed request for rp- June 23, 2025 11:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes several issues and enhances functionality in both autoscale VM hostname generation and storage connectivity, including improvements for handling disk connections asynchronously and build configuration refinements.

  • Introduces an optional configuration for including a hostname prefix for autoscale VMs.
  • Implements asynchronous disk connection handling and improves error messaging and logging across storage adapter scripts.
  • Adds several m2e IDE build annotations and fixes path issues in Maven POMs.

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java Adds hostname generation methods with and without prefix for autoscale VMs.
server/src/main/java/com/cloud/network/as/AutoScaleManager.java Introduces a new config key to enable/disable the autoscale hostname prefix.
scripts/storage/multipath/startConnectVolume.sh Implements a shell script to connect volumes, with minor spelling issues in comments.
scripts/storage/multipath/finishConnectVolume.sh Provides a finishing connect script with similar spelling issues as startConnectVolume.sh.
scripts/storage/multipath/disconnectVolume.sh Updates background execution behavior for disk disconnect operations.
scripts/storage/multipath/connectVolume.sh Refactors volume connect logic to use dedicated start/finish connect scripts and a waiting loop.
pom.xml, plugins/*/pom.xml, engine/schema/pom.xml Updates Maven POM configurations and ensures m2e IDE compatibility.
plugins/storage/volume/adaptive/src/main/java/org/apache/cloudstack/storage/datastore/driver/AdaptiveDataStoreDriverImpl.java Modifies persistence method signatures and logging for volume operations.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/MultipathSCSIAdapterBase.java Adjusts script timeout values and error messages, and adds new script properties.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java, KVMStoragePoolManager.java, AsyncPhysicalDiskConnectorDecorator.java Improves exception handling and implements support for asynchronous physical disk connections.

@rp-
Copy link
Contributor

rp- commented Jul 3, 2025

I ran the Linstor integration tests against it and had not problems, so green light from me, from that perspective.

Copy link
Contributor

@rp- rp- left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor

shwstppr commented Sep 3, 2025

@rg9975 can you please resolve the conflicts?

@vishesh92
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@DaanHoogland DaanHoogland reopened this Sep 9, 2025
@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14249)

templateList.add("systemvmtemplate-${csVersion}.${patch}-x86_64-ovm")
templateList.add("systemvmtemplate-${csVersion}.${patch}-x86_64-hyperv")
File file = new File("./engine/schema/dist/systemvm-templates/md5sum.txt")
File file = new File("${basedir}/../../engine/schema/dist/systemvm-templates/md5sum.txt")
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look right.

Copy link
Author

Choose a reason for hiding this comment

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

Well, it technically will work, although it could have been expressed:

File file = new File("${basedir}/dist/systemvm-templates/md5sum.txt")

The primary motivation was to eliminate the relative File path that seems to cause problems in Visual Studio Code during compilation.

if (!connectPhysicalDisk(address, pool, null)) {
throw new CloudRuntimeException("Unable to connect to volume " + address.getPath());
}
LOGGER.debug("Physical disk " + address.getPath() + " is not connected, a request to connectPhysicalDisk must be made before it can be used.");
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to make a call to the connectPhysicalDisk method?

Copy link
Author

Choose a reason for hiding this comment

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

This is intentional in the change. The getPhysicalDisk operation expects that a previous call to connectPhysicalDisk has already been made. If it has not been made, an error is thrown. This allows for asynchronous connections to be processed by the storage provider to improve startup of virtual machines with a large # of attached disks rather than a connection being created as side effect of a getPhysicalDisk call.

…/storage/KVMStoragePoolManager.java

Co-authored-by: Vishesh <[email protected]>
@weizhouapache weizhouapache modified the milestones: 4.20.2, 4.20.3 Sep 10, 2025
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.

7 participants