os-vif

raw JSON →
4.3.0 verified Fri May 01 auth: no python

A library for plugging and unplugging virtual interfaces in OpenStack. Current version is 4.3.0, release cadence is aligned with OpenStack releases (approximately every 6 months).

pip install os-vif
error ModuleNotFoundError: No module named 'os_vif'
cause The package is not installed.
fix
Run 'pip install os-vif'.
error AttributeError: module 'os_vif' has no attribute 'initialize'
cause Using an older version (<2.0.0) where 'initialize' was not present, or importing incorrectly.
fix
Upgrade to latest version: 'pip install --upgrade os-vif'. Ensure import is 'import os_vif'.
error os_vif.exception.PluginNotFound: No plugin found for VIF type 'bridge'
cause The required plugin package (e.g., os-vif-bridge) is not installed.
fix
Install the corresponding plugin: 'pip install os-vif-bridge'.
breaking In version 4.0.0, the 'os_vif' module dropped support for Python 2 and moved to namespace packages. Ensure your project is Python 3.9+.
fix Update your Python environment to >=3.9 and check for deprecated imports.
gotcha The 'initialize()' function must be called before using any plugins or VIF operations. Forgetting this will cause runtime errors about uninitialized plugins.
fix Always call os_vif.initialize() early in your startup code.
gotcha os-vif dynamically loads plugins via setuptools entry points. If plugins are not installed (e.g., os-vif-bridge, os-vif-ovs), no plugins will be available. This often confuses users who expect built-in plugins.
fix Ensure you install the required plugin packages, e.g., 'pip install os-vif-bridge os-vif-ovs'.

Initialize os-vif and list loaded plugins.

import os_vif
from os_vif import plugin

# Example: initialize os_vif (no args needed)
os_vif.initialize()

# List loaded plugins
loaded_plugins = plugin.get_loaded_plugins()
print(loaded_plugins)

# Each plugin can plug/unplug a VIF
# Refer to OpenStack nova or neutron code for full usage