NSX: Fix VPC form to ignore source NAT IP when creating VPCs and fix label
diff --git a/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
index 12c64ec..755cf2b 100644
--- a/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1176,7 +1176,12 @@
cmd.getIp6Dns2(), cmd.isDisplay(), cmd.getPublicMtu());
String sourceNatIP = cmd.getSourceNatIP();
- if (sourceNatIP != null || isVpcForNsx(vpc)) {
+ boolean forNsx = isVpcForNsx(vpc);
+ if (sourceNatIP != null || forNsx) {
+ if (forNsx) {
+ logger.info("Provided source NAT IP will be ignored in an NSX-enabled zone");
+ sourceNatIP = null;
+ }
logger.info(String.format("Trying to allocate the specified IP [%s] as the source NAT of VPC [%s].", sourceNatIP, vpc));
allocateSourceNatIp(vpc, sourceNatIP);
}
diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index 6f4ddba..4b3a1be 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -1050,7 +1050,7 @@
"label.internaldns2": "Internal DNS 2",
"label.internallb.description": "Brief description of the internal LB.",
"label.internallb.name.description": "Unique name for internal LB.",
-"label.internallb.sourceip.description": "Brief description of the internal LB.",
+"label.internallb.sourceip.description": "Source IP address the network traffic will be load balanced from",
"label.internallbvm": "InternalLbVm",
"label.internetprotocol": "Internet protocol",
"label.interval": "Polling interval (in sec)",
diff --git a/ui/src/views/network/CreateVpc.vue b/ui/src/views/network/CreateVpc.vue
index 64e5cdd..199eac2 100644
--- a/ui/src/views/network/CreateVpc.vue
+++ b/ui/src/views/network/CreateVpc.vue
@@ -155,7 +155,7 @@
</a-form-item>
</a-col>
</a-row>
- <a-form-item v-if="selectedNetworkOfferingSupportsSourceNat" name="sourcenatipaddress" ref="sourcenatipaddress">
+ <a-form-item v-if="selectedNetworkOfferingSupportsSourceNat && !isNsxNetwork" name="sourcenatipaddress" ref="sourcenatipaddress">
<template #label>
<tooltip-label :title="$t('label.routerip')" :tooltip="apiParams.sourcenatipaddress?.description"/>
</template>
@@ -201,7 +201,8 @@
publicMtuMax: 1500,
minMTU: 68,
errorPublicMtu: '',
- selectedVpcOffering: {}
+ selectedVpcOffering: {},
+ isNsxNetwork: false
}
},
beforeCreate () {
@@ -278,6 +279,7 @@
if (zone.id === value) {
this.setMTU = zone?.allowuserspecifyvrmtu || false
this.publicMtuMax = zone?.routerpublicinterfacemaxmtu || 1500
+ this.isNsxNetwork = zone?.isnsxenabled || false
}
}
this.fetchOfferings()