@@ -33,7 +33,6 @@ use nexus_types::deployment::BlueprintHostPhase2DesiredContents;
3333use nexus_types:: deployment:: BlueprintHostPhase2DesiredSlots ;
3434use nexus_types:: deployment:: BlueprintPhysicalDiskConfig ;
3535use nexus_types:: deployment:: BlueprintPhysicalDiskDisposition ;
36- use nexus_types:: deployment:: BlueprintSledConfig ;
3736use nexus_types:: deployment:: BlueprintSource ;
3837use nexus_types:: deployment:: BlueprintZoneConfig ;
3938use nexus_types:: deployment:: BlueprintZoneDisposition ;
@@ -486,9 +485,8 @@ struct OximeterReadPolicy {
486485///
487486/// 1. Build one directly. This would generally only be used once in the
488487/// lifetime of a rack, to assemble the first blueprint during rack setup.
489- /// It is also common in tests. To start with a blueprint that contains an
490- /// empty zone config for some number of sleds, use
491- /// [`BlueprintBuilder::build_empty_with_sleds`].
488+ /// It is also common in tests. To start with an empty initial blueprint,
489+ /// use [`BlueprintBuilder::build_empty`].
492490///
493491/// 2. Build one _from_ another blueprint, called the "parent", making changes
494492/// as desired. Use [`BlueprintBuilder::new_based_on`] for this. Once the
@@ -533,64 +531,16 @@ impl<'a> BlueprintBuilder<'a> {
533531 /// Directly construct an empty blueprint: no sleds; default values for all
534532 /// other fields.
535533 pub fn build_empty ( creator : & str ) -> Blueprint {
536- Self :: build_empty_with_sleds ( iter :: empty ( ) , creator )
534+ Self :: build_empty_seeded ( creator , PlannerRng :: from_entropy ( ) )
537535 }
538536
539537 /// A version of [`Self::build_empty`] that allows the
540538 /// blueprint ID to be generated from a deterministic RNG.
541- pub fn build_empty_seeded ( creator : & str , rng : PlannerRng ) -> Blueprint {
542- Self :: build_empty_with_sleds_seeded ( iter:: empty ( ) , creator, rng)
543- }
544-
545- /// Directly construct a `Blueprint` that contains an empty zone config for
546- /// the given sleds.
547- pub fn build_empty_with_sleds (
548- sled_ids : impl Iterator < Item = SledUuid > ,
549- creator : & str ,
550- ) -> Blueprint {
551- Self :: build_empty_with_sleds_impl (
552- sled_ids,
553- creator,
554- PlannerRng :: from_entropy ( ) ,
555- )
556- }
557-
558- /// A version of [`Self::build_empty_with_sleds`] that allows the
559- /// blueprint ID to be generated from a deterministic RNG.
560- pub fn build_empty_with_sleds_seeded (
561- sled_ids : impl Iterator < Item = SledUuid > ,
562- creator : & str ,
563- rng : PlannerRng ,
564- ) -> Blueprint {
565- Self :: build_empty_with_sleds_impl ( sled_ids, creator, rng)
566- }
567-
568- fn build_empty_with_sleds_impl (
569- sled_ids : impl Iterator < Item = SledUuid > ,
570- creator : & str ,
571- mut rng : PlannerRng ,
572- ) -> Blueprint {
573- let sleds = sled_ids
574- . map ( |sled_id| {
575- let config = BlueprintSledConfig {
576- state : SledState :: Active ,
577- sled_agent_generation : Generation :: new ( ) ,
578- disks : IdOrdMap :: default ( ) ,
579- datasets : IdOrdMap :: default ( ) ,
580- zones : IdOrdMap :: default ( ) ,
581- remove_mupdate_override : None ,
582- host_phase_2 :
583- BlueprintHostPhase2DesiredSlots :: current_contents ( ) ,
584- } ;
585- ( sled_id, config)
586- } )
587- . collect :: < BTreeMap < _ , _ > > ( ) ;
588- let num_sleds = sleds. len ( ) ;
589-
539+ pub fn build_empty_seeded ( creator : & str , mut rng : PlannerRng ) -> Blueprint {
590540 let id = rng. next_blueprint ( ) ;
591541 Blueprint {
592542 id,
593- sleds,
543+ sleds : BTreeMap :: new ( ) ,
594544 pending_mgs_updates : PendingMgsUpdates :: new ( ) ,
595545 parent_blueprint_id : None ,
596546 internal_dns_version : Generation :: new ( ) ,
@@ -605,7 +555,7 @@ impl<'a> BlueprintBuilder<'a> {
605555 oximeter_read_mode : OximeterReadMode :: SingleNode ,
606556 time_created : now_db_precision ( ) ,
607557 creator : creator. to_owned ( ) ,
608- comment : format ! ( "starting blueprint with {num_sleds} empty sleds " ) ,
558+ comment : format ! ( "starting blueprint ( empty) " ) ,
609559 // The only reason to create empty blueprints is tests. If that
610560 // changes (e.g., if RSS starts using this builder to generate its
611561 // blueprints), we could take a `source` argument instead.
0 commit comments