VPC private gateway cannot be created on a VXLAN-isolated physical network
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 78/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- java
- Domaine
- backend, cloud, networking
Piste de recherche
Commencez par NetworkServiceImpl.createPrivateNetwork() et l’allowlist des schémas d’URI de broadcast, puis examinez PrivateNetworkGuru.design() ainsi que la correction existante de VxlanGuestNetworkGuru.design(). Exécutez ou étendez CreatePrivateNetworkTest pour une URI vxlan://. C’est terminé lorsque les passerelles privées acceptent les URI VXLAN, que le type de domaine de broadcast persisté correspond au schéma d’URI et que le comportement existant de vlan:// reste inchangé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
problem
Creating a VPC private gateway with a vxlan:// broadcast URI fails:
unsupported type of broadcastUri specified: vxlan://1005002
createPrivateGateway documents its vlan parameter as "the network implementation uri for the
private gateway", and a VXLAN-isolated physical network hands out VNIs rather than 802.1Q tags,
so vxlan:// is the correct value to pass.
It is rejected by an allowlist in NetworkServiceImpl.createPrivateNetwork() that admits only two
schemes:
URI uri = BroadcastDomainType.fromString(broadcastUriString);
uriString = uri.toString();
BroadcastDomainType tiep = BroadcastDomainType.getSchemeValue(uri);
// numeric vlan or vlan URI are ok for now
// TODO make a test for any supported scheme
if (!(tiep == BroadcastDomainType.Vlan || tiep == BroadcastDomainType.Lswitch)) {
throw new InvalidParameterValueException("unsupported type of broadcastUri specified: " + broadcastUriString);
}
The "TODO make a test for any supported scheme" comment directly above suggests the list was
always meant to be provisional.
The rest of the path already copes with VXLAN, so this is the only functional blocker:
- encodeVlanIdIntoBroadcastUri() preserves an explicit vxlan:// prefix unchanged.
- The VNI overlap checks use BroadcastDomainType.getValue(), which is scheme-agnostic.
- NicProfileHelperImpl.createPrivateNicProfileForGateway() already passes the whole URI and
derives the broadcast type from its scheme. - BridgeVifDriver derives the protocol from the URI scheme rather than the broadcast type, so it
already selects modifyvxlan.sh and the brvx- bridge. - No systemvm/VR script references vlan at all - the private gateway interface is keyed on
MAC/device and the is_private_gateway flag, and the broadcast URI is never sent to the VR. - No schema change is needed: networks.broadcast_uri, nics.broadcast_uri and
vpc_gateways.vlan_tag (which despite its name already stores the full URI) are all
varchar(255), and vxlan://16777214 is 18 characters.
There is one related data-consistency problem that should be fixed in the same change.
NetworkOrchestrator.createGuestNetwork() encodes the URI correctly and then unconditionally sets
the type:
userNetwork.setBroadcastUri(uri);
if (!vlanIdFinal.equalsIgnoreCase(Vlan.UNTAGGED)) {
userNetwork.setBroadcastDomainType(BroadcastDomainType.Vlan);
Guest networks are corrected afterwards by VxlanGuestNetworkGuru.design(), but that guru excludes
system-only offerings (&& !offering.isSystemOnly()) so it never sees a private gateway, and
PrivateNetworkGuru has no equivalent override. The network would therefore be persisted with
broadcast_uri = 'vxlan://' and broadcast_domain_type = 'Vlan'. The gateway still works,
because nothing on the KVM bridge path reads that column, but the row is inconsistent and would
mislead any future code that trusts it.
versions
CloudStack: originally hit on 4.20.1.0.
The guard is byte-identical on 4.20.1.0, 4.20.2.0, 4.20.3.1, 4.21.0.0, 4.22.0.0, 4.22.1.1 and
current main (verified at b0601e5478 and 4bfeb96c96), so all supported releases are affected.
Not a regression.
Hypervisor: KVM with the Linux bridge VIF driver (network.bridge.type=native).
Network: Advanced zone, physical network with VXLAN isolation method.
The steps to reproduce the bug
-
In an Advanced zone, configure a physical network with isolation method VXLAN and a guest VNI
range (e.g. 1000000-1010000). -
Create a VPC.
-
As root admin, add a private gateway with a VXLAN broadcast URI, choosing a VNI outside the
guest VNI range:create privategateway vpcid= physicalnetworkid=
vlan=vxlan://1005002
ipaddress=10.10.10.2 gateway=10.10.10.1 netmask=255.255.255.0
Expected: the private gateway is created on VNI 1005002 and the VR NIC is attached to the
corresponding VXLAN bridge (brvx-1005002).
Actual: the API fails immediately with
unsupported type of broadcastUri specified: vxlan://1005002
Note that passing a bare number (vlan=1005002) is not a workaround: NetworkServiceImpl wraps any
value that does not already contain "://" as vlan://, so it is silently accepted as an
802.1Q tag of 1005002 rather than a VNI.
What to do about it?
Two changes, both in the server module.
-
NetworkServiceImpl.createPrivateNetwork() - accept BroadcastDomainType.Vxlan alongside Vlan
and Lswitch. This is the functional fix.- if (!(tiep == BroadcastDomainType.Vlan || tiep == BroadcastDomainType.Lswitch)) { + if (!(tiep == BroadcastDomainType.Vlan || tiep == BroadcastDomainType.Vxlan || tiep == BroadcastDomainType.Lswitch)) { -
PrivateNetworkGuru.design() - derive the broadcast domain type from the URI scheme so the
persisted row is self-consistent, the same correction VxlanGuestNetworkGuru.design() already
makes for guest networks. No-op for vlan://.if (userSpecified.getBroadcastUri() != null) { network.setBroadcastUri(userSpecified.getBroadcastUri()); + network.setBroadcastDomainType(BroadcastDomainType.getSchemeValue(userSpecified.getBroadcastUri())); network.setState(State.Setup); }
Plus unit test coverage in CreatePrivateNetworkTest for a vxlan:// URI.
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.4k
- Merge moyen
- 6 j 20 h
- PR mergées (30 j)
- 27
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/cloudstack
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Ouvertebug component:kubernetes
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
apache/cloudstack#14070 · 5 commentaires ·
-
component:backup
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Ouvertebug component:ceph
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/cloudstack#13989 · 3 commentaires ·
Toutes les issues de apache/cloudstack
Issues similaires
-
certification
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Ouvertebug ecr
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Needs: Triage Type: Feature request
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
github/copilot-sdk#2760 ·