From e4d8442e106267f42aacd6378853978020632902 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 15 Aug 2017 04:27:54 -0400 Subject: [PATCH 1/2] add usage and manpage for bmcdiscover "--sn" option --- .../references/man1/bmcdiscover.1.rst | 39 ++++++++++++++++--- xCAT-client/pods/man1/bmcdiscover.1.pod | 29 +++++++++++--- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 2 +- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index 7173c39f5..60b3f6499 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -23,7 +23,7 @@ SYNOPSIS \ **bmcdiscover**\ [\ **-v | -**\ **-version**\ ] -\ **bmcdiscover**\ [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] \ **-**\ **-range**\ \ *ip_ranges*\ +\ **bmcdiscover**\ [\ **-**\ **-sn**\ \ *SN_nodename*\ ] [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] \ **-**\ **-range**\ \ *ip_ranges*\ \ **bmcdiscover**\ \ **-u**\ \ *bmc_user*\ \ **-p**\ \ *bmc_passwd*\ \ **-i**\ \ *bmc_ip*\ \ **-**\ **-check**\ @@ -56,6 +56,12 @@ OPTIONS +\ **-**\ **-sn**\ + + Specify one or more service node on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SN and set them as the 'servicenode' attribute of the discovered BMC node. + + + \ **-s**\ Scan method (The only supported scan method at this time is \ **nmap**\ ) @@ -142,7 +148,7 @@ EXAMPLES Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254. -2. To get all BMSs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format: +2. To get all BMCs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format: .. code-block:: perl @@ -150,7 +156,30 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, bmcdiscover -s nmap --range "10.4.22-23.100-254" -z -3. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console: +3. To discovery BMCs through sn01: + + +.. code-block:: perl + + bmcdiscover --sn sn01 -s nmap --range "10.4.22-23.100-254" -z + + +Output is similar to: + + +.. code-block:: perl + + node-70e28414291b: + objtype=node + groups=all + bmc=10.4.22.101 + cons=openbmc + mgt=openbmc + servicenode=sn01 + conserver=sn01 + + +4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console: .. code-block:: perl @@ -158,7 +187,7 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z -4. To check if the username or password is correct against the BMC: +5. To check if the username or password is correct against the BMC: .. code-block:: perl @@ -166,7 +195,7 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, bmcdiscover -i 10.4.23.254 -u USERID -p PASSW0RD --check -5. Get BMC IP Address source, DHCP Address or static Address +6. Get BMC IP Address source, DHCP Address or static Address .. code-block:: perl diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 2e967fab5..d7a203f67 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -8,7 +8,7 @@ B [B<-?>|B<-h>|B<--help>] B [B<-v>|B<--version>] -B [B<-s> I] [B<-u> I] [B<-p> I] [B<-z>] [B<-w>] B<--range> I +B [B<--sn> I] [B<-s> I] [B<-u> I] [B<-p> I] [B<-z>] [B<-w>] B<--range> I B B<-u> I B<-p> I B<-i> I B<--check> @@ -33,6 +33,10 @@ Note: The scan method currently support is B. Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. +=item B<--sn> + +Specify one or more service node on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SN and set them as the 'servicenode' attribute of the discovered BMC node. + =item B<-s> Scan method (The only supported scan method at this time is B) @@ -90,19 +94,34 @@ Display version information Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254. -2. To get all BMSs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format: +2. To get all BMCs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format: bmcdiscover -s nmap --range "10.4.22-23.100-254" -z -3. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console: +3. To discovery BMCs through sn01: + + bmcdiscover --sn sn01 -s nmap --range "10.4.22-23.100-254" -z + +Output is similar to: + + node-70e28414291b: + objtype=node + groups=all + bmc=10.4.22.101 + cons=openbmc + mgt=openbmc + servicenode=sn01 + conserver=sn01 + +4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z -4. To check if the username or password is correct against the BMC: +5. To check if the username or password is correct against the BMC: bmcdiscover -i 10.4.23.254 -u USERID -p PASSW0RD --check -5. Get BMC IP Address source, DHCP Address or static Address +6. Get BMC IP Address source, DHCP Address or static Address bmcdiscover -i 10.4.23.254 -u USERID -p PASSW0RD --ipsource diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 0e754539c..a4ef5c5c5 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -183,7 +183,7 @@ sub bmcdiscovery_usage { push @{ $rsp->{data} }, "Usage:"; push @{ $rsp->{data} }, "\tbmcdiscover [-?|-h|--help]"; push @{ $rsp->{data} }, "\tbmcdiscover [-v|--version]"; - push @{ $rsp->{data} }, "\tbmcdiscover [-s scan_method] [-u bmc_user] [-p bmc_passwd] [-z] [-w] --range ip_range\n"; + push @{ $rsp->{data} }, "\tbmcdiscover [--sn ] [-s scan_method] [-u bmc_user] [-p bmc_passwd] [-z] [-w] --range ip_range\n"; push @{ $rsp->{data} }, "\tCheck BMC administrator User/Password:\n"; push @{ $rsp->{data} }, "\t\tbmcdiscover -u bmc_user -p bmc_password -i bmc_ip --check\n"; From 7e14a543fee032d1ce88a6a9b7d84c33b78c68d9 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 25 Aug 2017 04:35:48 -0400 Subject: [PATCH 2/2] modify description of "--sn" option for "bmcdiscover" according to Baiyuan's comments --- .../guides/admin-guides/references/man1/bmcdiscover.1.rst | 4 ++-- xCAT-client/pods/man1/bmcdiscover.1.pod | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index 60b3f6499..6fde20bb8 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -58,7 +58,7 @@ OPTIONS \ **-**\ **-sn**\ - Specify one or more service node on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SN and set them as the 'servicenode' attribute of the discovered BMC node. + Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node. @@ -156,7 +156,7 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, bmcdiscover -s nmap --range "10.4.22-23.100-254" -z -3. To discovery BMCs through sn01: +3. To discover BMCs through sn01: .. code-block:: perl diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index d7a203f67..fc9ddfe5a 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -35,7 +35,7 @@ Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP =item B<--sn> -Specify one or more service node on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SN and set them as the 'servicenode' attribute of the discovered BMC node. +Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node. =item B<-s> @@ -98,7 +98,7 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, bmcdiscover -s nmap --range "10.4.22-23.100-254" -z -3. To discovery BMCs through sn01: +3. To discover BMCs through sn01: bmcdiscover --sn sn01 -s nmap --range "10.4.22-23.100-254" -z