Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
Francesco Romani has submitted this change and it was merged. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. hooks: ovs: fix getVdsCaps and getVdsStats Testing with Engine revealed a few stats and caps hooks problems. Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Signed-off-by: Petr Horáček Reviewed-on: https://gerrit.ovirt.org/48263 Reviewed-by: Ido Barkan Reviewed-by: Dan Kenigsberg Continuous-Integration: Jenkins CI Bug-Url: https://bugzilla.redhat.com/1234867 Reviewed-on: https://gerrit.ovirt.org/49698 Reviewed-by: Francesco Romani --- M vdsm_hooks/ovs/ovs_after_get_caps.py M vdsm_hooks/ovs/ovs_after_get_stats.py 2 files changed, 54 insertions(+), 48 deletions(-) Approvals: Ido Barkan: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Petr Horáček: Verified Francesco Romani: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
gerrit-hooks has posted comments on this change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. Patch Set 3: * #1234867::Update tracker: OK * Set MODIFIED::bug 1234867#1234867IGNORE, not all related patches are closed, check 49977 -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
Francesco Romani has posted comments on this change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
Ido Barkan has posted comments on this change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
Petr Horáček has posted comments on this change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. Patch Set 2: Verified+1 passed functional network tests without a regression -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Petr Horáček Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
gerrit-hooks has posted comments on this change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. Patch Set 2: * #1234867::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1234867::OK, public bug * Check Product::#1234867::OK, Correct classification oVirt * Check TM::#1234867::OK, correct target milestone ovirt-3.6.3 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
gerrit-hooks has posted comments on this change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. Patch Set 1: * #1234867::Update tracker: OK * Check Bug-Url::OK * Check Public Bug::#1234867::OK, public bug * Check Product::#1234867::OK, Correct classification oVirt * Check TM::#1234867::OK, correct target milestone ovirt-3.6.3 * Check merged to previous::OK, change not open on any previous branch -- To view, visit https://gerrit.ovirt.org/49698 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Petr Horáček Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.6]: hooks: ovs: fix getVdsCaps and getVdsStats
Hello Ido Barkan, Dan Kenigsberg, I'd like you to do a code review. Please visit https://gerrit.ovirt.org/49698 to review the following change. Change subject: hooks: ovs: fix getVdsCaps and getVdsStats .. hooks: ovs: fix getVdsCaps and getVdsStats Testing with Engine revealed a few stats and caps hooks problems. Change-Id: Ibfc8298a737fccea626b4419bd7d462cc830afc2 Signed-off-by: Petr Horáček Reviewed-on: https://gerrit.ovirt.org/48263 Reviewed-by: Ido Barkan Reviewed-by: Dan Kenigsberg Continuous-Integration: Jenkins CI Bug-Url: https://bugzilla.redhat.com/1234867 --- M vdsm_hooks/ovs/ovs_after_get_caps.py M vdsm_hooks/ovs/ovs_after_get_stats.py 2 files changed, 54 insertions(+), 48 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/49698/1 diff --git a/vdsm_hooks/ovs/ovs_after_get_caps.py b/vdsm_hooks/ovs/ovs_after_get_caps.py index 3cb10fa..ea674b7 100755 --- a/vdsm_hooks/ovs/ovs_after_get_caps.py +++ b/vdsm_hooks/ovs/ovs_after_get_caps.py @@ -21,15 +21,13 @@ import sys import traceback -import six - from vdsm.netconfpersistence import RunningConfig from vdsm import netinfo from hooking import execCmd import hooking -from ovs_utils import (get_bond_options, is_ovs_network, is_ovs_bond, +from ovs_utils import (get_bond_options, iter_ovs_nets, iter_ovs_bonds, EXT_OVS_APPCTL, EXT_OVS_VSCTL, BRIDGE_NAME) @@ -45,6 +43,13 @@ return 'on' else: return 'off' + + +def _list_ports(bridge): +rc, out, err = execCmd([EXT_OVS_VSCTL, 'list-ports', bridge], sudo=True) +if rc != 0: +hooking.exit_hook('\n'.join(err)) +return out def _get_net_info(attrs, interface, dhcpv4ifaces, dhcpv6ifaces, routes): @@ -72,16 +77,15 @@ ovs_networks_caps = {} dhcpv4ifaces, dhcpv6ifaces = netinfo._get_dhclient_ifaces() routes = netinfo._get_routes() -for network, attrs in six.iteritems(running_config.networks): -if is_ovs_network(attrs): -interface = network if 'vlan' in attrs else BRIDGE_NAME -net_info = _get_net_info(attrs, interface, dhcpv4ifaces, - dhcpv6ifaces, routes) -net_info['iface'] = interface -net_info['bridged'] = True -net_info['ports'] = [] # TODO attached nics + vms nets -net_info['stp'] = _get_stp(interface) -ovs_networks_caps[network] = net_info +for network, attrs in iter_ovs_nets(running_config.networks): +interface = network if 'vlan' in attrs else BRIDGE_NAME +net_info = _get_net_info(attrs, interface, dhcpv4ifaces, dhcpv6ifaces, + routes) +net_info['iface'] = network +net_info['bridged'] = True +net_info['ports'] = _list_ports(interface) +net_info['stp'] = _get_stp(interface) +ovs_networks_caps[network] = net_info return ovs_networks_caps @@ -89,16 +93,16 @@ ovs_bridges_caps = {} dhcpv4ifaces, dhcpv6ifaces = netinfo._get_dhclient_ifaces() routes = netinfo._get_routes() -for network, attrs in six.iteritems(running_config.networks): -if is_ovs_network(attrs): -interface = network if 'vlan' in attrs else BRIDGE_NAME -net_info = _get_net_info(attrs, interface, dhcpv4ifaces, - dhcpv6ifaces, routes) -net_info['bridged'] = True -net_info['ports'] = [] # TODO attached nics + vms nets -net_info['opts'] = {} # TODO netinfo.bridgeOpts does not work here -net_info['stp'] = _get_stp(interface) -ovs_bridges_caps[network] = net_info +for network, attrs in iter_ovs_nets(running_config.networks): +interface = network if 'vlan' in attrs else BRIDGE_NAME +net_info = _get_net_info(attrs, interface, dhcpv4ifaces, dhcpv6ifaces, + routes) +net_info['bridged'] = True +net_info['ports'] = _list_ports(interface) +# TODO netinfo._bridge_options does not work here +net_info['opts'] = {} +net_info['stp'] = _get_stp(interface) +ovs_bridges_caps[network] = net_info return ovs_bridges_caps @@ -106,17 +110,16 @@ ovs_vlans_caps = {} dhcpv4ifaces, dhcpv6ifaces = netinfo._get_dhclient_ifaces() routes = netinfo._get_routes() -for network, attrs in six.iteritems(running_config.networks): -if is_ovs_network(attrs): -vlan = attrs.get('vlan') -if vlan is not None: -net_info = _get_net_info(attrs, network, dhcpv4ifaces, - dhcpv6ifaces, routes) -iface = attrs.get('bonding') or attrs.get('nic') -net_info['iface'] = iface -net_info['bridged'] = True -net_info['vlanid'] = vlan -ovs_vlans