mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 02:53:18 +01:00
another issue with vlan-number vs vlan-uri
This commit is contained in:
parent
75ebc03693
commit
d69a35086f
@ -245,7 +245,15 @@ public class NiciraNvpElement extends AdapterBase implements ConnectivityProvide
|
|||||||
PublicIp sourceNatIp = ipAddrMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
|
PublicIp sourceNatIp = ipAddrMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
|
||||||
String publicCidr = sourceNatIp.getAddress().addr() + "/" + NetUtils.getCidrSize(sourceNatIp.getVlanNetmask());
|
String publicCidr = sourceNatIp.getAddress().addr() + "/" + NetUtils.getCidrSize(sourceNatIp.getVlanNetmask());
|
||||||
String internalCidr = network.getGateway() + "/" + network.getCidr().split("/")[1];
|
String internalCidr = network.getGateway() + "/" + network.getCidr().split("/")[1];
|
||||||
long vlanid = (Vlan.UNTAGGED.equals(sourceNatIp.getVlanTag())) ? 0 : Long.parseLong(sourceNatIp.getVlanTag());
|
// assuming a vlan:
|
||||||
|
String vtag = sourceNatIp.getVlanTag();
|
||||||
|
BroadcastDomainType tiep = BroadcastDomainType.toEnumValue(vtag);
|
||||||
|
if (tiep == BroadcastDomainType.Vlan) {
|
||||||
|
vtag = BroadcastDomainType.Vlan.getValueFrom(BroadcastDomainType.fromString(vtag));
|
||||||
|
} else if (tiep != BroadcastDomainType.UnDecided) {
|
||||||
|
throw new CloudRuntimeException("only vlans are supported for sourceNatIp, at this moment: " + vtag);
|
||||||
|
}
|
||||||
|
long vlanid = (Vlan.UNTAGGED.equals(sourceNatIp.getVlanTag())) ? 0 : Long.parseLong(vtag);
|
||||||
|
|
||||||
CreateLogicalRouterCommand cmd =
|
CreateLogicalRouterCommand cmd =
|
||||||
new CreateLogicalRouterCommand(niciraNvpHost.getDetail("l3gatewayserviceuuid"), vlanid, BroadcastDomainType.getValue(network.getBroadcastUri()),
|
new CreateLogicalRouterCommand(niciraNvpHost.getDetail("l3gatewayserviceuuid"), vlanid, BroadcastDomainType.getValue(network.getBroadcastUri()),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user