Skip to content
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

Only allocate SNAT IP when there is no ephemeral or floating IP #4317

Open
bnaecker opened this issue Oct 23, 2023 · 6 comments
Open

Only allocate SNAT IP when there is no ephemeral or floating IP #4317

bnaecker opened this issue Oct 23, 2023 · 6 comments
Assignees
Labels
networking Related to the networking.
Milestone

Comments

@bnaecker
Copy link
Collaborator

In the instance-creation saga, we unconditionally allocate an SNAT IP for every instance. This is regardless of whether the request explicitly asked for ephemeral addresses. In that case, OPTE always uses the ephemeral address anyway, and no network traffic will ever flow through the SNAT IP. We ought to make such allocation optional, and only provide one if no ephemeral addresses were requested.

@bnaecker bnaecker added the networking Related to the networking. label Oct 23, 2023
@bnaecker
Copy link
Collaborator Author

Related to #2715. We should ideally also move the SNAT address allocation and release to the instance start saga and (maybe a new?) stop saga.

@david-crespo
Copy link
Contributor

david-crespo commented May 2, 2024

Wonder if the fact that you can now detach and attach ephemeral IPs changes things here. If you start with an ephemeral IP and no SNAT IP, then you detach the ephemeral IP, you have nothing.

@david-crespo david-crespo changed the title SNAT address creation could be optional Only allocate SNAT IP when there is no ephemeral or floating IP May 3, 2024
@david-crespo david-crespo added this to the 9 milestone May 3, 2024
@david-crespo
Copy link
Contributor

david-crespo commented May 3, 2024

Based on the discussion in #5043, we should:

  • At instance create, only allocate a SNAT IP (from default pool) if there is no ephemeral or floating IP
  • When the user has detached all ephemeral and floating IPs, allocate a SNAT IP (from default pool)
  • When an ephemeral or floating IP is attached, remove SNAT IP if there is one

None of that sounds too hard. One wrinkle is that we'd be introducing a new way that detaching a floating or ephemeral IP can fail, because if there is no default pool or the default pool is full, then allocating the SNAT IP at detach time will fail and we probably shouldn't allow that. Fortunately the lack of a default pool means it's very hard to do anything, so we should consider that just a Bad Configuration among many possible bad configurations operators must endeavor to avoid. Default pool being full is also generally a bad situation — you can't create new instances either — so it's not that weird if a few other operations are hamstrung by that.

@david-crespo
Copy link
Contributor

We're not getting this into v9.

@david-crespo david-crespo modified the milestones: 9, 10 Jun 27, 2024
@morlandi7 morlandi7 modified the milestones: 10, 11 Aug 14, 2024
@askfongjojo
Copy link

Would this still be required given the internet gateway feature? (#2154)

@rcgoodfellow
Copy link
Contributor

Would this still be required given the internet gateway feature? (#2154)

Yes, I think the steps that @david-crespo outlined above should be taken independently of the internet gateway feature.

@david-crespo david-crespo modified the milestones: 11, Unscheduled Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking Related to the networking.
Projects
None yet
Development

No branches or pull requests

5 participants