Bug 1254929

Summary: network team device configuration in kickstart pre section not working
Product: Red Hat Enterprise Linux 7 Reporter: Radek Vykydal <rvykydal>
Component: anacondaAssignee: Radek Vykydal <rvykydal>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: csychowski, lenh_jea, lkundrak, lmiksik, lrintel, mbanas, mkolaja, mkovarik, sbueno
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-21.48.22.87-1 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
: 1366300 (view as bug list) Environment:
Last Closed: 2016-11-03 23:09:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1366300    
Bug Blocks:    
Attachments:
Description Flags
A patch with two fixes none

Description Radek Vykydal 2015-08-19 09:15:30 UTC
Created attachment 1064699 [details]
A patch with two fixes

http://download.englab.brq.redhat.com/pub/rhel/rel-eng/RHEL-7.2-20150806.1/compose/Server/x86_64/os/

anaconda-21.48.22.29-1

Team device configuration in pre phase of kickstart does not work.

To reproduce:
- Have vm with 3 devices (eg ens3, ens7, ens8).
- Boot with ip=ens3:dhcp boot option (so that only ens3 is activated in dracut)
- Use one of these kickstarts

(A)
%include /tmp/ksinclude
%pre
echo 'network --device team0 --bootproto static --ip=10.34.102.222 --netmask=255.255.255.0 --gateway=10.34.102.254 --nameserver=10.34.39.2 --teamslaves=ens7,ens8 --teamconfig="{\"runner\": {\"name\": \"roundrobin\"}}" --activate' >> /tmp/ksinclude
%end

(B)
%include /tmp/ksinclude
%pre
echo "network --device team0 --bootproto static --ip=10.34.102.222 --netmask=255.255.255.0 --gateway=10.34.102.254 --nameserver=10.34.39.2 --teamslaves=\"ens7'{\\\"prio\\\": -10, \\\"sticky\\\": true}',ens8'{\\\"prio\\\": 100}'\" --teamconfig=\"{\\\"runner\\\": {\\\"name\\\": \\\"activebackup\\\"}}\" --activate" >> /tmp/ksinclude
%end

There are actually 2 fixes needed.

1) First one to make anaconda not crash on both (A) and (B).

2) Second one to actually use slave port configuration in (B), ie to have
TEAM_PORT_CONFIG="{\"prio\": 100}"
in /etc/sysconfig/network-scripts/ifcfg-ens8
based on ens8'{\\\"prio\\\": 100}' item of kickstart config

Comment 2 Radek Vykydal 2015-08-19 09:39:16 UTC
The patch is isolated and safe so I'm inclined to get this fix in rhel 7.2. OTOH I am not sure if defining team networking in pre kickstart is a widely used case.

Comment 4 Martin Banas 2015-09-08 13:27:37 UTC
Reproduced on RHEL-7.2-20150904.0, qa_ack+.

Comment 5 Radek Vykydal 2015-09-08 14:27:33 UTC
(In reply to Martin Banas from comment #4)
> Reproduced on RHEL-7.2-20150904.0, qa_ack+.

updates image for the compose:

https://rvykydal.fedorapeople.org/updates.teampre.20150904.img

Comment 6 LENHOF 2016-01-29 15:43:06 UTC
Hi,

This problem seem to affect me on my installation of RHEL 7.1, using network config in main kickstart file (without using pre).

Will probably move the config in a post-installation task...

Regards,

JYL

Comment 8 Michal Kovarik 2016-07-27 12:57:13 UTC
Tested with anaconda-21.48.22.80-1.el7.x86_64
Scenario (A) failed with:
anaconda 21.48.22.80-1 for Red Hat Enterprise Linux 7.3 (pre-release) started.
 * installation log files are stored in /tmp during the installation
 * shell is available on TTY2
 * when reporting a bug add logs from /tmp as separate text/plain attachments
12:54:48 Running pre-installation scripts
Traceback (most recent call last):
  File "/sbin/anaconda", line 1202, in <module>
    networkInitialize(ksdata)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 1298, in networkInitialize
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 1280, in apply_kickstart
    added_connections = add_connection_for_ksdata(network_data, dev_name)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 495, in add_connection_for_ksdata
    suuid = _add_slave_connection('team', slave, devname, networkdata.activate, svalues)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 662, in _add_slave_connection
    nm.nm_add_connection(values)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/nm.py", line 908, in nm_add_connection
    connection = proxy.AddConnection('(a{sa{sv}})', settings)
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gio.py", line 171, in __call__
    None)
GLib.Error: g-io-error-quark: GDBus.Error:org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty: team-port.config: value is NULL or empty (36)
Exception AttributeError: "'NoneType' object has no attribute 'udev_unref'" in <bound method Context.__del__ of <pyudev.core.Context object at 0x7fc529eb2290>> ignored

[anaconda root@localhost ~]# cat /tmp/ksinclude 
network --device team0 --bootproto static --ip=10.34.102.222 --netmask=255.255.255.0 --gateway=10.34.102.254 --nameserver=10.34.39.2 --teamslaves=eth1,eth2 --teamconfig="{\"runner\": {\"name\": \"roundrobin\"}}" --activate

Scenario (B) passed without issues.

Comment 9 Radek Vykydal 2016-07-29 09:46:24 UTC
Seems that NetworkManager started to require non-empty team port configration when creating team slave configuration (compared to 7.2 where empty port configuration would be accepted).

We can fix it by this patch:

https://github.com/rhinstaller/anaconda/pull/717

I'd just like to confirm from NM whether the change is really intentional?

Comment 10 Radek Vykydal 2016-07-29 09:50:22 UTC
Updates image with the patch for anaconda-21.48.22.80-1.el7.x86_64:
https://rvykydal.fedorapeople.org/updates.teamreg73.img

Updates image with the patch for the latest anaconda-21.48.22.81-1.el7.x86_64:
https://rvykydal.fedorapeople.org/updates.teamreg73.81.img

Comment 11 Lubomir Rintel 2016-08-01 15:41:01 UTC
I think we want to preserve the ability to specify empty configuration.

Comment 12 Radek Vykydal 2016-08-24 11:42:35 UTC
So this should be fixed by NM bug 1366300.

Comment 14 Radek Vykydal 2016-08-25 10:55:44 UTC
(In reply to Radek Vykydal from comment #12)
> So this should be fixed by NM bug 1366300.

I've tested that it (adding "" port configuration) works with

RHEL-7.3-20160824.n.0
NetworkManager-1.4.0-1.el7

which is unfortunately hitting another unrelated issue: bug 1370099.

Comment 17 Michal Kovarik 2016-09-09 08:31:07 UTC
Verified on RHEL-7.3-20160908.3 with anaconda-21.48.22.87-1. Both variants from description can be installed, configuration is also applied in installed system.

Comment 19 errata-xmlrpc 2016-11-03 23:09:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-2158.html