Files
openstack-ansible/playbooks/roles/lxc_container_create/templates/container-interface.ini.j2
Major Hayden 5e6dea8ab6 Used named veth pairs that match container
The default veth names from LXC make it difficult to tell which veth
corresponds to each container.  This patch sets a unique veth name
that matches the container as well as the network device inside the
container.  It should make troubleshooting a little easier.

Oddly enough, this patch seems to fix or greatly reduce the occurence
of the issues seen in ticket 1491440.

Partial-Bug: 1491440
Implements: blueprint named-veths
Change-Id: I28553fd1b4f36991e11d55d56c3f0f46af9e52be
2015-09-02 10:36:17 -05:00

19 lines
760 B
Django/Jinja

# {{ ansible_managed }}
# Create a veth pair within the container
lxc.network.type = {{ item.value.type|default('veth') }}
# Network device within the container
lxc.network.name = {{ item.value.interface }}
# Name the veth after the container
# NOTE(major): The lxc.network.veth.pair line must appear right after
# lxc.network.name or it will be ignored.
lxc.network.veth.pair = {{ inventory_hostname[-8:].replace('-', '').replace('_', '') }}_{{ item.value.interface }}
# Host link to attach to, this should be a bridge
lxc.network.link = {{ item.value.bridge }}
# Hardware Address
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
# enable the device on boot
lxc.network.flags = up
# Set the container network MTU
lxc.network.mtu = {{ item.value.mtu|default('1500') }}