diff --git a/Cargo.lock b/Cargo.lock index f1ae026d566..249b7c5ceac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,14 +256,12 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-bb8-diesel" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc03a2806f66f36513d65e0a7f34200382230250cadcf8a8397cfbe3f26b795" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/async-bb8-diesel?rev=ed7ab5ef0513ba303d33efd41d3e9e381169d59b#ed7ab5ef0513ba303d33efd41d3e9e381169d59b" dependencies = [ "async-trait", "bb8", "diesel", - "futures", "thiserror", "tokio", ] @@ -705,7 +703,7 @@ dependencies = [ name = "bootstrap-agent-api" version = "0.1.0" dependencies = [ - "dropshot 0.10.2-dev", + "dropshot", "nexus-client", "omicron-common", "omicron-uuid-kinds", @@ -975,7 +973,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "dropshot 0.10.2-dev", + "dropshot", "futures", "libc", "omicron-rpaths", @@ -1119,7 +1117,7 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" name = "clickhouse-admin-api" version = "0.1.0" dependencies = [ - "dropshot 0.10.2-dev", + "dropshot", "omicron-common", "omicron-uuid-kinds", "omicron-workspace-hack", @@ -1127,22 +1125,6 @@ dependencies = [ "serde", ] -[[package]] -name = "clickhouse-admin-types" -version = "0.1.0" -dependencies = [ - "anyhow", - "camino", - "camino-tempfile", - "derive_more", - "expectorate", - "omicron-common", - "omicron-workspace-hack", - "schemars", - "serde", - "serde_json", -] - [[package]] name = "clickward" version = "0.1.0" @@ -1178,7 +1160,7 @@ name = "cockroach-admin-api" version = "0.1.0" dependencies = [ "cockroach-admin-types", - "dropshot 0.10.2-dev", + "dropshot", "omicron-common", "omicron-uuid-kinds", "omicron-workspace-hack", @@ -1405,7 +1387,7 @@ name = "crdb-seed" version = "0.1.0" dependencies = [ "anyhow", - "dropshot 0.10.2-dev", + "dropshot", "omicron-test-utils", "omicron-workspace-hack", "slog", @@ -1557,7 +1539,7 @@ dependencies = [ "anyhow", "atty", "crucible-workspace-hack", - "dropshot 0.10.2-dev", + "dropshot", "nix 0.28.0", "rusqlite", "rustls-pemfile 1.0.4", @@ -1966,9 +1948,9 @@ checksum = "a7993efb860416547839c115490d4951c6d0f8ec04a3594d9dd99d50ed7ec170" [[package]] name = "diesel" -version = "2.2.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e13bab2796f412722112327f3e575601a3e9cdcbe426f0d30dbf43f3f5dc71" +checksum = "bf97ee7261bb708fa3402fa9c17a54b70e90e3cb98afb3dc8999d5512cb03f94" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -2122,7 +2104,7 @@ dependencies = [ "clap", "dns-server-api", "dns-service-client", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "hickory-client", "hickory-proto", @@ -2155,7 +2137,7 @@ name = "dns-server-api" version = "0.1.0" dependencies = [ "chrono", - "dropshot 0.10.2-dev", + "dropshot", "omicron-workspace-hack", "schemars", "serde", @@ -2228,52 +2210,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "dropshot" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a391eeedf8a75a188eb670327c704b7ab10eb2bb890e2ec0880dd21d609fb6e8" -dependencies = [ - "async-stream", - "async-trait", - "base64 0.22.1", - "bytes", - "camino", - "chrono", - "debug-ignore", - "dropshot_endpoint 0.10.1", - "form_urlencoded", - "futures", - "hostname 0.4.0", - "http 0.2.12", - "hyper 0.14.30", - "indexmap 2.4.0", - "multer", - "openapiv3", - "paste", - "percent-encoding", - "rustls 0.22.4", - "rustls-pemfile 2.1.3", - "schemars", - "scopeguard", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sha1", - "slog", - "slog-async", - "slog-bunyan", - "slog-json", - "slog-term", - "tokio", - "tokio-rustls 0.25.0", - "toml 0.8.19", - "uuid", - "version_check", - "waitgroup", -] - [[package]] name = "dropshot" version = "0.10.2-dev" @@ -2286,7 +2222,7 @@ dependencies = [ "camino", "chrono", "debug-ignore", - "dropshot_endpoint 0.10.2-dev", + "dropshot_endpoint", "form_urlencoded", "futures", "hostname 0.4.0", @@ -2320,19 +2256,6 @@ dependencies = [ "waitgroup", ] -[[package]] -name = "dropshot_endpoint" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9058c9c7e4a6b378cd12e71dc155bb15d0d4f8e1e6039ce2cf0a7c0c81043e33" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_tokenstream", - "syn 2.0.74", -] - [[package]] name = "dropshot_endpoint" version = "0.10.2-dev" @@ -2952,7 +2875,7 @@ dependencies = [ name = "gateway-api" version = "0.1.0" dependencies = [ - "dropshot 0.10.2-dev", + "dropshot", "gateway-types", "omicron-common", "omicron-uuid-kinds", @@ -3056,7 +2979,7 @@ name = "gateway-test-utils" version = "0.1.0" dependencies = [ "camino", - "dropshot 0.10.2-dev", + "dropshot", "gateway-messages", "gateway-types", "omicron-gateway", @@ -3693,7 +3616,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -4059,7 +3982,7 @@ name = "installinator-api" version = "0.1.0" dependencies = [ "anyhow", - "dropshot 0.10.2-dev", + "dropshot", "hyper 0.14.30", "installinator-common", "omicron-common", @@ -4127,7 +4050,7 @@ dependencies = [ "chrono", "dns-server", "dns-service-client", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "hickory-resolver", @@ -4154,7 +4077,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "dropshot 0.10.2-dev", + "dropshot", "hickory-resolver", "internal-dns", "omicron-common", @@ -4384,9 +4307,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "libdlpi-sys" @@ -4612,15 +4535,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "live-tests-macros" -version = "0.1.0" -dependencies = [ - "omicron-workspace-hack", - "quote", - "syn 2.0.74", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -4998,7 +4912,7 @@ dependencies = [ "base64 0.22.1", "chrono", "cookie 0.18.1", - "dropshot 0.10.2-dev", + "dropshot", "futures", "headers", "http 0.2.12", @@ -5055,7 +4969,7 @@ version = "0.1.0" dependencies = [ "anyhow", "camino", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "libc", "omicron-common", @@ -5138,6 +5052,7 @@ dependencies = [ "assert_matches", "async-bb8-diesel", "async-trait", + "bb8", "camino", "camino-tempfile", "chrono", @@ -5145,7 +5060,7 @@ dependencies = [ "db-macros", "diesel", "diesel-dtrace", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "gateway-client", @@ -5182,7 +5097,6 @@ dependencies = [ "pq-sys", "predicates", "pretty_assertions", - "qorb", "rand", "rcgen", "ref-cast", @@ -5204,7 +5118,6 @@ dependencies = [ "term", "thiserror", "tokio", - "url", "usdt", "uuid", ] @@ -5226,7 +5139,7 @@ dependencies = [ name = "nexus-internal-api" version = "0.1.0" dependencies = [ - "dropshot 0.10.2-dev", + "dropshot", "nexus-types", "omicron-common", "omicron-uuid-kinds", @@ -5482,7 +5395,7 @@ dependencies = [ "crucible-agent-client", "dns-server", "dns-service-client", - "dropshot 0.10.2-dev", + "dropshot", "futures", "gateway-messages", "gateway-test-utils", @@ -5492,7 +5405,6 @@ dependencies = [ "hyper 0.14.30", "illumos-utils", "internal-dns", - "nexus-client", "nexus-config", "nexus-db-queries", "nexus-sled-agent-shared", @@ -5541,7 +5453,7 @@ dependencies = [ "derive-where", "derive_more", "dns-service-client", - "dropshot 0.10.2-dev", + "dropshot", "futures", "gateway-client", "http 0.2.12", @@ -5866,8 +5778,7 @@ dependencies = [ "chrono", "clap", "clickhouse-admin-api", - "clickhouse-admin-types", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "http 0.2.12", "illumos-utils", @@ -5904,7 +5815,7 @@ dependencies = [ "cockroach-admin-api", "cockroach-admin-types", "csv", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "http 0.2.12", "illumos-utils", @@ -5946,7 +5857,7 @@ dependencies = [ "camino", "camino-tempfile", "chrono", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "hex", @@ -6014,7 +5925,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "libc", @@ -6054,7 +5965,7 @@ dependencies = [ "camino", "chrono", "clap", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "gateway-api", @@ -6072,7 +5983,6 @@ dependencies = [ "omicron-workspace-hack", "once_cell", "oximeter", - "oximeter-instruments", "oximeter-producer", "schemars", "serde", @@ -6092,38 +6002,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "omicron-live-tests" -version = "0.1.0" -dependencies = [ - "anyhow", - "assert_matches", - "dropshot 0.10.2-dev", - "futures", - "internal-dns", - "live-tests-macros", - "nexus-client", - "nexus-config", - "nexus-db-model", - "nexus-db-queries", - "nexus-reconfigurator-planning", - "nexus-reconfigurator-preparation", - "nexus-sled-agent-shared", - "nexus-types", - "omicron-common", - "omicron-rpaths", - "omicron-test-utils", - "omicron-workspace-hack", - "pq-sys", - "reqwest", - "serde", - "slog", - "slog-error-chain", - "textwrap", - "tokio", - "uuid", -] - [[package]] name = "omicron-nexus" version = "0.1.0" @@ -6150,7 +6028,7 @@ dependencies = [ "dns-server", "dns-service-client", "dpd-client", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "fatfs", "futures", @@ -6273,7 +6151,7 @@ dependencies = [ "crucible-agent-client", "csv", "diesel", - "dropshot 0.10.2-dev", + "dropshot", "dyn-clone", "expectorate", "futures", @@ -6436,7 +6314,7 @@ dependencies = [ "dns-server", "dns-service-client", "dpd-client", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "flate2", "flume", @@ -6521,7 +6399,7 @@ dependencies = [ "atomicwrites", "camino", "camino-tempfile", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "filetime", "gethostname", @@ -6622,7 +6500,7 @@ dependencies = [ "log", "managed", "memchr", - "mio 1.0.2", + "mio 0.8.11", "nix 0.28.0", "nom", "num-bigint-dig", @@ -6657,6 +6535,7 @@ dependencies = [ "similar", "slog", "smallvec 1.13.2", + "socket2 0.5.7", "spin 0.9.8", "string_cache", "subtle", @@ -6757,7 +6636,7 @@ dependencies = [ "clickhouse-admin-api", "cockroach-admin-api", "dns-server-api", - "dropshot 0.10.2-dev", + "dropshot", "fs-err", "gateway-api", "indent_write", @@ -6981,7 +6860,7 @@ name = "oximeter-api" version = "0.1.0" dependencies = [ "chrono", - "dropshot 0.10.2-dev", + "dropshot", "omicron-common", "omicron-workspace-hack", "schemars", @@ -7012,7 +6891,7 @@ dependencies = [ "camino", "chrono", "clap", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "hyper 0.14.30", @@ -7060,7 +6939,7 @@ dependencies = [ "clap", "clickward", "crossterm 0.28.1", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "futures", "highway", @@ -7102,7 +6981,7 @@ version = "0.1.0" dependencies = [ "cfg-if", "chrono", - "dropshot 0.10.2-dev", + "dropshot", "futures", "http 0.2.12", "hyper 0.14.30", @@ -7138,7 +7017,7 @@ dependencies = [ "anyhow", "chrono", "clap", - "dropshot 0.10.2-dev", + "dropshot", "internal-dns", "nexus-client", "omicron-common", @@ -8133,7 +8012,7 @@ dependencies = [ "atty", "base64 0.21.7", "clap", - "dropshot 0.10.2-dev", + "dropshot", "futures", "hyper 0.14.30", "progenitor", @@ -8220,29 +8099,6 @@ dependencies = [ "psl-types", ] -[[package]] -name = "qorb" -version = "0.0.1" -source = "git+https://github.com/oxidecomputer/qorb?branch=master#163a77838a3cfe8f7741d32e443f76d995b89df3" -dependencies = [ - "anyhow", - "async-trait", - "debug-ignore", - "derive-where", - "dropshot 0.10.1", - "futures", - "hickory-resolver", - "rand", - "schemars", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", - "tokio-tungstenite 0.23.1", - "tracing", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -8416,7 +8272,7 @@ dependencies = [ "camino-tempfile", "clap", "dns-service-client", - "dropshot 0.10.2-dev", + "dropshot", "expectorate", "humantime", "indexmap 2.4.0", @@ -9672,7 +9528,7 @@ name = "sled-agent-api" version = "0.1.0" dependencies = [ "camino", - "dropshot 0.10.2-dev", + "dropshot", "nexus-sled-agent-shared", "omicron-common", "omicron-uuid-kinds", @@ -10042,7 +9898,7 @@ dependencies = [ "anyhow", "async-trait", "clap", - "dropshot 0.10.2-dev", + "dropshot", "futures", "gateway-messages", "gateway-types", @@ -10766,27 +10622,28 @@ dependencies = [ [[package]] name = "tokio" -version = "1.39.3" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.2", + "mio 0.8.11", + "num_cpus", "parking_lot 0.12.2", "pin-project-lite", "signal-hook-registry", "socket2 0.5.7", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -10859,7 +10716,6 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", - "tokio-util", ] [[package]] @@ -10886,18 +10742,6 @@ dependencies = [ "tungstenite 0.21.0", ] -[[package]] -name = "tokio-tungstenite" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.23.0", -] - [[package]] name = "tokio-util" version = "0.7.11" @@ -11249,24 +11093,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "tungstenite" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.1.0", - "httparse", - "log", - "rand", - "sha1", - "thiserror", - "utf-8", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -11468,7 +11294,7 @@ dependencies = [ "clap", "debug-ignore", "display-error-chain", - "dropshot 0.10.2-dev", + "dropshot", "futures", "hex", "hubtools", @@ -11935,7 +11761,7 @@ version = "0.1.0" dependencies = [ "anyhow", "dpd-client", - "dropshot 0.10.2-dev", + "dropshot", "gateway-client", "maplit", "omicron-common", @@ -11991,7 +11817,7 @@ dependencies = [ "debug-ignore", "display-error-chain", "dpd-client", - "dropshot 0.10.2-dev", + "dropshot", "either", "expectorate", "flate2", @@ -12058,7 +11884,7 @@ name = "wicketd-api" version = "0.1.0" dependencies = [ "bootstrap-agent-client", - "dropshot 0.10.2-dev", + "dropshot", "gateway-client", "omicron-common", "omicron-passwords", @@ -12363,7 +12189,6 @@ version = "0.1.0" dependencies = [ "anyhow", "camino", - "camino-tempfile", "cargo_metadata", "cargo_toml", "clap", @@ -12372,7 +12197,6 @@ dependencies = [ "serde", "swrite", "tabled", - "textwrap", "toml 0.8.19", "usdt", ] @@ -12516,7 +12340,7 @@ dependencies = [ "anyhow", "camino", "clap", - "dropshot 0.10.2-dev", + "dropshot", "illumos-utils", "omicron-common", "omicron-sled-agent", diff --git a/Cargo.toml b/Cargo.toml index 8c247841323..cb30eb61eed 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 = "88c45eebf34027c3bc80e60a5f527738bcfaf16a" } +crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "88c45eebf34027c3bc80e60a5f527738bcfaf16a" } +crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "88c45eebf34027c3bc80e60a5f527738bcfaf16a" } +crucible-common = { git = "https://github.com/oxidecomputer/crucible", rev = "88c45eebf34027c3bc80e60a5f527738bcfaf16a" } csv = "1.3.0" curve25519-dalek = "4" datatest-stable = "0.2.9" @@ -501,8 +501,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 = "d3d01a178f7c92dafe5d91375320853dbc196af0" } +propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "d3d01a178f7c92dafe5d91375320853dbc196af0" } proptest = "1.5.0" qorb = { git = "https://github.com/oxidecomputer/qorb", branch = "master" } quote = "1.0" @@ -786,17 +786,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 90bf0bb16a7..a0f278ade03 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 bf61249fb17..e00af856c57 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 0317b43839e..4d045131da1 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 00000000000..c4b78edf2f2 --- /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 91ecca817de..38088acdb3e 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/sled-agent/src/instance.rs b/sled-agent/src/instance.rs index 33b2d0cf673..92ff07f76cf 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) => {