Skip to content

[omdb] Basic commands to access support bundles #7972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: sb-internal-api
Choose a base branch
from

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Apr 14, 2025

Testing somewhat manually:

$ cargo xtask omicron-dev run-all
...

# In another terminal...
$ export OMDB_NEXUS_URL=http://[::1]:12221

$ ./target/debug/omdb nexus -w support-bundles create
note: using Nexus URL http://[::1]:12221
created support bundle: 24c837af-dda4-4569-9baf-029bf9bd628d

 $ ./target/debug/omdb nexus support-bundles list
note: using Nexus URL http://[::1]:12221
ID                                   TIME_CREATED                   REASON_FOR_CREATION     REASON_FOR_FAILURE STATE  
24c837af-dda4-4569-9baf-029bf9bd628d 2025-04-15 22:54:25.182963 UTC Created by external API -                  Active


# It's expected that these are returning "_err.txt" variants -- the simulated sled agent returns "not implemented" for
# most of them.
$ ./target/debug/omdb nexus -w support-bundles get-index 24c837af-dda4-4569-9baf-029bf9bd628d
note: using Nexus URL http://[::1]:12221
bundle_id.txt
rack/
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/dladm_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/ipadm_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/nvmeadm_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/pargs_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/pfiles_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/pstack_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/sled.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/zfs_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/zoneadm_err.txt
rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/zpool_err.txt

# Grabbing the contents of a file, dumping it to stdout
$ ./target/debug/omdb nexus -w support-bundles get-file 24c837af-dda4-4569-9baf-029bf9bd628d rack/c19a698f-c6f9-4a17-ae30-20d711b8f7dc/sled/b6d65341-167c-41df-9b5c-41cded99c229/sled.txt
note: using Nexus URL http://[::1]:12221
Sled { identity: SledIdentity { id: b6d65341-167c-41df-9b5c-41cded99c229, time_created: 2025-04-15T22:54:05.449256Z, time_modified: 2025-04-15T22:54:05.449256Z }, time_deleted: None, rcgen: Generation(Generation(10)), rack_id: c19a698f-c6f9-4a17-ae30-20d711b8f7dc, is_scrimlet: true, serial_number: "sim-b6d65341", part_number: "Unknown", revision: SqlU32(0), usable_hardware_threads: SqlU32(16), usable_physical_ram: ByteCount(ByteCount(34359738368)), reservoir_size: ByteCount(ByteCount(17179869184)), ip: ::1, port: SqlU16(46313), last_used_address: ::ffff, policy: InService, state: Active, sled_agent_gen: Generation(Generation(1)), repo_depot_port: SqlU16(42437) }

Copy link
Contributor

@wfchandler wfchandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just a couple optional suggestions.

@@ -120,6 +122,8 @@ enum NexusCommands {
Sagas(SagasArgs),
/// interact with sleds
Sleds(SledsArgs),
/// interact with support bundles
SupportBundles(SupportBundleArgs),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support-bundles is a bit of a mouthful, WDYT about adding an alias?

Suggested change
SupportBundles(SupportBundleArgs),
#[command(visible_alias = "sb")]
SupportBundles(SupportBundleArgs),

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

#[derive(Debug, Args)]
struct SupportBundleFileArgs {
id: SupportBundleUuid,
path: Utf8PathBuf,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll eventually have non-text files in bundles, e.g. core dumps, SP dumps. An option to directly save the file would be useful for these.

Suggested change
path: Utf8PathBuf,
path: Utf8PathBuf,
output_path: Utf8PathBuf,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, also, removed utf8 parsing so the core dump cases can be passed through as regular binary files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants