Following up with the design discussion at GanetiCon, this patch proposes the transition from nicparams[constants.NIC_LINK] as a string to a dict to be able for it to hold more information, which is especially needed through the newly introduced OpenvSwitch functionality. The new object will be open for new parameters that might need to be stored in the future.
Signed-off-by: Sebastian Gebhard <[email protected]> --- doc/design-openvswitch.rst | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/doc/design-openvswitch.rst b/doc/design-openvswitch.rst index 555ad82..2474dd2 100644 --- a/doc/design-openvswitch.rst +++ b/doc/design-openvswitch.rst @@ -62,12 +62,40 @@ are given there, defaults should be used. As a first step, this will be implemented for using 1 ethernet device only. Functions for nic bonding will be added later on. +Structural changes to nicparams to store configuration +++++++++++++++++++++++++++++++++++++++++++++++++++++++ +nicparams[constants.NIC_LINK] shall be extended by a value "vlan" that will +store the VLAN information for each NIC. Therefore, the type of +nicparams[constants.NIC_LINK] needs to be changed from string to an dict than +can hold all the information needed. This dict can then hold "vlan" information +for OVS, as well as "interface" information for other network modes and is +easily extendible for future use cases (see QoS below for one future use case). +"vlan" parameter will only be used if +nicparams[constants.NIC_MODE] == constants.NIC_MODE_OVS, since it doesn't make +sense in other modes. + +On top of this parameters for OpenvSwitch could be moved into another subdict, +to support future network modes that might also need parameters at this level. + +Example for bridged mode: +nicparams[constants.NIC_LINK] = +{ +'interface': 'eth1' +} + +Example for openvswitch mode: +nicparams[constants.NIC_LINK]= +{ +'interface': 'switch1', +'ovs': { + 'vlan': '42', + 'qos_max_bandwidth': 'somevalue', + 'qos_max_burst': 'othervalue' + } +} + Configuration changes for VLANs +++++++++++++++++++++++++++++++ -nicparams shall be extended by a value "vlan" that will store the VLAN information for each NIC. -This parameter will only be used if nicparams[constants.NIC_MODE] == constants.NIC_MODE_OVS, -since it doesn't make sense in other modes. - Each VLAN the NIC belongs to shall be stored in this single value. The format of storing this information is the same as the one which is used in Xen 4.3, since Xen 4.3 comes with functionality to support OpenvSwitch. -- 1.8.1.2
