kuryr-kubernetes/kuryr_kubernetes/os_vif_plug_noop.py
Danil Golov 8e60dcc4aa Add SR-IOV pod vif driver
This commit adds SR-IOV driver and new type of VIF to handle SR-IOV requests.
This driver can work as a primary driver and only one driver, but only when kubernetes
will fully support CNI specification.

Now this driver can work in couple with multi vif driver, e.g. NPWGMultiVIFDriver.
(see doc/source/installation/multi_vif_with_npwg_spec.rst)

Also this driver relies on kubernetes SRIOV device plugin.

This commit also adds 'default_physnet_subnets' setting, that should
include a mapping of physnets to neutron subnet IDs, it's necessary to
specify VIF's physnet (subnet id comes from annotation).

To get details how to create pods with sriov interfaces see
doc/source/installation/sriov.rst

Target bp: kuryr-kubernetes-sriov-support
Change-Id: I45c5f1a7fb423ee68731d0ae85f7171e33d0aeeb
Signed-off-by: Danil Golov <d.golov@partner.samsung.com>
Signed-off-by: Vladimir Kuramshin <v.kuramshin@samsung.com>
Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
2018-09-18 10:19:43 +03:00

61 lines
1.9 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from os_vif import objects
from os_vif.plugin import PluginBase
from kuryr_kubernetes.objects import vif as k_vif
class NoOpPlugin(PluginBase):
"""No Op Plugin to be used with VIF types that dont need plugging"""
def describe(self):
return objects.host_info.HostPluginInfo(
plugin_name='noop',
vif_info=[
objects.host_info.HostVIFInfo(
vif_object_name=k_vif.VIFVlanNested.__name__,
min_version="1.0",
max_version="1.0"),
objects.host_info.HostVIFInfo(
vif_object_name=k_vif.VIFMacvlanNested.__name__,
min_version="1.0",
max_version="1.0"),
])
def plug(self, vif, instance_info):
pass
def unplug(self, vif, instance_info):
pass
class SriovPlugin(PluginBase):
"""Sriov Plugin to be used with sriov VIFS"""
def describe(self):
return objects.host_info.HostPluginInfo(
plugin_name='sriov',
vif_info=[
objects.host_info.HostVIFInfo(
vif_object_name=objects.vif.VIFDirect.__name__,
min_version="1.0",
max_version="1.0"),
])
def plug(self, vif, instance_info):
pass
def unplug(self, vif, instance_info):
pass