mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-02 19:40:10 +00:00
Merge pull request #582 from chenglch/getadapter
Use fifo pipe to enhance getadapter
This commit is contained in:
commit
fa55fe2520
51
docs/source/advanced/networks/getadapter.rst
Normal file
51
docs/source/advanced/networks/getadapter.rst
Normal file
@ -0,0 +1,51 @@
|
||||
Predict network adapter name before deployment
|
||||
==============================================
|
||||
|
||||
|
||||
|
||||
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. customer need a methods to get consistent and predictable network device name before provision or network configuration. xCAT provide a tool ``getadapter`` to help customer to resolve this problem.
|
||||
|
||||
|
||||
**[Note]** : This feature needs to restart your target sever which you want to obtain network adapter from.
|
||||
|
||||
How to use get adapters
|
||||
-----------------------
|
||||
|
||||
|
||||
Using below command to obtain the network adapters information ::
|
||||
|
||||
getadapter <noderange>
|
||||
|
||||
Then will get output like below ::
|
||||
|
||||
|
||||
The whole scan result:
|
||||
--------------------------------------
|
||||
[node2] scan successfully, below are the latest data
|
||||
node2:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
|
||||
node2:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
|
||||
--------------------------------------
|
||||
[node1] scan successfully, below are the latest data
|
||||
node1:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
|
||||
node1:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
|
||||
|
||||
|
||||
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
|
||||
|
||||
xCAT try its best to collect more information for each network adapter, but can’t guarantee collect same much information for every one. If a network adapter can be derived by xcat genesis, this adapter will have a predictable name, if it can’t be, it only has the information xcat can obtain.
|
||||
|
||||
below are the possible information:
|
||||
|
||||
* **name**: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
|
||||
|
||||
* **pci**: the pci location
|
||||
|
||||
* **mac**: the MAC address
|
||||
|
||||
* **candidatename**: All the names which satisfy predictable network device naming scheme, if customer needs to customize their network adapter name, they can choose one of them. (``confignic`` needs to do more work to support this. if customer want to use their own name, xcat should offer a interface to get customer’s input and change this column)
|
||||
|
||||
* **vendor**: the vender of network device
|
||||
|
||||
* **modle**: the modle of network device
|
||||
|
||||
* **linkstate**: The link state of network device
|
@ -1,53 +0,0 @@
|
||||
Predict network adapter name before deployment
|
||||
==============================================
|
||||
|
||||
|
||||
|
||||
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. customer need a methods to get consistent and predictable network device name before provision or network configuration. xCAT provide a tool ``getadapters`` to help customer to resolve this problem.
|
||||
|
||||
|
||||
**[Note]** : This feature needs to restart your target sever which you want to obtain network adapter from.
|
||||
|
||||
How to use get adapters
|
||||
-----------------------
|
||||
|
||||
|
||||
Using below command to obtain the network adapters information ::
|
||||
|
||||
getadapters <noderange>
|
||||
|
||||
Then will get output like below ::
|
||||
|
||||
|
||||
The whole scan result:
|
||||
--------------------------------------
|
||||
node1:1:hitname=enP3p3s0f0|pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.0|mac=98be9459ea24|candidatename=enP3p3s0f0,enx98be9459ea24|vendor=Broadcom Corporation|modle=NetXtreme II BCM57800 1/10 Gigabit Ethernet
|
||||
node1:2:hitname=enP3p3s0f1|pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.1|mac=98be9459ea25|candidatename=enP3p3s0f1,enx98be9459ea25|vendor=Broadcom Corporation|modle=NetXtreme II BCM57800 1/10 Gigabit Ethernet
|
||||
node1:3:hitname=enP3p3s0f2|pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.2|mac=98be9459ea26|candidatename=enP3p3s0f2,enx98be9459ea26|vendor=Broadcom Corporation|modle=NetXtreme II BCM57800 1/10 Gigabit Ethernet
|
||||
node1:4:hitname=enP3p3s0f3|pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.3|mac=98be9459ea27|candidatename=enP3p3s0f3,enx98be9459ea27|vendor=Broadcom Corporation|modle=NetXtreme II BCM57800 1/10 Gigabit Ethernet
|
||||
node1:5:pci=0001:01:00.0|modle=Mellanox Technologies MT27600 [Connect-IB]
|
||||
--------------------------------------
|
||||
node2:1:hitname=enP3p3s0f0|pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.0|mac=98be9459ea24|candidatename=enP3p3s0f0,enx98be9459ea24|vendor=Broadcom Corporation|modle=NetXtreme II BCM57800 1/10 Gigabit Ethernet
|
||||
node2:2:hitname=enP3p3s0f1|pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.1|mac=98be9459ea25|candidatename=enP3p3s0f1,enx98be9459ea25|vendor=Broadcom Corporation|modle=NetXtreme II BCM57800 1/10 Gigabit Ethernet
|
||||
|
||||
|
||||
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
|
||||
|
||||
xCAT try its best to collect more information for each network adapter, but can’t guarantee collect same much information for every one. If a network adapter can be derived by xcat genesis, this adapter will have a predictable name, if it can’t be, it only has the information xcat can obtain.
|
||||
|
||||
below are the possible information:
|
||||
|
||||
* **hitname**: the consistent name which can be used in ``confignic`` derectly in operating system which follow the same naming scheme with rhels7. (``confignic`` doesn’t need to do more work)
|
||||
|
||||
* **pci**: the pci location
|
||||
|
||||
* **mac**: the MAC address
|
||||
|
||||
* **candidatename**: All the names which satisfy predictable network device naming scheme, if customer needs to customize their network adapter name, they can choose one of them. (``confignic`` needs to do more work to support this. if customer want to use their own name, xcat should offer a interface to get customer’s input and change this column)
|
||||
|
||||
* **vendor**: the vender of network device
|
||||
|
||||
* **modle**: the modle of network device
|
||||
|
||||
|
||||
|
118
docs/source/guides/admin-guides/references/man1/getadapter.1.rst
Normal file
118
docs/source/guides/admin-guides/references/man1/getadapter.1.rst
Normal file
@ -0,0 +1,118 @@
|
||||
|
||||
############
|
||||
getadapter.1
|
||||
############
|
||||
|
||||
.. highlight:: perl
|
||||
|
||||
|
||||
****
|
||||
NAME
|
||||
****
|
||||
|
||||
|
||||
\ **getadapter**\ - Obtain all network adapters's predictable name and some other information before provision or network configuration.
|
||||
|
||||
|
||||
********
|
||||
SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **getadapter**\ \ *noderange*\ [\ **-f**\ ]
|
||||
|
||||
\ **getadapter**\ [\ **-h**\ |\ **--help**\ |\ **-v**\ |\ **--version**\ |\ **-V**\ ]
|
||||
|
||||
|
||||
***********
|
||||
DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. \ **getadapter**\ help customer to get predictable network device name and some other network adapter information before provision or network configuration.
|
||||
|
||||
\ **getadapter**\ use genesis to collect network adapters information, so that mean it need to restart the target node.
|
||||
|
||||
\ **getadapter**\ follows below scheme:
|
||||
|
||||
If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at local.
|
||||
If the target node has ever been scaned, i.e. this node has network device information in local, \ **getadapter**\ use the local information first.
|
||||
If user doesn't want to use local information, can use \ **-f**\ option to force to trigger new round scan process.
|
||||
if part nodes of \ *noderange*\ don't have network device information in local and the rest have, \ **getadapter**\ only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, \ **getadapter**\ still use the local information first.
|
||||
|
||||
\ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
|
||||
|
||||
Below are the possible information can be collect up to now:
|
||||
\ **name**\ : the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
|
||||
\ **pci**\ : the pci location
|
||||
\ **mac**\ : the MAC address
|
||||
\ **candidatename**\ : All the names which satisfy predictable network device naming scheme. \ *(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)*\
|
||||
\ **vender**\ : the vender of network device
|
||||
\ **model**\ : the model of network device
|
||||
\ **linkstate**\ : the link state of network device
|
||||
|
||||
|
||||
*******
|
||||
OPTIONS
|
||||
*******
|
||||
|
||||
|
||||
\ **-h**\
|
||||
|
||||
Display usage message.
|
||||
|
||||
\ **-v**\
|
||||
|
||||
Command Version.
|
||||
|
||||
\ **-V**\
|
||||
|
||||
Display verbose message.
|
||||
|
||||
\ **-f**\
|
||||
|
||||
Force to trigger new round scan. ignore the data collected before.
|
||||
|
||||
|
||||
********
|
||||
EXAMPLES
|
||||
********
|
||||
|
||||
|
||||
1. To collect node[1-3]'s network device information, enter:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
getadapter node[1-2]
|
||||
|
||||
|
||||
Output is similar to:
|
||||
|
||||
-->Starting scan for: node1,node2
|
||||
The whole scan result:
|
||||
--------------------------------------
|
||||
[node1]: Adapter information exists, no need to scan.
|
||||
--------------------------------------
|
||||
[node2] scan successfully, below are the latest data
|
||||
node2:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
|
||||
node2:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
|
||||
|
||||
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
|
||||
|
||||
2. Force to trigger new round scan
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
getadatper node -f
|
||||
|
||||
|
||||
|
||||
********
|
||||
SEE ALSO
|
||||
********
|
||||
|
||||
|
||||
noderange(3)|noderange.3
|
||||
|
@ -19,7 +19,7 @@ SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **nics Attributes:**\ \ *node*\ , \ *nicips*\ , \ *nichostnamesuffixes*\ , \ *nichostnameprefixes*\ , \ *nictypes*\ , \ *niccustomscripts*\ , \ *nicnetworks*\ , \ *nicaliases*\ , \ *nicextraparams*\ , \ *comments*\ , \ *disable*\
|
||||
\ **nics Attributes:**\ \ *node*\ , \ *nicips*\ , \ *nichostnamesuffixes*\ , \ *nichostnameprefixes*\ , \ *nictypes*\ , \ *niccustomscripts*\ , \ *nicnetworks*\ , \ *nicaliases*\ , \ *nicextraparams*\ , \ *nicdevices*\ , \ *nicsadapter*\ , \ *comments*\ , \ *disable*\
|
||||
|
||||
|
||||
***********
|
||||
@ -119,6 +119,19 @@ nics Attributes:
|
||||
|
||||
|
||||
|
||||
\ **nicdevices**\
|
||||
|
||||
Comma-separated list of NIC device per NIC, multiple ethernet devices can be bonded as bond device, these ethernet devices are separated by |. <nic1>!<dev1>|<dev3>,<nic2>!<dev2>, e.g. bond0!eth0|eth2,br0!bond0. The xCAT object definition commands support to use nicdevices.<nicname> as the sub attributes.
|
||||
|
||||
|
||||
|
||||
\ **nicsadapter**\
|
||||
|
||||
Comma-separated list of extra parameters that will be used for each NIC configuration.
|
||||
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
|
||||
|
||||
|
||||
|
||||
\ **comments**\
|
||||
|
||||
Any user-written notes.
|
||||
|
@ -0,0 +1,76 @@
|
||||
|
||||
###########
|
||||
taskstate.5
|
||||
###########
|
||||
|
||||
.. highlight:: perl
|
||||
|
||||
|
||||
****
|
||||
NAME
|
||||
****
|
||||
|
||||
|
||||
\ **taskstate**\ - a table in the xCAT database.
|
||||
|
||||
|
||||
********
|
||||
SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **taskstate Attributes:**\ \ *node*\ , \ *command*\ , \ *state*\ , \ *pid*\ , \ *reserve*\
|
||||
|
||||
|
||||
***********
|
||||
DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
The task state for the node.
|
||||
|
||||
|
||||
*********************
|
||||
taskstate Attributes:
|
||||
*********************
|
||||
|
||||
|
||||
|
||||
\ **node**\
|
||||
|
||||
The node name.
|
||||
|
||||
|
||||
|
||||
\ **command**\
|
||||
|
||||
Current command is running
|
||||
|
||||
|
||||
|
||||
\ **state**\
|
||||
|
||||
The task state(callback, running) for the node.
|
||||
|
||||
|
||||
|
||||
\ **pid**\
|
||||
|
||||
The process id of the request process.
|
||||
|
||||
|
||||
|
||||
\ **reserve**\
|
||||
|
||||
used to lock the node
|
||||
|
||||
|
||||
|
||||
|
||||
********
|
||||
SEE ALSO
|
||||
********
|
||||
|
||||
|
||||
\ **nodels(1)**\ , \ **chtab(8)**\ , \ **tabdump(8)**\ , \ **tabedit(8)**\
|
||||
|
@ -304,6 +304,10 @@ site(7)|site.7
|
||||
|
||||
|
||||
|
||||
taskstate(7)|taskstate.7
|
||||
|
||||
|
||||
|
||||
zone(7)|zone.7
|
||||
|
||||
|
||||
@ -682,6 +686,12 @@ switches(5)|switches.5
|
||||
|
||||
|
||||
|
||||
taskstate(5)|taskstate.5
|
||||
|
||||
The task state for the node.
|
||||
|
||||
|
||||
|
||||
token(5)|token.5
|
||||
|
||||
The token of users for authentication.
|
||||
|
@ -19,7 +19,7 @@ SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *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*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *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*\ , \ *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*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *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*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *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*\ , \ *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*\
|
||||
|
||||
|
||||
***********
|
||||
@ -259,6 +259,30 @@ group Attributes:
|
||||
|
||||
|
||||
|
||||
\ **dockercpus**\ (vm.cpus)
|
||||
|
||||
Number of CPUs the node should see.
|
||||
|
||||
|
||||
|
||||
\ **dockerflag**\ (vm.othersettings)
|
||||
|
||||
This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:"vcpupin:'0-15,^8'",Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively,the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running \ **virsh nodedev-list**\ on the host.
|
||||
|
||||
|
||||
|
||||
\ **dockerhost**\ (vm.host)
|
||||
|
||||
The system that currently hosts the VM
|
||||
|
||||
|
||||
|
||||
\ **dockermemory**\ (vm.memory)
|
||||
|
||||
Megabytes of memory the VM currently should be set to.
|
||||
|
||||
|
||||
|
||||
\ **domainadminpassword**\ (domain.adminpassword)
|
||||
|
||||
Allow a node specific indication of Administrative user password for the domain. Most will want to ignore this in favor of passwd table.
|
||||
@ -589,6 +613,12 @@ group Attributes:
|
||||
|
||||
|
||||
|
||||
\ **nicdevices**\ (nics.nicdevices)
|
||||
|
||||
Comma-separated list of NIC device per NIC, multiple ethernet devices can be bonded as bond device, these ethernet devices are separated by |. <nic1>!<dev1>|<dev3>,<nic2>!<dev2>, e.g. bond0!eth0|eth2,br0!bond0. The xCAT object definition commands support to use nicdevices.<nicname> as the sub attributes.
|
||||
|
||||
|
||||
|
||||
\ **nicextraparams**\ (nics.nicextraparams)
|
||||
|
||||
Comma-separated list of extra parameters that will be used for each NIC configuration.
|
||||
@ -689,6 +719,18 @@ group Attributes:
|
||||
|
||||
|
||||
|
||||
\ **nicsadapter**\ (nics.nicsadapter)
|
||||
|
||||
Comma-separated list of extra parameters that will be used for each NIC configuration.
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
|
||||
|
||||
|
||||
|
||||
|
||||
\ **nictypes**\ (nics.nictypes)
|
||||
|
||||
Comma-separated list of NIC types per NIC. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband. The xCAT object definition commands support to use nictypes.<nicname> as the sub attributes.
|
||||
@ -1313,7 +1355,7 @@ group Attributes:
|
||||
|
||||
\ **vmothersetting**\ (vm.othersettings)
|
||||
|
||||
This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:'vcpupin:'0-15,^8' ',Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively,the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running \ **virsh nodedev-list**\ on the host.
|
||||
This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:"vcpupin:'0-15,^8'",Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively,the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running \ **virsh nodedev-list**\ on the host.
|
||||
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *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*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *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*\ , \ *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*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *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*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *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*\ , \ *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*\
|
||||
|
||||
|
||||
***********
|
||||
@ -271,6 +271,30 @@ node Attributes:
|
||||
|
||||
|
||||
|
||||
\ **dockercpus**\ (vm.cpus)
|
||||
|
||||
Number of CPUs the node should see.
|
||||
|
||||
|
||||
|
||||
\ **dockerflag**\ (vm.othersettings)
|
||||
|
||||
This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:"vcpupin:'0-15,^8'",Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively,the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running \ **virsh nodedev-list**\ on the host.
|
||||
|
||||
|
||||
|
||||
\ **dockerhost**\ (vm.host)
|
||||
|
||||
The system that currently hosts the VM
|
||||
|
||||
|
||||
|
||||
\ **dockermemory**\ (vm.memory)
|
||||
|
||||
Megabytes of memory the VM currently should be set to.
|
||||
|
||||
|
||||
|
||||
\ **domainadminpassword**\ (domain.adminpassword)
|
||||
|
||||
Allow a node specific indication of Administrative user password for the domain. Most will want to ignore this in favor of passwd table.
|
||||
@ -589,6 +613,12 @@ node Attributes:
|
||||
|
||||
|
||||
|
||||
\ **nicdevices**\ (nics.nicdevices)
|
||||
|
||||
Comma-separated list of NIC device per NIC, multiple ethernet devices can be bonded as bond device, these ethernet devices are separated by |. <nic1>!<dev1>|<dev3>,<nic2>!<dev2>, e.g. bond0!eth0|eth2,br0!bond0. The xCAT object definition commands support to use nicdevices.<nicname> as the sub attributes.
|
||||
|
||||
|
||||
|
||||
\ **nicextraparams**\ (nics.nicextraparams)
|
||||
|
||||
Comma-separated list of extra parameters that will be used for each NIC configuration.
|
||||
@ -689,6 +719,18 @@ node Attributes:
|
||||
|
||||
|
||||
|
||||
\ **nicsadapter**\ (nics.nicsadapter)
|
||||
|
||||
Comma-separated list of extra parameters that will be used for each NIC configuration.
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
|
||||
|
||||
|
||||
|
||||
|
||||
\ **nictypes**\ (nics.nictypes)
|
||||
|
||||
Comma-separated list of NIC types per NIC. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband. The xCAT object definition commands support to use nictypes.<nicname> as the sub attributes.
|
||||
@ -1349,7 +1391,7 @@ node Attributes:
|
||||
|
||||
\ **vmothersetting**\ (vm.othersettings)
|
||||
|
||||
This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:'vcpupin:'0-15,^8' ',Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively,the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running \ **virsh nodedev-list**\ on the host.
|
||||
This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:"vcpupin:'0-15,^8'",Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively,the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running \ **virsh nodedev-list**\ on the host.
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,85 @@
|
||||
|
||||
###########
|
||||
taskstate.7
|
||||
###########
|
||||
|
||||
.. highlight:: perl
|
||||
|
||||
|
||||
****
|
||||
NAME
|
||||
****
|
||||
|
||||
|
||||
\ **taskstate**\ - a logical object definition in the xCAT database.
|
||||
|
||||
|
||||
********
|
||||
SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **taskstate Attributes:**\ \ *command*\ , \ *disable*\ , \ *node*\ , \ *pid*\ , \ *reserve*\ , \ *state*\
|
||||
|
||||
|
||||
***********
|
||||
DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
Logical objects of this type are stored in the xCAT database in one or more tables. Use the following commands
|
||||
to manipulate the objects: \ **mkdef**\ , \ **chdef**\ , \ **lsdef**\ , and \ **rmdef**\ . These commands will take care of
|
||||
knowing which tables the object attributes should be stored in. The attribute list below shows, in
|
||||
parentheses, what tables each attribute is stored in.
|
||||
|
||||
|
||||
*********************
|
||||
taskstate Attributes:
|
||||
*********************
|
||||
|
||||
|
||||
|
||||
\ **command**\ (taskstate.command)
|
||||
|
||||
Current command is running
|
||||
|
||||
|
||||
|
||||
\ **disable**\ (taskstate.disable)
|
||||
|
||||
Set to 'yes' or '1' to comment out this row.
|
||||
|
||||
|
||||
|
||||
\ **node**\ (taskstate.node)
|
||||
|
||||
The node name.
|
||||
|
||||
|
||||
|
||||
\ **pid**\ (taskstate.pid)
|
||||
|
||||
The process id of the request process.
|
||||
|
||||
|
||||
|
||||
\ **reserve**\ (taskstate.reserve)
|
||||
|
||||
used to lock the node
|
||||
|
||||
|
||||
|
||||
\ **state**\ (taskstate.state)
|
||||
|
||||
The task state(callback, running) for the node.
|
||||
|
||||
|
||||
|
||||
|
||||
********
|
||||
SEE ALSO
|
||||
********
|
||||
|
||||
|
||||
\ **mkdef(1)**\ , \ **chdef(1)**\ , \ **lsdef(1)**\ , \ **rmdef(1)**\
|
||||
|
@ -1442,7 +1442,7 @@ firmware => {
|
||||
},
|
||||
|
||||
nics => {
|
||||
cols => [qw(node nicips nichostnamesuffixes nichostnameprefixes nictypes niccustomscripts nicnetworks nicaliases nicextraparams nicdevices comments disable)],
|
||||
cols => [qw(node nicips nichostnamesuffixes nichostnameprefixes nictypes niccustomscripts nicnetworks nicaliases nicextraparams nicdevices nicsadapter comments disable)],
|
||||
keys => [qw(node)],
|
||||
tablespace =>'XCATTBS16K',
|
||||
table_desc => 'Stores NIC details.',
|
||||
@ -1486,6 +1486,8 @@ nics => {
|
||||
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
|
||||
The xCAT object definition commands support to use nicextraparams.<nicname> as the sub attributes.',
|
||||
nicdevices => 'Comma-separated list of NIC device per NIC, multiple ethernet devices can be bonded as bond device, these ethernet devices are separated by |. <nic1>!<dev1>|<dev3>,<nic2>!<dev2>, e.g. bond0!eth0|eth2,br0!bond0. The xCAT object definition commands support to use nicdevices.<nicname> as the sub attributes.',
|
||||
nicsadapter => 'Comma-separated list of extra parameters that will be used for each NIC configuration.
|
||||
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@ -1684,6 +1686,19 @@ token => {
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
taskstate => {
|
||||
cols => [qw(node command state pid reserve)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'The task state for the node.',
|
||||
descriptions => {
|
||||
node => 'The node name.',
|
||||
command => 'Current command is running',
|
||||
state => 'The task state(callback, running) for the node.',
|
||||
pid => 'The process id of the request process.',
|
||||
reserve => 'used to lock the node',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
); # end of tabspec definition
|
||||
|
||||
|
||||
@ -2416,10 +2431,14 @@ my @nodeattrs = (
|
||||
tabentry => 'nics.nicextraparams',
|
||||
access_tabentry => 'nics.node=attr:node',
|
||||
},
|
||||
{attr_name => 'nicdevices',
|
||||
{attr_name => 'nicdevices',
|
||||
tabentry => 'nics.nicdevices',
|
||||
access_tabentry => 'nics.node=attr:node',
|
||||
},
|
||||
},
|
||||
{attr_name => 'nicsadapter',
|
||||
tabentry => 'nics.nicsadapter',
|
||||
access_tabentry => 'nics.node=attr:node',
|
||||
},
|
||||
#######################
|
||||
# prodkey table #
|
||||
######################
|
||||
@ -3580,6 +3599,37 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
},
|
||||
);
|
||||
|
||||
###########################
|
||||
# taskstate data object #
|
||||
###########################
|
||||
# taskstate table #
|
||||
###########################
|
||||
@{$defspec{taskstate}->{'attrs'}} = (
|
||||
{attr_name => 'node',
|
||||
tabentry => 'taskstate.node',
|
||||
access_tabentry => 'taskstate.node=attr:node',
|
||||
},
|
||||
{attr_name => 'command',
|
||||
tabentry => 'taskstate.command',
|
||||
access_tabentry => 'taskstate.node=attr:node',
|
||||
},
|
||||
{attr_name => 'state',
|
||||
tabentry => 'taskstate.state',
|
||||
access_tabentry => 'taskstate.node=attr:node',
|
||||
},
|
||||
{attr_name => 'pid',
|
||||
tabentry => 'taskstate.pid',
|
||||
access_tabentry => 'taskstate.node=attr:node',
|
||||
},
|
||||
{attr_name => 'reserve',
|
||||
tabentry => 'taskstate.reserve',
|
||||
access_tabentry => 'taskstate.node=attr:node',
|
||||
},
|
||||
{attr_name => 'disable',
|
||||
tabentry => 'taskstate.disable',
|
||||
access_tabentry => 'taskstate.node=attr:node',
|
||||
},
|
||||
);
|
||||
|
||||
#############################
|
||||
# auditlog object #
|
||||
|
@ -37,6 +37,7 @@ opt/xcat/bin/xcatclient opt/xcat/bin/lstree
|
||||
opt/xcat/bin/xcatclient opt/xcat/bin/lsflexnode
|
||||
opt/xcat/bin/xcatclient opt/xcat/bin/rmflexnode
|
||||
opt/xcat/bin/xcatclient opt/xcat/bin/mkflexnode
|
||||
opt/xcat/bin/xcatclient opt/xcat/bin/getadapter
|
||||
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lsslp
|
||||
opt/xcat/bin/xcatclient opt/xcat/bin/imgcapture
|
||||
opt/xcat/bin/xcatclientnnr opt/xcat/bin/swapnodes
|
||||
|
84
xCAT-client/pods/man1/getadapter.1.pod
Normal file
84
xCAT-client/pods/man1/getadapter.1.pod
Normal file
@ -0,0 +1,84 @@
|
||||
=head1 NAME
|
||||
|
||||
B<getadapter> - Obtain all network adapters's predictable name and some other information before provision or network configuration.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<getadapter> I<noderange> [B<-f>]
|
||||
|
||||
B<getadapter> [B<-h>|B<--help>|B<-v>|B<--version>|B<-V>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. B<getadapter> help customer to get predictable network device name and some other network adapter information before provision or network configuration.
|
||||
|
||||
B<getadapter> use genesis to collect network adapters information, so that mean it need to restart the target node.
|
||||
|
||||
B<getadapter> follows below scheme:
|
||||
|
||||
If the target node is scaned for the first time, B<getadapter> will trigger genesis to collect information then save the information at local.
|
||||
If the target node has ever been scaned, i.e. this node has network device information in local, B<getadapter> use the local information first.
|
||||
If user doesn't want to use local information, can use B<-f> option to force to trigger new round scan process.
|
||||
if part nodes of I<noderange> don't have network device information in local and the rest have, B<getadapter> only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, B<getadapter> still use the local information first.
|
||||
|
||||
B<getadapter> tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
|
||||
|
||||
Below are the possible information can be collect up to now:
|
||||
B<name>: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
|
||||
B<pci>: the pci location
|
||||
B<mac>: the MAC address
|
||||
B<candidatename>: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)>
|
||||
B<vender>: the vender of network device
|
||||
B<model>: the model of network device
|
||||
B<linkstate>: the link state of network device
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<-V>
|
||||
|
||||
Display verbose message.
|
||||
|
||||
B<-f>
|
||||
|
||||
Force to trigger new round scan. ignore the data collected before.
|
||||
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
1. To collect node[1-3]'s network device information, enter:
|
||||
|
||||
getadapter node[1-2]
|
||||
|
||||
Output is similar to:
|
||||
|
||||
-->Starting scan for: node1,node2
|
||||
The whole scan result:
|
||||
--------------------------------------
|
||||
[node1]: Adapter information exists, no need to scan.
|
||||
--------------------------------------
|
||||
[node2] scan successfully, below are the latest data
|
||||
node2:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
|
||||
node2:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
|
||||
|
||||
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
|
||||
|
||||
|
||||
2. Force to trigger new round scan
|
||||
|
||||
getadatper node -f
|
||||
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<noderange(3)|noderange.3>
|
||||
|
||||
|
@ -1,85 +0,0 @@
|
||||
=head1 NAME
|
||||
|
||||
B<getadapters> - Obtain all network adapters's predictable name and some other information before provision or network configuration.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<getadapters> I<noderange> [B<-f>]
|
||||
|
||||
B<getadapters> [B<-h>|B<--help>|B<-v>|B<--version>|B<-V>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. B<getadapters> help customer to get predictable network device name and some other network adapter information before provision or network configuration.
|
||||
|
||||
B<getadapters> use genesis to collect network adapters information, so that mean it need to restart the target node.
|
||||
|
||||
B<getadapters> follows below scheme:
|
||||
|
||||
If the target node is scaned for the first time, B<getadapters> will trigger genesis to collect information then save the information at local.
|
||||
If the target node has ever been scaned, i.e. this node has network device information in local, B<getadapters> use the local information first.
|
||||
If user doesn't want to use local information, can use B<-f> option to force to trigger new round scan process.
|
||||
if part nodes of I<noderange> don't have network device information in local and the rest have, B<getadapters> only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, B<getadapters> still use the local information first.
|
||||
|
||||
B<getadapters> tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
|
||||
|
||||
Below are the possible information can be collect up to now:
|
||||
B<hitname>: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
|
||||
B<pci>: the pci location
|
||||
B<mac>: the MAC address
|
||||
B<candidatename>: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)>
|
||||
B<vender>: the vender of network device
|
||||
B<model>: the model of network device
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<-V>
|
||||
|
||||
Display verbose message.
|
||||
|
||||
B<-f>
|
||||
|
||||
Force to trigger new round scan. ignore the data collected before.
|
||||
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
1. To collect node[1-3]'s network device information, enter:
|
||||
|
||||
getadapters node[1-2]
|
||||
|
||||
Output is similar to:
|
||||
|
||||
-->Starting scan for: node1,node2
|
||||
The whole scan result:
|
||||
--------------------------------------
|
||||
[node1] with no need for scan due to old data exist, using the old data:
|
||||
node1:1:mac=98be9459ea24|pci=/0003:03:00.0|candidatename=enx98be9459ea24|vender=Broadcom Corporation
|
||||
node1:2:mac=98be9459ea25|pci=/0003:03:00.1|candidatename=enx98be9459ea25|vender=Broadcom Corporation
|
||||
--------------------------------------
|
||||
[node2] scan successfully, below are the latest data
|
||||
node2:1:mac=98be9459ea34|pci=/0003:03:00.0|candidatename=enx98be9459ea34|vender=Broadcom Corporation
|
||||
node2:2:mac=98be9459ea35|pci=/0003:03:00.1|candidatename=enx98be9459ea35|vender=Broadcom Corporation
|
||||
|
||||
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
|
||||
|
||||
|
||||
2. Force to trigger new round scan
|
||||
|
||||
getadatpers node -f
|
||||
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<noderange(3)|noderange.3>
|
||||
|
||||
|
@ -165,6 +165,7 @@ ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/lstree
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/lsflexnode
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rmflexnode
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/mkflexnode
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/getadapter
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsslp
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/switchdiscover
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/bmcdiscover
|
||||
|
@ -16,9 +16,10 @@ if [ -f "$ADAPTERFILE" ]; then
|
||||
fi
|
||||
|
||||
echo "<xcatrequest>
|
||||
<command>findadapter</command>
|
||||
<command>getadapter</command>
|
||||
<clienttype>cli</clienttype>
|
||||
<hostname>$HOSTNAME</hostname>" >> "$ADAPTERFILE"
|
||||
<noderange>$HOSTNAME</noderange>
|
||||
<action>update</action>" >> "$ADAPTERFILE"
|
||||
|
||||
#scan adapters have recognized by operating system
|
||||
for n in /sys/class/net/*; do
|
||||
@ -31,7 +32,7 @@ for n in /sys/class/net/*; do
|
||||
if [ -n "$tmp" ]; then
|
||||
echo "<interface>$tmp</interface>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
tmp=`udevadm info /sys/class/net/"$nic" | grep ID_NET_NAME | awk -F '=' '{print $2}'|sort -u| tr -s "\n" "," | sed "s/,$//g"`
|
||||
tmp=`udevadm info /sys/class/net/"$nic" | grep ID_NET_NAME | awk -F '=' '{print $2}'|sort -u| tr -s "\n" "/" | sed "s/\/$//g"`
|
||||
if [ -n "$tmp" ]; then
|
||||
echo "<predictablename>$tmp</predictablename>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
@ -39,11 +40,8 @@ for n in /sys/class/net/*; do
|
||||
if [ -n "$tmp" ]; then
|
||||
echo "<pcilocation>${tmp%/net*}</pcilocation>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
tmp=`udevadm info /sys/class/net/"$nic" | grep ID_NET_NAME_MAC | awk -F '=' '{print $2}'`
|
||||
if [ -n "$tmp" ]; then
|
||||
echo "<mac>${tmp##*enx}</mac>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
tmp=`udevadm info /sys/class/net/"$nic" | grep ID_VENDOR_FROM_DATABASE | awk -F '=' '{print $2}' | tr -s "\n" "," | sed "s/,$//g"`
|
||||
echo "<mac>`cat /sys/class/net/$nic/address`</mac>" >> "$ADAPTERFILE"
|
||||
tmp=`udevadm info /sys/class/net/"$nic" | grep ID_VENDOR_FROM_DATABASE | awk -F '=' '{print $2}' | tr -s "\n" "/" | sed "s/\/$//g"`
|
||||
if [ -n "$tmp" ]; then
|
||||
echo "<vendor>$tmp</vendor>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
@ -51,6 +49,11 @@ for n in /sys/class/net/*; do
|
||||
if [ -n "$tmp" ]; then
|
||||
echo "<model>$tmp</model>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
tmp=`ip link show $nic`
|
||||
if [ -n "$tmp" ]; then
|
||||
tmp=${tmp#*state }
|
||||
echo "<linkstate>${tmp% mode*}</linkstate>" >> "$ADAPTERFILE"
|
||||
fi
|
||||
echo '</nic>' >> "$ADAPTERFILE"
|
||||
fi
|
||||
done
|
||||
|
219
xCAT-server/lib/perl/xCAT/FifoPipe.pm
Normal file
219
xCAT-server/lib/perl/xCAT/FifoPipe.pm
Normal file
@ -0,0 +1,219 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT::FifoPipe;
|
||||
|
||||
BEGIN {
|
||||
$::XCATROOT =
|
||||
$ENV{'XCATROOT'} ? $ENV{'XCATROOT'}
|
||||
: -d '/opt/xcat' ? '/opt/xcat'
|
||||
: '/usr';
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use strict;
|
||||
use xCAT::Table;
|
||||
use xCAT::MsgUtils;
|
||||
use Data::Dumper;
|
||||
use POSIX;
|
||||
|
||||
|
||||
use constant PIPE_SIZE => 4096; # use ulimit -a to check
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 _create_pipe
|
||||
Create the pipe file if not exists. This function is a
|
||||
private method in FifoPipe.
|
||||
Input:
|
||||
$pipe_file: the file path of the pipe file
|
||||
Return:
|
||||
-1: Unexpected error
|
||||
0: Create success
|
||||
Usage example:
|
||||
my $fifo_path = '/tmp/fifopipe/pipe1;
|
||||
_create_pipe($pipe_file);
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub _create_pipe {
|
||||
my $pipe_file = shift;
|
||||
unless (-p $pipe_file) {
|
||||
if (-e _) {
|
||||
xCAT::MsgUtils->message("S", "$pipe_file is not a pipe file.");
|
||||
return -1;
|
||||
} else {
|
||||
unless (POSIX::mkfifo($pipe_file, 0660)) {
|
||||
xCAT::MsgUtils->message("S", "Can not create fifo pipe: $pipe_file");
|
||||
return -1;
|
||||
}
|
||||
xCAT::MsgUtils->message("I", "Create $pipe_file as a pipe file.");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 recv_message
|
||||
Use fifo pipe to receive the message
|
||||
Input:
|
||||
$class: FifoPipe class
|
||||
$pipe_file: the file path of the pipe file
|
||||
$buf_ptr: A pointer to the message buffer array
|
||||
Return:
|
||||
-1: Unexpected error
|
||||
count: Number of message getting from fifo pipe
|
||||
Usage example:
|
||||
my $fifo_path = '/tmp/fifopipe/pipe1;
|
||||
my @buf = ();
|
||||
xCAT::FifoPipe->recv_message($fifo_path, \@buf);
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub recv_message {
|
||||
my $class = shift;
|
||||
my $pipe_file = shift;
|
||||
my $buf_array_ptr = shift;
|
||||
my ($len, $pipe, $tmp);
|
||||
my $count = 0;
|
||||
my $rt = -1;
|
||||
|
||||
my $read_pipe_func = sub {
|
||||
my $pipe = shift;
|
||||
my $buf_ptr = shift;
|
||||
my $len = shift;
|
||||
my $read_len = $len;
|
||||
my ($rt, $tmp);
|
||||
|
||||
|
||||
while (($rt = read($pipe, $tmp, $read_len)) > 0) {
|
||||
$read_len -= $rt;
|
||||
${$buf_ptr} .= $tmp;
|
||||
if ($read_len == 0) {
|
||||
return $len;
|
||||
}
|
||||
}
|
||||
if (!defined($rt)) {
|
||||
xCAT::MsgUtils->message("S", "Read pipe $pipe_file error return code=$rt.");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}; # end of read_pipe_func
|
||||
|
||||
if (_create_pipe($pipe_file)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# NOTE(chenglch) if multiple process are writing the fifo pipe
|
||||
# at the same time, the open call of reader will be blocked only
|
||||
# once, but multiple messages should be retrived.
|
||||
$rt = open($pipe, '<', $pipe_file);
|
||||
unless ($rt) {
|
||||
xCAT::MsgUtils->message("S", "open $pipe_file error");
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (&$read_pipe_func($pipe, \$len, 8) > 0) {
|
||||
$len = unpack("A8", $len);
|
||||
if (($rt = &$read_pipe_func($pipe, \$tmp, $len)) < 0) {
|
||||
return -1;
|
||||
}
|
||||
if ($rt != $len) {
|
||||
xCAT::MsgUtils->message("S", "Read pipe $pipe_file error, uncomplete.");
|
||||
return -1;
|
||||
}
|
||||
${$buf_array_ptr}[$count] = $tmp;
|
||||
$count++;
|
||||
}
|
||||
close($pipe);
|
||||
return $count;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 send_message
|
||||
Send message to fifo pipe
|
||||
Input:
|
||||
$class: FifoPipe class
|
||||
$pipe_file: the file path of the pipe file
|
||||
$buf: A buf string
|
||||
Return:
|
||||
-1: Unexpected error
|
||||
0: send success
|
||||
Usage example:
|
||||
my $fifo_path = '/tmp/fifopipe/pipe1;
|
||||
my $buf = "hellow fifo pipe";
|
||||
xCAT::FifoPipe->send_message($fifo_path, $buf);
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub send_message {
|
||||
my $class = shift;
|
||||
my $pipe_file = shift;
|
||||
my $buf = shift;
|
||||
my $pipe;
|
||||
|
||||
# WARNING: the lenth of the buf should not be larger than PIPE_BUF,
|
||||
# otherwise the write opration for fifo pipe can not be
|
||||
# looked as a atomic opration.
|
||||
my $len = length($buf);
|
||||
if ($len > PIPE_SIZE - 8) {
|
||||
xCAT::MsgUtils->message("W", "The size of message is larger than 4088 bytes.");
|
||||
}
|
||||
my $tmp = pack("A8", $len);
|
||||
$buf = $tmp . $buf;
|
||||
$len += 8;
|
||||
if (_create_pipe($pipe_file)) {
|
||||
return -1;
|
||||
}
|
||||
my $rt = sysopen(PIPEHANDLE, $pipe_file, O_WRONLY);
|
||||
unless ($rt) {
|
||||
xCAT::MsgUtils->message("S", "open $pipe_file error");
|
||||
return -1;
|
||||
}
|
||||
while (($rt = syswrite(PIPEHANDLE, $buf, $len)) > 0) {
|
||||
$len -= $rt;
|
||||
if ($len == 0) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (!defined($rt)) {
|
||||
xCAT::MsgUtils->message("S", "Write $pipe_file error");
|
||||
return -1;
|
||||
}
|
||||
if ($len != 0) {
|
||||
xCAT::MsgUtils->message("S", "Write $pipe_file error");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#print {$pipe} $buf;
|
||||
close(PIPEHANDLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 remove_pipe
|
||||
Remove the fifo pipe file if pipe file exists.
|
||||
Input:
|
||||
$class: FifoPipe class
|
||||
$pipe_file: the file path of the pipe file
|
||||
|
||||
Usage example:
|
||||
my $fifo_path = '/tmp/fifopipe/pipe1;
|
||||
xCAT::FifoPipe->remove_pipe($fifo_path);
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub remove_pipe {
|
||||
my $class = shift;
|
||||
my $pipe_file = shift;
|
||||
xCAT::MsgUtils->message("I", "Remove fifo pipe file $pipe_file");
|
||||
if (-p $pipe_file) {
|
||||
unlink($pipe_file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1;
|
15
xCAT-server/lib/perl/xCAT/State.pm
Normal file
15
xCAT-server/lib/perl/xCAT/State.pm
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT::State;
|
||||
|
||||
use constant REQUEST_ERROR => 0;
|
||||
use constant REQUEST_WAIT => 1;
|
||||
use constant REQUEST_UPDATE => 2;
|
||||
|
||||
use constant WAIT_STATE => 'waiting';
|
||||
use constant UPDATE_STATE => 'updating';
|
||||
|
||||
use constant INSPECT_ACTION => 'inspect';
|
||||
use constant UPDATE_ACTION => 'update';
|
||||
|
||||
1;
|
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,7 @@ use xCAT::TableUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::xcatd;
|
||||
use xCAT::State;
|
||||
my $os = xCAT::Utils->osver();
|
||||
my $arch = `uname -p`;
|
||||
# These do not have the IO::Uncompress rpm available
|
||||
@ -73,6 +74,9 @@ my %dispatched_children=();
|
||||
my $plugin_numchildren=0;
|
||||
my %plugin_children;
|
||||
my $inet6support;
|
||||
|
||||
my @CALLBACK_COMMAND =('getadapter');
|
||||
|
||||
if ($^O =~ /^aix/i) { # disable AIX IPV6 TODO
|
||||
$inet6support = 0;
|
||||
} else {
|
||||
@ -111,7 +115,7 @@ use xCAT::ExtTab;
|
||||
use Data::Dumper;
|
||||
use Getopt::Long;
|
||||
use Sys::Syslog qw(:DEFAULT setlogsock);
|
||||
openlog("xcat",,"local4");
|
||||
openlog("xcat","local4");
|
||||
# turn off warnings for call to setlogsock. puts out warning message if
|
||||
# syslog tcp port not defined in /etc/services. this can safely be ignored.
|
||||
no warnings;
|
||||
@ -1472,10 +1476,6 @@ xCAT_monitoring::monitorctrl::stop($$);
|
||||
my $parent_fd;
|
||||
my %resps;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sub plugin_command {
|
||||
my $req = shift;
|
||||
my $sock = shift;
|
||||
@ -1744,6 +1744,7 @@ sub plugin_command {
|
||||
$parent_fd = $old_parent_fd;
|
||||
} else {
|
||||
my $req_back = undef;
|
||||
my $command = $req->{'command'}->[0];
|
||||
# executing plugins parallel
|
||||
foreach (keys %handler_hash) {
|
||||
my $modname = $_;
|
||||
@ -1751,6 +1752,20 @@ sub plugin_command {
|
||||
if (-r $plugins_dir."/".$modname.".pm") {
|
||||
require $plugins_dir."/".$modname.".pm";
|
||||
$plugin_numchildren++;
|
||||
# build the request queue for the callback command
|
||||
if (grep (/^$command$/, @CALLBACK_COMMAND)) {
|
||||
no strict "refs";
|
||||
if (defined(${"xCAT_plugin::".$modname."::"}{route_request})) {
|
||||
my $ret = ${"xCAT_plugin::".$modname."::"}{route_request}
|
||||
($req,$callback,\&do_request);
|
||||
if ($ret == xCAT::State->REQUEST_ERROR) {
|
||||
xCAT::MsgUtils->message("S", "Request failed: $!");
|
||||
next;
|
||||
} elsif ($ret == xCAT::State->REQUEST_UPDATE) {
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
my $pfd; # will be referenced for inter-process messaging.
|
||||
my $parfd; # not causing a problem that I discern yet, but theoretically
|
||||
my $child;
|
||||
|
Loading…
x
Reference in New Issue
Block a user