diff --git a/clients/sled-agent-client/src/lib.rs b/clients/sled-agent-client/src/lib.rs index dfa89f4cc64..85ea0411417 100644 --- a/clients/sled-agent-client/src/lib.rs +++ b/clients/sled-agent-client/src/lib.rs @@ -389,36 +389,6 @@ impl From } } -impl From - for types::SledIdentifiers -{ - fn from( - value: omicron_common::api::internal::shared::SledIdentifiers, - ) -> Self { - Self { - model: value.model, - rack_id: value.rack_id, - revision: value.revision, - serial: value.serial, - sled_id: value.sled_id, - } - } -} - -impl From - for omicron_common::api::internal::shared::SledIdentifiers -{ - fn from(value: types::SledIdentifiers) -> Self { - Self { - model: value.model, - rack_id: value.rack_id, - revision: value.revision, - serial: value.serial, - sled_id: value.sled_id, - } - } -} - /// Exposes additional [`Client`] interfaces for use by the test suite. These /// are bonus endpoints, not generated in the real client. #[async_trait] diff --git a/oximeter/oximeter/schema/dendrite.toml b/oximeter/oximeter/schema/dendrite.toml index e822069a2f2..251a0ccceed 100644 --- a/oximeter/oximeter/schema/dendrite.toml +++ b/oximeter/oximeter/schema/dendrite.toml @@ -18,7 +18,7 @@ versions = [ # switch for its statistics, which is why these fields are included. # Dendrite may eventually report statistics about itself, or other aspects # not related to the switch, so they belong here, not the target. - { added_in = 1, fields = [ "switch_model", "switch_revision", "switch_id", "switch_serial" ] } + { added_in = 1, fields = [ "switch_model", "switch_revision", "switch_id", "switch_serial", "switch_slot" ] } ] [fields.rack_id] @@ -56,3 +56,7 @@ description = "ID of the switch being managed" [fields.switch_serial] type = "string" description = "Serial number of the switch being managed" + +[fields.switch_slot] +type = "u32" +description = "Slot number of the switch the link is on" diff --git a/oximeter/oximeter/schema/switch-data-link.toml b/oximeter/oximeter/schema/switch-data-link.toml index d6744e8c7f9..c7543c7193d 100644 --- a/oximeter/oximeter/schema/switch-data-link.toml +++ b/oximeter/oximeter/schema/switch-data-link.toml @@ -5,7 +5,7 @@ name = "switch_data_link" description = "A network data link on an Oxide switch" authz_scope = "fleet" versions = [ - { version = 1, fields = [ "rack_id", "sled_id", "sled_model", "sled_revision", "sled_serial", "switch_id", "switch_model", "switch_revision", "switch_serial" ] }, + { version = 1, fields = [ "rack_id", "sled_id", "sled_model", "sled_revision", "sled_serial", "switch_id", "switch_model", "switch_revision", "switch_serial", "switch_slot" ] }, ] [[metrics]] @@ -263,6 +263,10 @@ description = "Revision number of the switch the link is on" type = "string" description = "Serial number of the switch the link is on" +[fields.switch_slot] +type = "u32" +description = "Slot number of the switch the link is on" + [fields.port_id] type = "string" description = "Physical switch port the link is on" diff --git a/package-manifest.toml b/package-manifest.toml index 1a93e0d1653..dfe460777bf 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -716,8 +716,8 @@ only_for_targets.image = "standard" # the other `source.*` keys. source.type = "prebuilt" source.repo = "dendrite" -source.commit = "f3810e7bc1f0d746b5e95b3aaff32e52b02dfdfa" -source.sha256 = "c1506f6f818327523e6ff3102432a2038d319338b883235664b34f9132ff676a" +source.commit = "f79076d4630895a0177839ea041c355e2589b9c1" +source.sha256 = "7dbd752327234d6321ae9b06fb1eb72874bd3bcf0122ee545f60fe2579d9746c" output.type = "zone" output.intermediate_only = true @@ -743,8 +743,8 @@ only_for_targets.image = "standard" # the other `source.*` keys. source.type = "prebuilt" source.repo = "dendrite" -source.commit = "f3810e7bc1f0d746b5e95b3aaff32e52b02dfdfa" -source.sha256 = "061d40085e733e60d7c53ebfd2a4cf64f54a856e7eb5fd4b82ac65ec6a5b847b" +source.commit = "f79076d4630895a0177839ea041c355e2589b9c1" +source.sha256 = "12d02211398203d56b48bfe5dbcad1a4e968a5627e94bd1093b45d77181038fe" output.type = "zone" output.intermediate_only = true @@ -763,8 +763,8 @@ only_for_targets.image = "standard" # the other `source.*` keys. source.type = "prebuilt" source.repo = "dendrite" -source.commit = "f3810e7bc1f0d746b5e95b3aaff32e52b02dfdfa" -source.sha256 = "c6cb4c077f0ddfc78ab06e07316d1312657f95526ced60c2b8e7baf1c73ae24a" +source.commit = "f79076d4630895a0177839ea041c355e2589b9c1" +source.sha256 = "b128356fd2986344b393ca178ee7e7fc7aa82c08a85b4088e3df61ab057263f3" output.type = "zone" output.intermediate_only = true diff --git a/sled-agent/src/services.rs b/sled-agent/src/services.rs index 506995d1c77..473900d5080 100644 --- a/sled-agent/src/services.rs +++ b/sled-agent/src/services.rs @@ -87,7 +87,7 @@ use omicron_common::address::{AZ_PREFIX, OXIMETER_PORT}; use omicron_common::address::{BOOTSTRAP_ARTIFACT_PORT, COCKROACH_ADMIN_PORT}; use omicron_common::api::external::Generation; use omicron_common::api::internal::shared::{ - HostPortConfig, RackNetworkConfig, + HostPortConfig, RackNetworkConfig, SledIdentifiers, }; use omicron_common::backoff::{ retry_notify, retry_policy_internal_service_aggressive, BackoffError, @@ -379,15 +379,18 @@ fn display_zone_init_errors(errors: &[(String, Box)]) -> String { /// Configuration parameters which modify the [`ServiceManager`]'s behavior. pub struct Config { /// Identifies the sled being configured - pub sled_id: Uuid, + pub sled_identifiers: SledIdentifiers, /// Identifies the revision of the sidecar to be used. pub sidecar_revision: SidecarRevision, } impl Config { - pub fn new(sled_id: Uuid, sidecar_revision: SidecarRevision) -> Self { - Self { sled_id, sidecar_revision } + pub fn new( + sled_identifiers: SledIdentifiers, + sidecar_revision: SidecarRevision, + ) -> Self { + Self { sled_identifiers, sidecar_revision } } } @@ -973,6 +976,7 @@ impl ServiceManager { .get() .expect("sled agent not started") .config + .sled_identifiers .sled_id } @@ -2705,15 +2709,42 @@ impl ServiceManager { if let Some(i) = info { dendrite_config = dendrite_config + .add_property( + "rack_id", + "astring", + &i.rack_id.to_string(), + ) .add_property( "sled_id", "astring", - &i.config.sled_id.to_string(), + &i.config + .sled_identifiers + .sled_id + .to_string(), ) .add_property( - "rack_id", + "sled_model", "astring", - &i.rack_id.to_string(), + &i.config + .sled_identifiers + .model + .to_string(), + ) + .add_property( + "sled_serial", + "astring", + &i.config + .sled_identifiers + .serial + .to_string(), + ) + .add_property( + "sled_revision", + "astring", + &i.config + .sled_identifiers + .revision + .to_string(), ); } @@ -3005,7 +3036,10 @@ impl ServiceManager { .add_property( "sled_uuid", "astring", - &i.config.sled_id.to_string(), + &i.config + .sled_identifiers + .sled_id + .to_string(), ) .add_property( "rack_uuid", @@ -3051,7 +3085,10 @@ impl ServiceManager { .add_property( "sled_uuid", "astring", - &i.config.sled_id.to_string(), + &i.config + .sled_identifiers + .sled_id + .to_string(), ) .add_property( "rack_uuid", @@ -4386,7 +4423,25 @@ impl ServiceManager { )?; smfh.setprop_default_instance( "config/sled_id", - info.config.sled_id, + info.config.sled_identifiers.sled_id, + )?; + smfh.setprop_default_instance( + "config/sled_model", + info.config + .sled_identifiers + .model + .to_string(), + )?; + smfh.setprop_default_instance( + "config/sled_revision", + info.config.sled_identifiers.revision, + )?; + smfh.setprop_default_instance( + "config/sled_serial", + info.config + .sled_identifiers + .serial + .to_string(), )?; } else { info!( @@ -4495,7 +4550,7 @@ impl ServiceManager { )?; smfh.setprop_default_instance( "config/sled_uuid", - info.config.sled_id, + info.config.sled_identifiers.sled_id, )?; } for address in &request.addresses { @@ -4538,7 +4593,7 @@ impl ServiceManager { )?; smfh.setprop_default_instance( "config/sled_uuid", - info.config.sled_id, + info.config.sled_identifiers.sled_id, )?; } smfh.delpropvalue_default_instance( @@ -4981,7 +5036,13 @@ mod illumos_tests { fn make_config(&self) -> Config { Config { - sled_id: Uuid::new_v4(), + sled_identifiers: SledIdentifiers { + rack_id: Uuid::new_v4(), + sled_id: Uuid::new_v4(), + model: "fake-gimlet".to_string(), + revision: 1, + serial: "fake-serial".to_string(), + }, sidecar_revision: SidecarRevision::Physical( "rev_whatever_its_a_test".to_string(), ), diff --git a/sled-agent/src/sled_agent.rs b/sled-agent/src/sled_agent.rs index 1b683818285..7e48c8718bf 100644 --- a/sled-agent/src/sled_agent.rs +++ b/sled-agent/src/sled_agent.rs @@ -451,7 +451,7 @@ impl SledAgent { serial: baseboard.identifier().to_string(), }; let metrics_manager = - MetricsManager::new(&log, identifiers, *sled_address.ip())?; + MetricsManager::new(&log, identifiers.clone(), *sled_address.ip())?; // Start tracking the underlay physical links. for link in underlay::find_chelsio_links(&config.data_links)? { @@ -497,10 +497,8 @@ impl SledAgent { }; let updates = UpdateManager::new(update_config); - let svc_config = services::Config::new( - request.body.id.into_untyped_uuid(), - config.sidecar_revision.clone(), - ); + let svc_config = + services::Config::new(identifiers, config.sidecar_revision.clone()); // Get our rack network config from the bootstore; we cannot proceed // until we have this, as we need to know which switches have uplinks to diff --git a/tools/dendrite_openapi_version b/tools/dendrite_openapi_version index 75c57e9d292..a23ac9fdde6 100755 --- a/tools/dendrite_openapi_version +++ b/tools/dendrite_openapi_version @@ -1,2 +1,2 @@ -COMMIT="f3810e7bc1f0d746b5e95b3aaff32e52b02dfdfa" -SHA2="3a54305ab4b1270c9a5fb0603f481fce199f3767c174a03559ff642f7f44687e" +COMMIT="f79076d4630895a0177839ea041c355e2589b9c1" +SHA2="d1a503d99fe7e12dfe20f83031a8ce718a28d5caa88c41d2ceb298ed287acb4e" diff --git a/tools/dendrite_stub_checksums b/tools/dendrite_stub_checksums index fe420e299e7..96472654289 100644 --- a/tools/dendrite_stub_checksums +++ b/tools/dendrite_stub_checksums @@ -1,3 +1,3 @@ -CIDL_SHA256_ILLUMOS="c1506f6f818327523e6ff3102432a2038d319338b883235664b34f9132ff676a" -CIDL_SHA256_LINUX_DPD="fc9ea4dc22e761dce3aa4d252983360f799426a0c23ea8f347653664d3e2b55a" -CIDL_SHA256_LINUX_SWADM="9da0dd6c972206338971a90144b1c35e101d69aaacf26240a45cef45d828b090" +CIDL_SHA256_ILLUMOS="7dbd752327234d6321ae9b06fb1eb72874bd3bcf0122ee545f60fe2579d9746c" +CIDL_SHA256_LINUX_DPD="6ffcebe792c268754352c29436d032027123ff33ee45fc9dfa4fe284e5eb0cec" +CIDL_SHA256_LINUX_SWADM="d6d9c42411cead6d823f21ba3082001595a4b47c7b8ec35f323bbe22eb8fa40a"