Skip to content

Added control for interface failover on IPMI#28

Open
jcpunk wants to merge 1 commit intojhoblitt:masterfrom
jcpunk:interface-controls
Open

Added control for interface failover on IPMI#28
jcpunk wants to merge 1 commit intojhoblitt:masterfrom
jcpunk:interface-controls

Conversation

@jcpunk
Copy link
Contributor

@jcpunk jcpunk commented Jul 11, 2016

These additions control IPMI device failover (at least on my systems). I've only got SuperMicro IPMI so I'm unclear how these commands respond on other IPMI devices.

validate_re($interface_type, '^dedicated$|^shared$|^failover$', 'Network interface type must be either dedicated, shared, or failover')

$interface_type_raw_command_code = '0x30 0x70 0x0c'
if $interface_type == 'dedicated' {
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be better as a case statement:

  case $interface_type {
    'dedicated': {
      # code
    }
    'shared': {
      # code
    }
    'failover': {
      # code
    }
    default: {
      fail('Unknown interface_type')
    }
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That does look nicer, I've updated my code and pushed a new commit.

@jcpunk jcpunk force-pushed the interface-controls branch from 7265ab1 to 6957c53 Compare July 12, 2016 14:17
@jhoblitt
Copy link
Owner

@jcpunk What brand of BMC are you working with? Let me see if I can dig up my notes on SM oem commands.

@elisiano
Copy link

He's using supermicro and we also have some of those.
I can confirm that in the past I had to run the same command (after reading the docs: http://www.supermicro.com/support/faqs/faq.cfm?faq=9829 )

@jhoblitt
Copy link
Owner

It looks like I have been using ipmitool raw 0x30 0x70 0x0c 1 1 but I'm unsure if this is translatable across different vendors.

@ripclawffb
Copy link
Contributor

I've tried this on Dell and I get errors. Maybe this can be an optional parameter? Or we could make a ipmi_raw defined type where you provide the raw command and expected output that way you can run any raw command.

On Tue, Jul 12, 2016 at 7:31 AM -0700, "Joshua Hoblitt" notifications@github.com wrote:

It looks like I have been using ipmitool raw 0x30 0x70 0x0c 1 1 but I'm unsure if this is translatable across different vendors.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#28 (comment)

@jhoblitt
Copy link
Owner

I'm OK with merging something SM specific but would request that there is a code comment calling this out. It shouldn't be very hard to add a fact with a BMC vendor ID to add support for additional brands with the interface in this PR.

Of course, this might be easier to handle in a native type.

@jhoblitt
Copy link
Owner

jhoblitt commented Jul 12, 2016

@ripclawffb Sort of surprisingly, I don't have bare metal access to a modern Dell. Do you know if interface switching can be done via oem commands or is a Dell specific utility required?

@jcpunk
Copy link
Contributor Author

jcpunk commented Jul 12, 2016

For building an abstraction for raw commands, a native type does sound rational.

While it would directly benefit me, I'm nervous about adding things that don't work everywhere....

@ripclawffb
Copy link
Contributor

Here's a cheat sheet that seems to work on the Dell. I just tested and verified.

http://www.theprojectbot.com/ipmitool-cheatsheet-and-configuring-drac-from-ipmitool/

Change the NIC settings to dedicated
#ipmitool raw 0x30 0x24 2
Change the NIC settings to shared
#ipmitool raw 0x30 0x24 0
Check the NIC settings
#ipmitool raw 0x30 0x25

@jcpunk
Copy link
Contributor Author

jcpunk commented Jul 12, 2016

Adding additional bits to the fire, it looks like ipmitool on some releases (1.8.17) supports ipmitool lan get which may take care of this.... Alas others do not (el6, el7)

@jhoblitt
Copy link
Owner

jhoblitt commented Apr 8, 2022

I realize it has been awhile... is this still a desired feature?

@jcpunk
Copy link
Contributor Author

jcpunk commented Apr 8, 2022

I'm still interested in some version of this behavior.

@jhoblitt
Copy link
Owner

jhoblitt commented Apr 9, 2022

I think I'm willing to accept this as exec statements but there needs to be some sort of guard logic to make sure raw commands aren't run on the wrong flavor of BMC.

@jcpunk jcpunk force-pushed the interface-controls branch from 6957c53 to db022ea Compare April 12, 2022 14:25
@jcpunk
Copy link
Contributor Author

jcpunk commented Apr 12, 2022

In theory I've rebased this off HEAD and gotten the tests sorted. In practice, I can't seem to run the unit tests locally.... I get a weird ruby error.

@jcpunk jcpunk force-pushed the interface-controls branch 4 times, most recently from fa1771d to e4d9bd6 Compare April 12, 2022 14:48
@jcpunk
Copy link
Contributor Author

jcpunk commented Apr 12, 2022

hmmm not sure why those tests are failing....

@jcpunk jcpunk force-pushed the interface-controls branch from e4d9bd6 to bbaac32 Compare February 27, 2026 16:29
@jcpunk
Copy link
Contributor Author

jcpunk commented Feb 27, 2026

I've rebased off HEAD with an updated module sync.

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.

5 participants