diff --git a/docs/source/QA/index.rst b/docs/source/QA/index.rst index 00069abdd..2c8c72c0c 100644 --- a/docs/source/QA/index.rst +++ b/docs/source/QA/index.rst @@ -1,7 +1,8 @@ -Q/A list -======== +Questions & Answers +=================== .. toctree:: :maxdepth: 2 - makehosts_qa.rst + + makehosts.rst \ No newline at end of file diff --git a/docs/source/QA/makehosts.rst b/docs/source/QA/makehosts.rst new file mode 100644 index 000000000..ba9755033 --- /dev/null +++ b/docs/source/QA/makehosts.rst @@ -0,0 +1,133 @@ +DNS, Hostname, Alias +==================== + +Q: When there are multiple NICs, how to generate ``/etc/hosts`` records? +------------------------------------------------------------------------ + +When there are multiple NICs, and you want to use ``confignetwork`` to configure these NICs, suggest to use ``hosts`` table to configure the installation NIC (``installnic``) and to use ``nics`` table to configure secondary NICs. Refer to the following example to generate ``/etc/hosts`` records. + +**Best practice example**: + + * There are 2 networks in different domains: ``mgtnetwork`` and ``pubnetwork`` + * ``mgtnetwork`` is xCAT management network + * There are 2 adapters in system node1: ``eth0`` and ``eth1`` + * Add installnic ``eth0`` ``10.5.106.101`` record in ``/etc/hosts``, its alias is ``mgtnic`` + * hostnames ``node1-pub`` and ``node1.public.com`` are for nic ``eth1``, IP is ``192.168.30.101`` + +**Steps**: + + #. Add networks entry in ``networks`` table: :: + + chdef -t network mgtnetwork net=10.0.0.0 mask=255.0.0.0 domain=cluster.com + chdef -t network pubnetwork net=192.168.30.0 mask=255.255.255.0 domain=public.com + + #. Create ``node1`` with installnic IP ``10.5.106.101``, its alias is ``mgtnic``: :: + + chdef node1 ip=10.5.106.101 hostnames=mgtnic groups=all + + #. Configure ``eth1`` in ``nics`` table: :: + + chdef node1 nicips.eth1=192.168.30.101 nichostnamesuffixes.eth1=-pub nicaliases.eth1=node1.public.com nictypes.eth1=Ethernet nicnetworks.eth1=pubnetwork + + #. Check ``node1`` definition: :: + + lsdef node1 + Object name: node1 + groups=all + ip=10.5.106.101 + hostnames=mgtnic + nicaliases.eth1=node1.public.com + nichostnamesuffixes.eth1=-pub + nicips.eth1=192.168.30.101 + nicnetworks.eth1=pubnetwork + nictypes.eth1=Ethernet + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + + #. Execute ``makehosts -n`` to generate ``/etc/hosts`` records: :: + + makehosts -n + + #. Check results in ``/etc/hosts``: :: + + 10.5.106.101 node1 node1.cluster.com mgtnic + 192.168.30.101 node1-pub node1.public.com + + #. Edit ``/etc/resolv.conf``, xCAT management node IP like ``10.5.106.2`` is nameserver: :: + + search cluster.com public.com + nameserver 10.5.106.2 + + #. Execute ``makedns -n`` to configure DNS + + +Q: How to configure aliases? +---------------------------- + +There are 3 methods to configure aliases: + +#. Use ``hostnames`` in ``hosts`` table to configure aliases for the installnic. +#. If you want to use script ``confignetwork`` to configure secondary NICs, suggest to use ``aliases`` in ``nics`` table to configure aliases. Refer to :doc:`Configure Aliases <../guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_aliases>` +#. If you want to generate aliases records in ``/etc/hosts`` for secondary NICs and you don't want to use the script ``confignetwork`` to configure these NICs, suggest to use ``otherinterfaces`` in ``hosts`` table to configure aliases. Refer to following example: + + * If you want to add ``node1-hd`` ``20.1.1.1`` in ``hosts`` table, and don't use ``confignetwork`` to configure it, you can add ``otherinterfaces`` like this: :: + + chdef node1 otherinterfaces="node1-hd:20.1.1.1" + + * After executing ``makehosts -n``, you can get records in ``/etc/hosts`` like following: :: + + 20.1.1.1 node1-hd + +**Note**: If suffixes or aliases for the same IP are configured in both ``hosts`` table and ``nics`` table, will cause conflicts. ``makehosts`` will use values from ``nics`` table. The values from ``nics`` table will over-write that from ``hosts`` table to create ``/etc/hosts`` records. + +Q: How to handle the same short hostname in different domains? +-------------------------------------------------------------- + +You can follow the best practice example. + +**Best practice example**: + + * There are 2 networks in different domains: ``mgtnetwork`` and ``pubnetwork`` + * ``mgtnetwork`` is xCAT management network + * Generate 2 records with the same hostname in ``/etc/hosts``, like: :: + + 10.5.106.101 node1.cluster.com + 192.168.20.101 node1.public.com + + * Nameserver is xCAT management node IP + +**Steps**: + + #. Add networks entry in ``networks`` table: :: + + chdef -t network mgtnetwork net=10.0.0.0 mask=255.0.0.0 domain=cluster.com + chdef -t network pubnetwork net=192.168.30.0 mask=255.255.255.0 domain=public.com + + #. Create ``node1`` with ``ip=10.5.106.101``, xCAT can manage and install this node: :: + + chdef node1 ip=10.5.106.101 groups=all + + #. Create ``node1-pub`` with ``ip=192.168.30.101``, this node is only used to generate ``/etc/hosts`` records for public network, can use ``_unmanaged`` group name to label it: :: + + chdef node1-pub ip=192.168.30.101 hostnames=node1.public.com groups=_unmanaged + + #. Execute ``makehosts -n`` to generate ``/etc/hosts`` records: :: + + makehosts -n + + #. Check results in ``/etc/hosts``: :: + + 10.5.106.101 node1 node1.cluster.com + 192.168.30.101 node1-pub node1.public.com + + #. Edit ``/etc/resolv.conf``, for example, xCAT management node IP is 10.5.106.2 : :: + + search cluster.com public.com + nameserver 10.5.106.2 + + #. Execute ``makedns -n`` to configure DNS + +Q: When to use ``hosts`` table and ``nics`` table? +-------------------------------------------------- + +``hosts`` table is used to store IP addresses and hostnames of nodes. ``makehosts`` use these data to create ``/etc/hosts`` records. ``nics`` table is used to stores secondary NICs details. Some scripts like ``confignetwork`` use data from ``nics`` table to configure secondary NICs. ``makehosts`` also use these data to create ``/etc/hosts`` records for each NIC. diff --git a/docs/source/conf.py b/docs/source/conf.py index f62bace59..f5c5b3eaa 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.13.8' +release = '2.13.9' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 097c35655..abc48f8d7 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -63,7 +63,7 @@ OpenPOWER OpenBMC specific : \ **rflash**\ \ *noderange*\ \ *tar_file_path*\ {[\ **-c | -**\ **-check**\ ] | [\ **-a | -**\ **-activate**\ ] | [\ **-u | -**\ **-upload**\ ]} -\ **rflash**\ \ *noderange*\ \ *tar_file_directory*\ [\ **-d**\] [\ **--no-host-reboot**\] +\ **rflash**\ \ *noderange*\ \ *tar_file_directory*\ [\ **-d**\ ] [\ **-**\ **-no-host-reboot**\ ] \ **rflash**\ \ *noderange*\ \ *image_id*\ {[\ **-a | -**\ **-activate**\ ] | [\ **-**\ **-delete**\ ]} @@ -180,6 +180,24 @@ To apply the firmware level, a reboot is required to BMC and HOST. \ **Note:**\ When using \ **rflash**\ in hierarchical environment, the .tar file must be accessible from Service Nodes. +\ **-d**\ : + + +.. code-block:: perl + + This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and PNOR .tar files. When BMC and PNOR tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. + + +\ **Note:**\ When using \ **-**\ **-no-host-reboot**\ , it will not reboot the host after BMC is reboot. + +\ **-**\ **-delete**\ : + + +.. code-block:: perl + + This delete option will delete update image from BMC. It expects an ID as the input. + + \ **-d**\ : @@ -389,7 +407,7 @@ To apply the firmware level, a reboot is required to BMC and HOST. .. code-block:: perl - rflash p9euh02 -a /tmp/witherspoon.pnor.squashfs.tar + rflash p9euh02 -a /tmp/witherspoon.pnor.squashfs.tar diff --git a/docs/source/guides/admin-guides/references/man5/pdu.5.rst b/docs/source/guides/admin-guides/references/man5/pdu.5.rst index 5d5076cfb..c94edf9fe 100644 --- a/docs/source/guides/admin-guides/references/man5/pdu.5.rst +++ b/docs/source/guides/admin-guides/references/man5/pdu.5.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **pdu Attributes:**\ \ *node*\ , \ *nodetype*\ , \ *outlet*\ , \ *machinetype*\ , \ *modelnum*\ , \ *serialnum*\ , \ *comments*\ , \ *disable*\ +\ **pdu Attributes:**\ \ *node*\ , \ *nodetype*\ , \ *pdutype*\ , \ *outlet*\ , \ *username*\ , \ *password*\ , \ *snmpversion*\ , \ *community*\ , \ *snmpuser*\ , \ *authtype*\ , \ *authkey*\ , \ *privtype*\ , \ *privkey*\ , \ *seclevel*\ , \ *comments*\ , \ *disable*\ *********** @@ -48,27 +48,75 @@ pdu Attributes: +\ **pdutype**\ + + The type of pdu + + + \ **outlet**\ The pdu outlet count -\ **machinetype**\ +\ **username**\ - The pdu machine type + The remote login user name -\ **modelnum**\ +\ **password**\ - The pdu model number + The remote login password -\ **serialnum**\ +\ **snmpversion**\ - The pdu serial number + The version to use to communicate with switch. SNMPv1 is assumed by default. + + + +\ **community**\ + + The community string to use for SNMPv1/v2 + + + +\ **snmpuser**\ + + The username to use for SNMPv3 communication, ignored for SNMPv1 + + + +\ **authtype**\ + + The authentication protocol(MD5|SHA) to use for SNMPv3. + + + +\ **authkey**\ + + The authentication passphrase for SNMPv3 + + + +\ **privtype**\ + + The privacy protocol(AES|DES) to use for SNMPv3. + + + +\ **privkey**\ + + The privacy passphrase to use for SNMPv3. + + + +\ **seclevel**\ + + The Security Level(noAuthNoPriv|authNoPriv|authPriv) to use for SNMPv3. diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 0995bf85c..de06fff57 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\ +\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *authkey*\ , \ *authtype*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *community*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *pdutype*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *privkey*\ , \ *privtype*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *seclevel*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpuser*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\ *********** @@ -57,6 +57,18 @@ group Attributes: +\ **authkey**\ (pdu.authkey) + + The authentication passphrase for SNMPv3 + + + +\ **authtype**\ (pdu.authtype) + + The authentication protocol(MD5|SHA) to use for SNMPv3. + + + \ **bmc**\ (ipmi.bmc, openbmc.bmc) The hostname of the BMC adapter. @@ -179,6 +191,12 @@ group Attributes: +\ **community**\ (pdu.community) + + The community string to use for SNMPv1/v2 + + + \ **cons**\ (nodehm.cons) The console method. If nodehm.serialport is set, this will default to the nodehm.mgt setting, otherwise it defaults to unused. Valid values: cyclades, mrv, or the values valid for the mgt attribute. @@ -457,12 +475,6 @@ group Attributes: -\ **machinetype**\ (pdu.machinetype) - - The pdu machine type - - - \ **membergroups**\ (nodegroup.membergroups) This attribute stores a comma-separated list of nodegroups that this nodegroup refers to. This attribute is only used by PCM. @@ -529,12 +541,6 @@ group Attributes: -\ **modelnum**\ (pdu.modelnum) - - The pdu model number - - - \ **monserver**\ (noderes.monserver) The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node. @@ -780,7 +786,7 @@ group Attributes: -\ **password**\ (ppchcp.password, mpa.password, websrv.password, switches.sshpassword) +\ **password**\ (ppchcp.password, mpa.password, websrv.password, pdu.password, switches.sshpassword) Password of the HMC or IVM. If not filled in, xCAT will look in the passwd table for key=hmc or key=ivm. If not in the passwd table, the default used is abc123 for HMCs and padmin for IVMs. @@ -794,6 +800,10 @@ group Attributes: or + The remote login password + + or + The remote login password. It can be for ssh or telnet. If it is for telnet, set protocol to "telnet". If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key. @@ -804,6 +814,12 @@ group Attributes: +\ **pdutype**\ (pdu.pdutype) + + The type of pdu + + + \ **postbootscripts**\ (postscripts.postbootscripts) Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command @@ -867,6 +883,18 @@ group Attributes: +\ **privkey**\ (pdu.privkey) + + The privacy passphrase to use for SNMPv3. + + + +\ **privtype**\ (pdu.privtype) + + The privacy protocol(AES|DES) to use for SNMPv3. + + + \ **productkey**\ (prodkey.key) The product key relevant to the aforementioned node/group and product combination @@ -909,6 +937,12 @@ group Attributes: +\ **seclevel**\ (pdu.seclevel) + + The Security Level(noAuthNoPriv|authNoPriv|authPriv) to use for SNMPv3. + + + \ **serial**\ (vpd.serial) The serial number of the node. @@ -921,12 +955,6 @@ group Attributes: -\ **serialnum**\ (pdu.serialnum) - - The pdu serial number - - - \ **serialport**\ (nodehm.serialport) The serial port for this node, in the linux numbering style (0=COM1/ttyS0, 1=COM2/ttyS1). For SOL on IBM blades, this is typically 1. For rackmount IBM servers, this is typically 0. @@ -1067,13 +1095,23 @@ group Attributes: +\ **snmpuser**\ (pdu.snmpuser) + + The username to use for SNMPv3 communication, ignored for SNMPv1 + + + \ **snmpusername**\ (switches.username) The username to use for SNMPv3 communication, ignored for SNMPv1 -\ **snmpversion**\ (switches.snmpversion) +\ **snmpversion**\ (pdu.snmpversion, switches.snmpversion) + + The version to use to communicate with switch. SNMPv1 is assumed by default. + + or The version to use to communicate with switch. SNMPv1 is assumed by default. @@ -1195,7 +1233,7 @@ group Attributes: -\ **username**\ (ppchcp.username, mpa.username, websrv.username, switches.sshusername) +\ **username**\ (ppchcp.username, mpa.username, websrv.username, pdu.username, switches.sshusername) Userid of the HMC or IVM. If not filled in, xCAT will look in the passwd table for key=hmc or key=ivm. If not in the passwd table, the default used is hscroot for HMCs and padmin for IVMs. @@ -1209,6 +1247,10 @@ group Attributes: or + The remote login user name + + or + The remote login user name. It can be for ssh or telnet. If it is for telnet, set protocol to "telnet". If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 060e5fc74..63d82dfa8 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\ +\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *authkey*\ , \ *authtype*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *community*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *pdutype*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *privkey*\ , \ *privtype*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *seclevel*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpuser*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\ *********** @@ -69,6 +69,18 @@ node Attributes: +\ **authkey**\ (pdu.authkey) + + The authentication passphrase for SNMPv3 + + + +\ **authtype**\ (pdu.authtype) + + The authentication protocol(MD5|SHA) to use for SNMPv3. + + + \ **bmc**\ (ipmi.bmc, openbmc.bmc) The hostname of the BMC adapter. @@ -191,6 +203,12 @@ node Attributes: +\ **community**\ (pdu.community) + + The community string to use for SNMPv1/v2 + + + \ **cons**\ (nodehm.cons) The console method. If nodehm.serialport is set, this will default to the nodehm.mgt setting, otherwise it defaults to unused. Valid values: cyclades, mrv, or the values valid for the mgt attribute. @@ -469,12 +487,6 @@ node Attributes: -\ **machinetype**\ (pdu.machinetype) - - The pdu machine type - - - \ **memory**\ (hwinv.memory) The size of the memory for the node in MB. @@ -529,12 +541,6 @@ node Attributes: -\ **modelnum**\ (pdu.modelnum) - - The pdu model number - - - \ **monserver**\ (noderes.monserver) The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node. @@ -786,7 +792,7 @@ node Attributes: -\ **password**\ (ppchcp.password, mpa.password, websrv.password, switches.sshpassword) +\ **password**\ (ppchcp.password, mpa.password, websrv.password, pdu.password, switches.sshpassword) Password of the HMC or IVM. If not filled in, xCAT will look in the passwd table for key=hmc or key=ivm. If not in the passwd table, the default used is abc123 for HMCs and padmin for IVMs. @@ -800,6 +806,10 @@ node Attributes: or + The remote login password + + or + The remote login password. It can be for ssh or telnet. If it is for telnet, set protocol to "telnet". If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key. @@ -810,6 +820,12 @@ node Attributes: +\ **pdutype**\ (pdu.pdutype) + + The type of pdu + + + \ **postbootscripts**\ (postscripts.postbootscripts) Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command @@ -879,6 +895,18 @@ node Attributes: +\ **privkey**\ (pdu.privkey) + + The privacy passphrase to use for SNMPv3. + + + +\ **privtype**\ (pdu.privtype) + + The privacy protocol(AES|DES) to use for SNMPv3. + + + \ **productkey**\ (prodkey.key) The product key relevant to the aforementioned node/group and product combination @@ -921,6 +949,12 @@ node Attributes: +\ **seclevel**\ (pdu.seclevel) + + The Security Level(noAuthNoPriv|authNoPriv|authPriv) to use for SNMPv3. + + + \ **serial**\ (vpd.serial) The serial number of the node. @@ -933,12 +967,6 @@ node Attributes: -\ **serialnum**\ (pdu.serialnum) - - The pdu serial number - - - \ **serialport**\ (nodehm.serialport) The serial port for this node, in the linux numbering style (0=COM1/ttyS0, 1=COM2/ttyS1). For SOL on IBM blades, this is typically 1. For rackmount IBM servers, this is typically 0. @@ -1079,13 +1107,23 @@ node Attributes: +\ **snmpuser**\ (pdu.snmpuser) + + The username to use for SNMPv3 communication, ignored for SNMPv1 + + + \ **snmpusername**\ (switches.username) The username to use for SNMPv3 communication, ignored for SNMPv1 -\ **snmpversion**\ (switches.snmpversion) +\ **snmpversion**\ (pdu.snmpversion, switches.snmpversion) + + The version to use to communicate with switch. SNMPv1 is assumed by default. + + or The version to use to communicate with switch. SNMPv1 is assumed by default. @@ -1231,7 +1269,7 @@ node Attributes: -\ **username**\ (ppchcp.username, mpa.username, websrv.username, switches.sshusername) +\ **username**\ (ppchcp.username, mpa.username, websrv.username, pdu.username, switches.sshusername) Userid of the HMC or IVM. If not filled in, xCAT will look in the passwd table for key=hmc or key=ivm. If not in the passwd table, the default used is hscroot for HMCs and padmin for IVMs. @@ -1245,6 +1283,10 @@ node Attributes: or + The remote login user name + + or + The remote login user name. It can be for ssh or telnet. If it is for telnet, set protocol to "telnet". If the sshusername is blank, the username, password and protocol will be retrieved from the passwd table with "switch" as the key. diff --git a/docs/source/guides/admin-guides/references/man7/pdu.7.rst b/docs/source/guides/admin-guides/references/man7/pdu.7.rst index 1e2397a42..a9aaae2b6 100644 --- a/docs/source/guides/admin-guides/references/man7/pdu.7.rst +++ b/docs/source/guides/admin-guides/references/man7/pdu.7.rst @@ -40,15 +40,11 @@ pdu Attributes: \ **machinetype**\ (pdu.machinetype) - - The pdu machine type - + \ **modelnum**\ (pdu.modelnum) - - The pdu model number - + \ **node**\ (pdu.node) @@ -70,9 +66,7 @@ pdu Attributes: \ **serialnum**\ (pdu.serialnum) - - The pdu serial number - + diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 53c2c5c89..56e021d2c 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -14,6 +14,17 @@ xCAT 2.13.x |xCAT |New OS |New |New Feature | |Version | |Hardware | | +=================================+===============+=============+==================================+ +|| xCAT 2.13.9 | | |- OpenBMC support: | +|| 2017/12/18 | | | | +|| | | | rflash -a/-u enhance, add -d | +| `2.13.9 Release Notes `_ | | | | +| | | | rspconfig dump,hostname, | +| | | | ntpserver,admin_passwd | +| | | | | +| | | |- goconserver for OpenBMC | ++---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.13.8 | | |- OpenBMC support: | || 2017/11/3 | | | | || | | | rflash/rpower run parallelly | diff --git a/docs/source/security/2017/20171212_tls.rst b/docs/source/security/2017/20171212_tls.rst new file mode 100644 index 000000000..87eeffd86 --- /dev/null +++ b/docs/source/security/2017/20171212_tls.rst @@ -0,0 +1,29 @@ +2017-12-12 - TLS Vulnerabilities +================================ + +*Dec 12, 2017*, TLS implementations may disclose side channel information via discrepencies between valid and invalid PKCS#1 padding + +Advisory CVEs +------------- + +* CWE-203 - http://cwe.mitre.org/data/definitions/203.html + +Summary +------- + +Transport Layer Security (TLS) is a mechanism for a security transport over network connections, and is defined in RFC 5246. TLS may utilize RSA cryptography to secure the connection, and section 7.4.7 describes how client and server may exchange keys. Implementations that don't closely follow the descriptions in RFC 5246 may leak information to an attacker when they handle PKCS #1 v1.5 padding errors in ways that lets the attacker distinguish between valid and invalid messages. An attacker may utilize discrepancies in TLS error messages to obtain the pre-master secret key private RSA key used by TLS to decrypt sensitive data. This type of attack has become known as a Bleichenbacher attack. CERT/CC previously published CERT Advisory CA-1998-07 for this type of attack. + +Action +------ + +Consider the following recommended actions: + +1. Disable TLS RSA +2. Apply an update (if available) + + +xCAT uses OpenSSL for client-server communication but **does not** ship it. + +It is highly recommended to keep your OpenSSL levels up-to-date. Obtain the updated software packages from your Operating system distribution channels. + + diff --git a/docs/source/security/2017/index.rst b/docs/source/security/2017/index.rst index 78e927e17..1786e2562 100644 --- a/docs/source/security/2017/index.rst +++ b/docs/source/security/2017/index.rst @@ -4,6 +4,7 @@ .. toctree:: :maxdepth: 1 + 20171212_tls.rst 20170828_openssl.rst 20170216_openssl.rst 20170126_openssl.rst diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 695db59d7..92bc14928 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -79,6 +79,7 @@ $::RSPCONFIG_DUMP_WAIT_TOTALTIME = int($::RSPCONFIG_DUMP_INTERVAL*$::RSPCONFIG_D $::RSPCONFIG_WAIT_VLAN_DONE = 15; $::RSPCONFIG_WAIT_IP_DONE = 3; $::RSPCONFIG_DUMP_CMD_TIME = 0; +$::RSPCONFIG_CONFIGURED_API_KEY = -1; $::XCAT_LOG_DIR = "/var/log/xcat"; $::RAS_POLICY_TABLE = "/opt/ibm/ras/lib/policyTable.json"; @@ -365,6 +366,13 @@ my %status_info = ( RSPCONFIG_GET_RESPONSE => { process => \&rspconfig_response, }, + RSPCONFIG_GET_NIC_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/network/enumerate", + }, + RSPCONFIG_GET_NIC_RESPONSE => { + process => \&rspconfig_response, + }, RSPCONFIG_SET_PASSWD_REQUEST => { method => "POST", init_url => "/xyz/openbmc_project/user/root/action/SetPassword", @@ -378,6 +386,11 @@ my %status_info = ( init_url => "$openbmc_project_url/network/config/attr/HostName", data => "[]", }, + RSPCONFIG_SET_NTPSERVERS_REQUEST => { + method => "PUT", + init_url => "$openbmc_project_url/network/#NIC#/attr/NTPServers", + data => "[]", + }, RSPCONFIG_SET_RESPONSE => { process => \&rspconfig_response, }, @@ -481,6 +494,54 @@ my %status_info = ( RVITALS_RESPONSE => { process => \&rvitals_response, }, + RSPCONFIG_API_CONFIG_ON_REQUEST => { + method => "PUT", + init_url => "$openbmc_project_url", + data => "true", + }, + RSPCONFIG_API_CONFIG_ON_RESPONSE => { + process => \&rspconfig_api_config_response, + }, + RSPCONFIG_API_CONFIG_OFF_REQUEST => { + method => "PUT", + init_url => "$openbmc_project_url", + data => "false", + }, + RSPCONFIG_API_CONFIG_OFF_RESPONSE => { + process => \&rspconfig_api_config_response, + }, + RSPCONFIG_API_CONFIG_QUERY_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url", + }, + RSPCONFIG_API_CONFIG_QUERY_RESPONSE => { + process => \&rspconfig_api_config_response, + }, +); + +# Setup configured subcommand. Currently only rspconfig is supported and only for boolean commands. +# For example: rspconfig +# rspconfig =0 +# rspconfig =1 +# +# +my %api_config_info = ( + RSPCONFIG_AUTO_REBOOT => { + command => "rspconfig", + url => "/control/host0/auto_reboot", + attr_url => "AutoReboot", + display_name => "AutoReboot", + type => "boolean", + subcommand => "autoreboot", + }, + RSPCONFIG_POWERSUPPLY_REDUNDENCY => { + command => "rspconfig", + url => "/sensors/chassis/PowerSupplyRedundancy", + attr_url => "PowerSupplyRedundency", + display_name => "PowerSupplyRedundency", + type => "boolean", + subcommand => "powersupplyredundency", + }, ); $::RESPONSE_OK = "200 OK"; @@ -990,13 +1051,18 @@ sub parse_args { my $setorget; my $all_subcommand = ""; foreach $subcommand (@ARGV) { - if ($subcommand =~ /^(\w+)=(.*)/) { + $::RSPCONFIG_CONFIGURED_API_KEY = &is_valid_config_api($subcommand, $callback); + if ($::RSPCONFIG_CONFIGURED_API_KEY != -1) { + # subcommand defined in the configured API hash, return from here, the RSPCONFIG_CONFIGURED_API_KEY is the key into the hash + return; + } + elsif ($subcommand =~ /^(\w+)=(.*)/) { return ([ 1, "Can not set and query OpenBMC information at the same time" ]) if ($setorget and $setorget eq "get"); my $key = $1; my $value = $2; return ([ 1, "Changing ipsrc value is currently not supported." ]) if ($key eq "ipsrc"); - return ([ 1, "Unsupported command: $command $key" ]) unless ($key =~ /^ip$|^netmask$|^gateway$|^hostname$|^vlan$|^admin_passwd$/); - return ([ 1, "The option '$key' can not work with other options." ]) if ($key =~ /^hostname$|^admin_passwd$/ and $num_subcommand > 1); + return ([ 1, "Unsupported command: $command $key" ]) unless ($key =~ /^ip$|^netmask$|^gateway$|^hostname$|^vlan$|^admin_passwd$|^ntpservers$/); + return ([ 1, "The option '$key' can not work with other options." ]) if ($key =~ /^hostname$|^admin_passwd$|^ntpservers$/ and $num_subcommand > 1); if ($key eq "admin_passwd") { my $comma_num = $value =~ tr/,/,/; return ([ 1, "Invalid parameter for option $key: $value" ]) if ($comma_num != 1); @@ -1006,7 +1072,7 @@ sub parse_args { } my $nodes_num = @$noderange; - return ([ 1, "Invalid parameter for option $key" ]) unless ($value); + return ([ 1, "Invalid parameter for option $key" ]) if (!$value and $key ne ("ntpservers")); return ([ 1, "Invalid parameter for option $key: $value" ]) if (($key eq "netmask") and !xCAT::NetworkUtils->isIpaddr($value)); return ([ 1, "Invalid parameter for option $key: $value" ]) if (($key eq "gateway") and ($value !~ "0.0.0.0" and !xCAT::NetworkUtils->isIpaddr($value))); if ($key eq "ip") { @@ -1024,7 +1090,7 @@ sub parse_args { $all_subcommand .= $key . ","; } $setorget = "set"; - } elsif ($subcommand =~ /^ip$|^netmask$|^gateway$|^hostname$|^vlan$|^ipsrc$/) { + } elsif ($subcommand =~ /^ip$|^netmask$|^gateway$|^hostname$|^vlan$|^ipsrc$|^ntpservers$/) { return ([ 1, "Can not set and query OpenBMC information at the same time" ]) if ($setorget and $setorget eq "set"); $setorget = "get"; } elsif ($subcommand =~ /^sshcfg$/) { @@ -1354,6 +1420,41 @@ sub parse_command_status { if ($command eq "rspconfig") { my @options = (); my $num_subcommand = @$subcommands; + #Setup chain to process the configured command + if ($::RSPCONFIG_CONFIGURED_API_KEY != -1) { + $subcommand = $$subcommands[0]; + # Check if setting or quering + if ($subcommand =~ /^(\w+)=(.*)/) { + # setting + my $subcommand_key = $1; + my $subcommand_value = $2; + + if ($subcommand_value eq "1") { + # Setup chain for subcommand=1 + $next_status{LOGIN_RESPONSE} = "RSPCONFIG_API_CONFIG_ON_REQUEST"; + $status_info{RSPCONFIG_API_CONFIG_ON_REQUEST}{init_url} = $status_info{RSPCONFIG_API_CONFIG_ON_REQUEST}{init_url} . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{url} . "/attr/" . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}; + $next_status{RSPCONFIG_API_CONFIG_ON_REQUEST} = "RSPCONFIG_API_CONFIG_ON_RESPONSE"; + } + elsif ($subcommand_value eq "0") { + # Setup chain for subcommand=0 + $next_status{LOGIN_RESPONSE} = "RSPCONFIG_API_CONFIG_OFF_REQUEST"; + $status_info{RSPCONFIG_API_CONFIG_OFF_REQUEST}{init_url} = $status_info{RSPCONFIG_API_CONFIG_OFF_REQUEST}{init_url} . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{url} . "/attr/" . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}; + $next_status{RSPCONFIG_API_CONFIG_OFF_REQUEST} = "RSPCONFIG_API_CONFIG_OFF_RESPONSE"; + } + else { + # Everything else is invalid + xCAT::SvrUtils::sendmsg([1, "Invalid value $subcommand_value for 'rspconfig $subcommand_key=$subcommand_value' command"], $callback); + return 1; + } + } + else { + # Setup chain for query subcommand + $next_status{LOGIN_RESPONSE} = "RSPCONFIG_API_CONFIG_QUERY_REQUEST"; + $status_info{RSPCONFIG_API_CONFIG_QUERY_REQUEST}{init_url} = $status_info{RSPCONFIG_API_CONFIG_QUERY_REQUEST}{init_url} . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{url}; + $next_status{RSPCONFIG_API_CONFIG_QUERY_REQUEST} = "RSPCONFIG_API_CONFIG_QUERY_RESPONSE"; + } + return 0; + } if ($num_subcommand == 1) { $subcommand = $$subcommands[0]; if ($subcommand =~ /^sshcfg$/) { @@ -1381,6 +1482,19 @@ sub parse_command_status { $status_info{RSPCONFIG_GET_RESPONSE}{argv} = "hostname"; return 0; } + if ($subcommand =~ /^ntpservers=(.*)/) { + $next_status{LOGIN_RESPONSE} = "RSPCONFIG_GET_NIC_REQUEST"; + $next_status{RSPCONFIG_GET_NIC_REQUEST} = "RSPCONFIG_GET_NIC_RESPONSE"; + $next_status{RSPCONFIG_GET_NIC_RESPONSE} = "RSPCONFIG_SET_NTPSERVERS_REQUEST"; + $next_status{RSPCONFIG_SET_NTPSERVERS_REQUEST} = "RSPCONFIG_SET_RESPONSE"; + $next_status{RSPCONFIG_SET_RESPONSE} = "RSPCONFIG_GET_REQUEST"; + $next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE"; + + $status_info{RSPCONFIG_GET_RESPONSE}{argv} = "ntpservers"; + $status_info{RSPCONFIG_SET_RESPONSE}{argv} = "NTPServers"; + $status_info{RSPCONFIG_SET_NTPSERVERS_REQUEST}{data} = "[\"$1\"]"; + return 0; + } } $subcommand = $$subcommands[0]; @@ -1450,7 +1564,7 @@ sub parse_command_status { my $type = "obj"; my %tmp_hash = (); foreach $subcommand (@$subcommands) { - if ($subcommand =~ /^ip$|^netmask$|^gateway$|^hostname$|^vlan$|^ipsrc$/) { + if ($subcommand =~ /^ip$|^netmask$|^gateway$|^hostname$|^vlan$|^ipsrc$|^ntpservers$/) { $type = "get"; push @options, $subcommand; } elsif ($subcommand =~ /^(\w+)=(.+)/) { @@ -2811,11 +2925,11 @@ sub rspconfig_response { my $response_info; $response_info = decode_json $response->content if ($response); - if ($node_info{$node}{cur_status} eq "RSPCONFIG_GET_RESPONSE") { + if ($node_info{$node}{cur_status} eq "RSPCONFIG_GET_RESPONSE" or $node_info{$node}{cur_status} eq "RSPCONFIG_GET_NIC_RESPONSE") { my $hostname = ""; my $default_gateway = "n/a"; my %nicinfo = (); - my $error; + my $multiple_error = ""; my @output; my $grep_string = $status_info{RSPCONFIG_GET_RESPONSE}{argv}; foreach my $key_url (keys %{$response_info->{data}}) { @@ -2846,79 +2960,99 @@ sub rspconfig_response { my $nic = $path; $nic =~ s/(.*\/)//g; unless (defined($nicinfo{$nic}{address})) { - $nicinfo{$nic}{address} = "n/a"; - $nicinfo{$nic}{gateway} = "n/a"; - $nicinfo{$nic}{ipsrc} = "n/a"; - $nicinfo{$nic}{netmask} = "n/a"; - $nicinfo{$nic}{prefix} = "n/a"; + $nicinfo{$nic}{address} = (); + $nicinfo{$nic}{gateway} = (); + $nicinfo{$nic}{ipsrc} = (); + $nicinfo{$nic}{netmask} = (); + $nicinfo{$nic}{prefix} = (); $nicinfo{$nic}{vlan} = "Disable"; } if (defined($content{Address}) and $content{Address}) { - unless ($nicinfo{$nic}{address} =~ /n\/a/) { - # We have already processed an entry with adapter information. - # This must be a second entry. Display an error. Currently only supporting - # an adapter with a single IP address set. - $error = "Interfaces with multiple IP addresses are not supported"; - $node_info{$node}{cur_status} = ""; - # Terminate loop on this error unless we are looking for hostname to display - last unless ($grep_string =~ /(.*)hostname(.*)/); + if ($content{Address} eq $node_info{$node}{bmcip} and $node_info{$node}{cur_status} eq "RSPCONFIG_GET_NIC_RESPONSE") { + $status_info{RSPCONFIG_SET_NTPSERVERS_REQUEST}{init_url} =~ s/#NIC#/$nic/g; + if ($next_status{"RSPCONFIG_GET_NIC_RESPONSE"}) { + $node_info{$node}{cur_status} = $next_status{"RSPCONFIG_GET_NIC_RESPONSE"}; + gen_send_request($node); + return; + } } - $nicinfo{$nic}{address} = $content{Address}; + if ($nicinfo{$nic}{address}) { + $multiple_error = "Interfaces with multiple IP addresses are not supported"; + } + push @{ $nicinfo{$nic}{address} }, $content{Address}; } if (defined($content{Gateway}) and $content{Gateway}) { - $nicinfo{$nic}{gateway} = $content{Gateway}; + push @{ $nicinfo{$nic}{gateway} }, $content{Gateway}; } if (defined($content{PrefixLength}) and $content{PrefixLength}) { - $nicinfo{$nic}{prefix} = $content{PrefixLength}; + push @{ $nicinfo{$nic}{prefix} }, $content{PrefixLength}; } if (defined($content{Origin})) { - $nicinfo{$nic}{ipsrc} = $content{Origin}; - $nicinfo{$nic}{ipsrc} =~ s/^.*\.(\w+)/$1/; + my $ipsrc_tmp = $content{Origin}; + $ipsrc_tmp =~ s/^.*\.(\w+)/$1/; + push @{ $nicinfo{$nic}{ipsrc} }, $ipsrc_tmp; } - + if (defined($response_info->{data}->{$path}->{Id})) { $nicinfo{$nic}{vlan} = $response_info->{data}->{$path}->{Id}; } + + if (defined($response_info->{data}->{$path}->{NTPServers})) { + $nicinfo{$nic}{ntpservers} = join(",", @{ $response_info->{data}->{$path}->{NTPServers} }); + } } } - if ($grep_string =~ /(.*)hostname(.*)/) { - xCAT::SvrUtils::sendmsg("BMC hostname: $hostname", $callback, $node); - unless ($1 or $2) { - $wait_node_num--; - return; - } - } + if (scalar (keys %nicinfo) == 0) { - $error = "No valid BMC network information"; + my $error = "No valid BMC network information"; + xCAT::SvrUtils::sendmsg([1, "$error"], $callback, $node); $node_info{$node}{cur_status} = ""; - } - if ($error) { - xCAT::SvrUtils::sendmsg([1,"$error"], $callback, $node); } else { my @address = (); my @ipsrc = (); my @netmask = (); my @gateway = (); my @vlan = (); + my @ntpservers = (); my @nics = keys %nicinfo; foreach my $nic (@nics) { my $addon_info = ''; if ($#nics > 1) { $addon_info = " for $nic"; } - push @address, "BMC IP$addon_info: $nicinfo{$nic}{address}"; - push @ipsrc, "BMC IP Source$addon_info: $nicinfo{$nic}{ipsrc}"; + + if ($nicinfo{$nic}{ntpservers}) { + push @ntpservers, "BMC NTP Servers$addon_info: $nicinfo{$nic}{ntpservers}"; + } else { + push @ntpservers, "BMC NTP Servers$addon_info: None"; + } + + next if ($multiple_error); + + push @address, "BMC IP$addon_info: ${ $nicinfo{$nic}{address} }[0]"; + push @ipsrc, "BMC IP Source$addon_info: ${ $nicinfo{$nic}{ipsrc} }[0]"; if ($nicinfo{$nic}{address}) { - my $mask_shift = 32 - $nicinfo{$nic}{prefix}; - my $decimal_mask = (2 ** $nicinfo{$nic}{prefix} - 1) << $mask_shift; + my $mask_shift = 32 - ${ $nicinfo{$nic}{prefix} }[0]; + my $decimal_mask = (2 ** ${ $nicinfo{$nic}{prefix} }[0] - 1) << $mask_shift; push @netmask, "BMC Netmask$addon_info: " . join('.', unpack("C4", pack("N", $decimal_mask))); } - push @gateway, "BMC Gateway$addon_info: $nicinfo{$nic}{gateway} (default: $default_gateway)"; + push @gateway, "BMC Gateway$addon_info: ${ $nicinfo{$nic}{gateway} }[0] (default: $default_gateway)"; push @vlan, "BMC VLAN ID$addon_info: $nicinfo{$nic}{vlan}"; } + my $mul_out = 0; foreach my $opt (split /,/,$grep_string) { + if ($opt eq "hostname") { + push @output, "BMC Hostname: $hostname"; + } elsif ($opt eq "ntpservers") { + push @output, @ntpservers; + } + + if ($multiple_error and ($opt =~ /^ip$|^ipsrc$|^netmask$|^gateway$|^vlan$/)) { + $mul_out = 1; + next; + } if ($opt eq "ip") { push @output, @address; } elsif ($opt eq "ipsrc") { @@ -2931,8 +3065,14 @@ sub rspconfig_response { push @output, @vlan; } } + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@output); - + if ($multiple_error and $mul_out) { + xCAT::SvrUtils::sendmsg([1, "$multiple_error"], $callback, $node); + $wait_node_num--; + return; + } + if ($grep_string eq "all") { # If all current values equal the input, just print out message my @checks = split("-", $status_info{RSPCONFIG_CHECK_RESPONSE}{argv}); @@ -2944,9 +3084,9 @@ sub rspconfig_response { my ($check_ip,$check_netmask,$check_gateway) = @checks; my $the_nic_to_config = undef; foreach my $nic (@nics) { - my $address = $nicinfo{$nic}{address}; - my $prefix = $nicinfo{$nic}{prefix}; - my $gateway = $nicinfo{$nic}{gateway}; + my $address = ${ $nicinfo{$nic}{address} }[0]; + my $prefix = ${ $nicinfo{$nic}{prefix} }[0]; + my $gateway = ${ $nicinfo{$nic}{gateway} }[0]; if ($check_ip eq $address and $check_netmask eq $prefix and $check_gateway eq $gateway) { if (($check_vlan and $check_vlan eq $nicinfo{$nic}{vlan}) or !$check_vlan) { $next_status{ $node_info{$node}{cur_status} } = "RSPCONFIG_PRINT_BMCINFO"; @@ -3087,6 +3227,78 @@ sub rspconfig_response { #------------------------------------------------------- +=head3 rspconfig_api_config_response + + Deal with response of rspconfig command for configured subcommand + + Currently understands only generic boolean setting and query responses + Input: + $node: nodename of current response + $response: Async return response + +=cut + +#------------------------------------------------------- +sub rspconfig_api_config_response { + my $node = shift; + my $response = shift; + + my $response_info; + my $value = -1; + $response_info = decode_json $response->content if ($response); + + + if ($node_info{$node}{cur_status}) { + if ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ON_RESPONSE") { + if ($response_info->{'message'} eq $::RESPONSE_OK) { + xCAT::SvrUtils::sendmsg("BMC Setting ". $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . "...", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("Error setting RSPCONFIG_API_CONFIG_ON_RESPONSE", $callback, $node); + } + } + elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_OFF_RESPONSE") { + if ($response_info->{'message'} eq $::RESPONSE_OK) { + xCAT::SvrUtils::sendmsg("BMC Setting ". $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . "...", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("Error unsetting RSPCONFIG_API_CONFIG_OFF_RESPONSE", $callback, $node); + } + } + elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") { + if ($response_info->{'message'} eq $::RESPONSE_OK) { + foreach my $key_url (keys %{$response_info->{data}}) { + if ($key_url eq $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}) { + #Is this the attribute we are looking for ? + $value = $response_info->{data}{$key_url}; + last; + } + } + if (scalar($value) >= 0) { + xCAT::SvrUtils::sendmsg($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . ": $value", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("Unable to query value for " . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}, $callback, $node); + } + } + else { + xCAT::SvrUtils::sendmsg("Error query RSPCONFIG_API_CONFIG_QUERY_RESPONSE", $callback, $node); + } + } + } + + if ($next_status{ $node_info{$node}{cur_status} }) { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + if ($node_info{$node}{method} || $status_info{ $node_info{$node}{cur_status} }{method}) { + gen_send_request($node); + } + } else { + $wait_node_num--; + } +} + +#------------------------------------------------------- + =head3 rspconfig_sshcfg_response Deal with request and response of rspconfig command for sscfg subcommand. @@ -3902,4 +4114,39 @@ sub rflash_upload { close (RFLASH_LOG_FILE_HANDLE); return 0; } + +#------------------------------------------------------- + +=head3 is_valid_config_api + + Verify passed in subcomaand is defined in the api_config_info + Input: + $subcommand: subcommand to verify + $callback: callback for message display + + Output: + returns index into the hash of the $subcommand + returns -1 if no match + +=cut + +#------------------------------------------------------- +sub is_valid_config_api { + my ($subcommand, $callback) = @_; + + my $subcommand_key = $subcommand; + my $subcommand_value; + if ($subcommand =~ /^(\w+)=(.*)/) { + $subcommand_key = $1; + $subcommand_value = $2; + } + foreach my $config_subcommand (keys %api_config_info) { + foreach my $config_attribute (keys %{ $api_config_info{$config_subcommand} }) { + if ($subcommand_key eq $api_config_info{$config_subcommand}{subcommand}) { + return $config_subcommand; + } + } + } + return -1; +} 1; diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist index 1439425ef..004be88cf 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist @@ -27,3 +27,4 @@ parted gzip tar xz +ethtool diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist index 24c092e95..1f690f86e 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist @@ -23,3 +23,4 @@ parted gzip tar xz +ethtool diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist index 6c101ad23..a53f72cf5 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist @@ -30,3 +30,4 @@ xz grub2 grub2-tools bzip2 +ethtool diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist index e0dede612..d03f18c1b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist @@ -22,3 +22,4 @@ net-tools gzip tar xz +ethtool diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot index cca462a0b..5154c4cff 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot @@ -4,6 +4,10 @@ dracut_install wget tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" +for file in /etc/udev/rules.d/*;do + grep -qi xcat $file && inst_rules $(basename $file) +done diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite index 7c7646652..07e24fee4 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite @@ -3,6 +3,10 @@ echo $drivers dracut_install wget cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh" +for file in /etc/udev/rules.d/*;do + grep -qi xcat $file && inst_rules $(basename $file) +done diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.pkglist index d76968a29..906d37e0c 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.pkglist @@ -46,3 +46,4 @@ vsftpd wget xz rsyslog +ethtool diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.pkglist index 4b965a656..0aa1e60cc 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.pkglist @@ -45,3 +45,4 @@ vsftpd wget xz rsyslog +ethtool diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle index f7ac6792d..366289ce7 100644 --- a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle @@ -33,10 +33,17 @@ rspconfig_list_ip rspconfig_list_netmask rspconfig_list_vlan rspconfig_noderange_invalid -rspconfig_set_all rspconfig_set_all_invalid rspconfig_set_vlan rspconfig_set_vlan_invalid +rspconfig_set_hostname_equal_star_with_bmc_is_ip +rspconfig_set_hostname_equal_star_with_bmc_is_hostname +rspconfig_get_hostname +rspconfig_hostname_with_error_input +rspconfig_set_hostname +rspconfig_set_admin_passwd_with_error_input +rspconfig_set_admin_passwd_with_error_origin_password +rspconfig_sshcfg_with_error_input rflash_option_c_without_specify_noderange rflash_option_l_without_specify_noderange rflash_option_a_without_specify_noderange @@ -73,5 +80,4 @@ reventlog_s_openbmc rpower_softoff rpower_suspend_OpenpowerBmc rpower_wake_OpenpowerBmc -rpower_errorcommand_OpenpowerBmc -rpower_wrongpasswd +rpower_errorcommand_OpenpowerBmc \ No newline at end of file diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index 62a05dd1c..4115fbad5 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -446,6 +446,9 @@ cmd:rflash $$CN -d /tmp/bogus123 check:output=~Error: Can't open directory check:output!~Attempting to check:rc != 0 +cmd:rflash $$CN /tmp/bogus123 +check:output=~Error: Invalid option specified +check:rc != 0 cmd:mkdir -p /tmp/bogus123 check:rc == 0 cmd:rflash $$CN /tmp/bogus123 -d @@ -478,7 +481,7 @@ hcp:openbmc cmd:rflash -h check:output =~Usage: check:output =~OpenPOWER OpenBMC specific: -check:output =~ -d.+–no-host-reboot +check:output =~ -d.+no-host-reboot check:output =~ image_id.+--delete check:rc == 0 end diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index e1a41eecd..37f916efa 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -121,7 +121,7 @@ cmd:chdef $$CN bmcpassword=test check:rc==0 cmd:rinv $$CN all check:rc==1 -check:output=~$$CN: Error: Invalid username or password|Error: ERROR: Incorrect password provided +check:output=~$$CN: Error:.+Invalid username or password|Error: ERROR: Incorrect password provided cmd:cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza check:rc==0 end diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index da4ddb70f..b6869b4c4 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -11,7 +11,7 @@ cmd:rspconfig $$CEC iocap check:rc==0 check:output=~$$CEC: iocap: \w+ end -start: + start:rspconfig_time hcp:fsp cmd:rspconfig $$CEC time @@ -41,55 +41,97 @@ check:rc==0 check:output=~__GETNODEATTR($$CN,hcp)__: \w+ end -start:rspconfig_set_ip -description:rspconfig change openbmc ip +start:rspconfig_list_ntpservers +description: rspconfig list ntpservers info Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -i $$CN $NODEIP +cmd:rspconfig $$CN ntpservers check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -c $$CN ip +check:output=~$$CN: BMC NTP Servers +end + +start:rspconfig_set_ntpservers +description: rspconfig set ntpservers +Attribute: $$CN-The operation object of rspconfig command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig_ntp.sh $$CN $$MN check:rc==0 end +start:rspconfig_set_ip +description:To test change openbmc ip separately by rspconfig. should not support and throw out error message +Attribute: $$CN-The operation object of rspconfig command +os:Linux +hcp:openbmc +cmd:rspconfig $$CN ip=__GETNODEATTR($$CN,bmc)__ +check:output=~Error: IP, netmask and gateway must be configured together. +check:rc!=0 +end + start:rspconfig_ip_invalid description:rspconfig could not change openbmc ip using invalid ip Attribute: $$CN-The operation object of rspconfig command -cmd:rspconfig $$CN ip=ddd +os:Linux +hcp:openbmc +cmd:rspconfig $$CN ip=ddd gateway=0.0.0.0 netmask=255.255.0.0 +check:output=~Error: Invalid parameter for option ip check:rc!=0 end start:rspconfig_ip_null description:rspconfig could not set ip to null Attribute: $$CN-The operation object of rspconfig command +os:Linux +hcp:openbmc cmd:rspconfig $$CN ip= +check:output=~Invalid parameter for option ip +check:rc!=0 +cmd:rspconfig $$CN ip= gateway=0.0.0.0 netmask=255.255.0.0 +check:output=~Invalid parameter for option ip check:rc!=0 end start:rspconfig_set_netmask -description:rspconfig change openbmc netmask +description:To test change openbmc netmask separately by rspconfig. should not support and throw out error message Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -n $$CN netmask -check:rc==0 +os:Linux +hcp:openbmc +cmd:rspconfig $$CN netmask=255.255.0.0 +check:output=~Error: IP, netmask and gateway must be configured together. +check:rc!=0 end start:rspconfig_netmask_invalid despcription:rspconfig could not change openbmc netmask using invalid netmask Attribute: $$CN-The operation object of rspconfig command cmd:rspconfig $$CN netmask=ddd +check:output=~Error: Invalid parameter for option netmask +check:rc!=0 +cmd:rspconfig $$CN netmask=ddd ip=__GETNODEATTR($$CN,bmc)__ gateway=0.0.0.0 +check:output=~Error: Invalid parameter for option netmask +check:rc!=0 +cmd:rspconfig $$CN netmask= ip=__GETNODEATTR($$CN,bmc)__ gateway=0.0.0.0 +check:output=~Error: Invalid parameter for option netmask check:rc!=0 end start:rspconfig_set_gateway -description:rspconfig change openbmc gateway +description:To test change openbmc gateway by rspconfig. should not support and throw out error message Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -g $$CN gateway -check:rc==0 +os:Linux +hcp:openbmc +cmd:rspconfig $$CN gateway=0.0.0.0 +check:output=~Error: IP, netmask and gateway must be configured together. +check:rc!=0 end start:rspconfig_set_vlan description:rspconfig change openbmc gateway Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -v $$CN vlan -check:rc==0 +cmd:rspconfig $$CN vlan=0 +check:output=~Error: Invalid parameter for option vlan +check:rc!=0 +cmd:rspconfig $$CN vlan=111 +check:output=~Error: VLAN must be configured with IP, netmask and gateway +check:rc!=0 end start:rspconfig_set_all @@ -102,29 +144,47 @@ end start:rspconfig_gateway_invalid despcription:rspconfig could not change openbmc gatway using invalid gateway Attribute: $$CN-The operation object of rspconfig command +os:Linux +hcp:openbmc cmd:rspconfig $$CN gateway=ddd +check:output=~Error: Invalid parameter for option gateway +check:rc!=0 +cmd:rspconfig $$CN gateway= ip=__GETNODEATTR($$CN,bmc)__ netmask=255.0.0.0 +check:output=~Error: Invalid parameter for option gateway +check:rc!=0 +cmd:rspconfig $$CN gateway= +check:output=~Error: Invalid parameter for option gateway check:rc!=0 end start:rspconfig_set_vlan_invalid despcription:rspconfig could not change openbmc gatway using invalid vlan Attribute: $$CN-The operation object of rspconfig command +os:Linux +hcp:openbmc cmd:rspconfig $$CN vlan=dddsdsdfs +check:output=~Error: VLAN must be configured with IP, netmask and gateway check:rc!=0 end start:rspconfig_set_all_invalid despcription:rspconfig could not change openbmc gatway using invalid vlan Attribute: $$CN-The operation object of rspconfig command +os:Linux +hcp:openbmc cmd:rspconfig $$CN ip=dsd gateway=ooo netmask=asfsf vlan=dddsdsdfs +check:output=~Error: Invalid parameter check:rc!=0 end start:rspconfig_node_invalid despcription:rspconfig could not do any action using invalid node +os:Linux +hcp:openbmc cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi check:rc==0 cmd:rspconfig testnode ip +check:output=~Error: Invalid nodes and/or groups in noderange check:rc!=0 cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi check:rc==0 @@ -132,9 +192,12 @@ end start:rspconfig_noderange_invalid despcription:rspconfig could not do any action using invalid node +os:Linux +hcp:openbmc cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi check:rc==0 cmd:rspconfig testnode,$$CN ip +check:output=~Error: Invalid nodes check:rc!=0 cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi check:rc==0 @@ -184,3 +247,156 @@ check:output=~$$CN: BMC Netmask: check:output=~__GETNODEATTR($$CN,bmc)__ end + +start:rspconfig_set_hostname_equal_star_with_bmc_is_ip +description:when bmc=, rspconfig hostname=* should throw out error +os:Linux +hcp:openbmc +#in automation environment, bmc is ip by default. +cmd:lsdef $$CN -i bmc -c +check:rc == 0 +cmd:rspconfig $$CN hostname=* +check:rc == 0 +check:output =~ Invalid OpenBMC Hostname +end + + +start:rspconfig_set_hostname_equal_star_with_bmc_is_hostname +description:when bmc=, rspconfig hostname=* should set bmc_hostname into bmc +os:Linux +hcp:openbmc +cmd:mkdir -p /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname +check:rc == 0 +cmd:lsdef $$CN -z > /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname/$$CN.stanza +check:rc == 0 +cmd:chdef -t node -o bogus_bmc_hostname groups=bmc ip=10.6.17.100 +check:rc == 0 +cmd:makehosts bogus_bmc_hostname +check:rc == 0 +cmd:chdef $$CN bmc=bogus_bmc_hostname +check:rc == 0 +cmd:lsdef $$CN -i bmc -c +check:rc == 0 +cmd:rspconfig $$CN hostname=* +check:rc == 0 +check:output =~$$CN: BMC hostname: bogus_bmc_hostname +cmd:makehosts -d bogus_bmc_hostname +check:rc == 0 +cmd:rmdef bogus_bmc_hostname +check:rc == 0 +cmd:rmdef $$CN +check:rc == 0 +cmd:cat /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname/$$CN.stanza |mkdef -z +check:rc == 0 +cmd:rm -rf /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname +check:rc == 0 +end + +start:rspconfig_get_hostname +description:To test get bmc hostname by rspconfig. +os:Linux +hcp:openbmc +cmd:mkdir -p /tmp/rspconfig_get_hostname +check:rc == 0 +cmd:rspconfig $$CN sshcfg +check:rc == 0 +cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_get_hostname/working_hostname +check:rc == 0 +cmd:cat /tmp/rspconfig_get_hostname/working_hostname +check:rc == 0 +cmd:rspconfig $$CN hostname |tee /tmp/rspconfig_get_hostname/rspconfig_output +check:rc == 0 +cmd:awk -F':' '/BMC hostname/ {print $3}' /tmp/rspconfig_get_hostname/rspconfig_output |sed s/\\s//g > /tmp/rspconfig_get_hostname/rspconfig_get_hostname +check:rc == 0 +cmd:cat /tmp/rspconfig_get_hostname/rspconfig_get_hostname +cmd:diff /tmp/rspconfig_get_hostname/working_hostname /tmp/rspconfig_get_hostname/rspconfig_get_hostname +check:rc == 0 +cmd:rm -rf /tmp/rspconfig_get_hostname +check:rc == 0 +end + +start:rspconfig_hostname_with_error_input +description: To test with error input, should throw out error message +os:Linux +hcp:openbmc +cmd:rspconfig $$CN hostname bogus +check:output =~Error: Unsupported command +check:rc != 0 +cmd:rspconfig $$CN bogus hostname +check:output =~Error: Unsupported command +check:rc != 0 +cmd:rspconfig $$CN hostname= +check:output =~Error: Invalid parameter for option hostname +check:rc != 0 +end + +start:rspconfig_set_hostname +description:To test set bmc hostname by rspconfig +os:Linux +hcp:openbmc +cmd:mkdir -p /tmp/rspconfig_set_hostname +check:rc == 0 +cmd:rspconfig $$CN sshcfg +check:rc == 0 +cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_set_hostname/working_hostname +check:rc == 0 +cmd:cat /tmp/rspconfig_set_hostname/working_hostname +check:rc == 0 +cmd:a=$(cat /tmp/rspconfig_set_hostname/working_hostname); rspconfig $$CN hostname=test_$a |tee /tmp/rspconfig_set_hostname/rspconfig_output +check:rc == 0 +cmd:awk -F':' '/BMC hostname/ {print $3}' /tmp/rspconfig_set_hostname/rspconfig_output |sed s/\\s//g > /tmp/rspconfig_set_hostname/rspconfig_get_hostname +check:rc == 0 +cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_set_hostname/new_working_hostname +check:rc == 0 +cmd:diff /tmp/rspconfig_set_hostname/rspconfig_get_hostname /tmp/rspconfig_set_hostname/new_working_hostname +check:rc == 0 +cmd:diff /tmp/rspconfig_set_hostname/new_working_hostname /tmp/rspconfig_set_hostname/working_hostname +check:rc != 0 +cmd:a=test_$(cat /tmp/rspconfig_set_hostname/working_hostname);b=$(cat /tmp/rspconfig_set_hostname/new_working_hostname);echo "a=$a b=$b";if [ "$a" = "$b" ];then exit 0;else exit 1; fi +check:rc == 0 +cmd:rm -rf /tmp/rspconfig_set_hostname +check:rc == 0 +end + +start:rspconfig_set_admin_passwd_with_error_input +description: To test "rspconfig admin_passwd=xxx,yyy". If the format of "xxx,yyy" is wrong, should throw out error message +os:Linux +hcp:openbmc +cmd:rspconfig $$CN admin_passwd=cluster, +check:output =~Error: Invalid parameter for option admin_passwd +check:rc != 0 +cmd:rspconfig $$CN admin_passwd=,cluster +check:output =~Error: Invalid parameter for option admin_passwd +check:rc != 0 +cmd:rspconfig $$CN admin_passwd=, +check:output =~Error: Invalid parameter for option admin_passwd +check:rc != 0 +cmd:rspconfig $$CN admin_passwd= +check:output =~Error: Invalid parameter for option admin_passwd +check:rc != 0 +cmd:rspconfig $$CN admin_passwd=; +check:output =~Error: Invalid parameter for option admin_passwd +check:rc != 0 +end + +start:rspconfig_set_admin_passwd_with_error_origin_password +description: To test "rspconfig admin_passwd=xxx,yyy". If the original password is wrong, should throw out error message +os:Linux +hcp:openbmc +cmd:rspconfig $$CN admin_passwd=bogus__GETNODEATTR($$CN,bmcpassword)__,cluster +check:output =~Current BMC password is incorrect +check:rc != 0 +end + +start:rspconfig_sshcfg_with_error_input +description: To test "rspconfig sshcfg" with error input, should throw out error message +os:Linux +hcp:openbmc +cmd:rspconfig $$CN sshcfg aaa +check:output =~Error: Configure sshcfg must be issued without other options. +check:rc != 0 +cmd:rspconfig $$CN hostname sshcfg +check:output =~Error: Configure sshcfg must be issued without other options. +check:rc != 0 +end + diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig_ntp.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig_ntp.sh new file mode 100755 index 000000000..13c53fa61 --- /dev/null +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig_ntp.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +cn=$1 +mn=$2 + +ntpservers=`rspconfig $cn ntpservers | awk -F":" '{print $3}' | sed 's/^ //;s/ $//'` +if [ $? -ne 0 ]; then + echo "rspconfig $cn ntpservers failed" + exit 1 +fi + +echo "The original BMC NTP Servers is $ntpservers" + +if [ $ntpservers != "None" ]; then + new_ntpservers=$ntpservers"_test" +else + new_ntpservers=$mn +fi + +output=`rspconfig $cn ntpservers=$new_ntpservers` +if [ $? -ne 0 ]; then + echo "rspconfig $cn ntpservers=$new_ntpservers failed" + exit 1 +fi + +if [[ $output =~ "$cn: BMC NTP Servers" ]] && [[ $output =~ "$new_ntpservers" ]]; then + echo "Setting NTPServers as $new_ntpservers success" +else + echo "Setting NTPServers as $new_ntpservers failed, the output is $output" + exit 1 +fi + +echo "To clear environment" + +if [ $ntpservers != "None" ]; then + original_ntpservers="$ntpservers" +else + original_ntpservers="" +fi + +output=`rspconfig $cn ntpservers=$original_ntpservers` +if [ $? -ne 0 ]; then + echo "rspconfig $cn ntpservers=$ntpservers failed when clearing environment" + exit 1 +fi + +if [[ "$output" =~ "$cn: BMC NTP Servers" ]] && [[ $output =~ "$ntpservers" ]]; then + echo "Setting NTPServers as $ntpservers success when clearing environment" + exit 0 +fi + +echo "Setting NTPServers as $ntpservers failed when clearing environment" +exit 1