Skip to content
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

Fixes #9810 - IPMI facter extensions multichannel support #7

Closed
wants to merge 1 commit into from

Conversation

lzap
Copy link
Member

@lzap lzap commented Mar 18, 2015

This patch now fixes ipmi_facts and also add ipmi_N_facts (where N is channel
number) for those who would like to get information from multiple channels for
any reason.

Example run of facter with this patch on IBM server with IPMI on channel 1:

[root@ibm-x3655-01 ~]# FACTERLIB=/root facter | grep ipmi
ipmi_1_gateway => 10.16.71.254
ipmi_1_ipaddress => 10.16.68.91
ipmi_1_ipaddress_source => DHCP Address
ipmi_1_macaddress => 00:14:5e:5b:8c:8e
ipmi_1_subnet_mask => 255.255.248.0
ipmi_enabled => true
ipmi_gateway => 10.16.71.254
ipmi_ipaddress => 10.16.68.91
ipmi_ipaddress_source => DHCP Address
ipmi_macaddress => 00:14:5e:5b:8c:8e
ipmi_subnet_mask => 255.255.248.0

The same on HP box with IPMI on channel 2:

[root@hp-dl165g6-01 ~]# FACTERLIB=/root facter | grep ipmi
ipmi_2_gateway => 10.16.71.254
ipmi_2_ipaddress => 10.16.66.131
ipmi_2_ipaddress_source => DHCP Address
ipmi_2_macaddress => 00:25:b3:e6:5d:98
ipmi_2_subnet_mask => 255.255.248.0
ipmi_enabled => true
ipmi_gateway => 10.16.71.254
ipmi_ipaddress => 10.16.66.131
ipmi_ipaddress_source => DHCP Address
ipmi_macaddress => 00:25:b3:e6:5d:98
ipmi_subnet_mask => 255.255.248.0

@MHulan can you take a look?

@lzap
Copy link
Member Author

lzap commented Mar 27, 2015

@ares can you take a look please?

end if output

if attributes.keys.empty?
Facter.debug("Running ipmitool didn't give any information")
Copy link
Member

Choose a reason for hiding this comment

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

maybe update the message so we know for what channel we have no info

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, actually I've changed it and only report when the first channel was not yet found.

@ares
Copy link
Member

ares commented Mar 29, 2015

I didn't tested but except small nits it looks good to me. I'm not IPMI expert so I don't know whether it's reasonable to consider IPMI with low channels as default but I suppose it does not do any harm.

@lzap
Copy link
Member Author

lzap commented Apr 8, 2015

Thanks I will fix these and release 2.2.

@lzap
Copy link
Member Author

lzap commented Apr 9, 2015

Ok refactored a bit. Tested:

FACTERLIB=/root facter -d | grep ipmi
Running ipmitool on port 0 didn't give any information
Could not retrieve discovery_version: No such file or directory - /usr/share/fdi/VERSION
Could not retrieve discovery_release: No such file or directory - /usr/share/fdi/RELEASE
ipmi_1_gateway => 10.16.71.254
ipmi_1_ipaddress => 10.16.68.47
ipmi_1_ipaddress_source => DHCP Address
ipmi_1_macaddress => 00:1a:64:cc:36:e1
ipmi_1_subnet_mask => 255.255.248.0
ipmi_enabled => true
ipmi_gateway => 10.16.71.254
ipmi_ipaddress => 10.16.68.47
ipmi_ipaddress_source => DHCP Address
ipmi_macaddress => 00:1a:64:cc:36:e1
ipmi_subnet_mask => 255.255.248.0

Ignore the two errors, not related (testing it on non-discovery machine). @orrabin please merge at will.

@ohadlevy
Copy link
Member

ohadlevy commented Apr 9, 2015

I have a vague memory that we used these facts somewhere, maybe it was staypuft, @ares maybe remembers?

@ares
Copy link
Member

ares commented Apr 9, 2015

yes, these ipmi facts are used in staypuft and foreman has builtin support for them so similarly as it creates other interfaces, it can create bmc interface based on it

@ohadlevy
Copy link
Member

ohadlevy commented Apr 9, 2015 via email

@ares
Copy link
Member

ares commented Apr 9, 2015

I don't think so, my understanding is that ipmi_* are always set to first channel we found, ipmi_n_* are just additional if someone would need to read info from more channels. AFAIK Foreman currently support only one bmc interface per host.

@lzap
Copy link
Member Author

lzap commented Apr 9, 2015

@ohadlevy to give you some more context - this was created for Staypuft team, there is a downstream BZ link. They read it in their codebase. The only issue is that some HP boxes have IPMI on channel 2 instead of 1. This patch fixes it and reports correctly in ipmi_ facts (adding those special ipmi_N) just for case.

@lzap
Copy link
Member Author

lzap commented May 25, 2015

@stbenjam or @orrabin any chance you can take a look? I'd like to merge this and backport this downstream. Important patch, to test this you either need to boot image on hardware with BMC on 2nd channel, or to copy this file and use facter on a different (non-image) machine. I can provide you a hardware box if needed.

@lzap
Copy link
Member Author

lzap commented Jul 22, 2015

To test this: build and run discovery on IPMI enabled hardware. If you don't have any, I can provide you a shell on such a box and testing can be done manually running facter with this extension. I'd like to have this in the new fdi release. Thanks!

@stbenjam stbenjam self-assigned this Aug 14, 2015
@stbenjam
Copy link
Member

@lzap Yea, I'll need a hardware box with IPMI to test this, if you can give me access to one.

@fernandocarolo
Copy link

FWIW, I have a setup with several HP boxes that report IPMI on channel 2 and this patch has worked fine with them. It also doesn't seem to break anything on other machines that have a more traditional config with IPMI on channel 1.

@lzap
Copy link
Member Author

lzap commented Aug 27, 2015

Have you extended the beaker machine I reserved to you? @stbenjam ? :-)

@stbenjam
Copy link
Member

I know nothing about this... what beaker machine?

@lzap
Copy link
Member Author

lzap commented Aug 27, 2015

I know nothing about this... what beaker machine?

Hmm sent you an email with reservation.

Later,
Lukas #lzap Zapletal

@stbenjam
Copy link
Member

I only have the e-mail from a few minutes ago, but anyway I'll take a look when I have time

@stbenjam
Copy link
Member

stbenjam commented Sep 3, 2015

Tested and looks good. Merged as 4608b22, thanks @lzap!

@stbenjam stbenjam closed this Sep 3, 2015
@lzap lzap deleted the ipmi-multiport-support branch January 11, 2018 09:54
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