Skip to content

The mini design of confignetwork support NetworkManager

Yuan Bai edited this page Mar 13, 2019 · 25 revisions

Summarize

In RH8, NetworkManager is default enabled and used, confignetwork use nmcli to configure network interfaces.

In RH7.x and below OS distribution, NetworkManager is disabled in xCAT managed node, confignetwork use network service to manage network interfaces. If the node is not xCAT managed node and NetworkManager is used, confignetwork use nmcli to configure network interfaces.

Related commands refer to https://github.com/xcat2/xcat2-task-management/issues/598

confignetwork framework refine

  1. Make hash for nicdevice, nictypes, nicips, nicnetwork, niccustomscripts
  2. Sort nics device pair based on nicdevice type
  3. If there is invalid nics pair, errorcode is 1
  4. Delete invalid nics device pair based on Error
  5. Check NetworkManager service status, use "networkmanager_active" as global variable,
    if NetworkManager is active, networkmanager_active=1
    1. Check if nmcli is installed:
      1. if yes, continue, stop network.service and networking service
      2. if no, print error and exit 1
    if NetworkManager is not active:
    1. if network.service or networking is active, networkmanager_active=0
    2. if both network.service and networking is not active, exit 1
  6. Back up the network interface configuration files to /tmp directory, if it is existed in /tmp, do nothing.
  7. Configure nics framework, the inputs are orderd nic and its device
    For each nic and its device pair:
    1. If install nic is configured, skip to reconfigure it
    2. If there is customscript, then processing custom scripts for nics
    3. For current nic, get its base nic and base nic type
    4. If current nic type is BMC, ignore bmc interfaces
    5. If current nic type is ethernet, configure standalone ethernet nic
    6. If current nic type is bridge:
      1. If brctl works well:
        1. If networkmanager_active=1: create_bridge_interface_nmcli ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type
        2. If networkmanager_active=0: create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type
    7. If current nic type is VLAN:
      1. Get vlanname and vlanid
      2. If networkmanager_active=1: create_vlan_interface_nmcli ifname=$vlanname vlanid=$vlanid
      3. If networkmanager_active=0: create_vlan_interface ifname=$vlanname vlanid=$vlanid
    8. If current nic type is BOND:
      1. If networkmanager_active=1: create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type
      2. If networkmanager_active=0: create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type
    9. If current nic type is infiniband Or Omnipath, use "configib" to configure IB nics

create BOND interface

  1. create_bond_interface is original interface

  2. create_bond_interface_nmcli is for NetworkManager
    1. Parser input arguments

    2. If no slave_ports, return 1

    3. Set bonding_opts based on slave_type, slave_type can be ethernet or infiniband

    4. Query "nicnetworks" entry about its target "xcatnet"

    5. Query mtu value from "networks"

    6. Calculate prefix based on mask and network

    7. Check if bond slaves device is managed or unmanaged
      1. if it is unmanaged, set it managed, if set it managed failed, print error and return 1;
    8. Create target bond interface
      1. if target bond device has connection:
        1. disconnect master and slaves connection
      2. stage 0: create raw bond connection
        1. load the bonding module if not loaded
        2. create master and slaves bond device connection, connection name should be with xCAT label
      3. stage 1: setup bond options for the new connection
        1. modify master bond connection options (ip, prefix, bonding_opts etc)
        2. if there is customized parameter, customize master bond interface connection
      4. stage 2: bring interface up
        For each slaves:
        1. bring up slave connection.
        1. bring new master bond connection up
      5. stage 3: check all connection state, if it is failed, wait for connection state and check target interface up again, can use "wait_for_ifstate" function

create VLAN interface

  1. create_vlan_interface is original interface
  2. create_vlan_interface_nmcli is for NetworkManager
    1. Parser input arguments
    2. Check if there is no vlanid, return 1
    3. Query "networks" entry
    4. Query mtu value from "networks" hash
    5. Calculate prefix based on mask and network
    6. Load the 8021q module if not loaded
    7. Check if base nic device is managed or not
      1. If unmanaged, set it managed
      2. If failed to set it managed, return 1
    8. Check if vlan connection exists or not
      1. If vlan connection exists, modify this vlan connection
      2. If vlan connection does not exist, create new vlan connection using nmcli
    9. If there is customized parameter for this vlan
      1. customize vlan interface connection using nmcli
    10. Set vlan connection up
    11. Check vlan interface state, if failed, Wait for connection state, can use "wait_for_ifstate" function

create Bridge interface

  1. create_bridge_interface is original interface
  2. create_bridge_interface_nmcli is for NetworkManager
    1. Parser input arguments
    2. Query "nicnetworks" entry about its target "xcatnet"
    3. Query mtu value from "networks"
    4. Calculate prefix based on mask and network
    5. If base type is ethernet
      1. check if this device is managed or not, if it is unmanaged, set it managed, if set it managed failed, print error and return 1;
      2. create enthernet type slave connection using nmcli
    6. If base type is vlan
      1. check if this device is managed or not, if it is unmanaged, set it managed, if set it managed failed, print error and return 1;
      2. create vlan type slave connection using nmcli
    7. If base type is bond
      1. check if this device is managed or not, if it is unmanaged, set it managed, if set it managed failed, print error and return 1;
      2. create bond type slave connection using nmcli
    8. Check If master bridge connection existed or not
      1. If not, create master bridge connection using nmcli
      2. If yes, disconnect old connection, create master bridge connection using nmcli
    9. if there is customized parameter
      1. customize master bridge interface connection using nmcli
    10. Bring up slave connection
    11. Check and wait for slave connection state, can use "wait_for_ifstate" function
    12. Bring up master connection
    13. Check and wait for master connection state, can use "wait_for_ifstate" function

News

History

  • Oct 22, 2010: xCAT 2.5 released.
  • Apr 30, 2010: xCAT 2.4 is released.
  • Oct 31, 2009: xCAT 2.3 released. xCAT's 10 year anniversary!
  • Apr 16, 2009: xCAT 2.2 released.
  • Oct 31, 2008: xCAT 2.1 released.
  • Sep 12, 2008: Support for xCAT 2 can now be purchased!
  • June 9, 2008: xCAT breaths life into (at the time) the fastest supercomputer on the planet
  • May 30, 2008: xCAT 2.0 for Linux officially released!
  • Oct 31, 2007: IBM open sources xCAT 2.0 to allow collaboration among all of the xCAT users.
  • Oct 31, 1999: xCAT 1.0 is born!
    xCAT started out as a project in IBM developed by Egan Ford. It was quickly adopted by customers and IBM manufacturing sites to rapidly deploy clusters.
Clone this wiki locally