@@ -254,6 +254,12 @@ impl super::Nexus {
254
254
255
255
let rack_network_config = & request. rack_network_config ;
256
256
257
+ // The `rack` row is created with the rack ID we know when Nexus starts,
258
+ // but we didn't know the rack subnet until now. Set it.
259
+ let mut rack = self . rack_lookup ( opctx, & self . rack_id ) . await ?;
260
+ rack. rack_subnet = Some ( rack_network_config. rack_subnet . into ( ) ) ;
261
+ self . datastore ( ) . update_rack_subnet ( opctx, & rack) . await ?;
262
+
257
263
// TODO - https://github.com/oxidecomputer/omicron/pull/3359
258
264
// register all switches found during rack initialization
259
265
// identify requested switch from config and associate
@@ -612,8 +618,6 @@ impl super::Nexus {
612
618
} // TODO - https://github.com/oxidecomputer/omicron/issues/3277
613
619
// record port speed
614
620
615
- self . initial_bootstore_sync ( & opctx) . await ?;
616
-
617
621
self . db_datastore
618
622
. rack_set_initialized (
619
623
opctx,
@@ -689,31 +693,6 @@ impl super::Nexus {
689
693
}
690
694
}
691
695
692
- pub ( crate ) async fn initial_bootstore_sync (
693
- & self ,
694
- opctx : & OpContext ,
695
- ) -> Result < ( ) , Error > {
696
- let mut rack = self . rack_lookup ( opctx, & self . rack_id ) . await ?;
697
- if rack. rack_subnet . is_some ( ) {
698
- return Ok ( ( ) ) ;
699
- }
700
- let sa = self . get_any_sled_agent_client ( opctx) . await ?;
701
- let result = sa
702
- . read_network_bootstore_config_cache ( )
703
- . await
704
- . map_err ( |e| Error :: InternalError {
705
- internal_message : format ! ( "read bootstore network config: {e}" ) ,
706
- } ) ?
707
- . into_inner ( ) ;
708
-
709
- rack. rack_subnet =
710
- result. body . rack_network_config . map ( |x| x. rack_subnet . into ( ) ) ;
711
-
712
- self . datastore ( ) . update_rack_subnet ( opctx, & rack) . await ?;
713
-
714
- Ok ( ( ) )
715
- }
716
-
717
696
/// Return the list of sleds that are inserted into an initialized rack
718
697
/// but not yet initialized as part of a rack.
719
698
//
@@ -885,14 +864,6 @@ impl super::Nexus {
885
864
. address ( ) ;
886
865
Ok ( format ! ( "http://{}" , addr) )
887
866
}
888
-
889
- async fn get_any_sled_agent_client (
890
- & self ,
891
- opctx : & OpContext ,
892
- ) -> Result < sled_agent_client:: Client , Error > {
893
- let url = self . get_any_sled_agent_url ( opctx) . await ?;
894
- Ok ( sled_agent_client:: Client :: new ( & url, self . log . clone ( ) ) )
895
- }
896
867
}
897
868
898
869
pub fn rack_subnet (
0 commit comments