Skip to content

Commit fb209f9

Browse files
authored
Move creation of /var/oxide from RSS to bootstrap-agent (#1132)
In single-sled cases, our current RSS implementation would create `/var/oxide` before issuing requests that would ultimately end up creating files under it. However, in multisled cases, `/var/oxide` would only be created on the sled running RSS; requests to other sleds that tried to write files in that directory would fail. This commit moves the creation of the directory from "early in RSS" to "early in bootstrap-agent", ensuring it happens on all sleds.
1 parent 5a0d1e0 commit fb209f9

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

sled-agent/src/bootstrap/agent.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@ impl Agent {
138138
"server" => sled_config.id.to_string(),
139139
));
140140

141+
// We expect this directory to exist - ensure that it does, before any
142+
// subsequent operations which may write configs here.
143+
info!(
144+
log, "Ensuring config directory exists";
145+
"path" => omicron_common::OMICRON_CONFIG_PATH,
146+
);
147+
tokio::fs::create_dir_all(omicron_common::OMICRON_CONFIG_PATH)
148+
.await
149+
.map_err(|err| BootstrapError::Io {
150+
message: format!(
151+
"Creating config directory {}",
152+
omicron_common::OMICRON_CONFIG_PATH
153+
),
154+
err,
155+
})?;
156+
141157
let data_link = if let Some(link) = sled_config.data_link.clone() {
142158
link
143159
} else {

sled-agent/src/rack_setup/service.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,6 @@ impl ServiceInner {
416416
) -> Result<(), SetupServiceError> {
417417
info!(self.log, "Injecting RSS configuration: {:#?}", config);
418418

419-
// We expect this directory to exist - ensure that it does, before any
420-
// subsequent operations which may write configs here.
421-
tokio::fs::create_dir_all(omicron_common::OMICRON_CONFIG_PATH)
422-
.await
423-
.map_err(|err| SetupServiceError::Io {
424-
message: format!(
425-
"Creating config directory {}",
426-
omicron_common::OMICRON_CONFIG_PATH
427-
),
428-
err,
429-
})?;
430-
431419
// Check if a previous RSS plan has completed successfully.
432420
//
433421
// If it has, the system should be up-and-running.

0 commit comments

Comments
 (0)