Enable wicket to configure the rack subnet#9653
Conversation
jgallagher
left a comment
There was a problem hiding this comment.
Looks reasonable to me - just a couple minor questions.
Have you given this a spin on a racklette? (Can we, before merging?)
| if rack_subnet_address.octets()[6] == 0x00 { | ||
| return Err("rack number (seventh octet) cannot be 0".into()); | ||
| }; | ||
|
|
There was a problem hiding this comment.
Do we want to check that the low 72 bits are all 0? That's guaranteed for our random ones, and converting the subnet address into an Ipv6Net<56> will do that, but it may indicate some confusion if an operator asks for it?
There was a problem hiding this comment.
I think that's a reasonable check to add, as it does make things a bit clearer in terms of what we expect (and what the system will do if you set the lower bits of the address)
wicket/src/ui/panes/rack_setup.rs
Outdated
| rack_network_config.as_ref().map_or("".into(), |c| { | ||
| match c.rack_subnet_address { | ||
| Some(v) => v.to_string(), | ||
| None => "".to_string(), |
There was a problem hiding this comment.
Do we want something like "(will be chosen randomly)" instead of leaving it blank?
There was a problem hiding this comment.
I think this is also a good idea
I'll do that today! |
jgallagher
left a comment
There was a problem hiding this comment.
LGTM, assuming the racklette testing went well
| |c| { | ||
| match c.rack_subnet_address { | ||
| Some(v) => v.to_string(), | ||
| None => "(chosen randomly)".to_string(), |
There was a problem hiding this comment.
Tiny nit - why is this string different from the one a few lines up?
There was a problem hiding this comment.
I figured we wanted it to say "will be chosen randomly" if the user hasn't provided a ipv6 subnet address and we are still uninitialzed, but it should say "chosen randomly` once we are initialized.
This is how it looks when None maps to "will be chosen randomly"

It seems like it could be a little confusing to users if we left it that way.
There was a problem hiding this comment.
Ahh, got it. Yeah that works for me 👍
help rustfmt with long strings :D Co-authored-by: John Gallagher <john@oxidecomputer.com>



To pave the way for a multi-rack world, we are replacing the static
fd00:1122:3344::01prefix with a randomly generated one or a user specified one, that way racks can have unique addresses once they start talking to each other.fd/56Related
#9501