NSX: remove unsupported VPN capability from NAT VPC offering - #13765
Open
Dogface2k wants to merge 1 commit into
Open
NSX: remove unsupported VPN capability from NAT VPC offering#13765Dogface2k wants to merge 1 commit into
Dogface2k wants to merge 1 commit into
Conversation
Dogface2k
marked this pull request as ready for review
August 1, 2026 00:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR stops the built-in
VPC offering with NSX - NAT Modeoffering from advertising Site-to-Site VPN through the NSX provider when the provider does not implement that service.The seeded offering currently maps
VpntoNsx, butNsxElementdoes not implementSite2SiteVpnServiceProvider; the only production implementation isVpcVirtualRouterElement.Site2SiteVpnManagerImplthen selects a VPN endpoint through logic hard-coded toVPCVirtualRouter. On an NSX NAT-mode VPC, that legacy lookup sees both the NSX source-NAT IP and the system-VM helper source-NAT IP and fails withCannot found source nat ip of vpc <id>, hiding the unsupported provider mapping.The changes align the advertised capability with the implementation:
Vpn/Nsxmapping;createVpnGatewaynow verifies that the VPC mapsVpntoVPCVirtualRouterbefore any IP lookup and returns a clear unsupported-capability error;This does not change the NSX VPC router public NIC, source-NAT IP allocation, custom VPC offerings,
Vpn/VPCVirtualRoutermappings, or implement NSX-native Site-to-Site VPN.Fixes: #13764
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Not applicable.
How Has This Been Tested?
The failure was reproduced on Apache CloudStack 4.22.1.0 in an NSX 4.2.4-backed VMware environment through the public API. A VPC created from the built-in NSX NAT offering had
Vpn/Nsxin its service snapshot.createVpnGatewayreached the legacy exactly-one source-NAT lookup and failed with:Source and negative-control tests verified the same unsupported seed and pre-fix behavior on 4.22.0.0, 4.22.1.0, and main at
4f117071c9397b1e4714c8fb61c384883c872842. On unmodified main, the new fail-fast regression test fails with the oldCannot found source nat ipexception while the other 45 focused tests pass. With the patch applied to main, all 47 focused tests pass.The actual patched
4.22PR branch was tested with Java 17 and is green:The Maven reactor built all 15 modules required by the schema test run and all 25 modules required by the server test run successfully, with zero Checkstyle violations.
The data migration SQL was also executed against an isolated MariaDB 11.8 schema. It removed the target built-in offering and VPC-snapshot
Vpn/Nsxrows while preserving:Vpn/VPCVirtualRoutermappings;SourceNat/Nsxmappings;Vpn/Nsxmappings on custom offerings;A committed run removed the two target rows, and a second run removed zero rows without error.
How did you try to break this feature and the system with this change?
The regression coverage and database checks exercise the boundaries introduced by this PR:
Vpn/VPCVirtualRouteris rejected before any public-IP lookup or gateway persistence;Vpn;unique_name, ordered to remove VPC snapshots before the offering mapping, and idempotent.No generic exception handling, public-IP filtering workaround, router behavior change, or provider-specific branch was added to the VPN endpoint selector.