[PATCH V3 0/2] Warn users about NetworkManager instability

V3: - Use cached capability value. V2: - Change is_nm_running to use a 'cross distro' command. - Update the warning message NetworkManager might have some instability when managing the bridges created by libvirt. There some bugs against NM about it and there is no much we can do more than warn the users about it. So, this patchset checks if NM is running and, if so, will display a message to users. Jose Ricardo Ziviani (2): Implement function to check if NM is running. Add a warn about NM running in the system. src/kimchi/model/config.py | 1 + src/kimchi/model/featuretests.py | 10 ++++++++++ tests/test_rest.py | 3 ++- ui/js/src/kimchi.network.js | 3 +++ ui/pages/i18n.json.tmpl | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) -- 1.9.1

- NetworkManager does not (fully) support bridges yet and there is no portable/bullet-proof way to solve any possible issue that may happen to libvirt bridge creation due to NM problems. - This commit adds a new capability to inform the frontend whether the NM is running or not, so the frontend could inform the user about it. Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> --- src/kimchi/model/config.py | 1 + src/kimchi/model/featuretests.py | 10 ++++++++++ tests/test_rest.py | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/kimchi/model/config.py b/src/kimchi/model/config.py index 1c43360..a417c9b 100644 --- a/src/kimchi/model/config.py +++ b/src/kimchi/model/config.py @@ -140,6 +140,7 @@ class CapabilitiesModel(object): 'federation': kconfig.get("server", "federation"), 'auth': kconfig.get("authentication", "method"), 'kernel_vfio': self.kernel_vfio, + 'nm_running': FeatureTests.is_nm_running(), } diff --git a/src/kimchi/model/featuretests.py b/src/kimchi/model/featuretests.py index 4aac8ed..8cbe31d 100644 --- a/src/kimchi/model/featuretests.py +++ b/src/kimchi/model/featuretests.py @@ -223,3 +223,13 @@ class FeatureTests(object): kimchi_log.warning("Unable to load Kernal module vfio-pci.") return False return True + + @staticmethod + def is_nm_running(): + '''Tries to determine whether NetworkManager is running.''' + + out, err, rc = run_command(['nmcli', 'dev', 'status']) + if rc != 0: + return False + + return True diff --git a/tests/test_rest.py b/tests/test_rest.py index 4ade722..686d54c 100644 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -1025,7 +1025,8 @@ class RestTests(unittest.TestCase): keys = [u'libvirt_stream_protocols', u'qemu_stream', u'qemu_spice', u'screenshot', u'system_report_tool', u'update_tool', - u'repo_mngt_tool', u'federation', u'kernel_vfio', u'auth'] + u'repo_mngt_tool', u'federation', u'kernel_vfio', u'auth', + u'nm_running'] self.assertEquals(sorted(keys), sorted(conf.keys())) def test_peers(self): -- 1.9.1

- If NetworkManager is running when user is trying to create a bridge, it will warn about problems that could happen, asking the user to turn NM service off while dealing with bridge creation. Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> --- ui/js/src/kimchi.network.js | 3 +++ ui/pages/i18n.json.tmpl | 1 + 2 files changed, 4 insertions(+) diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js index 90fb62b..c84bcb0 100644 --- a/ui/js/src/kimchi.network.js +++ b/ui/js/src/kimchi.network.js @@ -323,6 +323,9 @@ kimchi.setDefaultNetworkType = function(isInterfaceAvail) { kimchi.enableBridgeOptions(false); $("#networkBriDisabledLabel").show(); } else { + if (kimchi.capabilities && kimchi.capabilities.nm_running) { + kimchi.message.warn(i18n['KCHNET6001W']); + } $("#bridgeOptions").slideDown(100); $("#networkVlanID").toggle(false); $("#labelNetworkVlanID").toggle(false); diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl index a7f9daf..a6e3f5b 100644 --- a/ui/pages/i18n.json.tmpl +++ b/ui/pages/i18n.json.tmpl @@ -153,6 +153,7 @@ "KCHNET6002M": "$_("This action will interrupt network connectivity for any virtual machine that depend on this network.")", "KCHNET6003M": "$_("Create a network")", "KCHNET6004M": "$_("This network is not persistent. Instead of stop, this action will permanently delete it. Would you like to continue?")", + "KCHNET6001W": "$_("The bridged VLAN tag may not work well with NetworkManager enabled. You should consider disabling it.")", "KCHPOOL6001M": "$_("This will permanently delete the storage pool. Would you like to continue?")", "KCHPOOL6002M": "$_("This storage pool is empty.")", -- 1.9.1
participants (2)
-
Aline Manera
-
Jose Ricardo Ziviani