2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-21 19:22:05 +00:00

ADD support for power reset of PDU outlet

This commit is contained in:
Casandra Qiu 2017-03-21 12:01:42 -04:00
parent 7bd2810161
commit 865527400f
21 changed files with 172 additions and 31 deletions

View File

@ -63,6 +63,12 @@ The following commands are supported against a compute node:
cn01: f5pdu3 outlet 6 is on
cn01: f5pdu3 outlet 7 is on
* Power cycling the PDU outlets on a compute node: ::
# rpower cn01 pdureset
cn01: f5pdu3 outlet 6 is on
cn01: f5pdu3 outlet 7 is on
The following commands are supported against a PDU:
* Check the status of the full PDU: ::
@ -98,7 +104,7 @@ The following commands are supported against a PDU:
f5pdu3: outlet 12 is off
* Power on the full PDU: ::
# rpower f5pdu3 on
f5pdu3: outlet 1 is on
f5pdu3: outlet 2 is on
@ -112,6 +118,22 @@ The following commands are supported against a PDU:
f5pdu3: outlet 10 is on
f5pdu3: outlet 11 is on
f5pdu3: outlet 12 is on
* Power reset the full PDU: ::
# rpower f5pdu3 reset
f5pdu3: outlet 1 is on
f5pdu3: outlet 2 is on
f5pdu3: outlet 3 is on
f5pdu3: outlet 4 is on
f5pdu3: outlet 5 is on
f5pdu3: outlet 6 is on
f5pdu3: outlet 7 is on
f5pdu3: outlet 8 is on
f5pdu3: outlet 9 is on
f5pdu3: outlet 10 is on
f5pdu3: outlet 11 is on
f5pdu3: outlet 12 is on
**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower <node> on`` to power on the compute node after the BMC boots.

View File

@ -29,7 +29,7 @@ BMC (using IPMI) specific:
\ **rpower**\ \ *noderange*\ [\ **on | off | softoff | reset | boot | stat | state | status | wake | suspend**\ [\ **-w**\ \ *timeout*\ ] [\ **-o**\ ] [\ **-r**\ ]]
\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat**\ ]
\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ]
OpenBMC specific:
@ -115,7 +115,7 @@ pdu specific:
=============
\ **rpower**\ \ *noderange*\ [\ **stat | off | on**\ ]
\ **rpower**\ \ *noderange*\ [\ **stat | off | on | reset**\ ]

View File

@ -50,7 +50,7 @@ nodehm Attributes:
\ **mgt**\
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.

View File

@ -0,0 +1,82 @@
#########
openbmc.5
#########
.. highlight:: perl
****
NAME
****
\ **openbmc**\ - a table in the xCAT database.
********
SYNOPSIS
********
\ **openbmc Attributes:**\ \ *node*\ , \ *bmc*\ , \ *username*\ , \ *password*\ , \ *comments*\ , \ *disable*\
***********
DESCRIPTION
***********
Setting for nodes that are controlled by an on-board OpenBmc.
*******************
openbmc Attributes:
*******************
\ **node**\
The node name or group name.
\ **bmc**\
The hostname of the BMC adapter.
\ **username**\
The BMC userid.
\ **password**\
The BMC password.
\ **comments**\
Any user-written notes.
\ **disable**\
Set to 'yes' or '1' to comment out this row.
********
SEE ALSO
********
\ **nodels(1)**\ , \ **chtab(8)**\ , \ **tabdump(8)**\ , \ **tabedit(8)**\

View File

@ -50,13 +50,13 @@ passwd Attributes:
\ **password**\
The default password for this type of component
The default password for this type of component. On Linux, a crypted form could be provided. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported.
\ **cryptmethod**\
Indicates the method that was used to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default.
Indicates the method to use to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default to encrypt plain-text passwords.

View File

@ -565,6 +565,12 @@ notification(5)|notification.5
openbmc(5)|openbmc.5
Setting for nodes that are controlled by an on-board OpenBmc.
osdistro(5)|osdistro.5
Information about all the OS distros in the xCAT cluster

View File

@ -57,16 +57,24 @@ group Attributes:
\ **bmc**\ (ipmi.bmc)
\ **bmc**\ (ipmi.bmc, openbmc.bmc)
The hostname of the BMC adapter.
or
The hostname of the BMC adapter.
\ **bmcpassword**\ (ipmi.password)
\ **bmcpassword**\ (ipmi.password, openbmc.password)
The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC password.
\ **bmcport**\ (ipmi.bmcport)
@ -115,10 +123,14 @@ group Attributes:
\ **bmcusername**\ (ipmi.username)
\ **bmcusername**\ (ipmi.username, openbmc.username)
The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC userid.
\ **bmcvlantag**\ (ipmi.taggedvlan)
@ -461,7 +473,7 @@ group Attributes:
\ **mgt**\ (nodehm.mgt)
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.

View File

@ -69,16 +69,24 @@ node Attributes:
\ **bmc**\ (ipmi.bmc)
\ **bmc**\ (ipmi.bmc, openbmc.bmc)
The hostname of the BMC adapter.
or
The hostname of the BMC adapter.
\ **bmcpassword**\ (ipmi.password)
\ **bmcpassword**\ (ipmi.password, openbmc.password)
The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC password.
\ **bmcport**\ (ipmi.bmcport)
@ -127,10 +135,14 @@ node Attributes:
\ **bmcusername**\ (ipmi.username)
\ **bmcusername**\ (ipmi.username, openbmc.username)
The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC userid.
\ **bmcvlantag**\ (ipmi.taggedvlan)
@ -461,7 +473,7 @@ node Attributes:
\ **mgt**\ (nodehm.mgt)
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.

View File

@ -53,8 +53,8 @@ my %usage = (
docker specific:
rpower noderange [start|stop|restart|pause|unpause|state]
pdu specific:
rpower noderange [off|on|stat]
rpower noderange [pduoff|pduon|pdustat]
rpower noderange [off|on|stat|status|reset]
rpower noderange [pduoff|pduon|pdustat|pdustatus|pdureset]
",
"rbeacon" =>
"Usage: rbeacon <noderange> [on|off|stat] [-V|--verbose]

View File

@ -12,7 +12,7 @@ B<rpower> [B<-h>|B<--help>|B<-v>|B<--version>]
B<rpower> I<noderange> [B<on>|B<off>|B<softoff>|B<reset>|B<boot>|B<stat>|B<state>|B<status>|B<wake>|B<suspend> [B<-w> I<timeout>] [B<-o>] [B<-r>]]
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>]
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>|B<pdureset>]
=head2 OpenBMC specific:
@ -62,7 +62,7 @@ B<rpower> I<noderange> [B<start>|B<stop>|B<restart>|B<pause>|B<unpause>|B<state>
=head2 pdu specific:
B<rpower> I<noderange> [B<stat>|B<off>|B<on>]
B<rpower> I<noderange> [B<stat>|B<off>|B<on>|B<reset>]
=head1 DESCRIPTION

View File

@ -235,7 +235,7 @@ sub process_command {
if ($command eq 'rpower') { $subcommand = $request->{op}; }
#pdu commands will be handled in the pdu plugin
if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat')){
if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat') || ($subcommand eq 'pdureset')){
return 0;
}

View File

@ -4401,7 +4401,7 @@ sub process_request {
else { $moreinfo = build_more_info($noderange, $callback); }
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}

View File

@ -407,7 +407,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}
#my $sitetab = xCAT::Table->new('site');

View File

@ -647,7 +647,7 @@ sub process_request {
else { $moreinfo = build_more_info($noderange, $callback); }
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}

View File

@ -362,7 +362,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) {
if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pdureset') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) {
return;
}

View File

@ -7682,7 +7682,7 @@ sub preprocess_request {
}
#pdu commands will be handled in the pdu plugin
if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){
if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat') || ($subcmd eq 'pdureset')){
return 0;
}

View File

@ -3675,7 +3675,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}

View File

@ -140,7 +140,7 @@ sub process_request
return powerstat($noderange, $callback);
}elsif ($command eq "rpower") {
my $subcmd = $exargs[0];
if (($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){
if (($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')|| ($subcmd eq 'pdureset') ){
#if one day, pdu node have pdu attribute, handle in this section too
return powerpduoutlet($noderange, $subcmd, $callback);
} else {
@ -160,7 +160,7 @@ sub process_request
}
}
if(@allpdunodes) {
if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat') || ($subcmd eq 'state')){
if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat') || ($subcmd eq 'state') || ($subcmd eq 'reset') ){
return powerpdu(\@allpdunodes, $subcmd, $callback);
} else {
my $pdunode = join (",", @allpdunodes);
@ -232,9 +232,12 @@ sub powerpdu {
if ($subcmd eq "off") {
$value = 0;
$statstr = "off";
} else {
} elsif ( $subcmd eq "on") {
$value = 1;
$statstr = "on";
} else {
$value = 2;
$statstr = "reset";
}
for (my $outlet =1; $outlet <= $count; $outlet++)
@ -304,6 +307,10 @@ sub powerpduoutlet {
$value = 1;
$statstr = "on";
outletpower($session, $outlet, $value);
} elsif ($subcmd eq "pdureset") {
$value = 2;
$statstr = "reset";
outletpower($session, $outlet, $value);
} else {
$callback->({ error => "$subcmd is not support"});
}

View File

@ -127,7 +127,7 @@ sub preprocess_request {
}
#pdu commands will be handled in the pdu plugin
if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) {
if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pdureset') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) {
return;
}

View File

@ -706,7 +706,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}

View File

@ -2319,7 +2319,7 @@ sub powerVM {
my $out;
##pdu commands will be handled in the pdu plugin
if ($args->[0] eq 'pduon' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') {
if ($args->[0] eq 'pduon' || $args->[0] eq 'pdureset' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') {
return;
}