diff --git a/Cargo.lock b/Cargo.lock index 00e075877d..5814dd101a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5278,7 +5278,6 @@ dependencies = [ "macaddr", "mg-admin-client", "nexus-client", - "nexus-deployment", "omicron-common", "omicron-test-utils", "omicron-workspace-hack", diff --git a/common/src/address.rs b/common/src/address.rs index c26c6ff911..152fb9319e 100644 --- a/common/src/address.rs +++ b/common/src/address.rs @@ -24,6 +24,12 @@ pub const MAX_PORT: u16 = u16::MAX; /// minimum possible value for a tcp or udp port pub const MIN_PORT: u16 = u16::MIN; +/// The amount of redundancy for Nexus services. +/// +/// This is used by both RSS (to distribute the initial set of services) and the +/// Reconfigurator (to know whether to add new Nexus zones) +pub const NEXUS_REDUNDANCY: usize = 3; + /// The amount of redundancy for internal DNS servers. /// /// Must be less than or equal to MAX_DNS_REDUNDANCY. diff --git a/nexus/deployment/src/default_service_count.rs b/nexus/deployment/src/default_service_count.rs deleted file mode 100644 index 5881da6dc9..0000000000 --- a/nexus/deployment/src/default_service_count.rs +++ /dev/null @@ -1,8 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -//! Default counts of Omicron service zones that should be provised by RSS and -//! the reconfiguration system. - -pub const NEXUS: usize = 3; diff --git a/nexus/deployment/src/lib.rs b/nexus/deployment/src/lib.rs index 1e8ecd333d..546f2c1dc1 100644 --- a/nexus/deployment/src/lib.rs +++ b/nexus/deployment/src/lib.rs @@ -116,6 +116,5 @@ //! updates, etc. pub mod blueprint_builder; -pub mod default_service_count; mod ip_allocator; pub mod planner; diff --git a/nexus/src/app/deployment.rs b/nexus/src/app/deployment.rs index 716123df35..5818d1aa12 100644 --- a/nexus/src/app/deployment.rs +++ b/nexus/src/app/deployment.rs @@ -8,7 +8,6 @@ use nexus_db_queries::authz; use nexus_db_queries::context::OpContext; use nexus_db_queries::db::pagination::Paginator; use nexus_deployment::blueprint_builder::BlueprintBuilder; -use nexus_deployment::default_service_count; use nexus_deployment::planner::Planner; use nexus_types::deployment::Blueprint; use nexus_types::deployment::BlueprintMetadata; @@ -21,6 +20,7 @@ use nexus_types::identity::Asset; use nexus_types::inventory::Collection; use omicron_common::address::IpRange; use omicron_common::address::Ipv6Subnet; +use omicron_common::address::NEXUS_REDUNDANCY; use omicron_common::address::SLED_PREFIX; use omicron_common::api::external::CreateResult; use omicron_common::api::external::DataPageParams; @@ -223,7 +223,7 @@ impl super::Nexus { policy: Policy { sleds, service_ip_pool_ranges, - target_nexus_zone_count: default_service_count::NEXUS, + target_nexus_zone_count: NEXUS_REDUNDANCY, }, inventory, }) diff --git a/sled-agent/Cargo.toml b/sled-agent/Cargo.toml index 860e118263..5bd205b32e 100644 --- a/sled-agent/Cargo.toml +++ b/sled-agent/Cargo.toml @@ -44,7 +44,6 @@ libc.workspace = true macaddr.workspace = true mg-admin-client.workspace = true nexus-client.workspace = true -nexus-deployment.workspace = true omicron-common.workspace = true once_cell.workspace = true oximeter.workspace = true diff --git a/sled-agent/src/rack_setup/plan/service.rs b/sled-agent/src/rack_setup/plan/service.rs index 2a169082ed..10bfc34b26 100644 --- a/sled-agent/src/rack_setup/plan/service.rs +++ b/sled-agent/src/rack_setup/plan/service.rs @@ -12,12 +12,11 @@ use dns_service_client::types::DnsConfigParams; use illumos_utils::zpool::ZpoolName; use internal_dns::config::{Host, ZoneVariant}; use internal_dns::ServiceName; -use nexus_deployment::default_service_count; use omicron_common::address::{ get_sled_address, get_switch_zone_address, Ipv6Subnet, ReservedRackSubnet, DENDRITE_PORT, DNS_HTTP_PORT, DNS_PORT, DNS_REDUNDANCY, MAX_DNS_REDUNDANCY, - MGD_PORT, MGS_PORT, NTP_PORT, NUM_SOURCE_NAT_PORTS, RSS_RESERVED_ADDRESSES, - SLED_PREFIX, + MGD_PORT, MGS_PORT, NEXUS_REDUNDANCY, NTP_PORT, NUM_SOURCE_NAT_PORTS, + RSS_RESERVED_ADDRESSES, SLED_PREFIX, }; use omicron_common::api::external::{MacAddr, Vni}; use omicron_common::api::internal::shared::SwitchLocation; @@ -456,7 +455,7 @@ impl Plan { } // Provision Nexus zones, continuing to stripe across sleds. - for _ in 0..default_service_count::NEXUS { + for _ in 0..NEXUS_REDUNDANCY { let sled = { let which_sled = sled_allocator.next().ok_or(PlanError::NotEnoughSleds)?;