Commit Graph

84 Commits

Author SHA1 Message Date
Andreas Jaeger 902ab0466a Retire repo
This repo was created by accident, use deb-python-os-vif
instead.

Needed-By: I1ac1a06931c8b6dd7c2e73620a0302c29e605f03
Change-Id: I81894aea69b9d09b0977039623c26781093a397a
2017-04-17 19:29:59 +02:00
Jenkins 65883d2df8 Merge "Disable IPv6 on bridge devices in linux bridge code" 2016-08-08 09:19:35 +00:00
OpenStack Proposal Bot 45750a9311 Updated from global requirements
Change-Id: Ifebbfaa154394d85dffc0e75623c34964ce4089e
2016-08-05 20:26:50 +00:00
Brian Haley c74f92a0e0 Disable IPv6 on bridge devices in linux bridge code
Bridges should not have any IPv6 addresses, either
link-local, or on the tenant's private network due
to the bridge processing Router Advertisements from
Neutron and auto-configuring addresses, since it will
allow access to the hypervisor from a tenant VM.

The bridge only exists for the Neutron security group
code, so we can safely disable IPv6 on it.

Similar to other nova and neutron changes such as
https://review.openstack.org/#/c/313070/

Change-Id: I2ce540b4201cd227c5df53daeb686c4cc49a6e59
Closes-bug: 1302080
2016-08-05 11:37:34 -04:00
Jenkins 6292a98348 Merge "mtu: don't attempt to set link mtu if it's invalid" 2016-08-05 11:29:13 +00:00
Jenkins 1c46db533e Merge "Trivial: clean up oslo-incubator related stuff" 2016-08-03 12:50:12 +00:00
ChangBo Guo(gcb) 57157de6c4 Trivial: clean up oslo-incubator related stuff
Oslo-incubator has retired, so don't keep oslo-incubator
related stuff in os-vif.

Change-Id: I4ea6b4342b2d5bf46abe6dc83185feb2d33c1be1
2016-08-03 13:56:05 +08:00
Takashi NATSUME ff28181fdd Fix logging calls
This patch fixes the following items.

- Missing a marker function _LI
- String interpolation
- A typo (ENsuring -> Ensuring)

* Guidelines for Use In OpenStack — oslo.i18n
http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I4cc5781100fd2d2be3dd5c44c789396f3fdbd649
Closes-Bug: #1596829
2016-08-02 13:22:30 +09:00
Jenkins bdaa83f9f8 Merge "Remove discover from test-requirements" 2016-08-01 11:35:10 +00:00
Swapnil Kulkarni (coolsvap) 071a63a4cd Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I1773c819a7fa952ba8e133f4f507ee4f16544ec9
2016-07-21 07:21:58 +00:00
Maria Malyarova c16a74b962 Simplified if statement
Simplification of checking the value "got" to the limits
"get_common_version"
TrivialFix

Change-Id: If233b5f1e3162fde74e63e83e015be585d395ba2
2016-07-15 13:46:11 +00:00
Jenkins ca057c7ec7 Merge "Updated from global requirements" 2016-07-05 18:41:30 +00:00
Jenkins 2025adb978 Merge "Ensure the OVS bridge exists when plugging" 2016-07-05 18:36:07 +00:00
OpenStack Proposal Bot 4da0ab185a Updated from global requirements
Change-Id: I305125adb684fd730f911548bc24061f98f3cfa8
2016-06-24 17:10:19 +00:00
Jenkins 8aa8d0dbe1 Merge "Don't create extraneous linux bridge/veth pair for VIFOpenVSwitch" 2016-06-24 09:14:47 +00:00
Sean Mooney d9c72d2bc2 revert removal of create_ovs_vif_port timeout
- This change revert the accidental removal of the timeout
  keyword argument form the creat_ovs_vif_port function
  caused by Ifa53e5e821093459ab7a390ff8af26028b2a9056
- This change introduces unit test to check the useage of
  the timeout arg.

Change-Id: I32ecaef92c4efe21138436abdcf0995ec90de307
Closes-bug: #1595713
2016-06-23 21:48:20 +00:00
Rawlin Peters 3d62d8e23c Ensure the OVS bridge exists when plugging
When a vif will be plugged into an OVS bridge, ensure that the bridge
exists during the plugging operation. In most cases, the OVS bridge will
already exist at the time of port creation, so this will be a no-op.
However, the OVS agent implementation for vlan-aware VMs will require
the os-vif plugin to create the OVS bridge if it doesn't already exist,
because vifs that correspond to trunk ports won't be directly plugged
into br-int.

Change-Id: I3cb61a5e842177a26f38c85d7782ecced4ac07da
2016-06-23 11:18:54 -06:00
Rawlin Peters d5b119ba37 Don't create extraneous linux bridge/veth pair for VIFOpenVSwitch
VIFOpenVSwitch vifs will be booted by libvirt directly on the target
bridge. Don't create an extraneous linux bridge with a veth pair
connection to the target bridge.

VIFOpenVSwitch inherits from VIFBridge, so the following check causes
_plug_bridge() to be incorrectly executed for vifs of type
VIFOpenVSwitch:

    if isinstance(vif, objects.vif.VIFBridge):
        self._plug_bridge(vif, instance_info)

Fix this to check for instances of VIFOpenVSwitch first and do nothing
in that case.

Closes-Bug: #1595614
Change-Id: I447395cc50aa8fc21fa714b76f4cb1f5e79846ae
2016-06-23 10:51:25 -06:00
OpenStack Proposal Bot 2eb892caab Updated from global requirements
Change-Id: Ic178517d2b12afe7b45a2369bdffd9df3de8c4f5
2016-06-10 15:48:25 +00:00
Ihar Hrachyshka 138312122e mtu: don't attempt to set link mtu if it's invalid
network_device_mtu option does not have an explicit default value set,
in which case it is implicitly None. Also, it can be set to e.g. 0.

In those both cases, we should not attempt to set 'None' or '0' MTU
value on interfaces, since such requests are doomed to fail.

Instead of calling to 'ip link' as we do now, validate MTU value first
and issue a warning if MTU is not properly configured for the device.

Change-Id: I6b4a5e281297ee0c71b6968595480e805ec4279c
Co-Authored-By: Sean Mooney <sean.k.mooney@intel.com>
Closes-Bug: #1591127
2016-06-10 14:00:15 +01:00
Claudiu Belu 2c96373d5e ovs: Avoids setting MTU if MTU is None or 0
If the 'mtu' argument is None or 0, it will lead to
errors, as it is not a valid argument.

Skips setting the port's MTU if the given 'mtu' is None
or 0.

Closes-Bug: #1591113

Change-Id: Ia07ade945ca7469b9c23c801a6bfe08135d39466
2016-06-10 12:43:18 +03:00
Jenkins f0b5b4f583 Merge "os_vif: fix logging of exceptions during plug/unplug" 2016-06-09 16:03:17 +00:00
Jenkins 4b526ee28b Merge "vif_plug_ovs: clarify that the plugin was not in fact renamed" 2016-06-09 16:03:11 +00:00
Jenkins b0ddbaa01a Merge "os_vif: add logging for each plugin that is loaded" 2016-06-09 16:03:06 +00:00
Jenkins 5bd5bdfdd0 Merge "os_vif: register objects before loading plugins" 2016-06-09 16:02:34 +00:00
Daniel P. Berrange 8adde2fcb8 os_vif: fix logging of exceptions during plug/unplug
The parameters to interpolate in the log message were being
passed directly, instead of in a dict, so they were never
actually merged into the message. While fixing this, we
can also avoid manually including the exception in the
message and leave it upto python logging by simply setting
exc_info=True.

Change-Id: Ib6adb52fb331ed148a6c250fd008e9c117f4cf68
2016-06-09 11:35:31 +01:00
Daniel P. Berrange 632db7791e vif_plug_ovs: clarify that the plugin was not in fact renamed
An earlier change claimed to be renaming the ovs plugin:

  commit 65ae52baa7
  Author: Sean Mooney <sean.k.mooney@intel.com>
  Date:   Fri May 20 20:43:14 2016 +0100

    This change renames the ovs plugin

On re-examination this was not in fact the case. The actual
name of the plugins is specified in the setup.cfg config
file "[entry_points]" section, which recorded the name as
"ovs". The bug fixed in 65ae52baa7
was simply that the 'describe' method was reporting the wrong
name, which has no functional impact on usage of the plugin.
It merely meant that any app relying on the introspection
data to identify available plugins would be told the wrong
name.

Change-Id: Iaf7c2e38bce809afc4801a3af0971977461d66d3
2016-06-09 11:35:31 +01:00
Daniel P. Berrange d78a33ee90 os_vif: add logging for each plugin that is loaded
When debugging problems it is helpful to know which plugins
have been loaded. Ensure this is reported by emitting info
in a log message at load time.

Change-Id: Id6442c8aa2004aeb3fc9b25bfc4c9b8baa5a1e56
2016-06-09 11:35:31 +01:00
Daniel P. Berrange 8b72ece159 os_vif: register objects before loading plugins
It is conceivable that some part of the plugin loading process
may wish to use the os_vif object model. We should thus ensure
we register objects, before we load any of the plugins. It is
also incorrect to re-register the plugins if an app asks os_vif
to reinitialize itself, as it'll lead to duplicate object
registrations. So we now only register objects the first
time initialize() is called.

Change-Id: Ib5730135636acf37e3f9ed67fe1d4533a2df3474
2016-06-09 11:35:24 +01:00
Sean Mooney 8c58816f46 Add support for vhost-user
- This change extends the ovs plugin to add support for vhost-user.
- Following this change the ovs plugin will accpet VIFVHostUser
  os-vif vif objects as part of plug and unplug function calls.
- This change will be consumed by the reference openvswitch
  ml2 driver, networking-odl and networking-ovn to enable
  vhost-user with openvswitch.

Change-Id: Ifa53e5e821093459ab7a390ff8af26028b2a9056
2016-06-03 20:10:46 +00:00
Jenkins ad13b337be Merge "This change renames the ovs plugin" 2016-06-03 19:45:02 +00:00
Sean Mooney 65ae52baa7 This change renames the ovs plugin
- The ovs direct and ovs hybrid plug plugins
  have been merged into a single plugin.
- This change updated the name of the plugin form
  ovs_hybrid to ovs to reflect that.

Change-Id: I35b63ea609a463ffd786d3a89f4a0637cfcd484d
2016-05-23 16:33:39 +00:00
OpenStack Proposal Bot 8354942463 Updated from global requirements
Change-Id: I7341694acfda0bc10663b7458fde457b495cb452
2016-05-23 12:03:15 +00:00
Sean Mooney 4cacdaa560 remove unused entrypoints
- stevedore enterypoints for intree plugins should be defined
  in setup.cfg.
- This change remove the entrypoint definitions from setup.py
  as they are not needed.

Change-Id: Id768d3fe28d8dfe350a75f88eca62022ac7074c0
2016-05-20 21:29:10 +01:00
Daniel P. Berrange e5227ecbc0 Start using reno for release notes
Depends-on: I7174325294ba3cc978cbb1cff738b4b979adf9fb
Change-Id: Idc50dd5d408c67367256fb10efef5e772ffa83b1
2016-05-03 13:53:29 +01:00
Daniel P. Berrange 722b02d40e vif_plug_ovs: merge both plugins into one
There is no need to create separate plugins for each type of
VIF configuration - a single plugin is intended to be capable
of supporting multiple different VIF configs. On this basis,
the ovs & ovs_hybrid plugins can be merged to just create a
single 'ovs' plugin. This means that consumers of os-vif do
not need to remember multiple different plugin names - they
can always just use the 'ovs' plugin and feed it whichever
type of VIF config they desire.

Change-Id: I8ab37fea065a3d92585decf89bcc095c404e6ed2
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-04-04 17:57:39 +01:00
Daniel P. Berrange 3f60c8e3f7 ovs: convert over to use privsep module
Instead of relying on root wrap, convert the openvswitch
network code to use the privsep module to run privileged
actions.

Change-Id: I45208c683fadf97ebcc46e08e2cc9781ff6eedb0
2016-04-04 12:42:51 +01:00
Daniel P. Berrange 48d9e6464a ovs: move code from plugin into linux_net helper
The ovs plugin has a bunch of direct calls to the
processutils.execute() method. This will make it
hard to apply privsep annotations, so move them
all out into helper methods in linux_net

Change-Id: I7efa532541651849be5be42c58e86645cbebaa67
2016-04-04 12:42:16 +01:00
Daniel P. Berrange bf845feb11 linux_bridge: convert over to use privsep module
Instead of relying on root wrap, convert the Linux bridge
network and iptables code to use the privsep module to
run privileged actions.

Change-Id: Ief902f63c49e4529bae43c619c1284fe51c90a90
2016-04-04 12:42:16 +01:00
Daniel P. Berrange 76994a02d4 test: use real UUID in all UUID fields
Many of the fields in VIF related objects required a UUID, but
tests are passing in random garbage. The UUIDField is going to
start rejecting these bogus UUIDs so they need fixing

Closes-Bug: #1550629
Change-Id: I8ccc68a6f6e709951ae1ba6c1388d6c025775332
2016-03-31 12:17:12 +00:00
Daniel P. Berrange ae034f5802 test: add workaround for non-deterministic ovo object comparison
The ComparableVersionedObject impl of the __eq__ method incorrectly
checks the list of changed fields in an object. The ordering of
this list depends on the python hash seed, which causes the test
to randomly fail. Reset the list of changes as a workaround until
the ovo bug is fixed.

Change-Id: I438b4038308ad5f4af3c9055cda593f21ad7b654
2016-03-30 12:01:53 +01:00
Daniel P. Berrange 9686110d53 os-vif: introduce a ComputeInfo object to represent compute info
When a compute service is allocating ports with the network service,
it needs to pass across information about the capabilities of the
compute host. Currently each plugin provides information about its
own capabilities. This introduces a ComputeInfo class which,
initially, just contains a dict of PluginInfo classes.

With this change, there is a versioning constraint between the
compute and network hosts. The compute host must not pass the network
host a ComputeInfo object with a version that the network host
is unable to deserialize(). This implies that as a general rule the
version of os-vif on the network host must be at least as new as the
version on the compute hosts. During a live upgrade, the network
hosts must be upgraded before the compute hosts.

Change-Id: I7b51c97b5e03ffa51a56ceb3d4f97e188508379d
2016-03-18 13:37:33 +00:00
Jenkins d3e9d8f273 Merge "linux_bridge: actually apply the iptables rules" 2016-03-07 20:32:57 +00:00
Jenkins 72f84f280e Merge "Remove vlan from hostdev and direct vif" 2016-03-07 02:30:07 +00:00
Daniel P. Berrange 2d9c516c49 linux_bridge: actually apply the iptables rules
The linux bridge network code for creating bridges never
actually told the iptables manager to apply the rules it
just set. Previously when this code lived inside Nova it
just happened to work, because there was a single iptables
manager instance in nova and other unrelated code would
fortunately apply iptables rules. Now we're standalone
we must explicitly apply them

Change-Id: I26e27c1c4b337d0a51efbe37ca671b4f23cf38db
2016-03-03 11:15:55 +00:00
Sean M. Collins 5e72ecd5ad Fix calls to create_ovs_vif_port
create_ovs_vif_port has six required arguments:
* bridge
* dev
* iface_id
* mac
* instance_id
* mtu

And an optional argument - timeout.

However calls to create_ovs_vif_port only supplied five of six required
arguments and the optional argument, and mocks to the call also had the
incorrect number of arguments. Therefore the unit tests passed but any
code that actually called create_ovs_vif_port would have thrown an
error.

Change-Id: Ic165557da57cf6df1fd39309b16e0a89a02df16d
2016-02-24 14:03:21 -05:00
Moshe Levi e91941a0b8 Remove vlan from hostdev and direct vif
This patch remove the vlan attribute from hostdev
and direct vif. The vlan should be taken from the
network object. When the network vlan is null (for example in
flat network) it should be zero in the libvirt xml

Change-Id: Icf6dd39f515f5c2f8db8c1d414776eebd8e85617
2016-02-23 13:53:03 +02:00
Jenkins be8c70fe5d Merge "VIFDirect: replace dev_name with dev_address" 2016-02-22 14:20:56 +00:00
Moshe Levi b2a910ca48 Change network vlan to integer
Change-Id: I10e327d6a1dbffbdca92b767b25f7b9de1f8c540
2016-02-22 15:56:50 +02:00
Moshe Levi 40f6f49ecb VIFDirect: replace dev_name with dev_address
None of the vifs are using dev_name but we need
the pci address for hw_veb plugin

see blob/master/nova/virt/libvirt/vif.py#L306-L323

Change-Id: Ic51767369ed1c767665ff1742688c8db10217df9
2016-02-22 15:36:01 +02:00