diff --git a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst index c2ef30876..702605c82 100644 --- a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst +++ b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst @@ -61,59 +61,63 @@ dhcp should be restarted after seting up dynamic IP range. Discover Switches ~~~~~~~~~~~~~~~~~ -xCAT supports **switchdiscover** command to discover the switches that are attached to the subnets on xCAT management node. Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info. +.. note:: Only BNT and Mellanox switches are supported for switch-based switch discovery -For the switch-based switch discovery, we add **–setup** flag: :: +xCAT can automatically discover switches that are connected to the defined subnets from the management node using the ``switchdiscover`` command. + +For switch-based switch discovery, use the ``--setup`` option:: switchdiscover [noderange|--range ip_ranges][-s scan_methods] [--setup] -if **--setup** flag is specified, the command will perform following steps: +The ``--setup`` option will perform the following steps: -1. Use snmp or nmap scan methods to find all switches in the dynamic IP ranges specified by --range, the available switches will be stored in switch hash table with hostname, switchtype, vendor info and mac address. +1. Scan the IP range using ``snmp`` or ``nmap`` to find all switches that respond. The available switches will be stored into the switch hash table with ``hostname``, ``switchtype``, ``mac``, and vendor information. + +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 ports and find matched mac address. + + * If discovered switch didn't find any predefined switch matches, it will log the message ``NO predefined switch matched``. + * If discovered switch matched with one of pre-defined switch, it will update the predefined switch with :: + + otherinterface=x.x.x.x (discovered ip) + state=matched + switchtype=type of switch + usercomment=vendor information -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 ports and find matched mac address. +3. If the switches are matched, the ``switchdiscover`` command will execute the following scripts to configure static IP address, hostname, and enable the snmpv3. -* If discovered switch didn't find any predefined switch matches, it will log the message ``NO predefined switch matched``. -* If discovered switch matched with one of pre-defined switch, it will update the predefined switch with :: + * ``/opt/xcat/share/xcat/scripts/configBNT`` + * ``/opt/xcat/share/xcat/scripts/configMellanox`` - otherinterface=x.x.x.x (discovered ip) - state=matched - switchtype=type of switch - usercomment=vendor information +4. After discovery process the predefined node attribute in the xCAT database will be updated. :: + + lsdef switch-192-168-5-22 + groups=switch + ip=192.168.5.22 + mac=a8:97:dc:02:92:00 + mgt=switch + nodetype=switch + password=admin + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + protocol=telnet + snmpauth=sha + snmppassword=xcatadminpassw0rd@snmp + snmpusername=xcatadmin + snmpversion=3 + status=hostname_configured + statustime=08-31-2016 15:35:49 + supportedarchs=ppc64 + switch=switch-10-5-23-1 + switchport=45 + switchtype=BNT + usercomment=IBM Networking Operating System RackSwitch G8052 + username=root -3. After switches are matched, the command 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`` is displayed if switchtype is something other than BNT or Mellanox. - -4. After discovery process, the predefined node attribute in the xCATdb will be updated. - -:: - - lsdef switch-192-168-5-22 - groups=switch - ip=192.168.5.22 - mac=a8:97:dc:02:92:00 - mgt=switch - nodetype=switch - password=admin - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - protocol=telnet - snmpauth=sha - snmppassword=xcatadminpassw0rd@snmp - snmpusername=xcatadmin - snmpversion=3 - status=hostname_configured - statustime=08-31-2016 15:35:49 - supportedarchs=ppc64 - switch=switch-10-5-23-1 - switchport=45 - switchtype=BNT - usercomment=IBM Networking Operating System RackSwitch G8052 - username=root - +.. tip:: Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info. Configure switches diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst index 3d2232995..77b42e398 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst @@ -45,9 +45,11 @@ sync file **/etc/file2** to the file **/etc/file2** on the node :: /etc/file2 -> /etc/ -sync all files in **/home/mikev** to directory **/home/mikev** on the node :: +sync all files, including subdirectories, in **/home/mikev** to directory **/home/mikev** on the node :: /home/mikev/* -> /home/mikev/ + or + /home/mikev -> /home/mikev/ .. note:: Don't try to sync files to the read only directory on the target node. diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 57a821f0a..0b64d2314 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -61,7 +61,7 @@ Update the ca and credentials for the service nodes. The default behavior when no options are input to \ **updatenode**\ will be to run the following options \ **-S**\ , \ **-P**\ and \ **-F**\ options in this order. If you wish to limit \ **updatenode**\ to specific -actions you can use combinations of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags. +actions you can use combination of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags. For example, If you just want to synchronize configuration file you could specify the \ **-F**\ flag. If you want to synchronize files and update diff --git a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst index fe9661d72..49732546a 100644 --- a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst @@ -21,7 +21,7 @@ xdcp.1 \ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command] [\ \*\*-R\*\*\ ] [\ \*\*-t\*\*\ \ \*timeout\*\ ] [\ \*\*-T\*\*\ ] [\ \*\*-v\*\*\ ] [\ \*\*-q\*\*\ ] [\ \*\*-X\*\*\ \ \*env_list\*\ ] \ \*sourcefile.... targetpath\*\ *\ -\ **xdcp**\ \ *noderange*\ [\ **-F**\ Irsynclist input file>] [\ **-r**\ \ *node remote copy command*\ ] +\ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsynclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] \ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index 6700c946c..2855062a2 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -406,7 +406,7 @@ site Attributes: dbtracelevel: The trace level for the database access log. To activate this setting, please. restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: . - pkill -f -HUP 'xcatd: DB Access' + pkill -f -HUP 'xcatd: DB Access' Currrent support values: 0: disable the trace log for db 1: trace the calls of database subroutines diff --git a/docs/source/guides/get-started/index.rst b/docs/source/guides/get-started/index.rst new file mode 100644 index 000000000..d3d48abd8 --- /dev/null +++ b/docs/source/guides/get-started/index.rst @@ -0,0 +1,9 @@ +Get Started +=========== + + +.. toctree:: + :maxdepth: 1 + + quick_start.rst + workflow_guide.rst diff --git a/docs/source/guides/get-started/quick_start.rst b/docs/source/guides/get-started/quick_start.rst new file mode 100644 index 000000000..d8b2b06da --- /dev/null +++ b/docs/source/guides/get-started/quick_start.rst @@ -0,0 +1,140 @@ +Quick Start Guide +================= +xCAT can be a comprehensive system to manage infrastructure elements in Data Center, bare-metal servers, switches, PDUs, and Operation System distributions. This quick start guide will instruct you to set up a xCAT system and manage an IPMI managed bare metal server with Red Hat-based distribution in 15 minutes. + +The steps below will be focused on RHEL7, however they should work for other distribution, such as CentOS, SLES, etc, details :doc:`Operating System & Hardware Support Matrix <../../overview/support_matrix>` + +Prerequisites +------------- +Assume there are two servers named ``xcatmn.mydomain.com`` and ``cn1.mydomain.com``. + + #. They are in the same subnet ``192.168.0.0``. + #. ``cn1.mydomain.com`` has BMC which ``xcatmn.mydomain.com`` can access it. + #. ``xcatmn.mydomain.com`` has Red Hat OS installed, and uses IP ``192.168.0.2``. + #. ``xcatmn.mydomain.com`` has access to internet. + #. ``cn1.mydomain.com`` BMC IP address is ``10.4.40.254``. + #. Prepare a full DVD for OS provision, and not a ``Live CD`` ISO, for this example, will use ``RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso`` ISO, you can download it from Red Hat website. + +All the following steps should be executed in ``xcatmn.mydomain.com``. + +Prepare the Management Node ``xcatmn.mydomain.com`` +``````````````````````````````````````````````````` + +#. Disable SELinux: :: + + echo 0 > /selinux/enforce + sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config + +#. Set the hostname of ``xcatmn.mydomain.com``: :: + + hostname xcatmn.mydomain.com + +#. Set the IP to STATIC in the ``/etc/sysconfig/network-scripts/ifcfg-`` file + +#. Update your ``/etc/resolv.conf`` with DNS settings and make sure that the node could visit ``github`` and ``xcat`` official website. + +#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file + +#. Add ``xcatmn`` into ``/etc/hosts``: :: + + 192.168.0.2 xcatmn xcatmn.mydomain.com + +#. Install xCAT: :: + + wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat + chmod +x /tmp/go-xcat + go-xcat --yes install + source /etc/profile.d/xcat.sh + +#. Configure the system password for the root user on the compute nodes: :: + + chtab key=system passwd.username=root passwd.password=abc123 + +Stage 1 Add your first node and control it with out-of-band BMC interface +------------------------------------------------------------------------- + +#. Define compute node ``cn1``: :: + + mkdef -t node cn1 --template x86_64-template ip=192.168.0.3 mac=42:3d:0a:05:27:0c bmc=10.4.40.254 bmcusername=USERID bmcpassword=PASSW0RD + +#. Configure DNS: :: + + makehosts cn1 + makedns -n + +#. Check ``cn1`` Hardware Control: + +``cn1`` power management: :: + + rpower cn1 on + rpower cn1 state + cn1: on + +``cn1`` firmware information: :: + + rinv cn1 firm + cn1: UEFI Version: 1.31 (TDE134EUS 2013/08/27) + cn1: Backup UEFI Version: 1.00 (TDE112DUS ) + cn1: Backup IMM Version: 1.25 (1AOO26K 2012/02/23) + cn1: BMC Firmware: 3.10 (1AOO48H 2013/08/22 18:49:44) + +Stage 2 Provision a node and manage it with parallel shell +---------------------------------------------------------- + +#. In order to PXE boot, you need a DHCP server to hand out addresses and direct the booting system to the TFTP server where it can download the network boot files. Configure DHCP: :: + + makedhcp -n + +#. Copy all contents of Distribution ISO into ``/install`` directory, create OS repository and osimage for OS provision: :: + + copycds RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso + + After ``copycds``, the corresponding basic osimage will be generated automatically. And then you can list the new osimage name here. You can refer document to customize the package list or postscript for target compute nodes, but here just use the default one: :: + + lsdef -t osimage + +#. Use ``xcatprobe`` to precheck xCAT management node ready for OS provision: :: + + xcatprobe xcatmn + [mn]: Checking all xCAT daemons are running... [ OK ] + [mn]: Checking xcatd can receive command request... [ OK ] + [mn]: Checking 'site' table is configured... [ OK ] + [mn]: Checking provision network is configured... [ OK ] + [mn]: Checking 'passwd' table is configured... [ OK ] + [mn]: Checking important directories(installdir,tftpdir) are configured... [ OK ] + [mn]: Checking SELinux is disabled... [ OK ] + [mn]: Checking HTTP service is configured... [ OK ] + [mn]: Checking TFTP service is configured... [ OK ] + [mn]: Checking DNS service is configured... [ OK ] + [mn]: Checking DHCP service is configured... [ OK ] + ... ... + [mn]: Checking dhcpd.leases file is less than 100M... [ OK ] + =================================== SUMMARY ==================================== + [MN]: Checking on MN... [ OK ] + +#. Start the Diskful OS Deployment: :: + + rinstall cn1 osimage=rhels7.6-x86_64-install-compute + +#. Monitor Installation Process: :: + + makegocons cn1 + rcons cn1 + + **Note**: The keystroke ``ctrl+e c .`` will disconnect you from the console. + + After 5-10 min verify provision status is ``booted``: :: + + lsdef cn1 -i status + Object name: cn1 + status=booted + + Use ``xdsh`` to check ``cn1`` OS version, OS provision is successful: :: + + xdsh cn1 more /etc/*release + cn1: :::::::::::::: + cn1: /etc/os-release + cn1: :::::::::::::: + cn1: NAME="Red Hat Enterprise Linux Server" + cn1: VERSION="7.6 (Maipo)" + ... ... diff --git a/docs/source/overview/quick_start.rst b/docs/source/guides/get-started/workflow_guide.rst similarity index 98% rename from docs/source/overview/quick_start.rst rename to docs/source/guides/get-started/workflow_guide.rst index d26fc33b8..49bedef5b 100644 --- a/docs/source/overview/quick_start.rst +++ b/docs/source/guides/get-started/workflow_guide.rst @@ -1,5 +1,5 @@ -Quick Start Guide -================= +Workflow Guide +============== If xCAT looks suitable for your requirement, following steps are recommended procedure to set up an xCAT cluster. diff --git a/docs/source/index.rst b/docs/source/index.rst index 048b7095d..247f43b94 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -30,6 +30,7 @@ Table of Contents overview/index.rst guides/install-guides/index.rst + guides/get-started/index.rst guides/admin-guides/index.rst advanced/index.rst QA/index.rst diff --git a/docs/source/overview/index.rst b/docs/source/overview/index.rst index 652aa8117..91c9a4d43 100644 --- a/docs/source/overview/index.rst +++ b/docs/source/overview/index.rst @@ -10,5 +10,4 @@ xCAT enables you to easily manage large number of servers for any type of techni features.rst support_matrix.rst architecture.rst - quick_start.rst xcat2_release.rst diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index 782722996..a35d07080 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -4,7 +4,7 @@ B - Update nodes in an xCAT cluster environment. =head1 SYNOPSIS -B I [B<-V>|B<--verbose>] [B<-F>|B<--sync>] [B<-f>|B<--snsync>] [B<-r>|B<--node-rcp> [I]] [B<-S>|B<--sw>] [B<-l> I] [B<-P>|B<--scripts> [I]] [B<-s>|B<--sn>] [B<-A>|B<--updateallsw>] [B<-c>|B<--cmdlineonly>] [B<-d> I] [B<--fanout>=I] [B<-t> I} [I [I]] [B<-n>|B<--noverify>] +B I [B<-V>|B<--verbose>] [B<-F>|B<--sync>] [B<-f>|B<--snsync>] [B<-r>|B<--node-rcp> [I]] [B<-S>|B<--sw>] [B<-l> I] [B<-P>|B<--scripts> [I]] [B<-s>|B<--sn>] [B<-A>|B<--updateallsw>] [B<-c>|B<--cmdlineonly>] [B<-d> I] [B<--fanout>=I] [B<-t> I} [I [I]] [B<-n>|B<--noverify>] B B [B<-k>|B<--security>] [B<-t> I] @@ -41,7 +41,7 @@ Update the ca and credentials for the service nodes. The default behavior when no options are input to B will be to run the following options B<-S>, B<-P> and B<-F> options in this order. If you wish to limit B to specific -actions you can use combinations of the B<-S>, B<-P>, and B<-F> flags. +actions you can use combination of the B<-S>, B<-P>, and B<-F> flags. For example, If you just want to synchronize configuration file you could specify the B<-F> flag. If you want to synchronize files and update @@ -315,17 +315,17 @@ read-only option for files/directories listed in B table with source location specified in the B table. -=item [B<-r>|B<--node-rcp> [I]] +=item [B<-r>|B<--node-rcp> [I]] -Specifies the full path of the remote copy command used for syncing files to node targets, such as "/usr/bin/rsync" or "/usr/bin/scp". If not specified, rsync will be used by default. +Specifies the full path of the remote copy command used for syncing files to node targets, such as B or B. If not specified, B will be used by default. -Notice: The synclist for "-r /usr/bin/scp" has some differences with "-r /usr/bin/rsync": +Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B<-r /usr/bin/rsync>: -1) the ``EXECUTE`` clause is not supported in "-r /usr/bin/scp" +1) the B clause in synclist file is not supported with B<-r /usr/bin/scp> flag -2) if the destination directory specified in synclist is an existing file on target node, "updatenode -r /usr/bin/scp" will fail with ``scp: : Not a directory`` +2) if the destination directory specified in synclist file is an existing file on target node, B will fail with "scp: : Not a directory" -3) if the destination file specified in synclist is an existing directory on target node, "updatenode -r /usr/bin/scp" will fail with ``scp: : Is a directory`` +3) if the destination file specified in synclist file is an existing directory on target node, B will fail with "scp: : Is a directory" =item B<-g|--genmypost> diff --git a/xCAT-client/pods/man1/xdcp.1.pod b/xCAT-client/pods/man1/xdcp.1.pod index 665823e79..bd41741bc 100644 --- a/xCAT-client/pods/man1/xdcp.1.pod +++ b/xCAT-client/pods/man1/xdcp.1.pod @@ -4,15 +4,13 @@ B - Concurrently copies files to or from multiple nodes. In addition, prov =head1 B -B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-R>] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I +B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I -B I [B<-F> I] +B I [B<-F> I] [B<-r> I] -B I [B<-s> B<-F> I] - - -B [B<-i> I] [B<-F> I] +B I [B<-s> B<-F> I] [B<-r> I] +B [B<-i> I] [B<-F> I] [B<-r> I] B [B<-h> | B<-V> | B<-q>] @@ -46,7 +44,7 @@ For node targets, the remote copy command is determined by the following order 1. The B<-r> flag. -2. The B command. +2. The B command. B B: @@ -99,7 +97,7 @@ Specifies a fanout value for the maximum number of concurrently executing rem can be specified by indicating a fanout value of B<1>. If B<-f> is not specified, a default fanout value of B<64> is used. -=item B<-F>|B<--File> I +=item B<-F>|B<--File> I Specifies the path to the file that will be used to build the B command. @@ -151,10 +149,17 @@ valid contexts. Each setting is prefixed with I: to identify the source context of the setting. -=item B<-r>|B<--node-rcp> I +=item B<-r>|B<--node-rcp> I -Specifies the full path of the remote copy command used -for remote command execution on node targets. +Specifies the full path of the remote copy command used for syncing files to node targets, such as B or B. If not specified, B will be used by default. + +Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B<-r /usr/bin/rsync>: + +1) the B clause in synclist file is not supported with B<-r /usr/bin/scp> flag + +2) if the destination directory specified in synclist file is an existing file on target node, B will fail with "scp: : Not a directory" + +3) if the destination file specified in synclist file is an existing directory on target node, B will fail with "scp: : Is a directory" =item B<-R>|B<--recursive> I diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 9b3a3fe34..ae64092ef 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -4609,7 +4609,7 @@ sub defmk_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); @@ -4656,7 +4656,7 @@ sub defch_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); @@ -4700,7 +4700,7 @@ sub defls_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); @@ -4741,7 +4741,7 @@ sub defrm_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 0e89ff286..e3f63cb9a 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -335,8 +335,8 @@ start:xcatconfig_u_check_xcatsslversion_rhels_sles description:after xcatconfig -u the site.xcatsslversion will not be changed os:rhels,sles label:mn_only -cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1$' -check:rc==0 +cmd:mkdir -p /tmp/xcatconfig_u_check_xcatsslversion_rhels_sles +cmd:lsdef -t site clustersite -z >/tmp/xcatconfig_u_check_xcatsslversion_rhels_sles/clustersite.stanza cmd:chtab key=xcatsslversion site.value=TLSv12 check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv12$' @@ -345,8 +345,8 @@ cmd:xcatconfig -u check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv12$' check:rc==0 -cmd:chtab key=xcatsslversion site.value=TLSv1 -check:rc==0 +cmd: cat /tmp/xcatconfig_u_check_xcatsslversion_rhels_sles/clustersite.stanza |mkdef -zf +cmd: rm -rf /tmp/xcatconfig_u_check_xcatsslversion_rhels_sles end @@ -354,8 +354,8 @@ start:xcatconfig_u_check_xcatsslversion_ubuntu description:after xcatconfig -u the site.xcatsslversion will not be changed os:ubuntu label:mn_only -cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1$' -check:rc==0 +cmd:mkdir -p /tmp/xcatconfig_u_check_xcatsslversion_ubuntu +cmd:lsdef -t site clustersite -z >/tmp/xcatconfig_u_check_xcatsslversion_ubuntu/clustersite.stanza cmd:chtab key=xcatsslversion site.value=TLSv1_2 check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1_2$' @@ -364,6 +364,6 @@ cmd:xcatconfig -u check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1_2$' check:rc==0 -cmd:chtab key=xcatsslversion site.value=TLSv1 -check:rc==0 +cmd: cat /tmp/xcatconfig_u_check_xcatsslversion_ubuntu/clustersite.stanza |mkdef -zf +cmd: rm -rf /tmp/xcatconfig_u_check_xcatsslversion_ubuntu end diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 7a6186bf4..602919b5c 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -559,7 +559,11 @@ function configure_nicdevice { if [ $? -ne 0 ]; then errorcode=1 else - create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + if [ "$networkmanager_active" = "0" ]; then + create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + elif [ "$networkmanager_active" = "1" ]; then + create_bridge_interface_nmcli ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + fi fi #configure vlan elif [ x"$nic_dev_type" = "xvlan" ]; then @@ -570,11 +574,18 @@ function configure_nicdevice { vlanid=`echo "$nic_dev" | $sed -e 's/^\(.*\)vla\?n\?\([0-9]\+\)$/\2/'` vlanname=`echo "$nic_dev" | $sed -e 's/^\(.*\)vla\?n\?\([0-9]\+\)$/\1/'` fi - create_vlan_interface ifname=$vlanname vlanid=$vlanid - + if [ "$networkmanager_active" = "0" ]; then + create_vlan_interface ifname=$vlanname vlanid=$vlanid + elif [ "$networkmanager_active" = "1" ]; then + create_vlan_interface_nmcli ifname=$vlanname vlanid=$vlanid + fi #configure bond elif [ x"$nic_dev_type" = "xbond" ]; then - create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type + if [ "$networkmanager_active" = "0" ]; then + create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type + elif [ "$networkmanager_active" = "1" ]; then + create_bond_interface_nmcli ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type + fi elif [ x"$nic_dev_type" = "xinfiniband" ] || [ x"$nic_dev_type" = "xOmnipath" ]; then log_info "Call configib for IB nics: $nic_dev, ports: $num_iba_ports" log_info "NIC_IBNICS=$nic_dev NIC_IBAPORTS=$num_iba_ports configib" @@ -593,26 +604,6 @@ function configure_nicdevice { return $errorcode } -############################################################################ -# -# disable NetworkManager and start network -# -########################################################################### -function enable_network_service { - - checkservicestatus NetworkManager > /dev/null - if [ $? -eq 0 ]; then - log_info "NetworkManager is active. start to stop it ..." - stopservice NetworkManager | log_lines info - disableservice NetworkManager - enableservice network - startservice network - else - log_info "NetworkManager is inactive." - fi - -} - ############################################################################ # # Main process @@ -644,6 +635,17 @@ if [ $boot_install_nic -eq 1 ];then fi fi +#check if using NetworkManager or network service +networkmanager_active=2 +check_NetworkManager_or_network_service +if [ $? -eq 0 ]; then + networkmanager_active=0 +elif [ $? -eq 1 ]; then + networkmanager_active=1 +else + exit 1 +fi + #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` @@ -695,8 +697,6 @@ if [ -n "$valid_sorted_nicdevice_list" ]; then log_info "All valid nics and device list:" echo "$valid_sorted_nicdevice_list" |log_lines info fi -#enable network service -enable_network_service #config nics and ifcfg files configure_nicdevice "$valid_sorted_nicdevice_list" diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 74e6131ce..bc6dc1b47 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -743,6 +743,17 @@ function check_brctl() { fi } +############################################################################### +# +# check and set device managed +# input: ifname +# output: 0 managed +# 1 umanaged +# +############################################################################### +function check_and_set_device_managed() { + ifname=$1 +} ############################################################################### # @@ -1548,3 +1559,82 @@ function decode_arguments { return $rc } +############################################################################### +# +# check NetworkManager +# output: 2 error +# 1 using NetworkManager +# 0 using network +# +############################################################################## +function check_NetworkManager_or_network_service() { + #check NetworkManager is active + checkservicestatus NetworkManager > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + log_info "NetworkManager is active" + #check nmcli is installed + type $nmcli >/dev/null 2>/dev/null + if [ $? -ne 0 ]; then + log_error "There is no nmcli" + else + stopservice network | log_lines info + disableservice network | log_lines info + stopservice networking | log_lines info + disableservice networking | log_lines info + return 1 + fi + fi + checkservicestatus network > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + stopservice NetworkManager | log_lines info + disableservice NetworkManager | log_lines info + log_info "network service is active" + return 0 + fi + checkservicestatus networking > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + stopservice NetworkManager | log_lines info + disableservice NetworkManager | log_lines info + log_info "networking service is active" + return 0 + fi + log_error "NetworkManager, network.service and networking service are not active" + return 2 +} + +############################################################################### +# +# create vlan using nmcli +# +# input : ifname= slave_ports= xcatnet= _ipaddr= _netmask= _mtu= _bridge= vlanid= +# return : 0 success +# +############################################################################### +function create_vlan_interface_nmcli { + log_info "create_vlan_interface_nmcli $@" +} + +############################################################################### +# +# create bridge +# +# input : ifname= xcatnet= _ipaddr= _netmask= _port= _pretype= _brtype= _mtu= _bridge= +# +############################################################################### +function create_bridge_interface_nmcli { + log_info "create_bridge_interface_nmcli $@" + +} + +############################################################################################################################# +# +# create bond or bond->vlan interface +# https://www.kernel.org/doc/Documentation/networking/bonding.txt +# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Using_Channel_Bonding.html +# +# input : ifname= xcatnet= _ipaddr= _netmask= _bonding_opts= _mtu= slave_ports= +# +############################################################################################################################ +function create_bond_interface_nmcli { + log_info "create_bond_interface $@" +} diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index a06539bbd..057f25ccf 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -495,7 +495,6 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) download_postscripts "${SIP}:${HTTPPORT}" if [ $? -eq 0 ]; then downloaded=1 - break fi fi fi