Change in vdsm[master]: net: Remove OVS bond setup.
Petr Horáček has posted comments on this change. Change subject: net: Remove OVS bond setup. .. Patch Set 1: (1 comment) https://gerrit.ovirt.org/#/c/63850/1//COMMIT_MSG Commit Message: Line 3: AuthorDate: 2016-09-14 14:26:55 +0300 Line 4: Commit: Edward HaasLine 5: CommitDate: 2016-09-14 14:33:20 +0300 Line 6: Line 7: net: Remove OVS bond setup. > It's a reporting tool, how can it harm? But it works with bondings created by us, with other_config: vdsm_level=southbound etc. it won't work with user created bonding. it's loads of extra mess Line 8: Line 9: The OVS bond is to be replaced by Linux bond. Line 10: This patch removes all setup related OVS bond code. Line 11: -- To view, visit https://gerrit.ovirt.org/63850 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e3d6ba6ecd64bbf22d4be88af6a69ed2f476cea Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Remove OVS bond setup.
Edward Haas has posted comments on this change. Change subject: net: Remove OVS bond setup. .. Patch Set 1: (1 comment) https://gerrit.ovirt.org/#/c/63850/1//COMMIT_MSG Commit Message: Line 3: AuthorDate: 2016-09-14 14:26:55 +0300 Line 4: Commit: Edward HaasLine 5: CommitDate: 2016-09-14 14:33:20 +0300 Line 6: Line 7: net: Remove OVS bond setup. > ovs/info.py bond handling does not make sense if there are no configured bo It's a reporting tool, how can it harm? What if someone will define it on the switch? Don't we want to detect it? Line 8: Line 9: The OVS bond is to be replaced by Linux bond. Line 10: This patch removes all setup related OVS bond code. Line 11: -- To view, visit https://gerrit.ovirt.org/63850 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e3d6ba6ecd64bbf22d4be88af6a69ed2f476cea Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Remove OVS bond setup.
Petr Horáček has posted comments on this change. Change subject: net: Remove OVS bond setup. .. Patch Set 1: Code-Review-1 (1 comment) https://gerrit.ovirt.org/#/c/63850/1//COMMIT_MSG Commit Message: Line 3: AuthorDate: 2016-09-14 14:26:55 +0300 Line 4: Commit: Edward HaasLine 5: CommitDate: 2016-09-14 14:33:20 +0300 Line 6: Line 7: net: Remove OVS bond setup. ovs/info.py bond handling does not make sense if there are no configured bondings. i guess we should clean that up as well. Line 8: Line 9: The OVS bond is to be replaced by Linux bond. Line 10: This patch removes all setup related OVS bond code. Line 11: -- To view, visit https://gerrit.ovirt.org/63850 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e3d6ba6ecd64bbf22d4be88af6a69ed2f476cea Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas Gerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Remove OVS bond setup.
Edward Haas has posted comments on this change. Change subject: net: Remove OVS bond setup. .. Patch Set 1: Verified+1 -- To view, visit https://gerrit.ovirt.org/63850 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e3d6ba6ecd64bbf22d4be88af6a69ed2f476cea Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: Edward Haas Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Remove OVS bond setup.
gerrit-hooks has posted comments on this change. Change subject: net: Remove OVS bond setup. .. Patch Set 1: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0']) -- To view, visit https://gerrit.ovirt.org/63850 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e3d6ba6ecd64bbf22d4be88af6a69ed2f476cea Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward HaasGerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org
Change in vdsm[master]: net: Remove OVS bond setup.
Edward Haas has uploaded a new change for review. Change subject: net: Remove OVS bond setup. .. net: Remove OVS bond setup. The OVS bond is to be replaced by Linux bond. This patch removes all setup related OVS bond code. Change-Id: I3e3d6ba6ecd64bbf22d4be88af6a69ed2f476cea Signed-off-by: Edward Haas--- M lib/vdsm/network/ovs/switch.py M tests/network/ovs_switch_test.py M tests/network/ovs_test.py 3 files changed, 7 insertions(+), 144 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/63850/1 diff --git a/lib/vdsm/network/ovs/switch.py b/lib/vdsm/network/ovs/switch.py index 18425a9..691e410 100644 --- a/lib/vdsm/network/ovs/switch.py +++ b/lib/vdsm/network/ovs/switch.py @@ -18,14 +18,11 @@ # from __future__ import absolute_import -import itertools import random import six -from vdsm.network import errors as ne from vdsm.network.netlink import link -from vdsm.network.netinfo import bonding from vdsm.network.netinfo.nics import nics from vdsm.utils import random_iface_name @@ -88,105 +85,6 @@ else: six.reraise(type, value, traceback) -def remove_bonds(self, bonds): -self._transaction.add( -*[self._ovsdb.del_port(bond) for bond in bonds]) - -def edit_bonds(self, bonds): -detach_commands = [] -attach_commands = [] - -for bond, attrs in six.iteritems(bonds): -bridge = self._bridges_by_sb[bond] - -to_be_configured_slaves = attrs['nics'] -self._acquired_ifaces.update(to_be_configured_slaves) -running_bond = self._ovs_info.bridges[bridge]['ports'][bond] -running_slaves = running_bond['bond']['slaves'] - -detach, attach = self._edit_slaves( -bond, running_slaves, to_be_configured_slaves) -detach_commands.extend(detach) -attach_commands.extend(attach) - -attach_commands.extend( -self._edit_mode(bond, attrs.get('options', ''))) - -self._transaction.add(*detach_commands) -self._transaction.add(*attach_commands) - -def add_bonds(self, bonds): -""" -On a bond creation, OVS bridge is created. Northbound port (network) -then can be attached to it. -""" -for bond, attrs in six.iteritems(bonds): -bridge = self._create_bridge() -self._bridges_by_sb[bond] = bridge -to_be_configured_slaves = attrs['nics'] -self._create_sb_bond(bridge, bond, to_be_configured_slaves) -self._acquired_ifaces.update(to_be_configured_slaves) - -self._transaction.add(*self._edit_mode( -bond, attrs.get('options', ''))) - -def _edit_slaves(self, bond, running_slaves, to_be_configured_slaves): -running = frozenset(running_slaves) -to_be_configured = frozenset(to_be_configured_slaves) - -attach = list(itertools.chain.from_iterable( -self._ovsdb.attach_bond_slave(bond, slave) -for slave in to_be_configured - running)) - -detach = list(itertools.chain.from_iterable( -self._ovsdb.detach_bond_slave(bond, slave) -for slave in running - to_be_configured)) - -return detach, attach - -def _edit_mode(self, bond, options): -# TODO: Support setup of all OVS bond-related attributes and move -# fallback setup into a separate function. - -commands = [] - -parsed_options = bonding.parse_bond_options(options) -mode = parsed_options.get('mode') -miimon = parsed_options.get('miimon') - -bond_mode = 'active-backup' -if mode is None: -lacp = 'off' -else: -if mode in ('1', bonding.BONDING_MODES_NUMBER_TO_NAME['1']): -lacp = 'off' -elif mode in ('4', bonding.BONDING_MODES_NUMBER_TO_NAME['4']): -lacp = 'active' -else: -# TODO: Validation should be moved to validator.py as soon as -# we implement bond options canonicalization. -raise ne.ConfigNetworkError( -ne.ERR_BAD_PARAMS, -'Mode {} is not available for OVS bondings'.format(mode)) -commands.append(self._ovsdb.set_port_attr( -bond, 'bond_mode', bond_mode)) -commands.append(self._ovsdb.set_port_attr(bond, 'lacp', lacp)) - -if miimon is None: -bond_detect_mode = 'carrier' -bond_miimon_interval = None -else: -bond_detect_mode = 'miimon' -bond_miimon_interval = miimon -commands.append(self._ovsdb.set_port_attr( -bond, 'other_config:bond-detect-mode', bond_detect_mode)) -if bond_miimon_interval is not None: -commands.append(self._ovsdb.set_port_attr( -bond,