Commit Graph

16 Commits

Author SHA1 Message Date
Jialiang 8107e5ced8 Update the file for IPv4-only or IPv6-only network
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
2019-10-02 16:54:20 +00:00
Alessandro Pilotti 577174b025 Fixes interfaces template identification issue
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
2014-12-07 17:52:34 +02:00
Davanum Srinivas 3d4e421204 Add support for ipv6 nameservers
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
2014-09-04 11:35:26 +00:00
Rick Harris d0248d0621 libvirt: Support IPv6 with LXC
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
2014-07-15 11:39:07 -05:00
Rick Harris 383d0c945e Fix interfaces template for two interfaces and IPv6
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
2014-07-11 10:00:09 -05:00
Sascha Peilicke fa0d61084e Port Cheetah templates to Jinja2
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
2013-09-02 16:03:34 +02:00
Mathieu Mitchell 27fc4648b7 Support networks without gateway
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
2013-08-04 00:45:54 -04:00
Justin Santa Barbara 1a32aad3a6 Don't write a dns directive if there are no dns records in /etc/network/interfaces
Change-Id: I26e22f37f91bf242aa573c91b26b2304fdd25751
2012-02-05 19:51:17 -08:00
Brian Waldon 76e79792b4 Add comments to injected keys and network config
Fixes bug 754950

Change-Id: Ib773479c3b34b9ddd322abd02b297acf5359a847
2012-02-02 12:57:18 -08:00
Ilya Alekseyev 7181c4fc17 trunk merged 2011-03-23 21:24:19 +03:00
Ilya Alekseyev f5dada1e01 review comments fixed 2011-03-23 19:22:51 +03:00
Ilya Alekseyev 31388f18f8 fixes for NWFilterFirewall and net injection 2011-03-17 20:56:25 +03:00
Tushar Patil df0a4d66f7 Changed ra_server to gateway_v6 and removed addressv6 column from fixed_ips db table 2011-03-01 17:12:47 -08:00
Tushar Patil f7beae47ca IPV6 FlatManager changes 2011-02-24 17:07:59 -08:00
Soren Hansen 587b21cc00 Leave out the network setting from the interfaces template. It does not get passed anymore. 2010-09-14 15:23:58 +02:00
Soren Hansen 49a2098163 Move interfaces template into virt/, too. 2010-08-13 23:45:26 +02:00