Change in vdsm[master]: ifcfg: consume bond slaves owned by NetworkManager

osvoboda at redhat.com osvoboda at redhat.com
Tue Apr 19 17:30:41 UTC 2016


Ondřej Svoboda has uploaded a new change for review.

Change subject: ifcfg: consume bond slaves owned by NetworkManager
......................................................................

ifcfg: consume bond slaves owned by NetworkManager

On ifcfg systems NetworkManager uses the "ifcfg-rh" plugin to persist
its "connections" (one could say "profiles") in the same directory
as initscripts do: /etc/sysconfig/network-scripts/ (in contrast to
/etc/NetworkManager/system-connections/ which is used by the default
"keyfile" plugin).

It can also watch the directory for changes if configured like below
and automatically refresh its configuration according to changed
files' content.

cat /etc/NetworkManager/conf.d/90-vdsm-monitor-connection-files.conf
[main]
monitor-connection-files=true

To let NetworkManager know VDSM wants to consume its devices we
have to create ifcfg files with NM_CONTROLLED=no for all of them,
not just those that differ from the expected configuration.

This patch assumes the above file exists. It will be the focus
of a different patch to write this file either upon installation
or deployment to a hypervisor. NetworkManager would have to be
restarted afterwards.

TODO (possibly in different patches): make sure to always write
ifcfg files for all types of devices VDSM manages.

Change-Id: I77a600cd3bfddc0da48ae801bb121a8093254ae2
Bug-Url: https://bugzilla.redhat.com/1304509
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
---
M lib/vdsm/network/configurators/ifcfg.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/56364/1

diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py
index 6c74472..4a5bd41 100644
--- a/lib/vdsm/network/configurators/ifcfg.py
+++ b/lib/vdsm/network/configurators/ifcfg.py
@@ -159,7 +159,10 @@
         for slave in bond.slaves:
             if slave.name in nicsToAdd:
                 ifdown(slave.name)  # nics must be down to join a bond
-                self.configApplier.addNic(slave)
+            # NetworkManager compatibility: ifcfg file must be written (with
+            # NM_CONTROLLED=no) for all NICs we want to consume.
+            self.configApplier.addNic(slave)
+            if slave.name in nicsToAdd:
                 _exec_ifup(slave)
 
         if bondIfcfgWritten:


-- 
To view, visit https://gerrit.ovirt.org/56364
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77a600cd3bfddc0da48ae801bb121a8093254ae2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>


More information about the vdsm-patches mailing list