[Draft] server: do not allocate nic on public network for NSX VPC VR#10081
[Draft] server: do not allocate nic on public network for NSX VPC VR#10081weizhouapache wants to merge 1 commit intoapache:4.20from
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10081 +/- ##
============================================
- Coverage 16.03% 16.03% -0.01%
Complexity 12814 12814
============================================
Files 5637 5637
Lines 493506 493513 +7
Branches 59831 59835 +4
============================================
+ Hits 79129 79130 +1
- Misses 405601 405607 +6
Partials 8776 8776
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @Override | ||
| public boolean isSrcNatIpRequiredForVpcVr(long vpcOfferingId) { | ||
| final Map<Network.Service, Set<Network.Provider>> vpcOffSvcProvidersMap = getVpcOffSvcProvidersMap(vpcOfferingId); | ||
| return (Objects.nonNull(vpcOffSvcProvidersMap.get(Network.Service.SourceNat)) | ||
| && vpcOffSvcProvidersMap.get(Network.Service.SourceNat).contains(Network.Provider.VPCVirtualRouter)) | ||
| || (Objects.nonNull(vpcOffSvcProvidersMap.get(Network.Service.Gateway)) | ||
| && vpcOffSvcProvidersMap.get(Service.Gateway).contains(Network.Provider.VPCVirtualRouter)); | ||
| } |
There was a problem hiding this comment.
how about StaticNat (and maybe others)?
There was a problem hiding this comment.
good question
To be honest, I never tested the case that SourceNat and StaticNat are provided by different providers (e.g. Nsx for Source NAT and VPCVirtualRouter for Static NAT). I do not think it will work.
this PR is aligned with the 4.19 code
cloudstack/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
Lines 3115 to 3119 in f9b1767
There was a problem hiding this comment.
ok, might work. As you create a method isSrcNatIpRequiredForVpcVr the contents seems appropriate, but its use is more like needsPublicInterface does it? and in that case we would also want to test if the VR needs to provide StaticNat. I think a Gateway could be on a static ip as well, in theory at least.
maybe rename the method?
There was a problem hiding this comment.
for isolated networks (NATTED mode by default), it uses VR as SourceNat
for Routed networks, it uses VR as Gateway
in both cases, the VR needs a public IP (as Source NAT or Gateway)
For Static NAT, I think we do not need to add a public interface to the VR when VR is created.
when Static NAT is enabled, it may add a public interface if needed
|
as discussed offline, we need to evaluate the impact of the changes and test heavily. |
Description
The VPC VR for NSX has a public interface/IP allocated, which is not needed as the VPC VR only provides Dhcp/Dns/UserData services.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?