Skip to content

vpc: keep a public IP that other networks still use when its network goes - #20

Open
calvix wants to merge 2 commits into
integration/all-fixes-4.23.0.0from
fix/vpc-network-delete-keeps-shared-ip-4.23
Open

calvix wants to merge 2 commits into
integration/all-fixes-4.23.0.0from
fix/vpc-network-delete-keeps-shared-ip-4.23

Conversation

@calvix

@calvix calvix commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

In a VPC, one public IP can carry rules of several networks (for example a port forward for one network and a load balancer for another), but the IP is associated with only one of them. Shutting down that network (on delete, garbage collection, restart with cleanup or an offering change) marked the IP as Releasing and removed it from the router, which broke the rules of the other networks that still used it.

Before releasing a network's IPs, NetworkOrchestrator now re-binds every VPC IP that still has a rule of another network to that network, in both shutdownNetworkResources and cleanupNetworkResources, so the IP stays on the router and the remaining rules keep working. An implemented network is preferred, since a router only plugs the IPs of the networks it serves when it starts, then one whose rule is active rather than still being added; removed networks are never chosen. IPs used only by the network going away are released as before. Unit tests cover the choice of network and that the IPs to release are listed only after the re-bind.

…goes

With conserve mode on a VPC offering, one public IP can carry port
forwarding and load balancing rules of several networks of the VPC, but it
stays bound to the network of its first rule. Shutting down or deleting that
network marked the IP Releasing and released it on the router, so the other
networks' rules on the IP stopped working at once (load balancing) or at the
router's next rebuild (port forwarding), and new rules on the IP failed.

Before releasing a VPC network's IPs, an IP that has a rule of another
network which is not being revoked is now bound to that network and kept,
both on network shutdown and on network delete.
When a network goes, a VPC IP that other networks' rules use was bound to the
first such network found. A router only plugs the IPs of the networks it
serves when it starts, so an IP bound to a network that is not implemented
was left off the router after a rebuild, and the rules of the networks that
were implemented stopped working. An implemented network is now preferred,
then one whose rule is active rather than still being added, and a removed
network is never chosen.

The IPs to release are listed in one place, after the re-bind, for both the
shutdown and the cleanup of a network. A network is shut down not only when
it is deleted, but also when it is garbage collected, restarted with cleanup
or changes offering; the IP then stays with the network it was bound to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant