Skip to content

Add DisableDualMachineConnections to switches - #212

Draft
mwindower wants to merge 1 commit into
mainfrom
disable-dual-machine-connections
Draft

mwindower wants to merge 1 commit into
mainfrom
disable-dual-machine-connections

Conversation

@mwindower

Copy link
Copy Markdown

Description

Adds a per-switch field disable_dual_machine_connections (default false), as suggested in metal-stack/metal-apiserver#360 (comment):

  • metalstack.api.v2.Switch.disable_dual_machine_connections
  • metalstack.admin.v2.SwitchServiceUpdateRequest.disable_dual_machine_connections (optional), so an operator can toggle it

When set, metal-apiserver lets a machine register while connected to this switch only, e.g. in single-leaf partitions such as hardware labs. With the default, machines must still be connected to exactly two switches. The implementation is in metal-stack/metal-apiserver#360.

Used AI-Tools ✨

  • Claude Code

🤖 Generated with Claude Code

Lets an operator allow machines to be connected to a single switch, e.g.
in single-leaf partitions. Default false keeps the requirement of exactly
two switches. Settable via the admin SwitchService Update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@metal-robot metal-robot Bot added this to Development Nov 6, 2026
// SwitchOs is the OS running on the switch.
optional metalstack.api.v2.SwitchOS os = 10;
// DisableDualMachineConnections allows machines to be connected to this switch only, without a twin switch.
optional bool disable_dual_machine_connections = 11;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO adding boolean flags to a API would end up in a bunch of such. I wonder if a Slice of Feature Flags would be more appropriate and extendable.

rough sample located in api/v2/switch.proto:

enum SwitchFeature {
  SWITCH_FEATURE_UNSPECIFIED = 0;
  SWITCH_FEATURE_SINGLE_MACHINE_CONNECTION_ALLOWED = 1;
  SWITCH_FEATURE_DISABLE_ZTP = 2;
}

# in admin|api/v2/switch.proto
message Switch {
.....
  repeated metalstack.api.v2.SwitchFeature features = 11;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After thinking again, we should double check if this is not better a feature of a Port, especially with MEP-17 in Mind.

Overall, making this an API exposed feature flag i like much more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants