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
8 changes: 4 additions & 4 deletions openapi/sled-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@
]
},
"DatasetEnsureBody": {
"description": "Used to request a new partition kind exists within a zpool.\n\nMany partition types are associated with services that will be instantiated when the partition is detected.",
"description": "Used to request a new dataset kind exists within a zpool.\n\nMany dataset types are associated with services that will be instantiated when the dataset is detected.",
"type": "object",
"properties": {
"address": {
"type": "string"
},
"partition_kind": {
"dataset_kind": {
"$ref": "#/components/schemas/DatasetKind"
},
"zpool_uuid": {
Expand All @@ -254,7 +254,7 @@
},
"required": [
"address",
"partition_kind",
"dataset_kind",
"zpool_uuid"
]
},
Expand Down Expand Up @@ -941,7 +941,7 @@
]
},
"ServiceEnsureBody": {
"description": "Used to request that the Sled initialize certain services on initialization.\n\nThis may be used to record that certain sleds are responsible for launching services which may not be associated with a partition, such as Nexus.",
"description": "Used to request that the Sled initialize certain services on initialization.\n\nThis may be used to record that certain sleds are responsible for launching services which may not be associated with a dataset, such as Nexus.",
"type": "object",
"properties": {
"services": {
Expand Down
2 changes: 1 addition & 1 deletion sled-agent/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async fn filesystem_put(
let body_args = body.into_inner();
sa.filesystem_ensure(
body_args.zpool_uuid,
body_args.partition_kind,
body_args.dataset_kind,
body_args.address,
)
.await
Expand Down
14 changes: 7 additions & 7 deletions sled-agent/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,21 @@ impl std::fmt::Display for DatasetKind {
}
}

/// Used to request a new partition kind exists within a zpool.
/// Used to request a new dataset kind exists within a zpool.
///
/// Many partition types are associated with services that will be
/// instantiated when the partition is detected.
/// Many dataset types are associated with services that will be
/// instantiated when the dataset is detected.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
pub struct DatasetEnsureBody {
// The name (and UUID) of the Zpool which we are inserting into.
pub zpool_uuid: Uuid,
// The type of the filesystem.
pub partition_kind: DatasetKind,
pub dataset_kind: DatasetKind,
// The address on which the zone will listen for requests.
pub address: SocketAddr,
// NOTE: We could insert a UUID here, if we want that to be set by the
// caller explicitly? Currently, the lack of a UUID implies that
// "at most one partition type" exists within a zpool.
// "at most one dataset type" exists within a zpool.
//
// It's unclear if this is actually necessary - making this change
// would also require the RSS to query existing datasets before
Expand All @@ -219,7 +219,7 @@ impl From<DatasetEnsureBody> for sled_agent_client::types::DatasetEnsureBody {
fn from(p: DatasetEnsureBody) -> Self {
Self {
zpool_uuid: p.zpool_uuid,
partition_kind: p.partition_kind.into(),
dataset_kind: p.dataset_kind.into(),
address: p.address.to_string(),
}
}
Expand Down Expand Up @@ -247,7 +247,7 @@ impl From<ServiceRequest> for sled_agent_client::types::ServiceRequest {
/// Used to request that the Sled initialize certain services on initialization.
///
/// This may be used to record that certain sleds are responsible for
/// launching services which may not be associated with a partition, such
/// launching services which may not be associated with a dataset, such
/// as Nexus.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
pub struct ServiceEnsureBody {
Expand Down
6 changes: 3 additions & 3 deletions sled-agent/src/rack_setup/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ pub struct SledRequest {
/// The Sled Agent address receiving these requests.
pub sled_address: SocketAddr,

/// Partitions to be created.
#[serde(default, rename = "partition")]
pub partitions: Vec<DatasetEnsureBody>,
/// Datasets to be created.
#[serde(default, rename = "dataset")]
pub datasets: Vec<DatasetEnsureBody>,

/// Services to be instantiated.
#[serde(default, rename = "service")]
Expand Down
16 changes: 8 additions & 8 deletions sled-agent/src/rack_setup/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ impl ServiceInner {

// TODO(https://github.com/oxidecomputer/omicron/issues/724):
// We could potentially handle this case by deleting all
// partitions (in preparation for applying the new
// datasets (in preparation for applying the new
// configuration), but at the moment it's an error.
warn!(
self.log,
"Rack Setup Service Config was already applied, but has changed.
This means that you may have partitions set up on this sled, but they
This means that you may have datasets set up on this sled, but they
may not match the ones requested by the supplied configuration.\n
To re-initialize this sled:
- Disable all Oxide services
- Delete all partitions within the attached zpool
- Delete all datasets within the attached zpool
- Delete the configuration file ({})
- Restart the sled agent",
rss_config_path.to_string_lossy()
Expand Down Expand Up @@ -143,11 +143,11 @@ impl ServiceInner {
self.log.new(o!("SledAgentClient" => request.sled_address)),
);

info!(self.log, "sending partition requests...");
for partition in &request.partitions {
info!(self.log, "sending dataset requests...");
for dataset in &request.datasets {
let filesystem_put = || async {
info!(self.log, "creating new filesystem: {:?}", partition);
client.filesystem_put(&partition.clone().into())
info!(self.log, "creating new filesystem: {:?}", dataset);
client.filesystem_put(&dataset.clone().into())
.await
.map_err(BackoffError::transient)?;
Ok::<
Expand All @@ -172,7 +172,7 @@ impl ServiceInner {

// Issue service initialization requests.
//
// Note that this must happen *after* the partition initialization,
// Note that this must happen *after* the dataset initialization,
// to ensure that CockroachDB has been initialized before Nexus
// starts.
futures::future::join_all(
Expand Down
6 changes: 3 additions & 3 deletions sled-agent/src/sled_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl From<Error> for omicron_common::api::external::Error {
///
/// Contains both a connection to the Nexus, as well as managed instances.
pub struct SledAgent {
// Component of Sled Agent responsible for storage and partition management.
// Component of Sled Agent responsible for storage and dataset management.
storage: StorageManager,

// Component of Sled Agent responsible for managing Propolis instances.
Expand Down Expand Up @@ -182,11 +182,11 @@ impl SledAgent {
pub async fn filesystem_ensure(
&self,
zpool_uuid: Uuid,
partition_kind: DatasetKind,
dataset_kind: DatasetKind,
address: SocketAddr,
) -> Result<(), Error> {
self.storage
.upsert_filesystem(zpool_uuid, partition_kind, address)
.upsert_filesystem(zpool_uuid, dataset_kind, address)
.await?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion sled-agent/src/storage_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ impl StorageWorker {
// If requested via the `do_format` parameter, may also initialize
// these resources.
//
// Returns the UUID attached to the underlying ZFS partition.
// Returns the UUID attached to the underlying ZFS dataset.
// Returns (was_inserted, Uuid).
async fn initialize_dataset_and_zone(
&self,
Expand Down
28 changes: 17 additions & 11 deletions smf/sled-agent/config-rss.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,44 @@
[[request]]
sled_address = "[fd00:1de::]:12345"

[[request.partition]]
# TODO(https://github.com/oxidecomputer/omicron/issues/732): Nexus
# should allocate crucible datasets.
[[request.dataset]]
zpool_uuid = "d462a7f7-b628-40fe-80ff-4e4189e2d62b"
address = "[fd00:1de::9]:32345"
partition_kind.type = "crucible"
dataset_kind.type = "crucible"

[[request.partition]]
[[request.dataset]]
zpool_uuid = "e4b4dc87-ab46-49fb-a4b4-d361ae214c03"
address = "[fd00:1de::10]:32345"
partition_kind.type = "crucible"
dataset_kind.type = "crucible"

[[request.partition]]
[[request.dataset]]
zpool_uuid = "f4b4dc87-ab46-49fb-a4b4-d361ae214c03"
address = "[fd00:1de::11]:32345"
partition_kind.type = "crucible"
dataset_kind.type = "crucible"

[[request.partition]]
[[request.dataset]]
zpool_uuid = "d462a7f7-b628-40fe-80ff-4e4189e2d62b"
address = "[fd00:1de::5]:32221"
partition_kind.type = "cockroach_db"
partition_kind.all_addresses = [
dataset_kind.type = "cockroach_db"
dataset_kind.all_addresses = [
"[fd00:1de::5]:32221",
]

[[request.partition]]
# TODO(https://github.com/oxidecomputer/omicron/issues/732): Nexus
# should allocate clickhouse datasets.
[[request.dataset]]
zpool_uuid = "d462a7f7-b628-40fe-80ff-4e4189e2d62b"
address = "[fd00:1de::8]:8123"
partition_kind.type = "clickhouse"
dataset_kind.type = "clickhouse"

[[request.service]]
name = "nexus"
addresses = [ "[fd00:1de::7]:12220", "[fd00:1de::7]:12221" ]

# TODO(https://github.com/oxidecomputer/omicron/issues/732): Nexus
# should allocate Oximeter services.
[[request.service]]
name = "oximeter"
addresses = [ "[fd00:1de::6]:12223" ]