Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes #11129

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?

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

@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 15.17%. Comparing base (de5188e) to head (51c99bf).
⚠️ Report is 1 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../main/java/com/cloud/network/NetworkModelImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #11242      +/-   ##
============================================
- Coverage     15.18%   15.17%   -0.01%     
- Complexity    11363    11366       +3     
============================================
  Files          5415     5415              
  Lines        476061   476061              
  Branches      58122    58122              
============================================
- Hits          72269    72263       -6     
- Misses       395702   395710       +8     
+ Partials       8090     8088       -2     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.90% <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 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.

@blueorangutan
Copy link

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

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

@blueorangutan
Copy link

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

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

@blueorangutan
Copy link

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

@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-13820)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 53024 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11242-t13820-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

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Contributor

@weizhouapache , the issue is reported on 4.19.2, should we base this on the 4.19 branch?

@weizhouapache weizhouapache reopened this Aug 5, 2025
@weizhouapache weizhouapache marked this pull request as ready for review August 5, 2025 03:15
@weizhouapache weizhouapache changed the base branch from 4.20 to 4.19 August 5, 2025 07:43
@DaanHoogland DaanHoogland added this to the 4.19.4 milestone Aug 5, 2025
@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@rosi-shapeblue rosi-shapeblue self-assigned this Aug 5, 2025
@blueorangutan
Copy link

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

@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

Copy link
Collaborator

@rosi-shapeblue rosi-shapeblue 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 and verified - the fix works correctly.

Test Environment

  • CloudStack Version: 4.19.x with PR code
  • Zone Type: Advanced Zone with shared networks
  • Network Setup: Shared network with security groups owned by ROOT
  • Test Account: Regular user account (not admin)

Test Results

Regression Test - PASSED

Results without networkids parameter (with shared + isolated network):

(localcloud) 🐱 > deploy virtualmachine displayname=pr11242-regression-test domainid=793fb714-7213-11f0-b207-1e00e0000162 securitygroupnames=pr11242-test-sg serviceofferingid=fb167f79-2995-41e6-886d-5a0db529a3af templateid=79465b9c-7213-11f0-b207-1e00e0000162 zoneid=8ee99a5c-7aca-45cc-97d3-a3d1a84c5503 account=pr11242user
{
  "virtualmachine": {
    "account": "pr11242user",
    "affinitygroup": [],
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2025-08-05T17:59:53+0000",
    "details": {
      "cpuOvercommitRatio": "2.0"
    },
    "displayname": "pr11242-regression-test",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "793fb714-7213-11f0-b207-1e00e0000162",
    "domainpath": "/",
    "guestosid": "796544f2-7213-11f0-b207-1e00e0000162",
    "haenable": false,
    "hasannotations": false,
    "hostcontrolstate": "Enabled",
    "hostid": "dc80ec52-96c8-4b0e-870e-189300e55daf",
    "hostname": "ref-trl-9163-k-Mol8-rositsa-kyuchukova-kvm2",
    "hypervisor": "KVM",
    "id": "a4cae218-09ab-43f0-b139-45b7d561c53f",
    "instancename": "i-5-3-VM",
    "ipaddress": "10.1.1.218",
    "isdynamicallyscalable": false,
    "jobid": "b5c49339-808d-467f-bed1-7de663fbdc0f",
    "jobstatus": 0,
    "lastupdated": "2025-08-05T18:00:54+0000",
    "memory": 512,
    "name": "VM-a4cae218-09ab-43f0-b139-45b7d561c53f",
    "nic": [
      {
        "broadcasturi": "vlan://1467",
        "deviceid": "0",
        "extradhcpoption": [],
        "gateway": "10.1.1.1",
        "id": "2b136221-7de5-4691-8e39-25fdb75ea71b",
        "ipaddress": "10.1.1.218",
        "isdefault": true,
        "isolationuri": "vlan://1467",
        "macaddress": "02:01:00:cd:00:01",
        "netmask": "255.255.255.0",
        "networkid": "22240880-8c47-480b-9294-cf7759f84b4f",
        "networkname": "pr11242user-network",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "Isolated"
      }
    ],
    "osdisplayname": "CentOS 5.5 (64-bit)",
    "ostypeid": "796544f2-7213-11f0-b207-1e00e0000162",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "sentbytes": 0,
    "serviceofferingid": "fb167f79-2995-41e6-886d-5a0db529a3af",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
    "templateformat": "QCOW2",
    "templateid": "79465b9c-7213-11f0-b207-1e00e0000162",
    "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
    "templatetype": "BUILTIN",
    "userid": "5eb1d817-c560-484b-afc1-73b846ab0a1d",
    "username": "pr11242user",
    "zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
    "zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
  }
}

Result: VM deployed successfully on user's isolated network

Results without networkids parameter (with shared network only):

(localcloud) 🐱 > deploy virtualmachine displayname=pr11242-regression-test domainid=793fb714-7213-11f0-b207-1e00e0000162 securitygroupnames=pr11242-test-sg serviceofferingid=fb167f79-2995-41e6-886d-5a0db529a3af templateid=79465b9c-7213-11f0-b207-1e00e0000162 zoneid=8ee99a5c-7aca-45cc-97d3-a3d1a84c5503 account=pr11242user
{
  "virtualmachine": {
    "account": "pr11242user",
    "affinitygroup": [],
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2025-08-06T06:14:24+0000",
    "details": {
      "cpuOvercommitRatio": "2.0"
    },
    "displayname": "pr11242-regression-test",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "793fb714-7213-11f0-b207-1e00e0000162",
    "domainpath": "/",
    "guestosid": "796544f2-7213-11f0-b207-1e00e0000162",
    "haenable": false,
    "hasannotations": false,
    "hostcontrolstate": "Enabled",
    "hostid": "d3593fd2-513e-4f63-ae5e-abf744740169",
    "hostname": "ref-trl-9163-k-Mol8-rositsa-kyuchukova-kvm1",
    "hypervisor": "KVM",
    "id": "6ecd7c74-f04c-49e9-b9b7-16c8f7ef7254",
    "instancename": "i-5-9-VM",
    "ipaddress": "10.1.1.61",
    "isdynamicallyscalable": false,
    "jobid": "c160be07-1680-468d-b539-717fcb016498",
    "jobstatus": 0,
    "lastupdated": "2025-08-06T06:14:30+0000",
    "memory": 512,
    "name": "VM-6ecd7c74-f04c-49e9-b9b7-16c8f7ef7254",
    "nic": [
      {
        "broadcasturi": "vlan://1469",
        "deviceid": "0",
        "extradhcpoption": [],
        "gateway": "10.1.1.1",
        "id": "07a5146b-901a-4436-ad48-d412e21a7f01",
        "ipaddress": "10.1.1.61",
        "isdefault": true,
        "isolationuri": "vlan://1469",
        "macaddress": "02:01:00:ce:00:03",
        "netmask": "255.255.255.0",
        "networkid": "c40ea500-75a9-451e-ad8c-69cebcd604e3",
        "networkname": "pr11242user-network",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "Isolated"
      }
    ],
    "osdisplayname": "CentOS 5.5 (64-bit)",
    "ostypeid": "796544f2-7213-11f0-b207-1e00e0000162",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "sentbytes": 0,
    "serviceofferingid": "fb167f79-2995-41e6-886d-5a0db529a3af",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
    "templateformat": "QCOW2",
    "templateid": "79465b9c-7213-11f0-b207-1e00e0000162",
    "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
    "templatetype": "BUILTIN",
    "userid": "5eb1d817-c560-484b-afc1-73b846ab0a1d",
    "username": "pr11242user",
    "zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
    "zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
  }
}

Result: VM deployed successfully on the shared network

Control Test - PASSED
Results with explicit networkids parameter:

(localcloud) 🐱 > deploy virtualmachine displayname=pr11242-control-test domainid=793fb714-7213-11f0-b207-1e00e0000162 networkids=72ee02a2-1b13-49e5-9986-7dc0141dc0a5 serviceofferingid=fb167f79-2995-41e6-886d-5a0db529a3af templateid=79465b9c-7213-11f0-b207-1e00e0000162 zoneid=8ee99a5c-7aca-45cc-97d3-a3d1a84c5503 account=pr11242user
{
  "virtualmachine": {
    "account": "pr11242user",
    "affinitygroup": [],
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2025-08-05T18:00:58+0000",
    "details": {
      "cpuOvercommitRatio": "2.0"
    },
    "displayname": "pr11242-control-test",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "793fb714-7213-11f0-b207-1e00e0000162",
    "domainpath": "/",
    "guestosid": "796544f2-7213-11f0-b207-1e00e0000162",
    "haenable": false,
    "hasannotations": false,
    "hostcontrolstate": "Enabled",
    "hostid": "d3593fd2-513e-4f63-ae5e-abf744740169",
    "hostname": "ref-trl-9163-k-Mol8-rositsa-kyuchukova-kvm1",
    "hypervisor": "KVM",
    "id": "bed8a716-cf95-4d54-8f88-598c6a6edae0",
    "instancename": "i-5-5-VM",
    "ipaddress": "10.0.100.38",
    "isdynamicallyscalable": false,
    "jobid": "6eb4f412-1eea-4220-8ea8-5686630b2897",
    "jobstatus": 0,
    "lastupdated": "2025-08-05T18:01:48+0000",
    "memory": 512,
    "name": "VM-bed8a716-cf95-4d54-8f88-598c6a6edae0",
    "nic": [
      {
        "broadcasturi": "vlan://52",
        "deviceid": "0",
        "extradhcpoption": [],
        "gateway": "10.0.100.1",
        "id": "04f92c86-8c91-4ed6-a3be-9e84f883ddb0",
        "ipaddress": "10.0.100.38",
        "isdefault": true,
        "isolationuri": "vlan://52",
        "macaddress": "1e:00:6a:00:00:45",
        "netmask": "255.255.255.0",
        "networkid": "72ee02a2-1b13-49e5-9986-7dc0141dc0a5",
        "networkname": "pr11242-shared-network",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "Shared"
      }
    ],
    "osdisplayname": "CentOS 5.5 (64-bit)",
    "ostypeid": "796544f2-7213-11f0-b207-1e00e0000162",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [
      {
        "account": "pr11242user",
        "description": "Default Security Group",
        "egressrule": [],
        "id": "085aa356-eee3-48b2-a987-2dce4a8e7c08",
        "ingressrule": [],
        "name": "default",
        "tags": [],
        "virtualmachineids": []
      }
    ],
    "sentbytes": 0,
    "serviceofferingid": "fb167f79-2995-41e6-886d-5a0db529a3af",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
    "templateformat": "QCOW2",
    "templateid": "79465b9c-7213-11f0-b207-1e00e0000162",
    "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
    "templatetype": "BUILTIN",
    "userid": "5eb1d817-c560-484b-afc1-73b846ab0a1d",
    "username": "pr11242user",
    "zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
    "zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
  }
}

Result: VM deployed successfully on ROOT-owned shared network

(localcloud) 🐱 > list networks id=72ee02a2-1b13-49e5-9986-7dc0141dc0a5
{
  "count": 1,
  "network": [
    {
      "acltype": "Domain",
      "broadcastdomaintype": "Vlan",
      "broadcasturi": "vlan://52",
      "canusefordeploy": true,
      "cidr": "10.0.100.0/24",
      "created": "2025-08-05T17:58:26+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Test Shared Network for PR 11242",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "793fb714-7213-11f0-b207-1e00e0000162",
      "domainpath": "/",
      "gateway": "10.0.100.1",
      "hasannotations": false,
      "id": "72ee02a2-1b13-49e5-9986-7dc0141dc0a5",
      "ispersistent": false,
      "issystem": false,
      "name": "pr11242-shared-network",
      "netmask": "255.255.255.0",
      "networkdomain": "cs1cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Offering for Shared Security group enabled networks",
      "networkofferingid": "0bc1a291-b495-44a7-8cd8-5a7c01123f91",
      "networkofferingname": "DefaultSharedNetworkOfferingWithSGService",
      "physicalnetworkid": "866dd47e-a785-478c-bec7-a1666dda7405",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "72ee02a2-1b13-49e5-9986-7dc0141dc0a5",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [],
          "name": "SecurityGroup",
          "provider": [
            {
              "name": "SecurityGroupProvider"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": true,
      "specifyvlan": true,
      "state": "Setup",
      "strechedl2subnet": false,
      "subdomainaccess": true,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Shared",
      "vlan": "52",
      "zoneid": "8ee99a5c-7aca-45cc-97d3-a3d1a84c5503",
      "zonename": "ref-trl-9163-k-Mol8-rositsa-kyuchukova"
    }
  ]
}

IP: 10.0.100.38 on shared network (VLAN 52)
Confirms explicit shared network access still works

image image

Evidence

  • No deployment failures - the original bug (deployment failures) is resolved
  • Both deployment scenarios work - with and without networkids specification
  • User can access both network types - isolated and shared networks appear in user's network list
  • Graceful fallback behavior - system selects appropriate network instead of failing

@weizhouapache
Copy link
Member Author

LGTM - Tested and verified - the fix works correctly.

Evidence

  • No deployment failures - the original bug (deployment failures) is resolved
  • Both deployment scenarios work - with and without networkids specification
  • User can access both network types - isolated and shared networks appear in user's network list
  • Graceful fallback behavior - system selects appropriate network instead of failing

@rosi-shapeblue
Perfect testing !
Thanks a lot

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@weizhouapache
Copy link
Member Author

Merging based on approvals and manual test by @rosi-shapeblue

@weizhouapache weizhouapache merged commit b9864cb into apache:4.19 Aug 6, 2025
25 of 26 checks passed
@DaanHoogland DaanHoogland deleted the 4.19-fix-deployvm-without-networkid branch August 6, 2025 05:38
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Sep 4, 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.

regression caused by #9596 - Shared Networks created by root (accountid=1) in Advanced Zone cannot be found

5 participants