Skip to content

Commit c1281a9

Browse files
authored
ingest new Propolis VM creation API (#7211)
Update Omicron to use the new Propolis VM creation API defined in oxidecomputer/propolis#813 and oxidecomputer/propolis#816. This API requires clients to pass instance specs to create new VMs and component replacement lists to migrate existing VMs. Construct these in sled agent for now; in the future this logic can move to Nexus and become part of a robust virtual platform abstraction. For now the goal is just to keep everything working for existing VMs while adapting to the new Propolis API. Slightly adjust the sled agent instance APIs so that Nexus specifies disks and boot orderings using sled-agent-defined types and not re-exported Propolis types. Finally, adapt Nexus to the fact that Crucible's `VolumeConstructionRequest` and `CrucibleOpts` types no longer appear in Propolis's generated client (and so don't appear in sled agent's client either). Instead, the `propolis-client` crate re-exports these types directly from its `crucible-client-types` dependency. For the most part, this involves updating `use` directives and storing `SocketAddr`s in their natively typed form instead of converting them to and from strings. Tests: cargo nextest, plus ad hoc testing in a dev cluster as described in the PR comments.
1 parent 6672f1f commit c1281a9

38 files changed

+799
-695
lines changed

Cargo.lock

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,10 @@ prettyplease = { version = "0.2.25", features = ["verbatim"] }
547547
proc-macro2 = "1.0"
548548
progenitor = "0.8.0"
549549
progenitor-client = "0.8.0"
550-
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "220a6f367c18f2452dbc4fa9086f3fe73b961739" }
551-
propolis_api_types = { git = "https://github.com/oxidecomputer/propolis", rev = "220a6f367c18f2452dbc4fa9086f3fe73b961739" }
552-
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "220a6f367c18f2452dbc4fa9086f3fe73b961739" }
553-
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "220a6f367c18f2452dbc4fa9086f3fe73b961739" }
550+
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "d4529fd8247386b422b78e1203315d5baea5ea8b" }
551+
propolis_api_types = { git = "https://github.com/oxidecomputer/propolis", rev = "d4529fd8247386b422b78e1203315d5baea5ea8b" }
552+
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "d4529fd8247386b422b78e1203315d5baea5ea8b" }
553+
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "d4529fd8247386b422b78e1203315d5baea5ea8b" }
554554
proptest = "1.5.0"
555555
qorb = "0.2.1"
556556
quote = "1.0"

clients/sled-agent-client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ omicron-uuid-kinds.workspace = true
1717
omicron-workspace-hack.workspace = true
1818
oxnet.workspace = true
1919
progenitor.workspace = true
20+
propolis-client.workspace = true
2021
regress.workspace = true
2122
reqwest = { workspace = true, features = [ "json", "rustls-tls", "stream" ] }
2223
schemars.workspace = true

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use serde::Serialize;
1212
use std::convert::TryFrom;
1313
use uuid::Uuid;
1414

15+
pub use propolis_client::{CrucibleOpts, VolumeConstructionRequest};
16+
1517
progenitor::generate_api!(
1618
spec = "../../openapi/sled-agent.json",
1719
derives = [schemars::JsonSchema, PartialEq],

dev-tools/ls-apis/tests/api_dependencies.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ Oximeter (client: oximeter-client)
6767
consumed by: omicron-nexus (omicron/nexus) via 2 paths
6868

6969
Propolis (client: propolis-client)
70-
consumed by: omicron-nexus (omicron/nexus) via 2 paths
71-
consumed by: omicron-sled-agent (omicron/sled-agent) via 1 path
70+
consumed by: omicron-nexus (omicron/nexus) via 3 paths
71+
consumed by: omicron-sled-agent (omicron/sled-agent) via 2 paths
7272

7373
Crucible Repair (client: repair-client)
7474
consumed by: crucible-downstairs (crucible/downstairs) via 1 path

dev-tools/omdb/src/bin/omdb/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ use omicron_uuid_kinds::InstanceUuid;
135135
use omicron_uuid_kinds::PhysicalDiskUuid;
136136
use omicron_uuid_kinds::PropolisUuid;
137137
use omicron_uuid_kinds::SledUuid;
138-
use sled_agent_client::types::VolumeConstructionRequest;
138+
use sled_agent_client::VolumeConstructionRequest;
139139
use std::borrow::Cow;
140140
use std::cmp::Ordering;
141141
use std::collections::BTreeMap;

nexus/db-queries/src/db/datastore/region_replacement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ mod test {
924924

925925
use crate::db::pub_test_utils::TestDatabase;
926926
use omicron_test_utils::dev;
927-
use sled_agent_client::types::VolumeConstructionRequest;
927+
use sled_agent_client::VolumeConstructionRequest;
928928

929929
#[tokio::test]
930930
async fn test_one_replacement_per_volume() {

nexus/db-queries/src/db/datastore/region_snapshot_replacement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ mod test {
13711371
use crate::db::pub_test_utils::TestDatabase;
13721372
use omicron_test_utils::dev;
13731373
use omicron_uuid_kinds::DatasetUuid;
1374-
use sled_agent_client::types::VolumeConstructionRequest;
1374+
use sled_agent_client::VolumeConstructionRequest;
13751375

13761376
#[tokio::test]
13771377
async fn test_one_replacement_per_volume() {

0 commit comments

Comments
 (0)