aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config
AgeCommit message (Collapse)AuthorFilesLines
2017-04-25os_net_config should map nics that are down if nic is in mapping fileBob Fournier4-40/+103
Currently os-net_config will map nics from a user-supplied mapping file only if the nic is active (operstate = up). This can cause problems if a nic is in a bond and one of the bond's nics has no carrier. This fix will map the nic from the mapping file if the nic is defined on the system, regardless of the operstate status. The fix implements a new function to return a list of available nics (no check of operstate) for use if a mapping file is supplied. The list of active nics must still be used in the default case when numbering nics (no mapping file supplied). There is also some cleanup to check if a user-supplied mac is in the mapping file before attempting to convert the mac to a nic. Change-Id: Ia5d8c8b49b7ac0b51ee42a754f06e5e53587a5f6 Closes-Bug: 1679787 (cherry picked from commit b905e0d803e55deee9620a24de4b87c3429b43ab)
2017-03-22Merge "Network service is failing with DPDK" into stable/ocataJenkins2-0/+18
2017-03-13Allow setting NM_CONTROLLED=yes in os-net-config ifcfg filesDan Sneddon3-59/+124
This change adds a flag to the base interface type, nm_controlled. If this flag is true, the ifcfg file will contain NM_CONTROLLED=yes. Since this flag is applied at the base it applies to any interface type. Note that not all interface types are supported by NetworkManager at this time, so this option should be used with caution. A demonstration of the usage is included in the linux_bond_networkmanager.yaml file in the sample directory. Change-Id: I2df6ce5b4bdb04651f27fc5daa64aa752e47f3b1 Closes-Bug: 1671888 (cherry picked from commit 5f0145b88571b945b633f999c0d767ccefdce86b)
2017-03-08Network service is failing with DPDKJaganathan Palanisamy2-0/+18
Network service is failing and not started when interface is binded with dpdk driver and interface config file is available. In such case, removing config file for the interface which is binded with dpdk driver. Change-Id: Id445fbfe7abdd54c2ea522960224c7f0e412dd30 Closes-Bug: #1657661 (cherry picked from commit d1db332350a894e48a74a3b6b658d3d3c8d13c4a)
2017-03-01Restart Openvswitch after adding DPDK portskarthik s2-0/+46
OvS needs to be restarted after adding a DPDK port. This change shall be removed on migration to OvS 2.7 where DPDK Hotplug support is available. Co-Authored-By: Saravanan KR <skramaja@redhat.com> Closes-Bug: #1668375 Signed-off-by: karthik s <ksundara@redhat.com> Change-Id: I250bb8e9a8e50874a82bf7f159e5a9d5677ef5ac (cherry picked from commit ab0e0d433fb363f6a01b7c8305771f2bde47930e)
2017-01-23Merge "Exclude SR-IOV VFs in the nic numbering"Jenkins2-1/+34
2017-01-18Remove child members activation for OVS-DPDK bondSanjay Upadhyay1-4/+7
While creating DPDK bond, if-up of the bond interface itself will activate the member interfaces. Individual members should not be called for ifup. Additionally, removing the option to select the primary active-slave member for the bond, because of #1654975. Once it is fixed, primary selection from the network config will be added. Change-Id: I83527ada4a3618927d55b7aa06d436686b12d5b8 Closes-Bug: #1643026.
2017-01-05Make os-net-config pass tox py3 testsFrank A. Zdarsky4-16/+16
This patch improves Python 3 compatibility by replacing .iteritems() with .items() for iterating over dicts and fixing two tests to use portable string comparison. Change-Id: I8e1acafe372f1696823561d6aa8aae5437d34025 Closes-Bug: #1654187
2017-01-04Exclude SR-IOV VFs in the nic numberingSaravanan KR2-1/+34
SR-IOV Virtual Functions will be present as an interface in the directory '/sys/class/net'. As these are virtual interface created during the deployment process, it has to be ignored in the nic numbering logic. Closes-Bug: #1653097 Change-Id: I118a7314d496b531c52be45521d393123cdfe915
2016-11-18Add support for enabling hotplug on interfacesBrent Eagles6-6/+63
This patch adds support for enabling hotplugging on interfaces (disabled by default). This is useful for configuring SR-IOV root devices so that they "return" to the system when no longer used by a VM. Note: also updates an invalid value in the interface and ib_interface sample files. Partial-Bug: #1639901 Change-Id: Idfc17d6f20bb306271838895bc53f4b109dd664d
2016-11-16Merge "Stop dhclient in os-net-config if interface not set for DHCP"Jenkins2-0/+65
2016-11-15Stop dhclient in os-net-config if interface not set for DHCPBob Fournier2-0/+65
As described in https://bugs.launchpad.net/tripleo/+bug/1640598, there are situations in which the dhclient instance started by dhcp-all-interfaces runs even after the interface is no longer configured for DHCP. This change will terminate the instance using the '-r' argument if 'BOOTPROTO' is not set to 'dhcp' in the ifcfg file for the interface. The dhclient will only be stopped if a dhclient pid file exists, the pid file will be removed after stopping dhclient. Co-Authored-By: Dan Sneddon <dsneddon@redhat.com> Change-Id: I8a52ef5fb8052f185c01dcc27a1ecd70f5d630c8 Closes-Bug: 1640598
2016-11-15Add ovs_fail_mode option for OVS bridgesBrent Eagles4-9/+80
This patch adds an option "ovs_fail_mode" with a default value of 'standalone'. This is written to the interface configuration data as part of the ovs_extra options. Closes-Bug: #1640812 Change-Id: I2f30e56ff9fbda7beac21d95d15dbde0b01ba451
2016-11-15Add support for name replacement in OVS_EXTRABrent Eagles4-13/+102
While primarily to work around a heat issue that prevents intrinsic functions from being used for parameters being passed to NetworkConfig resources, this could be generally useful in other ways. Partial-Bug: #1640812 Change-Id: Ie9001f1d41f514666a44c8d9295b78a13e2108dc
2016-11-15Merge "Raise NotImplementedError instead of NotImplemented"Jenkins2-17/+17
2016-11-11Add support for ethtool_opts optionPierre Blanc4-4/+30
This patch add an optional option to specify the ETHTOOL_OPTS for each interface. ETHTOOL_OPTS option will be written to the ifcfg file. Change-Id: I6b594e89ba6b4c17e8df79def997f6c9ea427a3a
2016-10-19Add route_options parameterMatthew Flusche6-35/+77
route_options will append additional options to route definitions. Change-Id: I2b70efdd9c6df7ea252576e245fbc0e9c46ea4bd
2016-09-27Add options attribute to NFVSwitchSarath Kumar4-26/+19
Adding options to NFVSwitch type bridge will give flexibility and avoid specific attributes like 'cpus' in the yaml file (which will now be moved into the options) Change-Id: I4d715b641c54de969b9195b1a4b16195b2d7e595
2016-09-21Merge "Add mac address to the DPDK mapping file"Jenkins2-18/+60
2016-09-21Merge "Fixed nic numbering issue of DPDK nics after the nic has bound"Jenkins2-18/+244
2016-09-20Add mac address to the DPDK mapping fileSaravanan KR2-18/+60
When using mapping file with mac address, mapping logic will try to fetch the mac address of the interface, which will fail. Storing the mac address also in the DPDK mapping file so that we can satisfy mapping logic. Closes-Bug: #1619330 Change-Id: I92ba7f589c8d848feb083f07c3f937b50aca388e
2016-09-20Fixed nic numbering issue of DPDK nics after the nic has boundSaravanan KR2-18/+244
* os-net-config is called multiple times during the deploy. Once the interface is bound to a driver, it will not be listed for ethtool to get the pci address, which will through exception. Handled this exception. * Stored the DPDK bound nic configs at '/var/lib/os-net-config/ dpdk_mappings.yaml' file to emulate the same nic numbering after the nic has been bound to the DPDK driver. Partial-Bug: #1619330 Change-Id: I6b1e45003f851f1fcf5b8730890c75331e8d0f8f
2016-09-02Raise NotImplementedError instead of NotImplementedJi-Wei2-17/+17
NotImplementedError is the name of the exception (https://docs.python.org/2/library/exceptions.html). NotImplemented is the name of a constant (https://docs.python.org/2/library/constants.html). >>> raise NotImplemented() Traceback (most recent call last): File "<pyshell#31>", line 1, in <module> raise NotImplemented() TypeError: 'NotImplementedType' object is not callable >>> raise NotImplementedError() Traceback (most recent call last): File "<pyshell#32>", line 1, in <module> raise NotImplementedError() NotImplementedError This patch fix it. Change-Id: I8b8b47de26b9bf688d9d27a4daa6d9910994ac4a Closes-Bug: #1339855
2016-08-29Cleanups and new unit test for IVSSarath Kumar3-31/+37
- refactor test_object unit-test for IVS to follow other object class tests - add new CLI unit test for IVS - cleanup comments from https://review.openstack.org/#/c/345599 Change-Id: I0c337b019ae90ee7b2f207ff9b5060ed67bf182f
2016-08-26Supporting numbered nics for DPDK Port and DPDK BondSaravanan KR3-11/+39
Modified the sample code to use numbered nics instead of physical device name and added test code for testing the numbered nic usecases. Implements: blueprint tripleo-ovs-dpdk Depends-On: If1c91402d2d393140dc1b4a678e68a1bcdbe81e4 Change-Id: Ifadb495be57fcef56a97250de0c52fd03f2dd817
2016-08-26Add support for OVS DPDK BondSaravanan KR6-1/+200
Add functionality to os-net-config to allow DPDK bonding of interfaces, and implement support for parameters to be passed by TripleO Heat Templates. Implements: blueprint tripleo-ovs-dpdk Depends-On: Id4a23ced28b92a642c180a35c55080e5f4e2e05d Change-Id: If1c91402d2d393140dc1b4a678e68a1bcdbe81e4
2016-08-25Add support for OVS DPDK Bridge and PortSaravanan KR6-1/+284
Add support in os-net-config for DPDK ports and OVS user bridges, and implement parameters which will be set by the TripleO Heat Templates when using TripleO. Implements: blueprint tripleo-ovs-dpdk Change-Id: Id4a23ced28b92a642c180a35c55080e5f4e2e05d
2016-08-16Enhance and fix NIC mapping featureAlan Bishop4-65/+88
The original implementation supported a strictly numeric mapping scheme (e.g. nic1, nic2) that could misbehave if an active NIC was not listed in the user's mapping file. This change fixes the misbehavior, and enhances the feature by not requiring NIC aliases follow the numeric mapping scheme. This allows the user to choose meaningful names for the NIC aliases. NIC mapping now happens in two steps: 1) Process any user supplied mappings - NIC alias does not need to follow the numeric "nicN" scheme - Existing validation rules apply: mappings for inactive NICs are ignored (but logged), and duplicate mappings are rejected 2) Generate default mappings as needed - Only applies to active NICs that aren't already mapped - Follows the numeric scheme (nic1, nic2) using the NIC number based on the list of active NICs - No default mapping is assigned if another NIC is already using that numeric alias Change-Id: I6943623a51702349f6a7dcf2de8a8429078a3ab0 Closes-Bug: 1612723
2016-08-11Merge "Enable os-net-config to support and configure NFVSwitch"Jenkins6-0/+361
2016-08-09Fix Linux bond/slave ifup orderingDan Sneddon1-3/+3
The latest version of os-net-config is not reliably enabling bonding when there are no existing bonds on the system. This is due to an order-of-operations problem where it tries to bring up the bond before the slave interfaces. This can result in an error because the bonding module is not present. This change activates the bond only after the interfaces have been activated. This should ensure that the bonding module is loaded. Change-Id: I62e4b10a88168948ed59170285223fb4f8d8de88 Fixes-bug: 1611471
2016-08-02Enable os-net-config to support and configure NFVSwitchSarath Kumar6-0/+361
These changes are to generate /etc/sysconf/network-scripts/ifcfg-* and /etc/sysconfig/nfvswitch configuration files for nfvswitch and its interfaces. NFVSwitch is a virtual switch implementation based on DPDK for datacenter workloads with very high throughput needs. Change-Id: If02edb9c4c54c014f67290fe0c34e2fc73cb95bd
2016-07-25Add adapter teaming support using teamd for ifcfg-systemsDan Sneddon5-1/+192
This change adds support for Linux adapter teams using teamd to manage the bonds instead of the kernel bonding module. Adapter teams using teamd can act like bonds, but also support additional features and possibly more robust fault tolerance. This implementation is fairly straightforward, in order to maintain backward compatibility with templates made for Linux bonds. The only difference in the syntax between the two is type: team instead of type: linux_bond, and the bonding_options format is different. The configuration files for teams should contain the team options as a JSON string. The options that can be used are documented in the teamd.conf(5) man page. If an interface is marked as primary, the priority will be changed from default 0 to 100, making this interface the preferred one. In addition, the MAC address of the Team and all member interfaces will be set to that of the primary interface. At this time, there is no way to set the priority of link members individually, only the interface marked primary will have a non-default priority. This change has been tested on bare metal and worked for a team with two bonded interfaces using LACP. The team was part of an OVS bridge, and there was a VLAN interface on the team. Everything worked as expected. Unit tests are included and passing. Change-Id: If1d516ce8f9ada76375c3a52c5557d3f7348981a Implements: blueprint os-net-config-teaming
2016-07-25Merge "Add support for Infiniband interfaces"Jenkins5-0/+219
2016-07-19Merge "Make os-net-config idempotent with Linux bonds and MAC mapping"Jenkins1-0/+7
2016-07-05Add support for Infiniband interfacesDan Sneddon5-0/+219
This patch adds support for Infiniband interfaces. The only difference between Inifiniband and regular interfaces at this time is that an interface with type "ib_interface" will have "TYPE=Infiniband" added to the ifcfg file. However, the Infiniband interface is implemented as a full new class, so in the future we can add script functions or additional config options to the Infiniband interface config if needed. Unit tests for both the object and the ifcfg implementation are included. This patch does not include an implementation for systems that use /etc/network/interfaces (Debian-based systems). Note that this change has not yet been tested on bare metal with Infiniband hardware. Fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=1326616 Change-Id: Iaeaca9cd71e2cea6147951d49aecc7458be4ca0b
2016-07-05Merge "Add support for OVS patch ports"Jenkins5-0/+100
2016-06-30Make os-net-config idempotent with Linux bonds and MAC mappingDan Sneddon1-0/+7
This small change fixes a serious bug in os-net-config which made mapping NICs by MAC address not idempotent if Linux bonds were used. The first time os-net-config runs, it sees the MAC address of each interface, then it sets up the bond. On subsequent runs, any non-primary interfaces have taken the MAC address of the primary interface in the bond. At this time, they all show the same MAC address. This causes the mapping to fail, and it appears that the system has fewer matching interfaces than it had before. The impact of this bug is that bonding doesn't work for anyone doing mapping by MAC address. This is known to be affecting installations with a particular 3rd-party Neutron plugin vendor. This change simply looks for the permanent hardware address under the bonding_slave directory, if it exists. Change-Id: I5b0087370f74ecc319d2285b0f9f5f3dd951dbc2
2016-06-14Add support for OVS patch portsJames Slagle5-0/+100
OVS patch ports are used to connect two OVS bridges so traffic can flow between them. This is generally useful for various cases. Specifically it could be used to connect the bridges created by TripleO networking configurations (br-ex, etc) to the bridge created by the multinode networking setup in infra's nodepool (br_pub). This allows the nodes in a multinode deployment to have connectivity across private subnets where such traffic is typically firewalled off in public clouds. Change-Id: I11404106cb3f53734f6fc9a35c22f905a0770245
2016-06-14Merge "Add some debugging output to ordered_active_nics"Jenkins1-2/+9
2016-06-10Merge "Add support for OVS tunnels"Jenkins5-1/+135
2016-05-23Add some debugging output to ordered_active_nicsJames Slagle1-2/+9
Occassionally I've found myself debugging os-net-config's behavior related to detecting active nics. This adds a little debugging output to help see what's going on in the ordered_active_nics function. Change-Id: If7ea010071d2253b29aaaabb242690ea5fbfb165
2016-04-22Merge "Add warning for no active nics"Jenkins2-0/+8
2016-04-13Add support for OVS tunnelsJames Slagle5-1/+135
Adds support for configuring OVS Tunnels via os-net-config. Tunnels are configured as members of ovs_bridge's where the type is set to ovs_tunnel. The object also supports setting OVS extra and options so that additional tunnel data can be defined, such as remote_ip. Change-Id: I31ac1cbe8a13247a1529c0f99a0aea5807888844
2016-04-12Add warning for no active nicsBen Nemec2-0/+8
When there are no active nics, strange errors can happen later in the process of applying the configuration, and it's often not obvious what caused them. Logging a warning should make it easier to track down such problems. Note that this should never happen legitimately in a TripleO environment since we always need to have at least one active nic to even get configuration to the system. However, it is a valid case for someone who might be applying a configuration with local access to a system, so it should be handled sanely. It's also helpful in case of future bugs in the active nic checking. Change-Id: Iaf6d4b1b215b70d61e0857e093a834702829e1b9 Related-Bug: 1569403
2016-04-12Normalize operstate value for interfacesBen Nemec1-2/+2
The previous check for an interface operstate only looked for the literal "UP" in caps, but in my environments I'm seeing operstate returned as "up" in lower-case, which causes the _is_active_nic check to fail incorrectly. Example: [root@overcloud-controller-0 heat-admin]# cat /sys/class/net/eth0/operstate up In this environment os-net-config is failing with the exception in the linked bug. Change-Id: I85c2d074ce43673c691523ca146ff7cdfdf1c7ca Closes-Bug: 1569403
2016-04-12Merge "Fix typos"Jenkins1-3/+3
2016-04-12Fix typosJames Slagle1-3/+3
Fixes a couple of small types in a docstring and exception message. Change-Id: Id6977ca50418f9fbdca2d1a26174637968b305a6
2016-04-11Merge "Use interface operstate to determine nic status"Jenkins1-4/+4
2016-04-11Merge "Bump hacking in test-requirements.txt"Jenkins4-14/+15
2016-04-07Use PEERDNS when no dns_servers or use_dhcp is providedGiulio Fidente2-0/+14
PEERDNS=no ensures resolv.conf is not modified by ifup/ifdown when restarting an interface. Closes-bug: #1567004 Change-Id: Idec15d4c1630638ce8362f9d95ae3c09bcae86a3