Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7944,9 +7944,9 @@ planning report:
* skipping noop zone image source check on sled d81c6a84-79b8-4958-ae41-ea46c9b19763: all 9 zones are already from artifacts
* 3 remaining out-of-date zones
* 3 zones waiting to be expunged:
* zone 0c71b3b2-6ceb-4e8f-b020-b08675e83038 (nexus): image out-of-date, but zone's nexus_generation 1 is still active
* zone 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6 (nexus): image out-of-date, but zone's nexus_generation 1 is still active
* zone 466a9f29-62bf-4e63-924a-b9efdb86afec (nexus): image out-of-date, but zone's nexus_generation 1 is still active
* zone 0c71b3b2-6ceb-4e8f-b020-b08675e83038: nexus image out-of-date, but nexus_generation 1 is still active
* zone 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6: nexus image out-of-date, but nexus_generation 1 is still active
* zone 466a9f29-62bf-4e63-924a-b9efdb86afec: nexus image out-of-date, but nexus_generation 1 is still active
* updating top-level nexus_generation to: 2


Expand Down Expand Up @@ -8035,9 +8035,9 @@ planning report:
* skipping noop zone image source check on sled d81c6a84-79b8-4958-ae41-ea46c9b19763: all 9 zones are already from artifacts
* 3 remaining out-of-date zones
* 3 zones waiting to be expunged:
* zone 0c71b3b2-6ceb-4e8f-b020-b08675e83038 (nexus): image out-of-date, but zone's nexus_generation 1 is still active
* zone 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6 (nexus): image out-of-date, but zone's nexus_generation 1 is still active
* zone 466a9f29-62bf-4e63-924a-b9efdb86afec (nexus): image out-of-date, but zone's nexus_generation 1 is still active
* zone 0c71b3b2-6ceb-4e8f-b020-b08675e83038: nexus image out-of-date, but nexus_generation 1 is still active
* zone 3eeb8d49-eb1a-43f8-bb64-c2338421c2c6: nexus image out-of-date, but nexus_generation 1 is still active
* zone 466a9f29-62bf-4e63-924a-b9efdb86afec: nexus image out-of-date, but nexus_generation 1 is still active



Expand Down
12 changes: 11 additions & 1 deletion nexus/src/app/background/tasks/blueprint_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use omicron_common::api::external::LookupType;
use omicron_uuid_kinds::CollectionUuid;
use omicron_uuid_kinds::GenericUuid as _;
use serde_json::json;
use slog_error_chain::InlineErrorChain;
use std::sync::Arc;
use tokio::sync::watch::{self, Receiver, Sender};

Expand Down Expand Up @@ -292,7 +293,16 @@ impl BackgroundTask for BlueprintPlanner {
&'a mut self,
opctx: &'a OpContext,
) -> BoxFuture<'a, serde_json::Value> {
Box::pin(async move { json!(self.plan(opctx).await) })
Box::pin(async move {
let status = self.plan(opctx).await;
match serde_json::to_value(status) {
Ok(val) => val,
Err(err) => json!({
"error": format!("could not serialize task status: {}",
InlineErrorChain::new(&err)),
}),
}
})
}
}

Expand Down
34 changes: 12 additions & 22 deletions nexus/types/src/deployment/planning_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ pub struct PlanningZoneUpdatesStepReport {
pub out_of_date_zones: BTreeMap<SledUuid, Vec<PlanningOutOfDateZone>>,
pub expunged_zones: BTreeMap<SledUuid, Vec<BlueprintZoneConfig>>,
pub updated_zones: BTreeMap<SledUuid, Vec<BlueprintZoneConfig>>,
pub unsafe_zones: BTreeMap<BlueprintZoneConfig, ZoneUnsafeToShutdown>,
pub waiting_zones: BTreeMap<BlueprintZoneConfig, ZoneWaitingToExpunge>,
pub unsafe_zones: BTreeMap<OmicronZoneUuid, ZoneUnsafeToShutdown>,
pub waiting_zones: BTreeMap<OmicronZoneUuid, ZoneWaitingToExpunge>,
}

impl PlanningZoneUpdatesStepReport {
Expand Down Expand Up @@ -919,15 +919,15 @@ impl PlanningZoneUpdatesStepReport {
zone: &BlueprintZoneConfig,
reason: ZoneUnsafeToShutdown,
) {
self.unsafe_zones.insert(zone.clone(), reason);
self.unsafe_zones.insert(zone.id, reason);
}

pub fn waiting_zone(
&mut self,
zone: &BlueprintZoneConfig,
reason: ZoneWaitingToExpunge,
) {
self.waiting_zones.insert(zone.clone(), reason);
self.waiting_zones.insert(zone.id, reason);
}
}

Expand Down Expand Up @@ -986,28 +986,16 @@ impl fmt::Display for PlanningZoneUpdatesStepReport {
if !unsafe_zones.is_empty() {
let (n, s) = plural_map(unsafe_zones);
writeln!(f, "* {n} zone{s} not ready to shut down safely:")?;
for (zone, reason) in unsafe_zones.iter() {
writeln!(
f,
" * zone {} ({}): {}",
zone.id,
zone.zone_type.kind().report_str(),
reason,
)?;
for (zone_id, reason) in unsafe_zones.iter() {
writeln!(f, " * zone {zone_id}: {reason}")?;
}
}

if !waiting_zones.is_empty() {
let (n, s) = plural_map(waiting_zones);
writeln!(f, "* {n} zone{s} waiting to be expunged:")?;
for (zone, reason) in waiting_zones.iter() {
writeln!(
f,
" * zone {} ({}): {}",
zone.id,
zone.zone_type.kind().report_str(),
reason,
)?;
for (zone_id, reason) in waiting_zones.iter() {
writeln!(f, " * zone {zone_id}: {reason}")?;
}
}

Expand Down Expand Up @@ -1061,7 +1049,9 @@ pub enum ZoneUnsafeToShutdown {
impl fmt::Display for ZoneUnsafeToShutdown {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Cockroachdb { reason } => write!(f, "{reason}"),
Self::Cockroachdb { reason } => {
write!(f, "cockroach unsafe to shut down: {reason}")
}
Self::BoundaryNtp {
total_boundary_ntp_zones: t,
synchronized_count: s,
Expand Down Expand Up @@ -1092,7 +1082,7 @@ impl fmt::Display for ZoneWaitingToExpunge {
Self::Nexus { zone_generation } => {
write!(
f,
"image out-of-date, but zone's nexus_generation \
"nexus image out-of-date, but nexus_generation \
{zone_generation} is still active"
)
}
Expand Down
15 changes: 15 additions & 0 deletions openapi/nexus-lockstep.json
Original file line number Diff line number Diff line change
Expand Up @@ -7087,6 +7087,21 @@
"type"
]
},
{
"description": "Waiting on zones to propagate to inventory.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"inventory_propagation"
]
}
},
"required": [
"type"
]
},
{
"description": "Waiting on updates to RoT / SP / Host OS / etc.",
"type": "object",
Expand Down
Loading