Clean the interface template file by making both IP versions independent,
including when using LXC containers.
Co-Authored-By: Yongfeng Du <dolpher.du@intel.com>
Change-Id: If0843502fe0a85cbd5eff777d9260c90cea4812a
Closes-Bug:#1355171
When using networks without DHCP enabled and "flat_injected" set to True,
the interfaces template is injected in the associated instances or
included in the config drive metadata.
The template includes the interface name, based on a progressive numbering
(eth0, eth1, etc). In case of multiple nics, there's no clear way to
identify the interfaces in the guest OS if the actual interface naming
differs, this is especially valid for Windows instances.
Since the MAC address (hardware address) assigned to each vNIC identifies
uniquely the interface, providing the mac address during the template
generation solves the issue.
Change-Id: Id82db6d83caedf0e95f882d909b77ea9b98b2547
Closes-Bug: #1400080
Update interfaces.template to support ipv6 based dns servers. Make
sure we validate the version of the ip addresses before we
fill them in.
Closes-Bug: #1355777
Change-Id: I7229656bfa5ff5a29c63befc3b9ce91c46e04723
Libvirt's LXC implementation exposes a read-only `/proc/sys/net` to the
guests. This causes some of the guest's default network configuration scripts
to fail.
This patch works-around the issue by using `post-up` hooks to configure IPv6.
Closes-Bug: 1340791
Change-Id: I805cad98d855fcb2c90b07e98ad3653d1620bd42
If you have more than one interface and IPv6 enabled, then the interfaces file
emitted would have the incorrect syntax: the `auto eth1` line would be
appended to the end of the `gateway` line of the previous stanza.
This was a result of improper whitespace control in the Jinja template which
this patch fixes.
In order to prevent regressions, this patch swaps out the existing tests with
corresponding tests that are whitespace sensitive. This is important because
it's difficult to tweak Jinja templates in a way that fixes the whitespace
for one scenario while not breaking another.
Closes-Bug: 1339888
Change-Id: Id5566ea2f93ee1a6b8bc42e83bc64a1c6a09e680
Cheetah is unmaintained since 2010 and it's unlikely to get Python3
support soon. Also, the rest of OpenStack (mostly) standardized on
Jinja2.
Implements: blueprint jinja-templating-conversion
Change-Id: Ia15f00ee96d3c1d55d7c290f20ccc988e4c52e1a
Launching an instance when using network injection on a network
containing a subnet that has no gateway fails in scheduling with
a KeyError when using a legacy network_info provider and generates
an invalid network file for the others.
The following changes were done:
* The legacy transformer for network_info now always provides
a gateway/gateway_v6 field, with a value of None if no gateway
is available (this is similar to the other fields that are empty).
* The interfaces template was modified to include the gateway line
only if a gateway is provided for the interface.
Fixes: bug #1207878
Change-Id: I887757a6bcba528059ace8831a7d23a31b08c630