Skip to content

Implement basic multi-switch capability - #3262

Merged
internet-diglett merged 1 commit into
mainfrom
issue-3014
Jul 13, 2023
Merged

internet-diglett merged 1 commit into
mainfrom
issue-3014

Conversation

@internet-diglett

@internet-diglett internet-diglett commented May 30, 2023 •

Copy link
Copy Markdown
Contributor

closes #3014

Done

  • package sp-sim into switch zone for stub and softnpu targets
  • use gateway switch discovery api endpoint to determine which switch dendrite is connected to
  • allow users to specify which switch they want to use for the default uplink
  • detect switch zones using DNS records
  • populate ports for all switches detected
  • RSS: configure nat entries on all switches with uplinks
  • Nexus: configure nat entries on a switch based on whether or not it has external networking configured

Defer

Issues Addressed

Closes #3014
Closes #2760

@internet-diglett internet-diglett changed the title Implement multi-switch capability Implement basic multi-switch capability May 30, 2023
@internet-diglett
internet-diglett marked this pull request as ready for review June 27, 2023 21:04

@rcgoodfellow rcgoodfellow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, Levon. Comments follow.

Comment thread common/src/api/internal/shared.rs Resolved
Comment thread nexus/src/app/mod.rs Resolved
Comment thread nexus/src/app/rack.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
jgallagher added a commit that referenced this pull request Jun 29, 2023
Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"
# uplink_vid =

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)
internet-diglett pushed a commit that referenced this pull request Jun 30, 2023
Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"
# uplink_vid =

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)
Comment thread common/src/api/internal/shared.rs Resolved
Comment thread common/src/nexus_config.rs Resolved
Comment thread nexus/src/app/mod.rs Resolved
Comment thread nexus/src/app/rack.rs Resolved
Comment thread nexus/src/app/rack.rs Resolved
Comment thread nexus/src/app/switch_port.rs Resolved
Comment thread package-manifest.toml Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread smf/sp-sim/config.toml Resolved
internet-diglett pushed a commit that referenced this pull request Jul 6, 2023
Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"
# uplink_vid =

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)
@internet-diglett

Copy link
Copy Markdown
Contributor Author

Absent any CI errors, this PR is ready for final review.

internet-diglett pushed a commit that referenced this pull request Jul 7, 2023
Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml
# ... rest of config

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"
# uplink_vid =

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)

@luqmana luqmana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for tackling this Levon! Left some comments but looks mostly good

Comment thread common/src/api/internal/shared.rs Resolved
Comment thread common/src/nexus_config.rs Resolved
Comment thread nexus/src/app/instance.rs Resolved
Comment thread nexus/src/app/instance.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved
Comment thread sled-agent/src/rack_setup/service.rs Resolved

@luqmana luqmana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

woo, thanks levon! some db index questions aside, mostly looks good to me!

Comment thread common/src/sql/dbinit.sql Resolved
Comment thread common/src/sql/dbinit.sql Outdated
)
);

CREATE INDEX ON switch_port (port_settings_id);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be a UNIQUE INDEX or can multiple switch port share the same port settings? (my guess would be no)

cc @davepacheco who's been looking at these recently.

@internet-diglett internet-diglett Jul 13, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After revisting https://rfd.shared.oxide.computer/rfd/0267, it doesn't seem wrong to let switch_ports share port_settings, especially since we will allow the sharing of port_settings via groups.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Port settings are designed to be shared, so common settings can be applied to multiple ports. Because port settings can themselves include other port settings, this makes it possible to have baseline settings that apply to a large group of ports in combination with more specific settings that apply to only a small number of ports or a single port.

@rcgoodfellow rcgoodfellow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've been able to run this in my multi-switch lab and the basics are working. Several seemingly unrelated issues are preventing me from doing all the testing I wanted to do, but I think think the right call for now is to get this PR merged and get some laps on a real test rack.

@internet-diglett

Copy link
Copy Markdown
Contributor Author

Awesome. I'll open some follow up issues for the remaining comments, then do a final rebase and merge.

internet-diglett added a commit that referenced this pull request Jul 13, 2023
* allow control plane to manage an arbitrary number of
  dendrite clients
* populate ports for multiple switches

Enable multi-switch support for RSS

This commit enables multi-switch support for RSS, allowing users
to specify which switch should be used for the default uplink.
* package `sp-sim` into switch zone for stub and softnpu targets
* use mgs to discover switch slot managed by switch zone
* discover dendrite zone addresses by inspecting DNS config in service
  plan
* enable multiple uplinks to be specified in RSS.
* during RSS, for all switches present in user-provided
  uplink configurations, inject switches addresses as
  targets for NAT configuration when bringing internal
  services online.

Enable multi-switch for Nexus handoff

* Enable automatic discovery of front facing ports
* Populate uplink records based on which switch the user requested
* Select switches for nat entry creation based on existence
  of routes
* Initialize Nexus with multiple Dendrite clients, mapped to
  their respective switch slots

[wicket] Support multiple uplink config entries (#3452)

Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)
@internet-diglett
internet-diglett enabled auto-merge (squash) July 13, 2023 19:25
* allow control plane to manage an arbitrary number of
  dendrite clients
* populate ports for multiple switches

Enable multi-switch support for RSS

This commit enables multi-switch support for RSS, allowing users
to specify which switch should be used for the default uplink.
* package `sp-sim` into switch zone for stub and softnpu targets
* use mgs to discover switch slot managed by switch zone
* discover dendrite zone addresses by inspecting DNS config in service
  plan
* enable multiple uplinks to be specified in RSS.
* during RSS, for all switches present in user-provided
  uplink configurations, inject switches addresses as
  targets for NAT configuration when bringing internal
  services online.

Enable multi-switch for Nexus handoff

* Enable automatic discovery of front facing ports
* Populate uplink records based on which switch the user requested
* Select switches for nat entry creation based on existence
  of routes
* Initialize Nexus with multiple Dendrite clients, mapped to
  their respective switch slots

[wicket] Support multiple uplink config entries (#3452)

Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)
@internet-diglett
internet-diglett merged commit 0524304 into main Jul 13, 2023
@internet-diglett
internet-diglett deleted the issue-3014 branch July 13, 2023 23:35
rcgoodfellow pushed a commit that referenced this pull request Jul 14, 2023
Fleshes out the `wicket` bits for #3262:

1. The empty template returned by `setup get-config` now includes a
sample uplink table:

```toml

[rack_network_config]
infra_ip_first = ""
infra_ip_last = ""

[[rack_network_config.uplinks]]
switch = ""
gateway_ip = ""
uplink_port = ""
uplink_port_speed = ""
uplink_port_fec = ""
uplink_ip = ""
uplink_vid = 1234 # optional - remove if no VLAN id is needed
```

2. The populated template returned by `setup get-config` is filled in
with data:

```toml

[rack_network_config]
infra_ip_first = "172.20.26.1"
infra_ip_last = "172.20.26.5"

[[rack_network_config.uplinks]]
switch = "switch0"
gateway_ip = "1.2.3.4"
uplink_port = "foo"
uplink_port_speed = "speed10_g"
uplink_port_fec = "none"
uplink_ip = "2.3.4.5"

[[rack_network_config.uplinks]]
switch = "switch1"
gateway_ip = "4.5.6.7"
uplink_port = "bar"
uplink_port_speed = "speed40_g"
uplink_port_fec = "none"
uplink_ip = "5.6.7.8"
uplink_vid = 100
```

3. Multiple uplink configs can be displayed in the UI:

![multiple-uplinks](https://github.com/oxidecomputer/omicron/assets/1435635/6fb31ee6-03e0-46ca-a65f-1708d1517d84)
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.

Populate ports for multiple switches Nexus should be referencing both Dendrite instantiations separately

6 participants