Repository navigation
VR implementation on Shared network with multiple Guest IP ranges fails #13616
Description
Activity
this may be related to #11249
cc @sureshanapartiI traced this through the current 4.22 code and can confirm the exact failure mechanism. This is a regression caused by the interaction with #11249.
#11249 changed
networks.cidrfor shared networks from a single CIDR into a comma-separated list when multiple Guest IP ranges exist. It also introducedcom.cloud.utils.StringUtils#getFirstValueFromCommaSeparatedString()and used that for backward-compatible API responses, but the internal singular CIDR helper was not updated.The failing path is:
VirtualNetworkApplianceManagerImpl#createGuestBootLoadArgs() -> NetworkModelImpl#getValidNetworkCidr() -> NetUtils#getCidrNetmask()getValidNetworkCidr()currently returnsguestNetwork.getCidr()unchanged whenevernetwork_cidris null.For:
172.30.10.0/24,172.30.11.0/24NetUtils#getCidrNetmask()performscidr.split("/"), producing:[172.30.10.0, 24,172.30.11.0, 24]It then calls:
Long.parseLong("24,172.30.11.0")
which reproduces the exact
NumberFormatExceptionreported here.The correct repair point is
NetworkModelImpl#getValidNetworkCidr(), because all of its production callers expect one CIDR and immediately pass it to single-CIDR netmask/DHCP calculations.NetUtilsitself should remain a strict single-CIDR parser.Suggested implementation:
@Override public String getValidNetworkCidr(Network guestNetwork) { String networkCidr = guestNetwork.getNetworkCidr(); String validNetworkCidr = networkCidr == null ? guestNetwork.getCidr() : networkCidr; return com.cloud.utils.StringUtils.getFirstValueFromCommaSeparatedString(validNetworkCidr); }
This preserves
network_cidrprecedence, leaves null/empty/single-CIDR behaviour unchanged, and applies the same first-value compatibility already established by #11249.Regression coverage should verify:
network_cidrstill takes precedence;- a single fallback
cidris unchanged; - a comma-separated fallback
cidrreturns its first CIDR; - both reported runtime flows succeed:
- initial VR deployment after adding a second Guest IP range;
- network restart with cleanup after adding a second Guest IP range.
- linked a pull request that will close this issueFix VR start on shared network with multiple guest IP ranges #14282
on Oct 1, 2026
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsready for Review
problem
It was observed when creating a Shared network with multiple Guest IP ranges, the VR deployment fails but a parsing error:
In my environment, the conflicting value is coming from the network cidr value as a comma-separated value from both ranges:
versions
4.22.0, 4.22.1
The steps to reproduce the bug
Scenario 1:
Scenario 1:
What to do about it?
No response