-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Draft] server: do not allocate nic on public network for NSX VPC VR #10081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.20
Are you sure you want to change the base?
[Draft] server: do not allocate nic on public network for NSX VPC VR #10081
Conversation
Codecov ReportAttention: 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. |
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about StaticNat
(and maybe others)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@Override | |
public boolean isSrcNatIpRequired(long vpcOfferingId) { | |
final Map<Network.Service, Set<Network.Provider>> vpcOffSvcProvidersMap = getVpcOffSvcProvidersMap(vpcOfferingId); | |
return vpcOffSvcProvidersMap.get(Network.Service.SourceNat).contains(Network.Provider.VPCVirtualRouter); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?