Skip to content

Commit 322d5b3

Browse files
committed
Add FMD fault inventory to sled-agent API
Exposes illumos Fault Management Daemon (FMD) data through the sled-agent inventory endpoint. This lets the control plane see diagnosed hardware/software faults on each sled. New API version 35 adds an `fmd: Option<FmdInventory>` field to `Inventory`. When present, it contains: - Cases: diagnosed faults with UUID, diagnostic code, URL, and the full event nvlist serialized as JSON - Resources: affected components with FMRI, fault status flags On illumos, sled-agent queries FMD on each inventory request. On non-illumos (sim, tests), the field is None. Database storage is not included — that's a follow-up.
1 parent 5c0b62d commit 322d5b3

40 files changed

Lines changed: 787 additions & 62 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ filetime = "0.2.26"
504504
flate2 = "1.1.2"
505505
float-ord = "0.3.2"
506506
flume = "0.11.1"
507+
fmd-adm = { git = "https://github.com/oxidecomputer/fmd-adm", rev = "fffb52212fb1e073e9f1b16761b3614af8b38063" }
508+
fmd-adm-sys = { git = "https://github.com/oxidecomputer/fmd-adm", rev = "fffb52212fb1e073e9f1b16761b3614af8b38063" }
507509
foreign-types = "0.3.2"
508510
fs-err = "3.1.1"
509511
futures = "0.3.31"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ progenitor::generate_api!(
6060
ExternalIpConfig = omicron_common::api::internal::shared::ExternalIpConfig,
6161
ExternalIpv4Config = omicron_common::api::internal::shared::ExternalIpv4Config,
6262
ExternalIpv6Config = omicron_common::api::internal::shared::ExternalIpv6Config,
63+
FmdCase = sled_agent_types_versions::latest::inventory::FmdCase,
64+
FmdInventory = sled_agent_types_versions::latest::inventory::FmdInventory,
65+
FmdResource = sled_agent_types_versions::latest::inventory::FmdResource,
6366
Generation = omicron_common::api::external::Generation,
6467
Hostname = omicron_common::api::external::Hostname,
6568
ImportExportPolicy = sled_agent_types_versions::latest::early_networking::ImportExportPolicy,

cockroach-admin/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ toml.workspace = true
3939

4040
omicron-workspace-hack.workspace = true
4141

42+
[target.'cfg(target_os = "illumos")'.dependencies]
43+
# See omicron-rpaths for more about the "fmd-adm-sys" dependency.
44+
fmd-adm-sys.workspace = true
45+
4246
[dev-dependencies]
4347
expectorate.workspace = true
4448
nexus-test-utils.workspace = true

dev-tools/omdb/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ update-engine.workspace = true
9494
url.workspace = true
9595
uuid.workspace = true
9696

97+
[target.'cfg(target_os = "illumos")'.dependencies]
98+
# See omicron-rpaths for more about the "fmd-adm-sys" dependency.
99+
fmd-adm-sys.workspace = true
100+
97101
[dev-dependencies]
98102
camino-tempfile.workspace = true
99103
expectorate.workspace = true

dev-tools/omicron-dev/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ signal-hook-tokio.workspace = true
3131
tokio.workspace = true
3232
toml.workspace = true
3333

34+
[target.'cfg(target_os = "illumos")'.dependencies]
35+
# See omicron-rpaths for more about the "fmd-adm-sys" dependency.
36+
fmd-adm-sys.workspace = true
37+
3438
[dev-dependencies]
3539
expectorate.workspace = true
3640
omicron-dev-lib.workspace = true

end-to-end-tests/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name = "end-to-end-tests"
33
version = "0.1.0"
44
edition.workspace = true
55
license = "MPL-2.0"
6+
build = "build.rs"
67

78
[lints]
89
workspace = true
910

11+
[build-dependencies]
12+
omicron-rpaths.workspace = true
13+
1014
[dependencies]
1115
anstyle.workspace = true
1216
anyhow = { workspace = true, features = ["backtrace"] }
@@ -50,3 +54,7 @@ thiserror.workspace = true
5054
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
5155
toml.workspace = true
5256
uuid.workspace = true
57+
58+
[target.'cfg(target_os = "illumos")'.dependencies]
59+
# See omicron-rpaths for more about the "fmd-adm-sys" dependency.
60+
fmd-adm-sys.workspace = true

end-to-end-tests/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// See omicron-rpaths for documentation.
6+
// NOTE: This file MUST be kept in sync with the other build.rs files in this
7+
// repository.
8+
fn main() {
9+
omicron_rpaths::configure_default_omicron_rpaths();
10+
}

nexus/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ omicron-workspace-hack.workspace = true
164164
omicron-uuid-kinds.workspace = true
165165
zip = { workspace = true, features = ["jiff-02"] }
166166

167+
[target.'cfg(target_os = "illumos")'.dependencies]
168+
# See omicron-rpaths for more about the "fmd-adm-sys" dependency.
169+
fmd-adm-sys.workspace = true
170+
167171
[dev-dependencies]
168172
async-bb8-diesel.workspace = true
169173
camino-tempfile.workspace = true

nexus/db-queries/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ omicron-workspace-hack.workspace = true
8484
# only enabled during tests or via the `testing` feature
8585
omicron-test-utils = { workspace = true, optional = true }
8686

87+
[target.'cfg(target_os = "illumos")'.dependencies]
88+
# See omicron-rpaths for more about the "fmd-adm-sys" dependency.
89+
fmd-adm-sys.workspace = true
90+
8791
[features]
8892
# Enable to export `TestDatabase`
8993
testing = ["omicron-test-utils"]

0 commit comments

Comments
 (0)