Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor object model and generally clean up #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

berrange
Copy link

This series of patches does a number of things

  • Removes all the plugins - these legacy impls can live in nova libvirt tree until they are deleted
  • Removes all the (now unused) host OS network helper code, to avoid having to concern ourselves with supporting it as an official API in any sense
  • Refactor the VIF object to be a set of subclasses per the spec design
  • Replace generic config dict with PluginConfig object
  • Introduce InstanceConfig to isolate ourselves from Nova object model
  • Introduce association between plugins & vifs

The existing VIF types are to be deprecated once new VIF
types have been formally defined by os_vif. There will
be a transition period where compat plugins are needed
for use with existing deployments. These compat plugins
can continue to live in the Nova libvirt directory
until they are deleted. All new plugins will be provided
directly by vendors in their own python packages.
There will be no plugins bundled with the os_vif library
itself. Modern plugins will be bundled by Neutron vendors
in separate python packages. Plugins for legacy VIF types
willl be bundled by Nova, until they are deleted.

Providing network helper APIs in the os_vif places
undesirable burden on os_vif maintainers to provide a
stable API for this code which has historically always
been internal use only from Nova.

Where there is a need for code sharing for setup of host
OS networking pieces, it is intended that standalone
python modules be built and provided in pypi for reuse
by the broader ecosystem. This allows them to be maintained
independantly of os_vif instead of tieing them together.
Instead of accepting an arbitrary string for the address
field in a VIF object, formally validate it as a MAC
address
The word "type" is quite overloaded so it is often not obvious
what people are referring to when they say "type". Change the
VIF object field "type" to be called "plugin" so that it more
explicitly denotes an OS-VIF plugin name.
There are initially 5 core VIF backend class defined, which are
sufficient to cover all the current usage in the libvirt driver
and some usage in other drivers. It is expected that a couple
more may be added for vmware/hyperv.
Rename the base.py file to plugin.py since it will have more
than just the base class defined in it. Rather it defines the
overall plugin API contract
Rather than allowing unspecified arbitrary dict passthrough,
define an explicit plugin configuration object to pass to
plugins.
Make the os-vif library independent of the the Nova object
model by introducing an InstanceConfig object. This allows
it to be used by projects such as Kuryr.
Add a get_supported_vifs() method to the PluginBase class which
returns info on which os_vif.objects.VIFBase subclasses are
supported by the plugin, and associated version ranges.

A method is used, rather than a static attribute, since plugins
may wish to dynamically decide which VIFs are supported based
on some aspect of the host OS/hypervisor configuration/feature
set.


class MACAddressField(object_fields.AutoTypedField):
AUTO_TYPE = MACAddress()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above added to o.vo mainline here: https://review.openstack.org/#/c/245294/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants