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

Support rinv command for Intelligent PDU #4581

Merged
merged 2 commits into from
Jan 5, 2018
Merged

Support rinv command for Intelligent PDU #4581

merged 2 commits into from
Jan 5, 2018

Conversation

cxhong
Copy link
Contributor

@cxhong cxhong commented Dec 21, 2017

Add code to support pdudiscover and rinv command for Intelligent PDU

# pdudiscover --range 172.21.253.104-105
Discovering pdu using snmpwalk for 172.21.253.104-105 .....
ip              name                    vendor                                                  mac
------------    ------------            ------------                                            ------------
172.21.253.104  IBM PDU                 IBM PDU 46W1608(46M4003) OPDP_sIBM_v01.3_2 FreeRTOS_4.2.1 Lwip_1.2.0    00:18:23:05:84:0e
172.21.253.105  IBM PDU-001823058410    IBM PDU 46W1608(46M4003) OPDP_sIBM_v01.3_2 FreeRTOS_4.2.1 Lwip_1.2.0    00:18:23:05:84:10
pdu discovered and matched: IBM PDU to f6pdu15
pdu discovered and matched: IBM PDU-001823058410 to f6pdu16

Currently, we are support following info for rinv command. we can add more based on users request.

# rinv f6pdu15
f6pdu15: **********************************************************
f6pdu15: MFR Info List
f6pdu15: **********************************************************
f6pdu15: PDU Software Version: "OPDP_sIBM_v01.3_2"
f6pdu15: PDU Machine Type: "1U"
f6pdu15: PDU Model Number: "dPDU4230"
f6pdu15: PDU Part Number: "46W1608"
f6pdu15: PDU Name: "IBM PDU"
f6pdu15: PDU Serial Number: "4571S5"
f6pdu15: PDU Description: "description"
f6pdu15: **********************************************************

@xcatbot
Copy link

xcatbot commented Dec 21, 2017

CI CHECK RESULT : > PR FORMAT CORRECT> BUILD SUCCESSFUL > INSTALL XCAT SUCCESSFUL> CODE SYNTAX CORRECT> FAST REGRESSION TEST Successful: Totalcase 215 Pass 215 failed 0

@@ -913,7 +913,7 @@ sub showMFR {

foreach my $pdu (@$noderange) {
unless ($pduhash->{$pdu}->[0]->{pdutype} eq "crpdu") {
Copy link

Choose a reason for hiding this comment

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

Shall we change to something like:

if (pdutype eq 'irpdu') {
    do 1;
} elsif (pdutype ne 'crpud') {
    do 2;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't want to create another sub function :), I can make changes if this is not acceptable, but I think it's clear for now.

next;
}
my $line = "**********************************************************";
xCAT::SvrUtils::sendmsg("$line", $callback,$pdu);
Copy link

Choose a reason for hiding this comment

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

It seems we don't need to output "$line, (MFR Info List), $line" for every node.

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's the current output for multiple nodes

# rinv f6pdu15,f6pdu16
f6pdu15: **********************************************************
f6pdu15: MFR Info List
f6pdu15: **********************************************************
f6pdu15: PDU Software Version: "OPDP_sIBM_v01.3_2"
f6pdu15: PDU Machine Type: "1U"
f6pdu15: PDU Model Number: "dPDU4230"
f6pdu15: PDU Part Number: "46W1608"
f6pdu15: PDU Name: "IBM PDU"
f6pdu15: PDU Serial Number: "4571S5"
f6pdu15: PDU Description: "description"
f6pdu15: **********************************************************
f6pdu16: **********************************************************
f6pdu16: MFR Info List
f6pdu16: **********************************************************
f6pdu16: PDU Software Version: "OPDP_sIBM_v01.3_2"
f6pdu16: PDU Machine Type: "1U"
f6pdu16: PDU Model Number: "dPDU4230"
f6pdu16: PDU Part Number: "46W1608"
f6pdu16: PDU Name: "IBM PDU"
f6pdu16: PDU Serial Number: "4571S9"
f6pdu16: PDU Description: "description"
f6pdu16: **********************************************************

do u think this will be better?

# rinv f6pdu15,f6pdu16
**********************************************************
MFR Info List
 **********************************************************
f6pdu15: PDU Software Version: "OPDP_sIBM_v01.3_2"
f6pdu15: PDU Machine Type: "1U"
f6pdu15: PDU Model Number: "dPDU4230"
f6pdu15: PDU Part Number: "46W1608"
f6pdu15: PDU Name: "IBM PDU"
f6pdu15: PDU Serial Number: "4571S5"
f6pdu15: PDU Description: "description"
**********************************************************
f6pdu16: PDU Software Version: "OPDP_sIBM_v01.3_2"
f6pdu16: PDU Machine Type: "1U"
f6pdu16: PDU Model Number: "dPDU4230"
f6pdu16: PDU Part Number: "46W1608"
f6pdu16: PDU Name: "IBM PDU"
f6pdu16: PDU Serial Number: "4571S9"
f6pdu16: PDU Description: "description"
**********************************************************

Copy link

Choose a reason for hiding this comment

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

I don't think we need to print out "*******"

mid05tor12cn02: BMC Firmware Product:   ibm-v2.0-0-r13.3-0-gd624923 (Active)*
mid05tor12cn02: HOST Firmware Product:   IBM-witherspoon-ibm-OP9_v1.19_1.90 (Active)*
mid05tor12cn02: HOST Firmware Product: -- additional info: buildroot-2017.08-8-g5e23247
mid05tor12cn02: HOST Firmware Product: -- additional info: capp-ucode-p9-dd2-v2
mid05tor12cn02: HOST Firmware Product: -- additional info: hostboot-binaries-b4606e0
mid05tor12cn02: HOST Firmware Product: -- additional info: hostboot-c646b78
mid05tor12cn02: HOST Firmware Product: -- additional info: linux-4.13.11-openpower1-p5bc6a1c
mid05tor12cn02: HOST Firmware Product: -- additional info: machine-xml-bcd4a40
mid05tor12cn02: HOST Firmware Product: -- additional info: occ-51965bd
mid05tor12cn02: HOST Firmware Product: -- additional info: op-build-v1.19-276-g91e7614
mid05tor12cn02: HOST Firmware Product: -- additional info: petitboot-v1.6.3-pd4b114c
mid05tor12cn02: HOST Firmware Product: -- additional info: sbe-6d7627a
mid05tor12cn02: HOST Firmware Product: -- additional info: skiboot-v5.9.4
mid05tor12cn05: BMC Firmware Product:   ibm-v2.0-0-r21-0-ge3cbb5a (Active)*
mid05tor12cn05: HOST Firmware Product:   IBM-witherspoon-ibm-OP9_v1.19_1.98 (Active)*
mid05tor12cn05: HOST Firmware Product: -- additional info: buildroot-2017.08-8-g5e23247
mid05tor12cn05: HOST Firmware Product: -- additional info: capp-ucode-p9-dd2-v2
mid05tor12cn05: HOST Firmware Product: -- additional info: hostboot-53bcdc2
mid05tor12cn05: HOST Firmware Product: -- additional info: hostboot-binaries-c5203ed
mid05tor12cn05: HOST Firmware Product: -- additional info: linux-4.13.16-openpower1-p6099adf
mid05tor12cn05: HOST Firmware Product: -- additional info: machine-xml-592a6dd
mid05tor12cn05: HOST Firmware Product: -- additional info: occ-c62d875
mid05tor12cn05: HOST Firmware Product: -- additional info: op-build-v1.19-292-gc519660
mid05tor12cn05: HOST Firmware Product: -- additional info: petitboot-v1.6.3-pa5812d2
mid05tor12cn05: HOST Firmware Product: -- additional info: sbe-b8e05a5
mid05tor12cn05: HOST Firmware Product: -- additional info: skiboot-v5.9.6

@@ -1151,7 +1152,7 @@ sub get_switchtype {
return $xCAT::data::switchinfo::global_switch_type{$key};
} else {
if (exists($globalopt{pdu})) {
return "irpdu";
return "crpdu";
Copy link

Choose a reason for hiding this comment

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

Why set default pdu to crpdu?

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 didn't find good match string for Coral PDU but irpdu always has. that's why default to crpdu.

@zet809
Copy link

zet809 commented Jan 5, 2018

Looks good to me, agree to merge, thx @cxhong

@zet809 zet809 merged commit b750ea3 into xcat2:master Jan 5, 2018
@cxhong cxhong deleted the irpdu branch March 25, 2019 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants