Skip to content

Commit

Permalink
move NEXUS_REDUNDANCY from nexus-deployment to omicron-common to shar…
Browse files Browse the repository at this point in the history
…e with RSS
  • Loading branch information
jgallagher committed Feb 8, 2024
1 parent c82b1c3 commit d332154
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions common/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions nexus/deployment/src/default_service_count.rs

This file was deleted.

1 change: 0 additions & 1 deletion nexus/deployment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@
//! updates, etc.
pub mod blueprint_builder;
pub mod default_service_count;
mod ip_allocator;
pub mod planner;
4 changes: 2 additions & 2 deletions nexus/src/app/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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,
})
Expand Down
1 change: 0 additions & 1 deletion sled-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions sled-agent/src/rack_setup/plan/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)?;
Expand Down

0 comments on commit d332154

Please sign in to comment.