aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/__init__.py
diff options
context:
space:
mode:
authorxinwu <xin.wu@bigswitch.com>2016-01-31 18:35:28 -0800
committerxinwu <xin.wu@bigswitch.com>2016-03-07 18:59:02 -0800
commit63659fe4a60dfb18bbc8cc835d6d1c4fe7317a60 (patch)
tree5e9365a8a9e3a15552ad1fdba1fb83f3b0ad5390 /os_net_config/__init__.py
parentc545e46f8fe2362df81e86c187aa6e50be185ad6 (diff)
Enable os_net_config to configure IVS
This change generates /etc/sysconf/network-scripts/ifcfg-* for ivs. It also generates /etc/sysconf/ivs configuration file for ivs. It supports only RedHat at this point. Indigo Virtual Switch (IVS, https://github.com/floodlight/ivs) is a virtual switch for Linux. It is compatible with the KVM hypervisor and leveraging the Open vSwitch kernel module for packet forwarding. There are three major differences between IVS and OVS: 1. Each node can have at most one ivs, name is not required. 2. Bond is not allowed to attach to an ivs. It is the SDN controller's job to dynamically form bonds on ivs. 3. IP address can only be statically assigned. Change-Id: I276d736794d123405de793c2a4eb2c1ee55a0fad
Diffstat (limited to 'os_net_config/__init__.py')
-rw-r--r--os_net_config/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/os_net_config/__init__.py b/os_net_config/__init__.py
index 42131bb..f52eb59 100644
--- a/os_net_config/__init__.py
+++ b/os_net_config/__init__.py
@@ -48,6 +48,8 @@ class NetConfig(object):
self.add_interface(obj)
elif isinstance(obj, objects.Vlan):
self.add_vlan(obj)
+ elif isinstance(obj, objects.IvsInterface):
+ self.add_ivs_interface(obj)
elif isinstance(obj, objects.OvsBridge):
self.add_bridge(obj)
for member in obj.members:
@@ -56,6 +58,10 @@ class NetConfig(object):
self.add_linux_bridge(obj)
for member in obj.members:
self.add_object(member)
+ elif isinstance(obj, objects.IvsBridge):
+ self.add_ivs_bridge(obj)
+ for member in obj.members:
+ self.add_object(member)
elif isinstance(obj, objects.OvsBond):
self.add_bond(obj)
for member in obj.members:
@@ -93,6 +99,13 @@ class NetConfig(object):
"""
raise NotImplemented("add_linux_bridge is not implemented.")
+ def add_ivs_bridge(self, bridge):
+ """Add a IvsBridge object to the net config object.
+
+ :param bridge: The IvsBridge object to add.
+ """
+ raise NotImplemented("add_ivs_bridge is not implemented.")
+
def add_bond(self, bond):
"""Add an OvsBond object to the net config object.