From 5bf5f09545b7b74f809c099db5c0b315ea06f9be Mon Sep 17 00:00:00 2001 From: Zeeshan Lakhani Date: Tue, 3 Sep 2024 09:03:40 -0400 Subject: [PATCH] [network metrics] instance network interface schema (#6414) This is related to the ongoing work in [plumbing instance/guest metrics](https://github.com/oxidecomputer/propolis/issues/742) through to an oximeter producer in propolis. Includes: - Rewriting the comment for `trait Target` in Oximeter to not being prepped for deprecation, as it does come in handy for custom needs - The main differentiating field among instance network information here is `interface_id`, which is exposed to propolis via the client's `NetworkInterfaceRequest`. We currently match the `nic.slot` to the `port.slot` to pass which of the requested nics `interface_id` uuids are part of the request. ## Dependencies - [X] Propolis => https://github.com/oxidecomputer/propolis/pull/747 --- Cargo.lock | 53 +++++++---- Cargo.toml | 28 +++--- illumos-utils/src/opte/illumos.rs | 3 + illumos-utils/src/opte/non_illumos.rs | 3 + oximeter/instruments/src/kstat/link.rs | 2 +- .../schema/instance-network-interface.toml | 88 +++++++++++++++++++ oximeter/types/src/traits.rs | 23 ++--- package-manifest.toml | 16 ++-- sled-agent/src/instance.rs | 25 +++++- workspace-hack/Cargo.toml | 8 -- 10 files changed, 187 insertions(+), 62 deletions(-) create mode 100644 oximeter/oximeter/schema/instance-network-interface.toml diff --git a/Cargo.lock b/Cargo.lock index 75336496e9..d9524a6df9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -969,6 +969,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "ch-dev" version = "0.1.0" @@ -1536,7 +1542,7 @@ dependencies = [ [[package]] name = "crucible-agent-client" version = "0.0.1" -source = "git+https://github.com/oxidecomputer/crucible?rev=e58ca3693cb9ce0438947beba10e97ee38a0966b#e58ca3693cb9ce0438947beba10e97ee38a0966b" +source = "git+https://github.com/oxidecomputer/crucible?rev=eab46702b6a43ff558672462dea3eb5ff7b8a0e6#eab46702b6a43ff558672462dea3eb5ff7b8a0e6" dependencies = [ "anyhow", "chrono", @@ -1552,13 +1558,13 @@ dependencies = [ [[package]] name = "crucible-common" version = "0.0.1" -source = "git+https://github.com/oxidecomputer/crucible?rev=e58ca3693cb9ce0438947beba10e97ee38a0966b#e58ca3693cb9ce0438947beba10e97ee38a0966b" +source = "git+https://github.com/oxidecomputer/crucible?rev=eab46702b6a43ff558672462dea3eb5ff7b8a0e6#eab46702b6a43ff558672462dea3eb5ff7b8a0e6" dependencies = [ "anyhow", "atty", "crucible-workspace-hack", "dropshot 0.10.2-dev", - "nix 0.28.0", + "nix 0.29.0", "rusqlite", "rustls-pemfile 1.0.4", "schemars", @@ -1582,7 +1588,7 @@ dependencies = [ [[package]] name = "crucible-pantry-client" version = "0.0.1" -source = "git+https://github.com/oxidecomputer/crucible?rev=e58ca3693cb9ce0438947beba10e97ee38a0966b#e58ca3693cb9ce0438947beba10e97ee38a0966b" +source = "git+https://github.com/oxidecomputer/crucible?rev=eab46702b6a43ff558672462dea3eb5ff7b8a0e6#eab46702b6a43ff558672462dea3eb5ff7b8a0e6" dependencies = [ "anyhow", "chrono", @@ -1599,7 +1605,7 @@ dependencies = [ [[package]] name = "crucible-smf" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/crucible?rev=e58ca3693cb9ce0438947beba10e97ee38a0966b#e58ca3693cb9ce0438947beba10e97ee38a0966b" +source = "git+https://github.com/oxidecomputer/crucible?rev=eab46702b6a43ff558672462dea3eb5ff7b8a0e6#eab46702b6a43ff558672462dea3eb5ff7b8a0e6" dependencies = [ "crucible-workspace-hack", "libc", @@ -5616,7 +5622,19 @@ checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.6.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", + "libc", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases 0.2.1", "libc", ] @@ -6234,7 +6252,7 @@ dependencies = [ "pq-sys", "pretty_assertions", "progenitor-client", - "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9)", + "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138)", "rand", "rcgen", "ref-cast", @@ -6489,7 +6507,7 @@ dependencies = [ "oximeter-producer", "oxnet", "pretty_assertions", - "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9)", + "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138)", "propolis-mock-server", "rand", "rcgen", @@ -6639,7 +6657,6 @@ dependencies = [ "managed", "memchr", "mio 1.0.2", - "nix 0.28.0", "nom", "num-bigint-dig", "num-integer", @@ -8096,7 +8113,7 @@ dependencies = [ [[package]] name = "propolis-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9#24a74d0c76b6a63961ecef76acb1516b6e66c5c9" +source = "git+https://github.com/oxidecomputer/propolis?rev=6dceb9ef69c217cb78a2018bbedafbc19f6ec1af#6dceb9ef69c217cb78a2018bbedafbc19f6ec1af" dependencies = [ "async-trait", "base64 0.21.7", @@ -8110,14 +8127,14 @@ dependencies = [ "slog", "thiserror", "tokio", - "tokio-tungstenite 0.21.0", + "tokio-tungstenite 0.20.1", "uuid", ] [[package]] name = "propolis-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=6dceb9ef69c217cb78a2018bbedafbc19f6ec1af#6dceb9ef69c217cb78a2018bbedafbc19f6ec1af" +source = "git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138#d45b4898137762074b7f7435b64fd2ccf41f4138" dependencies = [ "async-trait", "base64 0.21.7", @@ -8131,14 +8148,14 @@ dependencies = [ "slog", "thiserror", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite 0.21.0", "uuid", ] [[package]] name = "propolis-mock-server" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9#24a74d0c76b6a63961ecef76acb1516b6e66c5c9" +source = "git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138#d45b4898137762074b7f7435b64fd2ccf41f4138" dependencies = [ "anyhow", "atty", @@ -8148,7 +8165,7 @@ dependencies = [ "futures", "hyper 0.14.30", "progenitor", - "propolis_types 0.0.0 (git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9)", + "propolis_types 0.0.0 (git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138)", "rand", "reqwest", "schemars", @@ -8180,7 +8197,7 @@ dependencies = [ [[package]] name = "propolis_types" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9#24a74d0c76b6a63961ecef76acb1516b6e66c5c9" +source = "git+https://github.com/oxidecomputer/propolis?rev=6dceb9ef69c217cb78a2018bbedafbc19f6ec1af#6dceb9ef69c217cb78a2018bbedafbc19f6ec1af" dependencies = [ "schemars", "serde", @@ -8189,7 +8206,7 @@ dependencies = [ [[package]] name = "propolis_types" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=6dceb9ef69c217cb78a2018bbedafbc19f6ec1af#6dceb9ef69c217cb78a2018bbedafbc19f6ec1af" +source = "git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138#d45b4898137762074b7f7435b64fd2ccf41f4138" dependencies = [ "schemars", "serde", @@ -9734,7 +9751,7 @@ dependencies = [ "omicron-uuid-kinds", "omicron-workspace-hack", "oxnet", - "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=24a74d0c76b6a63961ecef76acb1516b6e66c5c9)", + "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=d45b4898137762074b7f7435b64fd2ccf41f4138)", "rcgen", "schemars", "serde", diff --git a/Cargo.toml b/Cargo.toml index a870c52fe9..33098f0670 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -323,10 +323,10 @@ cookie = "0.18" criterion = { version = "0.5.1", features = [ "async_tokio" ] } crossbeam = "0.8" crossterm = { version = "0.28.1", features = ["event-stream"] } -crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" } -crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" } -crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" } -crucible-common = { git = "https://github.com/oxidecomputer/crucible", rev = "e58ca3693cb9ce0438947beba10e97ee38a0966b" } +crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6"} +crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6"} +crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6"} +crucible-common = { git = "https://github.com/oxidecomputer/crucible", rev = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6"} csv = "1.3.0" curve25519-dalek = "4" datatest-stable = "0.2.9" @@ -503,8 +503,8 @@ proc-macro2 = "1.0" progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" } progenitor-client = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" } bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "24a74d0c76b6a63961ecef76acb1516b6e66c5c9" } -propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "24a74d0c76b6a63961ecef76acb1516b6e66c5c9" } -propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "24a74d0c76b6a63961ecef76acb1516b6e66c5c9" } +propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "d45b4898137762074b7f7435b64fd2ccf41f4138" } +propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "d45b4898137762074b7f7435b64fd2ccf41f4138" } proptest = "1.5.0" qorb = { git = "https://github.com/oxidecomputer/qorb", branch = "master" } quote = "1.0" @@ -788,17 +788,19 @@ opt-level = 3 #dropshot = { path = "../dropshot/dropshot" } #[patch.crates-io] #steno = { path = "../steno" } -#[patch."https://github.com/oxidecomputer/propolis"] -#propolis-client = { path = "../propolis/lib/propolis-client" } -#propolis-mock-server = { path = "../propolis/bin/mock-server" } -#[patch."https://github.com/oxidecomputer/crucible"] -#crucible-agent-client = { path = "../crucible/agent-client" } -#crucible-pantry-client = { path = "../crucible/pantry-client" } -#crucible-smf = { path = "../crucible/smf" } +# [patch."https://github.com/oxidecomputer/propolis"] +# propolis-client = { path = "../propolis/lib/propolis-client" } +# propolis-mock-server = { path = "../propolis/bin/mock-server" } +# [patch."https://github.com/oxidecomputer/crucible"] +# crucible-agent-client = { path = "../crucible/agent-client" } +# crucible-pantry-client = { path = "../crucible/pantry-client" } +# crucible-smf = { path = "../crucible/smf" } #[patch.crates-io] #diesel = { path = "../../diesel/diesel" } #[patch."https://github.com/oxidecomputer/diesel-dtrace"] #diesel-dtrace = { path = "../diesel-dtrace" } +# [patch."https://github.com/oxidecomputer/falcon"] +# libfalcon = { path = "../falcon/lib" } # # Local client generation during development. diff --git a/illumos-utils/src/opte/illumos.rs b/illumos-utils/src/opte/illumos.rs index 90bf0bb16a..a0f278ade0 100644 --- a/illumos-utils/src/opte/illumos.rs +++ b/illumos-utils/src/opte/illumos.rs @@ -56,6 +56,9 @@ pub enum Error { #[error("Can't attach new ephemeral IP {0}, currently have {1}")] ImplicitEphemeralIpDetach(IpAddr, IpAddr), + + #[error("No matching NIC found for port {0} at slot {1}.")] + NoNicforPort(String, u32), } /// Delete all xde devices on the system. diff --git a/illumos-utils/src/opte/non_illumos.rs b/illumos-utils/src/opte/non_illumos.rs index bf61249fb1..e00af856c5 100644 --- a/illumos-utils/src/opte/non_illumos.rs +++ b/illumos-utils/src/opte/non_illumos.rs @@ -26,6 +26,9 @@ pub enum Error { #[error("Can't attach new ephemeral IP {0}, currently have {1}")] ImplicitEphemeralIpDetach(IpAddr, IpAddr), + + #[error("No matching NIC found for port {0} at slot {1}.")] + NoNicforPort(String, u32), } pub fn initialize_xde_driver( diff --git a/oximeter/instruments/src/kstat/link.rs b/oximeter/instruments/src/kstat/link.rs index 0317b43839..4d045131da 100644 --- a/oximeter/instruments/src/kstat/link.rs +++ b/oximeter/instruments/src/kstat/link.rs @@ -19,7 +19,7 @@ use oximeter::Sample; oximeter::use_timeseries!("sled-data-link.toml"); -// Helper function to extract the same kstat metrics from all link targets. +/// Helper function to extract the same kstat metrics from all link targets. fn extract_link_kstats( target: &T, named_data: &Named, diff --git a/oximeter/oximeter/schema/instance-network-interface.toml b/oximeter/oximeter/schema/instance-network-interface.toml new file mode 100644 index 0000000000..c4b78edf2f --- /dev/null +++ b/oximeter/oximeter/schema/instance-network-interface.toml @@ -0,0 +1,88 @@ +format_version = 1 + +[target] +name = "instance_network_interface" +description = "A network interface attached to a virtual machine instance" +authz_scope = "project" +versions = [ + { version = 1, fields = [ "interface_id", "instance_id", "project_id", "silo_id" ] }, +] + +[fields.interface_id] +type = "uuid" +description = "The ID of the network interface" + +[fields.instance_id] +type = "uuid" +description = "The ID of the virtual machine instance this network interface is attached to" + +[fields.project_id] +type = "uuid" +description = "The ID of the project containing the virtual machine instance this network interface is attached to" + +[fields.silo_id] +type = "uuid" +description = "The ID of the silo containing the virtual machine instance this network interface is attached to" + +[[metrics]] +name = "bytes_sent" +description = "Total number of bytes sent on the network interface" +units = "bytes" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] + +[[metrics]] +name = "bytes_received" +description = "Total number of bytes received on the network interface" +units = "bytes" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] + +[[metrics]] +name = "packets_sent" +description = "Total number of packets sent on the network interface" +units = "count" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] + +[[metrics]] +name = "packets_received" +description = "Total number of packets received on the network interface" +units = "count" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] + +[[metrics]] +name = "packets_dropped" +description = "Number of packets dropped on the RX queue of the network interface" +units = "count" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] + +[[metrics]] +name = "errors_sent" +description = "Number of errors encountered when sending on the network interface" +units = "count" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] + +[[metrics]] +name = "errors_received" +description = "Number of errors encountered when receiving on the network interface" +units = "count" +datum_type = "cumulative_u64" +versions = [ + { added_in = 1, fields = [] } +] diff --git a/oximeter/types/src/traits.rs b/oximeter/types/src/traits.rs index 91ecca817d..38088acdb3 100644 --- a/oximeter/types/src/traits.rs +++ b/oximeter/types/src/traits.rs @@ -23,12 +23,14 @@ use std::num::NonZeroU8; use std::ops::Add; use std::ops::AddAssign; -/// The `Target` trait identifies a source of metric data by a sequence of fields. -/// -/// A target is a single source of metric data, identified by a sequence of named and typed field -/// values. Users can write a single struct definition and derive this trait. The methods here -/// provide some introspection into the struct, listing its fields and their values. The struct -/// definition can be thought of as a schema, and an instance of that struct as identifying an +/// The `Target` trait identifies a source of metric data by a sequence of +/// fields. +/// +/// A target is a single source of metric data, identified by a sequence of +/// named and typed field values. Users can write a single struct definition and +/// derive this trait. The methods here provide some introspection into the +/// struct, listing its fields and their values. The struct definition can be +/// thought of as a schema, and an instance of that struct as identifying an /// individual target. /// /// Target fields may have one of a set of supported types: @@ -85,10 +87,11 @@ use std::ops::AddAssign; /// } /// ``` /// -/// **Important:** Deriving this trait is deprecated, and will be removed in the -/// future. Instead, define your timeseries schema through the TOML format -/// described in [the crate documentation](crate), and use the code -/// generated by the `use_timeseries` macro. +/// **Important:** Typically, you should define your timeseries schema through +/// the TOML format described in [the crate documentation](crate), and use the +/// code generated by the `use_timeseries` macro. However, if you need to handle +/// custom sampling logic and must define custom field definitions not published +/// as part of the target schema, you can implement this trait. pub trait Target { /// Return the name of the target, which is the snake_case form of the struct's name. fn name(&self) -> &'static str; diff --git a/package-manifest.toml b/package-manifest.toml index cab3c1877e..ec5c14dab2 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -569,10 +569,10 @@ only_for_targets.image = "standard" # 3. Use source.type = "manual" instead of "prebuilt" source.type = "prebuilt" source.repo = "crucible" -source.commit = "e58ca3693cb9ce0438947beba10e97ee38a0966b" +source.commit = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image//crucible.sha256.txt -source.sha256 = "18dc942935af51ea03161498c44b56bb85b4a5d2499a5ff19ba87c0284e34742" +source.sha256 = "fbc1482e41c92120cc79611fe7774752f1ed2ecef17a8adcd00ab4099f08821f" output.type = "zone" output.intermediate_only = true @@ -581,10 +581,10 @@ service_name = "crucible_pantry_prebuilt" only_for_targets.image = "standard" source.type = "prebuilt" source.repo = "crucible" -source.commit = "e58ca3693cb9ce0438947beba10e97ee38a0966b" +source.commit = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image//crucible-pantry.sha256.txt -source.sha256 = "9067426bb77ce091116a034a19abb96ecd98cc8ac228a147bd3c3283e40d527d" +source.sha256 = "7c7ea8cd3895687e3bdae2eef6dce57f11c937ce0c52bd6779c897cb6462d387" output.type = "zone" output.intermediate_only = true @@ -598,10 +598,10 @@ service_name = "crucible_dtrace" only_for_targets.image = "standard" source.type = "prebuilt" source.repo = "crucible" -source.commit = "e58ca3693cb9ce0438947beba10e97ee38a0966b" +source.commit = "eab46702b6a43ff558672462dea3eb5ff7b8a0e6" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image//crucible-dtrace.sha256.txt -source.sha256 = "660e04fdcbacda66e5012ba4ba6cf1022a4d80453da165b1507d97b7386f2691" +source.sha256 = "983a6b8a0add7dc19c8dde1e0675a5fe160dc92b25cae5817d4664a7a1aff18f" output.type = "tarball" # Refer to @@ -612,10 +612,10 @@ service_name = "propolis-server" only_for_targets.image = "standard" source.type = "prebuilt" source.repo = "propolis" -source.commit = "24a74d0c76b6a63961ecef76acb1516b6e66c5c9" +source.commit = "d45b4898137762074b7f7435b64fd2ccf41f4138" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/propolis/image//propolis-server.sha256.txt -source.sha256 = "e716c1fa5c4ee402f8e3a63f667bbcda744f378305f91ff333bebafe5c20d60b" +source.sha256 = "123b16bed8269c9fec93f462e8284567b86f42230401c7dec8fe68c63a811950" output.type = "zone" [package.mg-ddm-gz] diff --git a/sled-agent/src/instance.rs b/sled-agent/src/instance.rs index 33b2d0cf67..92ff07f76c 100644 --- a/sled-agent/src/instance.rs +++ b/sled-agent/src/instance.rs @@ -671,11 +671,28 @@ impl InstanceRunner { ) -> Result<(), Error> { let nics = running_zone .opte_ports() - .map(|port| propolis_client::types::NetworkInterfaceRequest { - name: port.name().to_string(), - slot: propolis_client::types::Slot(port.slot()), + .map(|port| { + self.requested_nics + .iter() + // We expect to match NIC slots to OPTE port slots. + // Error out if we can't find a NIC for a port. + .position(|nic| nic.slot == port.slot()) + .ok_or(Error::Opte( + illumos_utils::opte::Error::NoNicforPort( + port.name().into(), + port.slot().into(), + ), + )) + .map(|pos| { + let nic = &self.requested_nics[pos]; + propolis_client::types::NetworkInterfaceRequest { + interface_id: nic.id, + name: port.name().to_string(), + slot: propolis_client::types::Slot(port.slot()), + } + }) }) - .collect(); + .collect::, _>>()?; let migrate = match migrate { Some(params) => { diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index ab1f8b971e..788f349f73 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -238,7 +238,6 @@ zeroize = { version = "1.7.0", features = ["std", "zeroize_derive"] } dof = { version = "0.3.0", default-features = false, features = ["des"] } linux-raw-sys = { version = "0.4.13", default-features = false, features = ["elf", "errno", "general", "ioctl", "no_std", "std", "system"] } mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } @@ -247,35 +246,30 @@ signal-hook-mio = { version = "0.2.4", default-features = false, features = ["su dof = { version = "0.3.0", default-features = false, features = ["des"] } linux-raw-sys = { version = "0.4.13", default-features = false, features = ["elf", "errno", "general", "ioctl", "no_std", "std", "system"] } mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } [target.x86_64-apple-darwin.dependencies] mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } [target.x86_64-apple-darwin.build-dependencies] mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } [target.aarch64-apple-darwin.dependencies] mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } [target.aarch64-apple-darwin.build-dependencies] mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } @@ -283,7 +277,6 @@ signal-hook-mio = { version = "0.2.4", default-features = false, features = ["su [target.x86_64-unknown-illumos.dependencies] dof = { version = "0.3.0", default-features = false, features = ["des"] } mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] } @@ -292,7 +285,6 @@ toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", featu [target.x86_64-unknown-illumos.build-dependencies] dof = { version = "0.3.0", default-features = false, features = ["des"] } mio = { version = "1.0.2", features = ["net", "os-ext"] } -nix = { version = "0.28.0", features = ["feature", "fs", "ioctl", "poll", "signal", "term", "uio"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.34", features = ["fs", "stdio", "system", "termios"] } signal-hook-mio = { version = "0.2.4", default-features = false, features = ["support-v0_8", "support-v1_0"] }