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

[nexus] SNAT IP comes from same pool as ephemeral IP #5678

Closed
wants to merge 2 commits into from

Conversation

david-crespo
Copy link
Contributor

@david-crespo david-crespo commented May 1, 2024

Closes #5043

Like I said here, this is arguably a little strange when you think about it: why should the IP pool for the ephemeral IP also govern where the SNAT IP comes from? I'll definitely wait for confirmation from a networking knower that this is actually the desired behavior.

Base automatically changed from fip-attach-refactor to main May 1, 2024 03:24
@david-crespo david-crespo force-pushed the snat-ip-respects-pool branch from 80cbac6 to acf5759 Compare May 1, 2024 03:26
@@ -1075,7 +1066,7 @@ mod tests {
&context.opctx,
id,
instance_id,
context.default_pool_id().await,
None,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these work as expected when given None to make it keep choosing the default pool, but there should probably now be a test for a non-None value.

assert_eq!(
error.message,
"not found: ip-pool with name \"nonexistent-pool\""
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to complain about the default pool despite another pool being specified because the SNAT IP came from the default pool, and that failed before any ephemeral IP stuff came up.

// ephemeral IP comes from specified pool
assert_ip_pool_utilization(client, "pool2", 1, 5, 0, 0).await;
// ephemeral IP and SNAT IP come from specified pool, so +2
assert_ip_pool_utilization(client, "pool2", 2, 5, 0, 0).await;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what is supposed to happen, so that's good.

@david-crespo david-crespo changed the title [nexus] SNAT IP respects specified pool [nexus] SNAT IP comes from same pool as ephemeral IP May 1, 2024
@david-crespo
Copy link
Contributor Author

Based on the discussion in #5043 (comment), closing this because I think the right direction will be to instead

  • Not allocate a SNAT IP at create time if there is an ephemeral or floating IP
  • Allocate a SNAT IP from the default pool when the user detaches all ephemeral and floating IPs
  • Remove SNAT IP when an ephemeral IP or floating IP is added

@david-crespo david-crespo deleted the snat-ip-respects-pool branch May 3, 2024 15:05
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.

SNAT IP should come from chosen pool instead of default pool
1 participant