Skip to content

Conversation

@weizhouapache
Copy link
Member

Description

This PR fixes the issue which can be reproduced by steps below

  • add IPv4 subnet in zone (/20)
  • create Routed network offering
  • create a IPv4 subnet (/24)
  • disable global setting routed.ipv4.network.cidr.auto.allocation.enabled
  • create a Routed network from the offering with cidr size 24

without this PR: got an error on UI: Internal error executing command, please contact your system administrator

with this PR: the network is created successfully

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

@weizhouapache weizhouapache added this to the 4.20.2 milestone Sep 12, 2025
@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 Sep 12, 2025

Codecov Report

❌ Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (253ac03) to head (819a4f1).
⚠️ Report is 42 commits behind head on 4.20.

Files with missing lines Patch % Lines
...ache/cloudstack/network/RoutedIpv4ManagerImpl.java 78.26% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11624   +/-   ##
=========================================
  Coverage     16.17%   16.17%           
- Complexity    13297    13299    +2     
=========================================
  Files          5656     5656           
  Lines        498136   498147   +11     
  Branches      60432    60434    +2     
=========================================
+ Hits          80584    80593    +9     
- Misses       408584   408586    +2     
  Partials       8968     8968           
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.03% <78.26%> (+<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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14979

@weizhouapache weizhouapache marked this pull request as ready for review September 12, 2025 12:55
@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-14310)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53405 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11624-t14310-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

@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

@rosi-shapeblue rosi-shapeblue self-assigned this Oct 13, 2025
@rosi-shapeblue
Copy link
Collaborator

@blueorangutan package

@blueorangutan
Copy link

@rosi-shapeblue 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 15441

@rosi-shapeblue
Copy link
Collaborator

@blueorangutan package

@blueorangutan
Copy link

@rosi-shapeblue 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 15444

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. Verification passed.

Verified routed network creation with and without CIDR under different auto-allocation states. Confirmed correct behavior after the fix - manual CIDR works when auto-allocation is disabled, and subnet is auto-assigned when enabled. Tested via API and UI (CIDR not shown in UI but network creation succeeded).

Performed Tests

1. Create IPV4 subnet for zone

(localcloud) 🐱 > createIpv4SubnetForZone zoneid=cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538 subnet=10.10.0.0/20
{
  "zoneipv4subnet": {
    "created": "2025-10-14T09:40:38+0000",
    "id": "0cf41eaf-1139-4194-98bc-3ed54da87a6f",
    "subnet": "10.10.0.0/20",
    "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
    "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
  }
}

2. Create a routed network offering

(localcloud) 🐱 > create networkoffering name="Routed-Test" displaytext="Routed-Test" guestiptype=Isolated supportedservices=Dhcp,Dns,UserData,SourceNat serviceproviderlist[0].service=Dhcp serviceproviderlist[0].provider=VirtualRouter serviceproviderlist[1].service=Dns serviceproviderlist[1].provider=VirtualRouter serviceproviderlist[2].service=UserData serviceproviderlist[2].provider=VirtualRouter serviceproviderlist[3].service=SourceNat serviceproviderlist[3].provider=VirtualRouter traffictype=GUEST availability=Optional iptype=Routed
{
  "networkoffering": {
    "availability": "Optional",
    "conservemode": true,
    "created": "2025-10-14T09:41:52+0000",
    "displaytext": "Routed-Test",
    "egressdefaultpolicy": true,
    "fornsx": false,
    "fortungsten": false,
    "forvpc": false,
    "guestiptype": "Isolated",
    "hasannotations": false,
    "id": "41c8a8db-2074-4648-9b1b-b221211930ab",
    "internetprotocol": "IPv4",
    "isdefault": false,
    "ispersistent": false,
    "name": "Routed-Test",
    "networkrate": 200,
    "service": [
      {
        "name": "Dhcp",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "name": "UserData",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "name": "Dns",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "SupportedSourceNatTypes",
            "value": "peraccount"
          },
          {
            "canchooseservicecapability": false,
            "name": "RedundantRouter",
            "value": "false"
          }
        ],
        "name": "SourceNat",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      }
    ],
    "serviceofferingid": "3abe7dfb-5ead-48f8-be27-b4b06f61200a",
    "specifyasnumber": false,
    "specifyipranges": false,
    "specifyvlan": false,
    "state": "Disabled",
    "supportsinternallb": false,
    "supportspublicaccess": false,
    "supportsstrechedl2subnet": false,
    "traffictype": "Guest"
  }
}

3. Enable the routed network offering

(localcloud) 🐱 > list networkofferings id=41c8a8db-2074-4648-9b1b-b221211930ab filter=state
{
  "count": 1,
  "networkoffering": [
    {
      "state": "Enabled"
    }
  ]
}

4. Add a Guest IPv4 subnet /24

(localcloud) 🐱 > createIpv4SubnetForGuestNetwork zoneid=cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538 subnet=10.10.1.0/24 parentid=0cf41eaf-1139-4194-98bc-3ed54da87a6f
{
  "ipv4subnetforguestnetwork": {
    "created": "2025-10-14T09:44:55+0000",
    "id": "0d30421c-2c4e-4436-a1de-a7e130aa68f6",
    "parentid": "0cf41eaf-1139-4194-98bc-3ed54da87a6f",
    "parentsubnet": "10.10.0.0/20",
    "state": "Free",
    "subnet": "10.10.1.0/24",
    "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
    "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
  }
}
(localcloud) 🐱 >  

5. Disable auto-allocation

(localcloud) 🐱 > update configuration name=routed.ipv4.network.cidr.auto.allocation.enabled value=false
{
  "configuration": {
    "category": "Network",
    "component": "RoutedIpv4Manager",
    "defaultvalue": "true",
    "description": "Indicates whether the auto-allocation of network CIDR for routed network is enabled or not.",
    "displaytext": "Routed ipv4 network cidr auto allocation enabled",
    "group": "Network",
    "isdynamic": true,
    "name": "routed.ipv4.network.cidr.auto.allocation.enabled",
    "subgroup": "Network",
    "type": "Boolean",
    "value": "false"
  }
}

6. Try creating a Routed network with manual CIDR:

(localcloud) 🐱 > create network name="Routed-Network-Manual" displaytext="Routed-Network-Manual" networkofferingid=41c8a8db-2074-4648-9b1b-b221211930ab zoneid=cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538 subnet=10.10.1.0/24
{
  "network": {
    "account": "admin",
    "acltype": "Account",
    "broadcastdomaintype": "Vlan",
    "canusefordeploy": true,
    "cidr": "10.1.1.0/24",
    "created": "2025-10-14T09:46:56+0000",
    "details": {},
    "displaynetwork": true,
    "displaytext": "Routed-Network-Manual",
    "dns1": "10.0.32.1",
    "dns2": "8.8.8.8",
    "domain": "ROOT",
    "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
    "domainpath": "/",
    "egressdefaultpolicy": true,
    "gateway": "10.1.1.1",
    "hasannotations": false,
    "id": "fd737c5d-2a15-48ce-8d20-fd9ca30798e4",
    "ispersistent": false,
    "issystem": false,
    "name": "Routed-Network-Manual",
    "netmask": "255.255.255.0",
    "networkdomain": "cs2cloud.internal",
    "networkofferingavailability": "Optional",
    "networkofferingconservemode": true,
    "networkofferingdisplaytext": "Routed-Test",
    "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
    "networkofferingname": "Routed-Test",
    "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
    "privatemtu": 1500,
    "publicmtu": 1500,
    "receivedbytes": 0,
    "redundantrouter": false,
    "related": "fd737c5d-2a15-48ce-8d20-fd9ca30798e4",
    "restartrequired": false,
    "sentbytes": 0,
    "service": [
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "DhcpAccrossMultipleSubnets",
            "value": "true"
          }
        ],
        "name": "Dhcp",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [],
        "name": "UserData",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "AllowDnsSuffixModification",
            "value": "true"
          }
        ],
        "name": "Dns",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": true,
            "name": "SupportedSourceNatTypes",
            "value": "peraccount"
          },
          {
            "canchooseservicecapability": true,
            "name": "RedundantRouter",
            "value": "false"
          }
        ],
        "name": "SourceNat",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      }
    ],
    "specifyipranges": false,
    "specifyvlan": false,
    "state": "Allocated",
    "strechedl2subnet": false,
    "supportsvmautoscaling": false,
    "tags": [],
    "traffictype": "Guest",
    "type": "Isolated",
    "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
    "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
  }
}

7. Try creating the same, without specifying the CIDR

(localcloud) 🐱 > create network name="Routed-Network-NoCIDR" displaytext="Routed-Network-NoCIDR" networkofferingid=41c8a8db-2074-4648-9b1b-b221211930ab zoneid=cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538
{
  "network": {
    "account": "admin",
    "acltype": "Account",
    "broadcastdomaintype": "Vlan",
    "canusefordeploy": true,
    "cidr": "10.1.1.0/24",
    "created": "2025-10-14T09:47:28+0000",
    "details": {},
    "displaynetwork": true,
    "displaytext": "Routed-Network-NoCIDR",
    "dns1": "10.0.32.1",
    "dns2": "8.8.8.8",
    "domain": "ROOT",
    "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
    "domainpath": "/",
    "egressdefaultpolicy": true,
    "gateway": "10.1.1.1",
    "hasannotations": false,
    "id": "5a71909a-4bb6-447b-8f30-edfb2eeaeb40",
    "ispersistent": false,
    "issystem": false,
    "name": "Routed-Network-NoCIDR",
    "netmask": "255.255.255.0",
    "networkdomain": "cs2cloud.internal",
    "networkofferingavailability": "Optional",
    "networkofferingconservemode": true,
    "networkofferingdisplaytext": "Routed-Test",
    "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
    "networkofferingname": "Routed-Test",
    "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
    "privatemtu": 1500,
    "publicmtu": 1500,
    "receivedbytes": 0,
    "redundantrouter": false,
    "related": "5a71909a-4bb6-447b-8f30-edfb2eeaeb40",
    "restartrequired": false,
    "sentbytes": 0,
    "service": [
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "DhcpAccrossMultipleSubnets",
            "value": "true"
          }
        ],
        "name": "Dhcp",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [],
        "name": "UserData",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "AllowDnsSuffixModification",
            "value": "true"
          }
        ],
        "name": "Dns",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": true,
            "name": "SupportedSourceNatTypes",
            "value": "peraccount"
          },
          {
            "canchooseservicecapability": true,
            "name": "RedundantRouter",
            "value": "false"
          }
        ],
        "name": "SourceNat",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      }
    ],
    "specifyipranges": false,
    "specifyvlan": false,
    "state": "Allocated",
    "strechedl2subnet": false,
    "supportsvmautoscaling": false,
    "tags": [],
    "traffictype": "Guest",
    "type": "Isolated",
    "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
    "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
  }
}

8. Re-enable auto-allocation

(localcloud) 🐱 > update configuration name=routed.ipv4.network.cidr.auto.allocation.enabled value=true { "configuration": { "category": "Network", "component": "RoutedIpv4Manager", "defaultvalue": "true", "description": "Indicates whether the auto-allocation of network CIDR for routed network is enabled or not.", "displaytext": "Routed ipv4 network cidr auto allocation enabled", "group": "Network", "isdynamic": true, "name": "routed.ipv4.network.cidr.auto.allocation.enabled", "subgroup": "Network", "type": "Boolean", "value": "true" } } ```

9. Create a new Routed network without specifying subnet

(localcloud) 🐱 > create network name="Routed-Network-Auto" displaytext="Routed-Network-Auto" networkofferingid=41c8a8db-2074-4648-9b1b-b221211930ab zoneid=cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538
{
  "network": {
    "account": "admin",
    "acltype": "Account",
    "broadcastdomaintype": "Vlan",
    "canusefordeploy": true,
    "cidr": "10.1.1.0/24",
    "created": "2025-10-14T10:47:00+0000",
    "details": {},
    "displaynetwork": true,
    "displaytext": "Routed-Network-Auto",
    "dns1": "10.0.32.1",
    "dns2": "8.8.8.8",
    "domain": "ROOT",
    "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
    "domainpath": "/",
    "egressdefaultpolicy": true,
    "gateway": "10.1.1.1",
    "hasannotations": false,
    "id": "3d1e6c9d-11e6-4ca2-8421-25d00b323e25",
    "ispersistent": false,
    "issystem": false,
    "name": "Routed-Network-Auto",
    "netmask": "255.255.255.0",
    "networkdomain": "cs2cloud.internal",
    "networkofferingavailability": "Optional",
    "networkofferingconservemode": true,
    "networkofferingdisplaytext": "Routed-Test",
    "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
    "networkofferingname": "Routed-Test",
    "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
    "privatemtu": 1500,
    "publicmtu": 1500,
    "receivedbytes": 0,
    "redundantrouter": false,
    "related": "3d1e6c9d-11e6-4ca2-8421-25d00b323e25",
    "restartrequired": false,
    "sentbytes": 0,
    "service": [
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "DhcpAccrossMultipleSubnets",
            "value": "true"
          }
        ],
        "name": "Dhcp",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [],
        "name": "UserData",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": false,
            "name": "AllowDnsSuffixModification",
            "value": "true"
          }
        ],
        "name": "Dns",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      },
      {
        "capability": [
          {
            "canchooseservicecapability": true,
            "name": "SupportedSourceNatTypes",
            "value": "peraccount"
          },
          {
            "canchooseservicecapability": true,
            "name": "RedundantRouter",
            "value": "false"
          }
        ],
        "name": "SourceNat",
        "provider": [
          {
            "name": "VirtualRouter"
          }
        ]
      }
    ],
    "specifyipranges": false,
    "specifyvlan": false,
    "state": "Allocated",
    "strechedl2subnet": false,
    "supportsvmautoscaling": false,
    "tags": [],
    "traffictype": "Guest",
    "type": "Isolated",
    "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
    "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
  }
}

10. Verify the allocated subnets

(localcloud) 🐱 > list networks name="Routed-Network-Auto"
{
  "count": 4,
  "network": [
    {
      "account": "admin",
      "acltype": "Account",
      "broadcastdomaintype": "Vlan",
      "canusefordeploy": true,
      "cidr": "10.1.1.0/24",
      "created": "2025-10-14T10:47:00+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Routed-Network-Auto",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
      "domainpath": "/",
      "egressdefaultpolicy": true,
      "gateway": "10.1.1.1",
      "hasannotations": false,
      "id": "3d1e6c9d-11e6-4ca2-8421-25d00b323e25",
      "ispersistent": false,
      "issystem": false,
      "name": "Routed-Network-Auto",
      "netmask": "255.255.255.0",
      "networkdomain": "cs2cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Routed-Test",
      "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
      "networkofferingname": "Routed-Test",
      "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "3d1e6c9d-11e6-4ca2-8421-25d00b323e25",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": true,
              "name": "SupportedSourceNatTypes",
              "value": "peraccount"
            },
            {
              "canchooseservicecapability": true,
              "name": "RedundantRouter",
              "value": "false"
            }
          ],
          "name": "SourceNat",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": false,
      "specifyvlan": false,
      "state": "Allocated",
      "strechedl2subnet": false,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Isolated",
      "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
      "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
    },
    {
      "account": "admin",
      "acltype": "Account",
      "broadcastdomaintype": "Vlan",
      "canusefordeploy": true,
      "cidr": "10.10.1.0/24",
      "created": "2025-10-14T10:01:25+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "test PR - added via UI",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
      "domainpath": "/",
      "egressdefaultpolicy": true,
      "gateway": "10.10.1.1",
      "hasannotations": false,
      "id": "3ff80687-c836-4c0a-963e-acb91ff6009a",
      "ispersistent": false,
      "issystem": false,
      "name": "Routed-Network-NoCIDR-UI",
      "netmask": "255.255.255.0",
      "networkdomain": "cs2cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Routed-Test",
      "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
      "networkofferingname": "Routed-Test",
      "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "3ff80687-c836-4c0a-963e-acb91ff6009a",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": true,
              "name": "SupportedSourceNatTypes",
              "value": "peraccount"
            },
            {
              "canchooseservicecapability": true,
              "name": "RedundantRouter",
              "value": "false"
            }
          ],
          "name": "SourceNat",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": false,
      "specifyvlan": false,
      "state": "Allocated",
      "strechedl2subnet": false,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Isolated",
      "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
      "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
    },
    {
      "account": "admin",
      "acltype": "Account",
      "broadcastdomaintype": "Vlan",
      "canusefordeploy": true,
      "cidr": "10.1.1.0/24",
      "created": "2025-10-14T09:47:28+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Routed-Network-NoCIDR",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
      "domainpath": "/",
      "egressdefaultpolicy": true,
      "gateway": "10.1.1.1",
      "hasannotations": false,
      "id": "5a71909a-4bb6-447b-8f30-edfb2eeaeb40",
      "ispersistent": false,
      "issystem": false,
      "name": "Routed-Network-NoCIDR",
      "netmask": "255.255.255.0",
      "networkdomain": "cs2cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Routed-Test",
      "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
      "networkofferingname": "Routed-Test",
      "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "5a71909a-4bb6-447b-8f30-edfb2eeaeb40",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": true,
              "name": "SupportedSourceNatTypes",
              "value": "peraccount"
            },
            {
              "canchooseservicecapability": true,
              "name": "RedundantRouter",
              "value": "false"
            }
          ],
          "name": "SourceNat",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": false,
      "specifyvlan": false,
      "state": "Allocated",
      "strechedl2subnet": false,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Isolated",
      "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
      "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
    },
    {
      "account": "admin",
      "acltype": "Account",
      "broadcastdomaintype": "Vlan",
      "canusefordeploy": true,
      "cidr": "10.1.1.0/24",
      "created": "2025-10-14T09:46:56+0000",
      "details": {},
      "displaynetwork": true,
      "displaytext": "Routed-Network-Manual",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "39ccd0af-a8ba-11f0-86a0-1e00f00003ce",
      "domainpath": "/",
      "egressdefaultpolicy": true,
      "gateway": "10.1.1.1",
      "hasannotations": false,
      "id": "fd737c5d-2a15-48ce-8d20-fd9ca30798e4",
      "ispersistent": false,
      "issystem": false,
      "name": "Routed-Network-Manual",
      "netmask": "255.255.255.0",
      "networkdomain": "cs2cloud.internal",
      "networkofferingavailability": "Optional",
      "networkofferingconservemode": true,
      "networkofferingdisplaytext": "Routed-Test",
      "networkofferingid": "41c8a8db-2074-4648-9b1b-b221211930ab",
      "networkofferingname": "Routed-Test",
      "physicalnetworkid": "9e41d356-ee2d-402b-afcb-a5742a2894e3",
      "privatemtu": 1500,
      "publicmtu": 1500,
      "receivedbytes": 0,
      "redundantrouter": false,
      "related": "fd737c5d-2a15-48ce-8d20-fd9ca30798e4",
      "restartrequired": false,
      "sentbytes": 0,
      "service": [
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "DhcpAccrossMultipleSubnets",
              "value": "true"
            }
          ],
          "name": "Dhcp",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [],
          "name": "UserData",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": false,
              "name": "AllowDnsSuffixModification",
              "value": "true"
            }
          ],
          "name": "Dns",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        },
        {
          "capability": [
            {
              "canchooseservicecapability": true,
              "name": "SupportedSourceNatTypes",
              "value": "peraccount"
            },
            {
              "canchooseservicecapability": true,
              "name": "RedundantRouter",
              "value": "false"
            }
          ],
          "name": "SourceNat",
          "provider": [
            {
              "name": "VirtualRouter"
            }
          ]
        }
      ],
      "specifyipranges": false,
      "specifyvlan": false,
      "state": "Allocated",
      "strechedl2subnet": false,
      "supportsvmautoscaling": false,
      "tags": [],
      "traffictype": "Guest",
      "type": "Isolated",
      "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
      "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
    }
  ]
}

11. Verify the network associated with the new guest IPv4 subnet was automatically picked up

(localcloud) 🐱 > listIpv4SubnetsForGuestNetwork
{
  "count": 1,
  "ipv4subnetforguestnetwork": [
    {
      "created": "2025-10-14T09:44:55+0000",
      "id": "0d30421c-2c4e-4436-a1de-a7e130aa68f6",
      "parentid": "0cf41eaf-1139-4194-98bc-3ed54da87a6f",
      "parentsubnet": "10.10.0.0/20",
      "state": "Free",
      "subnet": "10.10.1.0/24",
      "zoneid": "cc565e94-b5cf-4c4a-8d22-6aeaf5cbe538",
      "zonename": "ref-trl-9680-k-Mol8-rositsa-kyuchukova"
    }
  ]
}
image

@weizhouapache
Copy link
Member Author

great, thanks @rosi-shapeblue a lot for the testing

thanks @DaanHoogland @sureshanaparti for reviews
merging based on approvals and testing results.

@weizhouapache weizhouapache merged commit 4327871 into apache:4.20 Oct 14, 2025
25 checks passed
@DaanHoogland DaanHoogland deleted the 4.20-fix-routed-auto-allocation-disabled branch October 14, 2025 11:11
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
…apache#11624)

* Routed: fix create network exception when auto-allocation is disabled for regular users

* routed: throw InvalidParameterValueException instead of CloudRuntimeException which gives vague message to regular users
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.

5 participants