Skip to content

Conversation

@mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Oct 28, 2025

Ignition commands in faux-mgs require specifying an "ignition target", which has to be looked up in RFD 144 § Switch port map. This isn't the same as cubby number, which is annoying.

This PR makes it easier to deal with:

Get the ignition state for a port (only valid if the SP is an ignition controller)

Usage: faux-mgs --interface <INTERFACE> ignition [OPTIONS]

Options:
  -t, --target <TARGET>    Ignition target
  -c, --cubby <CUBBY>      Sled cubby (0-31)
  -s, --sidecar <SIDECAR>  Sidecar ('local' or 'peer')
  -p, --psc <PSC>          PSC index (0-1)
  -a, --all                All targets
  -h, --help               Print help

This set of arguments is common to ignition, ignition-link-events, clear-ignition-link-events; ignition-command supports all the flags except --all.

Opening as a draft because racktest uses faux-mgs ignition all here, and we should figure out how to coordinate with its release. We could keep all as a special-cased target (instead of --all), but it's kinda annoying...

@mkeeter mkeeter requested a review from jgallagher October 28, 2025 17:36
/// `IgnitionSelector` that also supports `--all`
#[derive(Clone, Debug, clap::Args)]
pub struct IgnitionBulkSelector {
#[clap(flatten)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this preclude having a conficts_with_all = ["all"]? Could we get that effect by making IgnitionBulkSelector an enum, or would that force us to have a subcommand to specify the variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I switched to using argument groups, so you get exactly-one semantics:

Get the ignition state for a port (only valid if the SP is an ignition controller)

Usage: faux-mgs --interface <INTERFACE> ignition <--target <TARGET>|--cubby <CUBBY>|--sidecar <SIDECAR>|--psc <PSC>|--all|COMPAT>

Arguments:
  [COMPAT]  'all' or a target number (backwards-compatibility shim)

Options:
  -t, --target <TARGET>    Ignition target
  -c, --cubby <CUBBY>      Sled cubby (0-31)
  -s, --sidecar <SIDECAR>  Sidecar ('local' or 'peer')
  -p, --psc <PSC>          PSC index (0-1)
  -a, --all                All targets
  -h, --help               Print help

@mkeeter mkeeter marked this pull request as ready for review October 28, 2025 19:23
@mkeeter
Copy link
Contributor Author

mkeeter commented Oct 28, 2025

After chatting with @jclulow, I restored the support for faux-mgs ignition all and faux-mgs ignition [integer]. The former is used in racktest; I can't find any evidence for the latter being used in scripts.

Due to clap's limitations on optional arguments, I can't support both faux-mgs ignition-command --cubby=0 power-on and faux-mgs ignition-command 0 power-on, so I'm going to break backwards compatibility here. Searching through the entire oxidecomputer organization, there are no uses of ignition-command, ignition-link-events, or clear-ignition-link-events.

@mkeeter mkeeter enabled auto-merge (squash) November 5, 2025 18:05
@mkeeter mkeeter merged commit e51e8ff into main Nov 5, 2025
12 checks passed
@mkeeter mkeeter deleted the mkeeter/ignition-selection branch November 5, 2025 18:10
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.

3 participants