mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
Modify switchdiscover usage, man page and update readdoc
This commit is contained in:
parent
2a6d456029
commit
b90ca84237
@ -4,7 +4,7 @@ Networks
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
switchdiscover/index.rst
|
||||
ethernet_switches/index.rst
|
||||
switchdiscover/index.rst
|
||||
infiniband/index.rst
|
||||
ipv6/index.rst
|
||||
|
@ -5,3 +5,4 @@ Switch Discover
|
||||
:maxdepth: 2
|
||||
|
||||
switches_discovery.rst
|
||||
switch_based_switch_discovery.rst
|
||||
|
@ -0,0 +1,131 @@
|
||||
Switch-based Switch Discovery
|
||||
=============================
|
||||
|
||||
Currently, xCAT supports switch based hardware discovery, the servers are identified through the switches and switch ports they are directly connected to. Use same method, xcat introduced how to discovery switches use switch-based discovery within the user defined dynamic IP range.
|
||||
|
||||
Pre-requirement
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
In order to do switch-based switch discovery, the admin
|
||||
|
||||
1. Needs to manually setup and configure core-switch, SNMP v3 needs to be enabled in order for xCAT access to it. Example of core-switch definition:
|
||||
|
||||
::
|
||||
|
||||
lsdef switch-10-5-23-1
|
||||
Object name: switch-10-5-23-1
|
||||
groups=switch
|
||||
ip=10.5.23.1
|
||||
mac=ab:cd:ef:gh:dc
|
||||
mgt=switch
|
||||
nodetype=switch
|
||||
password=admin
|
||||
postbootscripts=otherpkgs
|
||||
postscripts=syslog,remoteshell,syncfiles
|
||||
protocol=telnet
|
||||
snmpauth=sha
|
||||
snmppassword=userpassword
|
||||
snmpusername=snmpadmin
|
||||
snmpversion=3
|
||||
switchtype=BNT
|
||||
usercomment=IBM
|
||||
username=root
|
||||
|
||||
|
||||
|
||||
2. Then pre-define all the top-rack switches which connect to core-switch.
|
||||
|
||||
::
|
||||
|
||||
lsdef switch-192-168-5-22
|
||||
objtype=node
|
||||
groups=switch
|
||||
ip=192.168.5.22
|
||||
mgt=switch
|
||||
nodetype=switch
|
||||
switch=switch-10-5-23-1
|
||||
switchport=45
|
||||
switchtype=BNT
|
||||
|
||||
|
||||
3. Setup Dynamic ip range to network table for discovery switches to use.
|
||||
|
||||
|
||||
Discover Switches
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
xCAT supports **switchdiscover** command to discover the switches that are attached to the subnets on xCAT management node. Please refer http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html for more info.
|
||||
|
||||
For the switch-based switch discovery, we add ``–setup`` flag: ::
|
||||
|
||||
|
||||
switchdiscover [noderange|--range ip_ranges][-s scan_methods] [--setup]
|
||||
|
||||
|
||||
if ``–setup`` flag is specified, it will process following steps:
|
||||
|
||||
1. Use snmp or nmap scan method to find all the switches in the dynamic ip ranges which specified by ``--range``, the available switches will be store to switch hash table with hostname, switchtype, vendor info and mac address.
|
||||
|
||||
|
||||
2. Based on mac address for each switch defined in the hash table, call **find_mac** subroutine. The **find_mac** subroutine will go thought the switch and switch port and find matched mac address.
|
||||
|
||||
* If discovered switch didn't match to pre-define, it will log the message to indicate ``NO predefined switch matched``.
|
||||
* If discovered switch matched with one of pre-defined switch, it will update the pre-defined switch with ::
|
||||
|
||||
otherinterface=x.x.x.x (discovered ip)
|
||||
state=matched
|
||||
switchtype=type of switch
|
||||
usercomment=vendor information
|
||||
|
||||
|
||||
3. after switches matched, will call config files to set up static ip address, hostname and enable the snmpv3. currently, BNT and Mellanox switches are supported. The two config files are located in the ** /opt/xcat/share/xcat/scripts/config.BNT** and **/opt/xcat/share/xcat/scripts/config.Mellanox**. the log message ``the switch type is not support for config`` if switchtype other than BNT and Mellanox.
|
||||
|
||||
|
||||
Configure switches
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The **switchdiscover** command with ``–setup`` options will set up switches with static ip address, change the hostname from predefine switches and enable snmpv3 configuration. For other switches configuration, please refer http://xcat-docs.readthedocs.io/en/latest/advanced/networks/ethernet_switches/ethernet_switches.html and http://xcat-docs.readthedocs.io/en/latest/advanced/networks/infiniband/switch_configuration.html
|
||||
|
||||
These two config files are located in the **/opt/xcat/share/xcat/scripts**. The **switchdiscover** process will call the config files with ``--all`` option. User can call this scripts to setup one of options manually.
|
||||
|
||||
1. **configBNT** is for configure BNT switches.
|
||||
|
||||
::
|
||||
|
||||
./configBNT --help
|
||||
Usage:
|
||||
configBNT [-?│-h│--help]
|
||||
configBNT [--switches switchnames] [--all]
|
||||
configBNT [--switches switchnames] [--ip]
|
||||
configBNT [--switches switchnames] [--name ]
|
||||
configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group]
|
||||
configBNT [--switches switchnames] [--port port] [--vlan vlan]
|
||||
|
||||
2. **configMellanox** is for configure Mellanox switch. The script will configure ntp service on the switch with xCAT MN and use rspconfig command to
|
||||
* enable ssh
|
||||
* enable snmp function on the switch
|
||||
* enable the snmp trap
|
||||
* set logging destination to xCAT MN
|
||||
|
||||
::
|
||||
|
||||
./configMellanox --help
|
||||
Usage:
|
||||
configMellonax [-?│-h│--help]
|
||||
configMellonax [--switches switchnames] [--all]
|
||||
configMellonax [--switches switchnames] [--ip]
|
||||
configMellonax [--switches switchnames] [--name]
|
||||
configMellonax [--switches switchnames] [--config]
|
||||
|
||||
|
||||
switch status
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
**Matched** --- Discover switch is matched to pre-define switch, otherinterfaces attribute is updated to dhcp ip address, and mac address, switch type and usercomment also updated with vendor information for the predefined switch.
|
||||
|
||||
**ip_configed** --- switches are set up to static ip address based on pre-define switch ip address
|
||||
|
||||
**hostname_configed** -- switches host name changed based on pre-define switch hostname.
|
||||
|
||||
**switch_configed** -- snmpv3 is setup for the switches. this should be finial status after run ``switchdiscover --setup`` command.
|
||||
|
@ -15,7 +15,7 @@ SYNOPSIS
|
||||
|
||||
\ **switchdiscover [-v| -**\ **-version]**\
|
||||
|
||||
\ **switchdiscover**\ [\ *noderange*\ | \ **-**\ **-range**\ \ *ip_ranges*\ ] \ **[-V] [-w][-r|-x|-z][-s**\ \ *scan_methods*\ ]
|
||||
\ **switchdiscover**\ [\ *noderange*\ | \ **-**\ **-range**\ \ *ip_ranges*\ ] \ **[-V] [-w][-r|-x|-z][-s**\ \ *scan_methods*\ \ **-**\ **-setup**\ ]
|
||||
|
||||
|
||||
***********
|
||||
@ -23,7 +23,8 @@ DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format.
|
||||
The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format.
|
||||
\ **-**\ **-setup**\ flag is for switch-based switch discovery. It will find all the discovery switches in the subnets, then matched with pre-defined switches in the xCATDB. It then set discovery switches with static ip address and hostname based on the pre-defined switch. It also enables snmpv3 configuration. The detail of process is defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html.
|
||||
|
||||
To view all the switches defined in the xCAT databasee use \ **lsdef -w "nodetype=switch"**\ command.
|
||||
|
||||
@ -110,6 +111,12 @@ OPTIONS
|
||||
|
||||
|
||||
|
||||
\ **-**\ **-setup**\
|
||||
|
||||
Process switch-based switch discovery. Update discovered switch's ip address, hostname and enable snmpv3 configuration based on the pre-defined switch.
|
||||
|
||||
|
||||
|
||||
|
||||
************
|
||||
RETURN VALUE
|
||||
@ -149,9 +156,7 @@ EXAMPLES
|
||||
|
||||
|
||||
|
||||
3.
|
||||
|
||||
To use lldp method to discover the switches:
|
||||
3. To use lldp method to discover the switches:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@ -161,6 +166,11 @@ EXAMPLES
|
||||
|
||||
|
||||
|
||||
4. To process switch-based switch discovery, the core switch has to configure already and top-of-rack (edge) switch has to pre-define into xCAT databse with attribute switch and switchport to core switch:
|
||||
switchdiscover --range 192.168.5.150-170 -s snmp --setup
|
||||
|
||||
|
||||
|
||||
|
||||
*****
|
||||
FILES
|
||||
|
@ -303,7 +303,7 @@ my %usage = (
|
||||
[-u] [--range IPranges][-t tries][--vpdtable][-C counts][-T timeout]",
|
||||
"switchdiscover" =>
|
||||
"Usage: switchdiscover [-h|--help|-v|--version]
|
||||
switchdiscover [<noderange>|--range ipranges] [-s scan_methods] [-r|-x|-z] [-w] [-V|--verbose]",
|
||||
switchdiscover [<noderange>|--range ipranges] [-s scan_methods] [-r|-x|-z] [-w] [-V|--verbose] [--setup]",
|
||||
"switchprobe" =>
|
||||
"Usage: switchprobe [<noderange>] [-V|--verbose | -c|--check]",
|
||||
"makentp" =>
|
||||
|
@ -10,13 +10,14 @@ B<switchdiscover [-h| --help]>
|
||||
|
||||
B<switchdiscover [-v| --version]>
|
||||
|
||||
B<switchdiscover> [I<noderange> | B<--range> I<ip_ranges>] B<[-V] [-w][-r|-x|-z][-s> I<scan_methods>]
|
||||
B<switchdiscover> [I<noderange> | B<--range> I<ip_ranges>] B<[-V] [-w][-r|-x|-z][-s> I<scan_methods> B<--setup>]
|
||||
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format.
|
||||
B<--setup> flag is for switch-based switch discovery. It will find all the discovery switches in the subnets, then matched with pre-defined switches in the xCATDB. It then set discovery switches with static ip address and hostname based on the pre-defined switch. It also enables snmpv3 configuration. The detail of process is defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html.
|
||||
|
||||
To view all the switches defined in the xCAT databasee use B<lsdef -w "nodetype=switch"> command.
|
||||
|
||||
@ -81,6 +82,10 @@ XML formated output.
|
||||
|
||||
Stanza formated output.
|
||||
|
||||
=item B<--setup>
|
||||
|
||||
Process switch-based switch discovery. Update discovered switch's ip address, hostname and enable snmpv3 configuration based on the pre-defined switch.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUE
|
||||
@ -106,11 +111,14 @@ To do the switch discovery and save them to the xCAT database:
|
||||
It is recommended to run B<makehosts> after the switches are saved in the DB.
|
||||
|
||||
=item 3.
|
||||
|
||||
To use lldp method to discover the switches:
|
||||
|
||||
switchdiscover -s lldp
|
||||
|
||||
=item 4.
|
||||
To process switch-based switch discovery, the core switch has to configure already and top-of-rack (edge) switch has to pre-define into xCAT databse with attribute switch and switchport to core switch:
|
||||
switchdiscover --range 192.168.5.150-170 -s snmp --setup
|
||||
|
||||
|
||||
=back
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user