Skip to content

Commit c833176

Browse files
committed
Supply real volume data to propolis
Instance creation now can specify that existing disks be attached to the instance (disk creation during instance creation is not yet implemented). There's a few important changes here. Nexus will instruct the sled agent to send volume construction requests when it ensures the instance, and therefore has to build these requests. This is done in sdc_regions_ensure as regions are allocated. sic_create_instance_record no longer returns the runtime of an instance, but the instance's name. Importantly, the instance creation saga now calls Nexus' instance_set_runtime instead of duplicating the logic to call instance_put. Nexus' instance_set_runtime will populate the InstanceHardware with NICs and disks. Nexus' disk_set_runtime now *optionally* calls the sled agent's disk_put if the instance is running already, otherwise the disk will be attached as part of the instance ensure by specifying volume requests. request_body_max_bytes had to be increased to 1M because the volume requests could be arbitrarily large (and eventually, the cloud init bytes will add to the body size too).
1 parent c66d2f6 commit c833176

File tree

22 files changed

+1001
-89
lines changed

22 files changed

+1001
-89
lines changed

Cargo.lock

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

common/src/api/external/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ impl<T: ClientError> From<progenitor::progenitor_client::Error<T>> for Error {
296296
}
297297
}
298298

299+
impl From<serde_json::Error> for Error {
300+
fn from(e: serde_json::Error) -> Self {
301+
Error::internal_error(&e.to_string())
302+
}
303+
}
304+
299305
/// Like [`assert!`], except that instead of panicking, this function returns an
300306
/// `Err(Error::InternalError)` with an appropriate message if the given
301307
/// condition is not true.

common/src/api/external/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ impl Generation {
467467
assert!(next_gen <= u64::try_from(i64::MAX).unwrap());
468468
Generation(next_gen)
469469
}
470+
471+
pub fn get(&self) -> u64 {
472+
self.0
473+
}
470474
}
471475

472476
impl Display for Generation {

nexus/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ path = "../rpaths"
1111
anyhow = "1.0"
1212
async-bb8-diesel = { git = "https://github.com/oxidecomputer/async-bb8-diesel", rev = "c849b717be" }
1313
async-trait = "0.1.51"
14+
base64 = "0.13.0"
1415
bb8 = "0.7.1"
1516
cookie = "0.16"
16-
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "3e7e49eeb88fa8ad74375b0642aabd4224b1f2cb" }
17+
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "32e603bdc3b6e5eb6b880a2ddde7e05f043b5357" }
1718
# Tracking pending 2.0 version.
1819
diesel = { git = "https://github.com/diesel-rs/diesel", rev = "ce77c382", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] }
1920
futures = "0.3.21"

0 commit comments

Comments
 (0)