Skip to content

Commit daac156

Browse files
committed
sled-agent: begin incorporating Cosmo support
Extend the existing `Baseboard` type to incorporate Cosmo, and introduce a new `OxideSled` enum to represent different Oxide sled types so that a) we can differentiate between different kinds of sled, and b) parameterize omicron code with constant data specific to a sled type. Also, identify places where we call the `is_gimlet` method, and instead call that, `is_oxide_sled` (none of these are actually specific to Gimlets in particular). Find places where we use symbolic constants named `Gimlet` that should be `Sled`; if these bleed into config files, set up Serde aliases to accommodate a change. Make it is that, if we set `skip_timesync` in a config file, we propagate that to RSS config as well. With these changes, we have successfully used the `gimlet-standalone` to boot the control plane on a Cosmo. (Yes, the config name is somewhat ironic, and should be addressed at some point.)
1 parent bf74f7a commit daac156

File tree

22 files changed

+380
-128
lines changed

22 files changed

+380
-128
lines changed

clients/bootstrap-agent-client/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ impl From<types::Baseboard> for sled_hardware_types::Baseboard {
4444
identifier, model, revision,
4545
)
4646
}
47+
types::Baseboard::Cosmo { identifier, model, revision } => {
48+
sled_hardware_types::Baseboard::new_cosmo(
49+
identifier, model, revision,
50+
)
51+
}
4752
types::Baseboard::Unknown => {
4853
sled_hardware_types::Baseboard::unknown()
4954
}
@@ -62,6 +67,11 @@ impl From<sled_hardware_types::Baseboard> for types::Baseboard {
6267
model,
6368
revision,
6469
} => types::Baseboard::Gimlet { identifier, model, revision },
70+
sled_hardware_types::Baseboard::Cosmo {
71+
identifier,
72+
model,
73+
revision,
74+
} => types::Baseboard::Cosmo { identifier, model, revision },
6575
sled_hardware_types::Baseboard::Unknown => {
6676
types::Baseboard::Unknown
6777
}

installinator/src/hardware.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ pub struct Hardware {
2121

2222
impl Hardware {
2323
pub async fn scan(log: &Logger) -> Result<Self> {
24-
let is_gimlet = sled_hardware::is_gimlet()
25-
.context("failed to detect whether host is a gimlet")?;
26-
ensure!(is_gimlet, "hardware scan only supported on gimlets");
24+
let is_oxide_sled = sled_hardware::is_oxide_sled()
25+
.context("failed to detect whether host is an oxide sled")?;
26+
ensure!(is_oxide_sled, "hardware scan only supported on oxide sleds");
2727

2828
let hardware = HardwareManager::new(log, SledMode::Auto, vec![])
2929
.map_err(|err| {
@@ -34,7 +34,7 @@ impl Hardware {
3434
hardware.disks().into_values().map(|disk| disk.into()).collect();
3535

3636
info!(
37-
log, "found gimlet hardware";
37+
log, "found oxide sled hardware";
3838
"baseboard" => ?hardware.baseboard(),
3939
"is_scrimlet" => hardware.is_scrimlet(),
4040
"num_disks" => disks.len(),

nexus/inventory/src/builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ impl CollectionBuilder {
627627

628628
let baseboard_id = match inventory.baseboard {
629629
Baseboard::Pc { .. } => None,
630-
Baseboard::Gimlet { identifier, model, revision: _ } => {
630+
Baseboard::Gimlet { identifier, model, .. }
631+
| Baseboard::Cosmo { identifier, model, .. } => {
631632
Some(Self::normalize_item(
632633
&mut self.baseboards,
633634
BaseboardId {

openapi/bootstrap-agent.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
"pattern": "^[a-zA-Z0-9._+-]{1,63}$"
210210
},
211211
"Baseboard": {
212-
"description": "Describes properties that should uniquely identify a Gimlet.",
212+
"description": "Describes properties that should uniquely identify a system.",
213213
"oneOf": [
214214
{
215215
"type": "object",
@@ -239,6 +239,34 @@
239239
"type"
240240
]
241241
},
242+
{
243+
"type": "object",
244+
"properties": {
245+
"identifier": {
246+
"type": "string"
247+
},
248+
"model": {
249+
"type": "string"
250+
},
251+
"revision": {
252+
"type": "integer",
253+
"format": "uint32",
254+
"minimum": 0
255+
},
256+
"type": {
257+
"type": "string",
258+
"enum": [
259+
"cosmo"
260+
]
261+
}
262+
},
263+
"required": [
264+
"identifier",
265+
"model",
266+
"revision",
267+
"type"
268+
]
269+
},
242270
{
243271
"type": "object",
244272
"properties": {
@@ -1001,6 +1029,11 @@
10011029
}
10021030
]
10031031
},
1032+
"skip_timesync": {
1033+
"nullable": true,
1034+
"description": "Skip timesync (for debugging)",
1035+
"type": "boolean"
1036+
},
10041037
"trust_quorum_peers": {
10051038
"nullable": true,
10061039
"description": "The set of peer_ids required to initialize trust quorum\n\nThe value is `None` if we are not using trust quorum",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sled-agent-3.0.0-f44f77.json
1+
sled-agent-3.0.0-bdaa82.json

openapi/wicketd.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@
10631063
}
10641064
},
10651065
"Baseboard": {
1066-
"description": "Describes properties that should uniquely identify a Gimlet.",
1066+
"description": "Describes properties that should uniquely identify a system.",
10671067
"oneOf": [
10681068
{
10691069
"type": "object",
@@ -1093,6 +1093,34 @@
10931093
"type"
10941094
]
10951095
},
1096+
{
1097+
"type": "object",
1098+
"properties": {
1099+
"identifier": {
1100+
"type": "string"
1101+
},
1102+
"model": {
1103+
"type": "string"
1104+
},
1105+
"revision": {
1106+
"type": "integer",
1107+
"format": "uint32",
1108+
"minimum": 0
1109+
},
1110+
"type": {
1111+
"type": "string",
1112+
"enum": [
1113+
"cosmo"
1114+
]
1115+
}
1116+
},
1117+
"required": [
1118+
"identifier",
1119+
"model",
1120+
"revision",
1121+
"type"
1122+
]
1123+
},
10961124
{
10971125
"type": "object",
10981126
"properties": {

sled-agent/src/bin/sled-agent.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ async fn do_run() -> Result<(), CmdError> {
6161
rss_config_path
6262
};
6363
let rss_config = if rss_config_path.exists() {
64-
Some(
64+
let mut rss_config =
6565
RackInitializeRequest::from_file(rss_config_path)
66-
.map_err(|e| CmdError::Failure(anyhow!(e)))?,
67-
)
66+
.map_err(|e| CmdError::Failure(anyhow!(e)))?;
67+
if rss_config.skip_timesync.is_none() {
68+
rss_config.skip_timesync = config.skip_timesync;
69+
}
70+
Some(rss_config)
6871
} else {
6972
None
7073
};

sled-agent/src/bootstrap/pre_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn sled_mode_from_config(config: &Config) -> Result<SledMode, StartError> {
303303
}
304304
SledMode::Auto
305305
}
306-
SledModeConfig::Gimlet => SledMode::Gimlet,
306+
SledModeConfig::Sled => SledMode::Sled,
307307
SledModeConfig::Scrimlet => {
308308
let asic = if cfg!(feature = "switch-asic") {
309309
DendriteAsic::TofinoAsic

sled-agent/src/config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ use illumos_utils::dladm::PhysicalLink;
1515
use omicron_common::vlan::VlanID;
1616
use serde::Deserialize;
1717
use sled_hardware::UnparsedDisk;
18-
use sled_hardware::is_gimlet;
18+
use sled_hardware::is_oxide_sled;
1919
use sprockets_tls::keys::SprocketsConfig;
2020

2121
#[derive(Clone, Debug, Deserialize)]
2222
#[serde(rename_all = "lowercase")]
2323
pub enum SledMode {
2424
Auto,
25-
Gimlet,
25+
#[serde(alias = "gimlet")]
26+
Sled,
2627
Scrimlet,
2728
}
2829

@@ -137,7 +138,7 @@ pub enum ConfigError {
137138
},
138139
#[error("Loading certificate: {0}")]
139140
Certificate(#[source] anyhow::Error),
140-
#[error("Could not determine if host is a Gimlet: {0}")]
141+
#[error("Could not determine if host is an Oxide sled: {0}")]
141142
SystemDetection(#[source] anyhow::Error),
142143
#[error("Could not enumerate physical links")]
143144
FindLinks(#[from] FindPhysicalLinkError),
@@ -158,7 +159,7 @@ impl Config {
158159
if let Some(link) = self.data_link.as_ref() {
159160
Ok(link.clone())
160161
} else {
161-
if is_gimlet().map_err(ConfigError::SystemDetection)? {
162+
if is_oxide_sled().map_err(ConfigError::SystemDetection)? {
162163
Dladm::list_physical()
163164
.await
164165
.map_err(ConfigError::FindLinks)?

sled-agent/src/rack_setup/plan/service.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,7 @@ mod tests {
12591259
bfd: Vec::new(),
12601260
},
12611261
allowed_source_ips: AllowedSourceIps::Any,
1262+
skip_timesync: Some(false),
12621263
}
12631264
}
12641265

0 commit comments

Comments
 (0)