This is follow-up of 077e43698e and fixes
the wrong stack level for deprecation warning. We don't have to look
for the point of upper caller.
Change-Id: I615d995c42e6ff689d25f5db8026d9cd684d93ad
Because WinStackers project has been retired, running OpenStack on
Windows operating systems is no longer maintained.
Change-Id: Ic5971ee22aa309a8b46f21fccaa8be7c0091fb0c
This change modifies the os-vif ovs plugin to set a default
tc qdisc on ovs interface when the host os is not windows
and the system datapath is used.
This change fixes a "silent" bug in the functional test code due
to a change in an ovsdbapp function signiture to accpet a new paramater.
Closes-Bug: #2017868
Change-Id: Id9ef7074634a0f23d67a4401fa8fca363b51bb43
* removed skipdist=True to make sure os-vif is available in the virtual
env
* removed basepython = python3 as we assume all developer switched to
python3 in their env already
* removed ignore_basepython_conflict = True as without the basepython
definition generative targets now work without conflict
Also squashed in the commit fixing the functional target as both fix is
needed to unblock the gate:
add CAP_DAC_OVERRIDE to test privsep contexts
This change modifes the privsep contexts used by the test
code to create inteface without using the os-vif plugins.
The os-vif functional tests actully create ovs and linux
brdiges and dummy netdevs. to ensure the drier work correctly
the functional tests have a simpler test only version of the
port/brige management commands that are used to prepare
and validate the test env. The simpler implementation uses
standard linux commandline tools like "ip" or "ovs-vsctl"
which on ubuntu 22.04 require the addtion of CAP_DAC_OVERRIDE
to work around socket/file ownership issues.
To avoid adding capablities at runtime that are not required
this change modifes the existing test only context in
the os_vif.tests.functional.privsep module and add a new test
context for the vif_plug_ovs plugin
Change-Id: Ide357cb64a8d128ff8ad978abae6a039e814d8a9
To assist with automated configuration validation, we need entry points
for oslo.config.opts for each one of the plugins.
Change-Id: I7fc132f917949d147dd6371d54e01a6cfd995aae
We were logging in a code path but not setting a return value. This was
passing tests because it seems 'assertFalse' does a falsey check, not a
true boolean False check.
Change-Id: If0156cd4d4c1acbad683873d632ee5afb0b7b7ad
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This change modifes os-vif add interface to account
for the new behavior of link_lookup.
In 0.5.13 if a link is not found link_lookup returns an
empty list. In previous releases it raised ipexc.NetlinkError.
Closes-bug: #1890353
Change-Id: I567afb544425c1b91d98968a0b597be718869089
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I67fcc16530f1c46eecb62e27eb7b88d1dee6f9df
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Now that we no longer support py27, we can remove six.
Change-Id: Ie3ff2b7f5e8a5ff1357d6147ab1eb481f562aba3
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Few warnings are now failing as error:
- duplicate autoclass for VIFDirect
- case sensitive for glossary terms 'Linux Bridge'
Change-Id: I58d7fd85d98333bee387feff7b2c3d6f2f9102f4
it seems that relevant OVS patches still did not land [1][2].
I think we should revert and wait for the patches to merge first,
then we can go ahead and merge in os-vif with release note that states
the exact OVS version required.
[1] https://patchwork.ozlabs.org/patch/1186896/
[2] https://patchwork.ozlabs.org/patch/1215075/
This reverts commit 399e355088.
Change-Id: I7cd6112b3b35a6971d3d354abae7652344ed1c97
Pass VF MAC address to ovs to set in case of netdev VIFHostDevice.
In case of DPDK representor port, Nova will pass through the VF PCI
as a hostdev and os-vif should pass the MAC to ovs as it would be
responsible for setting its MAC.
Moreover, when not using dpdk, libvirt does the mac cleanup,
since the VF is managed by libvirt, but when using DPDK,
libvirt does not manage the VF so we need to cleanup MAC address
in os-vif.
Change-Id: I5368c318cc0cfd7b5644d3da0dccbce7a48d6a85
Closes-Bug: #1829734
The mac ageing configuration on linux bridges is now
conditional and caller controlled. By default mac ageing
is unspecified and will use the kernel's default of 300
seconds. For ovs with hybrid plug we override this to
0 to prevent packet loss issue during some migration
edgecases. This change reverts disabling mac ageing
for the linux bridge plugin which was accidentally
introduced during the brctl removal via inheriting the
ovs plugin's default behavior when the bridge create
code became shared.
Change-Id: I95612352de6cdb47de98eb80c208dd1a74499d41
Closes-bug: #1837252
Remove IP proxy methods in os_vif.internal.command.ip.__init__.py. Both
Windows and Linux IP implementations have the same interface, IpCommand.
Method calls (set, add, delete, exists) must be the same for both IP
classes, making those proxy calls unnecessary.
Removed a nesting level for internal IP commands. Now those commands are
located in os_vif.internal.ip.
Change-Id: Id8b71172fb06b435cf169a7e55c11233f22fa65b
Closes-Bug: #1817940
The functional base test class should be implemented under os-vif.
Other projects will inherit from this project to implement functional
test cases.
Change-Id: Ib5873687032bfb55d1847d4948f6e9679cf6d31e
Closes-Bug: #1817938
This parameter is present in the IpCommand abstract class and both
Windows and Linux implementations.
This change modifies the pyroute2 driver to lookup the
interface index of the bridge when setting the master paramater
on a port.
This change add a functional test to use the master paramater
to add an interface to a bridge and validate it works correctly.
Change-Id: I54ded32281c6a5b67b6ccb9f1bdb6e3fb6731049
Closes-Bug: #1817919
- This change updates sanitize_log_path to
use replace instead of string.translate so that
it works across both python 2.7 and python 3.
- This change modifies the functional tests to run under
python 3 by default. A new functional-py27 env is
also added.
Change-Id: Id8127ae68cb5aeebdba73bd14fc0481cd9b773d9
Most of the docstrings that were missing have been taken from the
libvirt docs. Man, there is some tight coupling going on here.
Change-Id: I30fcf5cd4d695494edf8c99fb887ecefb5b404fe
- This change extends the ip_command interface set function
to accept a master as a parent device for a given interface.
- This change extends the impl_pyroute2 add function to
support creating linux bridges.
- This change replaces calls to brctl with calls to the ip_command api.
- This change removes the use of tee to disable ipv6 in the ovs plugin.
Change-Id: I8308e8840e20b0a72d00880c1a7996b4c73f6a83
Partial-Bug: #1801919
The backlevelling code for the VIF objects have a number of sharp edges.
This commit changes the layout of the obj_make_compatible methods to conform
to a fixed pattern.
Given the following version history:
# Version 1.0: Initial Release based on ParentClass 1.0
# Version 1.1: Added member_one_one
# Version 1.2: ParentClass version increased to 1.1 from 1.0
# Version 1.3: Added member_one_three
# Version 1.4: ParentClass version increased to 1.2 from 1.1
# Version 1.5: Added member_one_five
Use the following pattern for obj_make_compatible():
0. use versionutils to calculate target_version
1. Remove added members from the primitive in reverse order:
- if target_version < (1, 5) and 'member_one_five' in primitive:
del primitive['member_one_five']
- if target_version < (1, 3) and 'member_one_three' in primitive:
del primitive['member_one_three']
- if target_version < (1, 1) and 'member_one_one' in primitive:
del primitive['member_one_one']
2. Call the parent method explicitly when the parent class caused a version
bump in this object, in the following if/elif tree:
- if target_version < (1, 2):
super(MyClass, self).obj_make_compatible(primitive, '1.0')
- elif target_version < (1, 4):
super(MyClass, self).obj_make_compatible(primitive, '1.1')
3. Finally, if target_version is recent enough, call the parent method with
the current version of the parent class:
- else:
super(MyClass, self).obj_make_compatible(primitive, '1.2')
This pattern has been documented in: https://review.openstack.org/632321/
Change-Id: Ib7b0cca596c0cad8095ef18243b94ada2587d1cd
Signed-off-by: Jan Gutter <jan.gutter@netronome.com>
blueprint: generic-os-vif-offloads
In case of Smart NIC, os-vif is used to plug the representor port to the
integration bridge, so the Neutron agent that runs on the Smart NIC must
behave like libvirt and do plug/unplug for the representor port.
Change-Id: Ic2c3c88ad0c3865dae96c717b5d137f1ea18326f
If the IP module is loaded inside the privsep context, the following
error will occur:
return getattr(sys.modules[mod_str], class_str)
"AttributeError: 'module' object has no attribute 'PyRoute2'
Change-Id: I1852038b8d40d4aa52c4f8e661bc78e54e0fc966
Closes-Bug: #1812090
Random failures started appearing in the gate with the following
pattern:
testtools.matchers._impl.MismatchError: !=:
reference = HostInfo(plugin_info=[HostPluginInfo,HostPluginInfo])
actual = HostInfo(plugin_info=[HostPluginInfo,HostPluginInfo])
This change attempts to work around the issue by adopting the same
workaround as implemented in the VIF tests.
Note that the host_info class is currently largely stub code for an
unimplemented negotiation interface.
Change-Id: I1fff71ec6793e009cbee9da0656b77915591dec4
Signed-off-by: Jan Gutter <jan.gutter@netronome.com>
TC Offload capabilities have been present in Linux Kernel 4.13 for
hardware offloads. Currently OVS supports offloads (for OVS 2.8 and later)
with similar efforts planned for vrouter (OpenContrail and Tungsten
Fabric).
The existing method in os-vif is to pass the metadata required for
plugging via a VIFPortProfileOVSRepresentor port profile object. This is
used by the 'ovs' reference plugin and the external 'agilio_ovs' plugin.
With 'vrouter' being the third user of such metadata, it would be more
elegant to clean up this interface by using a composition pattern rather
than an inheritance based pattern.
Change-Id: I401ee6370dad68e62bc2d089e786a840d91d0267
Needed-By: I327894839a892a976cf314d4292b22ce247b0afa
Signed-off-by: Jan Gutter <jan.gutter@netronome.com>
blueprint: generic-os-vif-offloads
IPRoute() object must be closed once is no longer used. This is done
automatically calling it inside its own context. If IPRoute() object
is not closed, the following error is raised after many calls:
OSError: [Errno 24] Too many open files
Change-Id: I37ee291c22c2c3933ee229bfc939a4481898626c
Closes-Bug: #1807949
Pyroute2 is not available on Windows, for which reason we need some
platform checks.
At the moment, the ovs plugin can no longer be loaded on Windows
because of this import error.
Change-Id: I4aacd17e77d3b22b8245106d325a7e393794f0a1
Closes-Bug: #1801029
- In change I16b180a298e104f393b5f665409cdf4ba5bff203 an
error was introduced i how _get_impl was defiend in
os_vif/internal/command/ip/api.py. This change correct
the error by returning a instance of the the PyRoute2
class instead of a reference to the enclosing module.
- This change adds exists to the ip command interfece.
- This change makes the windows version also inherit from
the ip_command abstract base class.
Closes-Bug: #1797182
Change-Id: I82377297db9e9ff7fad055dadb73864964f427d9
IPTools driver [1] was implemented to avoid a bug in pyroute2 library,
currently solved. This implementation was marked as "deprecated" two
releases ago.
[1] 570c05266f
Change-Id: I16b180a298e104f393b5f665409cdf4ba5bff203
Closes-Bug: #1794524
Added a network library dependant on the operating system. Windows
and Linux OS are supported. The library is choosen automatically
depending on Python ``os.name``.
Linux library is based on ``ip`` commands and still relying on
``processutils`` library. Linux implementation can't use ``netifaces``
because this library doesn't provide the needed functionality. [1] will
migrate all ``ip`` commands to ``pyroute2`` library.
Windows library relies on Python's ``netifaces`` library because is
enough for the reduced set of commands used. The only functionality
implemented, to cover the bug resolution, is the device existence
check. New functionalities could be added following, for example,
the Neutron implementation.
[1] https://review.openstack.org/#/c/484386/
Closes-Bug: #1672812
Change-Id: I84e3582135ed02137366c8f55f1dd1e4c115f0b5
This change adds new nested DPDK VIF type and port profile for use with nested
DPDK driver in kuryr-kubernetes.
Co-Authored-By: Gary Loughnane <gary.loughnane@intel.com>
Co-Authored-By: Kural Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Co-Authored-By: Marco Chiappero <marco.chiappero@intel.com>
Change-Id: Ib38c427b84606fd232c2ce35cab520790d6ad8ae
Signed-off-by: Przemyslaw Lal <przemyslawx.lal@intel.com>
The usage doc stated that plug and unplug accept a single argument of
type `os_vif.objects.VIF`, which isn't a thing, and then went on to give
an example showing that they take two. The usage doc and the plug and
unplug docstrings also listed various objects at the wrong paths (e.g.
the `instance_info` param being of type `os_vif.objects.InstanceInfo`,
which also isn't a thing).
Fixed up the usage doc to list both arguments and correct the references
in the sample code; and fixed the plug/unplug docstrings
to list the proper paths to classes: os_vif.objects.vif.VIFBase and
os_vif.objects.instance_info.InstanceInfo.
Made everything in `single backticks` into a proper rst ``literal``.
Change-Id: I400838bbe9663917fe2c64f52975b77a370405b4
According to the thread at
http://lists.openstack.org/pipermail/openstack-dev/2018-May/130581.html
some projects including networking-midonet can not build docs with
sphinx 1.7.4+ This seems to be becaus the parser is now more strict?
This patch *seems* to fix those doc builds
Change-Id: Ie96dca126e727fc9a34eece1590a92f7dd3af426
Partial-Bug: 1771092
This is necessary because we're combining virtualenv's and sudo. sudo
doesn't passthrough environment variables by default, so we must do so
manually.
Change-Id: I8ef15edd1b8adae0ddad84f71379356ead5d4fd1
Related-bug: #1677238