Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes #11799

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?

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

code LGTM.

Better to test it with shared, L2 and isolated network types.

@harikrishna-patnala
Copy link
Contributor

@blueorangutan package

@harikrishna-patnala harikrishna-patnala added this to the 4.20.2 milestone Oct 9, 2025
@blueorangutan
Copy link

@harikrishna-patnala 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
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 28.57143% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (4d95f08) to head (49c449f).
⚠️ Report is 1 commits behind head on 4.20.

Files with missing lines Patch % Lines
...tack/engine/orchestration/NetworkOrchestrator.java 30.76% 8 Missing and 1 partial ⚠️
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11811      +/-   ##
============================================
- Coverage     16.17%   16.17%   -0.01%     
- Complexity    13297    13299       +2     
============================================
  Files          5656     5656              
  Lines        498331   498338       +7     
  Branches      60476    60478       +2     
============================================
+ Hits          80591    80592       +1     
- Misses       408767   408774       +7     
+ Partials       8973     8972       -1     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.02% <28.57%> (-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.

@weizhouapache weizhouapache linked an issue Oct 9, 2025 that may be closed by this pull request
@blueorangutan
Copy link

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

@nvazquez
Copy link
Contributor

nvazquez commented Oct 9, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test

@weizhouapache weizhouapache marked this pull request as ready for review October 9, 2025 13:04
@blueorangutan
Copy link

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

@vishesh92 vishesh92 self-assigned this Oct 10, 2025
@blueorangutan
Copy link

[SF] Trillian test result (tid-14602)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56425 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11811-t14602-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@vishesh92 vishesh92 requested a review from Copilot October 10, 2025 06:52
Copy link
Contributor

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 IP address allocation for importing VMs on Shared networks by updating the import process to handle Shared networks instead of just Basic zones.

  • Refactored IP allocation logic to handle Shared networks specifically instead of relying on Basic zone logic
  • Removed unused imports and injection dependencies for IpAddressManager
  • Updated method naming to reflect the change from Basic zone to Shared network handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
UnmanagedVMsManagerImpl.java Removed unused IP address allocation code and dependencies, simplified IP address initialization
NetworkOrchestrator.java Updated IP allocation logic to handle Shared networks instead of Basic zones, renamed method accordingly

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm. I did very basic testing by importing the VM from the shared disk. Earlier an IP was assigned to the imported VM (stopped state). After these changes, no IP is assigned to the imported VM. When the VM is started, an IP will be allocated. This should allow the user to import more VMs than the available IPs. But the start VM will probably fail due to unavailability of IPs.

@weizhouapache
Copy link
Member Author

clgtm. I did very basic testing by importing the VM from the shared disk. Earlier an IP was assigned to the imported VM (stopped state). After these changes, no IP is assigned to the imported VM. When the VM is started, an IP will be allocated. This should allow the user to import more VMs than the available IPs. But the start VM will probably fail due to unavailability of IPs.

thanks @vishesh92 for the testing

I think it would be better to allocate an IP when VM is imported (not started).
what's your opinions ? @nvazquez @harikrishna-patnala @rajujith

@harikrishna-patnala
Copy link
Contributor

clgtm. I did very basic testing by importing the VM from the shared disk. Earlier an IP was assigned to the imported VM (stopped state). After these changes, no IP is assigned to the imported VM. When the VM is started, an IP will be allocated. This should allow the user to import more VMs than the available IPs. But the start VM will probably fail due to unavailability of IPs.

thanks @vishesh92 for the testing

I think it would be better to allocate an IP when VM is imported (not started). what's your opinions ? @nvazquez @harikrishna-patnala @rajujith

yes I do agree @weizhouapache but with this PR it is supposed to get an IP during import itself right, except for L2 network. Do we need more changes then ?

@weizhouapache
Copy link
Member Author

thanks @vishesh92 for the testing
I think it would be better to allocate an IP when VM is imported (not started). what's your opinions ? @nvazquez @harikrishna-patnala @rajujith

yes I do agree @weizhouapache but with this PR it is supposed to get an IP during import itself right, except for L2 network. Do we need more changes then ?

thanks @harikrishna-patnala

I tested import of Running vms on L2/shared/isolated, all worked
However, for stopped vm, as @vishesh92 tested, "After these changes, no IP is assigned to the imported VM."
it looks more changes are needed

I will test it

@weizhouapache weizhouapache marked this pull request as draft October 10, 2025 08:40
@weizhouapache
Copy link
Member Author

pushed a commit to update IP state on shared network

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan package

@weizhouapache
Copy link
Member Author

@vishesh92
Update PR to automatically allocate an IP

  • on Isolated network: should be same as current behaviour
  • on Shared network: fix the IP allocation issue in Basic zone and Advanced zone

Copy link

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

Looks good except for the IP not getting allocated along with import.

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

Looks good except for the IP not getting allocated along with import.

thanks @rajujith
I discussed it with Vishesh, and pushed a commit to auto-allocate an IP on the network (it is not included in current packages)
can you test with new packages are ready ?

@blueorangutan
Copy link

Packaging result [SF]: ✖️ debian. SL-JID 15396

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

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm

@rajujith
Copy link

@blueorangutan package

@blueorangutan
Copy link

@rajujith 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 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15398

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-14631)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 60913 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11811-t14631-kvm-ol8.zip
Smoke tests completed. 138 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.63 test_human_readable_logs.py
test_01_primary_storage_nfs Error 0.25 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.43 test_primary_storage.py
test_01_primary_storage_scope_change Error 0.29 test_primary_storage_scope.py

Copy link

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM
Tested, import works and the IP address is allocated during import in a basic zone.

@weizhouapache weizhouapache marked this pull request as ready for review October 13, 2025 06:15
@weizhouapache
Copy link
Member Author

LGTM Tested, import works and the IP address is allocated during import in a basic zone.

thanks @rajujith @vishesh92 @harikrishna-patnala for the testing and review

Merging

@weizhouapache weizhouapache merged commit 86cad79 into apache:4.20 Oct 13, 2025
42 of 43 checks passed
@DaanHoogland DaanHoogland deleted the 4.20-fix-importvm-shared-network branch October 13, 2025 06:33
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 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.

ImportVm in Basic zone fails

6 participants