summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorTodd Willey <xtoddx@gmail.com>2011-12-23 14:15:40 -0500
committerTodd Willey <xtoddx@gmail.com>2012-01-04 16:18:36 -0500
commit96d8cbe8442cf25afecf47086d6ec6907008cb85 (patch)
tree546a19b3ebe285a07cdbe17e0833c64045f1e3ab /nova
parent976cc2295e276c3097f6c1e67eb8e0fc0635a534 (diff)
Set VLAN MTU size when creating the vlan interface.
When empty (the default) nova will not set any MTU parameters. You can specify a number as in --network_device_mtu=9000 to enable jumbo frames, for example. Updates: * change flag name * set mtu in ovs driver * empty string means don't fiddle with the interface mtu * Use None instead of '' for flag default Change-Id: Ib4bccf7f96a836af18b4ea7e164b26f3c9104482
Diffstat (limited to 'nova')
-rwxr-xr-xnova/network/linux_net.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
index 3638d5a06..3784a1117 100755
--- a/nova/network/linux_net.py
+++ b/nova/network/linux_net.py
@@ -46,6 +46,7 @@ flags.DEFINE_string('networks_path', '$state_path/networks',
'Location to keep network config files')
flags.DEFINE_string('public_interface', 'eth0',
'Interface for public IP addresses')
+flags.DEFINE_string('network_device_mtu', None, 'MTU setting for vlan')
flags.DEFINE_string('dhcpbridge', _bin_file('nova-dhcpbridge'),
'location of nova-dhcpbridge')
flags.DEFINE_string('routing_source_ip', '$my_ip',
@@ -942,6 +943,9 @@ class LinuxBridgeInterfaceDriver(LinuxNetInterfaceDriver):
_execute('ip', 'link', 'set', interface, "address",
mac_address, run_as_root=True)
_execute('ip', 'link', 'set', interface, 'up', run_as_root=True)
+ if FLAGS.network_device_mtu:
+ _execute('ip', 'link', 'set', interface, 'mtu',
+ FLAGS.network_device_mtu, run_as_root=True)
return interface
@classmethod
@@ -1042,6 +1046,9 @@ class LinuxOVSInterfaceDriver(LinuxNetInterfaceDriver):
run_as_root=True)
_execute('ip', 'link', 'set', dev, "address", mac_address,
run_as_root=True)
+ if FLAGS.network_device_mtu:
+ _execute('ip', 'link', 'set', dev, 'mtu',
+ FLAGS.network_device_mtu, run_as_root=True)
_execute('ip', 'link', 'set', dev, 'up', run_as_root=True)
if not gateway:
# If we weren't instructed to act as a gateway then add the