Change in vdsm[master]: net: try restore networks harder.

ibarkan at redhat.com ibarkan at redhat.com
Sun Aug 2 10:45:12 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: net: try restore networks harder.
......................................................................

net: try restore networks harder.

Assuming a single network fails to restore, VDSM can forgive it and
proceed with additional network restoration. Note that bond
creation failures might cause subsequent network creation failures
(if they are based on those bonds).

Change-Id: Ib6b9d314ed1df7fd0781113f6e77c647aaea7a6c
Bug-Url: https://bugzilla.redhat.com/1242532
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M vdsm/vdsm-restore-net-config
1 file changed, 22 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/44274/1

diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index c70c8b4..c5ef58e 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -120,11 +120,28 @@
     changed_config = _filter_changed_nets_bonds(available_config)
     nets = changed_config.networks
     bonds = changed_config.bonds
-    if nets or bonds:
-        _convert_to_blocking_dhcp(nets)
-        logging.debug('Calling setupNetworks with networks (%s) '
-                      'and bond (%s).', nets, bonds)
-        setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True)
+    _convert_to_blocking_dhcp(nets)
+    _try_setup_networks(bonds, nets)
+
+
+def _try_setup_networks(bonds, nets):
+    for bond, bond_attr in bonds.iteritems():
+        logging.debug('Calling setupNetworks with {%s:%s}', bond, bond_attr)
+        try:
+            setupNetworks({}, {bond: bond_attr}, connectivityCheck=False,
+                          _inRollback=True)
+        except:
+            logging.error('failed to setup bond %s. proceeding with '
+                          'restoration', bond)
+
+    for net, net_attr in nets.iteritems():
+        logging.debug('Calling setupNetworks with {%s:%s}', net, net_attr)
+        try:
+            setupNetworks({net: net_attr}, {}, connectivityCheck=False,
+                          _inRollback=True)
+        except:
+            logging.error('failed to setup network %s. proceeding with '
+                          'restoration', net)
 
 
 def _verify_all_devices_are_up(owned_ifcfg_files):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6b9d314ed1df7fd0781113f6e77c647aaea7a6c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list