design-openvswitch.rst 5.11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
========================
Support for Open vSwitch
========================

.. contents:: :depth: 3

This is a design document detailing the implementation of support for
Open vSwitch in the Ganeti tool chain.

Current state and shortcomings
==============================

13
At the moment Ganeti's support for Open vSwitch is very basic and
14 15 16 17 18 19 20 21 22 23
limited to connecting instances to an existing vSwitch.

The shortcomings of this approach are:

1. The full functionality (VLANs, QoS and trunking) of Open vSwitch is not used.

2. Open vSwitch cannot be managed centrally.

Proposed changes
----------------
24 25 26 27
1. Implement functions into gnt-cluster and gnt-node to manage Open vSwitch through Ganeti.
   It should be possible to create, modify and delete vSwitches. The resulting configuration
   shall automatically be done on all members of the node group, if possible. Connecting Ethernet 
   devices to vSwitches should be managed through this interface as well.
28 29 30 31 32

2. Implement VLAN-capabilities: Instances shall have additional information for every NIC: VLAN-ID
   and port type. These are used to determine their type of connection to Open vSwitch. This will
   require modifying the methods for instance creation and modification

33 34 35
3. Implement NIC bonding: Functions to bond NICs for performance improvement, load-balancing and
   failover should be added. It is preferable to have a configuration option to determine the
   type of the trunk, as there are different types of trunks (LACP dynamic and static, different
36 37
   failover and load-balancing mechanisms)

38 39
4. Set QoS level on per instance basis: Instances shall have an additional information: maximum
   bandwidth and maximum burst. This helps to balance the bandwidth needs between the VMs and to
40 41
   ensure fair sharing of the bandwidth.

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
Automatic configuration of OpenvSwitches
++++++++++++++++++++++++++++++++++++++++
Ideally, the OpenvSwitch configuration should be done automatically.

This needs to be done on node level, since each node can be individual and a setting on cluster / node group
level would be too global is thus not wanted. 

The task that each node needs to do is:
  ``ovs-vsctl addbr <switchname>`` with <switchname> defaulting to constants.DEFAULT_OVS
  ``ovs-vsctl add-port <switchname> <ethernet device>`` optional: connection to the outside

This will give us 2 parameters, that are needed for the OpenvSwitch Setup:
  switchname: Which will default to constants.DEFAULT_OVS when not given
  ethernet device: Which will default to None when not given, might be more than one (NIC bonding)

These parameters should be set at node level for individuality, _but_ can have defined defaults on cluster
and node group level, which can be inherited and thus allow a cluster or node group wide configuration.
If a node is setup without parameters, it should use the settings from the parent node group or cluster. If none
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.

65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
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.

This parameter will, at first, only be implemented for Xen and will have no effects on other hypervisors.
Support for KVM will be added in the future.

Example:
switch1 will connect the VM to the default VLAN of the switch1.
switch1.3 means that the VM is connected to an access port of VLAN 3.
81 82 83
switch1.2:10:20 means that the VM is connected to a hybrid port on switch1, carrying VLANs 2 untagged and 
VLANs 10 and 20 tagged.
switch1:44:55 means that the VM is connected to a trunk port on switch1, carrying VLANS 44 and 55
84

85 86
This configuration string is split at the dot or colon respectively and stored in nicparams[constants.NIC_LINK] 
and nicparams[constants.NIC_VLAN] respectively. Dot or colon are stored as well in nicparams[constants.NIC_VLAN].
87 88 89 90 91 92 93 94 95 96

For Xen hypervisors, this information can be concatenated again and stored in the vif config as
the bridge parameter and will be fully compatible with vif-openvswitch as of Xen 4.3.

Users of older Xen versions should be able to grab vif-openvswitch from the Xen repo and use it
(tested in 4.2).

gnt-instance modify shall be able to add or remove single VLANs from the vlan string without users needing
to specify the complete new string.

97 98 99 100
NIC bonding
+++++++++++
To be done

101 102
Configuration changes for QoS
+++++++++++++++++++++++++++++
103 104 105 106 107 108 109 110 111 112 113 114 115 116
Instances shall be extended with configuration options for

- maximum bandwidth
- maximum burst rate

New configuration objects need to be created for the Open vSwitch configuration.

All these configuration changes need to be made available on the whole node group.

.. vim: set textwidth=72 :
.. Local Variables:
.. mode: rst
.. fill-column: 72
.. End: