Can not have IPv4 or IPv6 only interfaces injected via /etc/network/interfaces.

Bug #1355171 reported by Pierre-Antoine Haidar-Bachminska on 2014-08-11
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Yongfeng Du

Bug Description

When I use nova's /etc/network/interfaces file injection via configdisk and set up by cloud-init, I end up with a not working /etc/network/interfaces like this one (notice the missing line feed and the "address None") :
----
# Injected by Nova on instance boot
#
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 10.1.0.14
        netmask 255.255.0.0
        broadcast 10.1.255.255
        gateway 10.1.0.1

iface eth0 inet6 static
    address None
    netmask Noneauto eth1
iface eth1 inet static
        address None
        netmask None
        broadcast None

iface eth1 inet6 static
    address XXXX:XXXX:XXXX:XXXX::c
    netmask 64

----

I use two interfaces for two different networks one v4 only on eth0 and one v6 only on eth1.

I also attached a patch that corrects both issues.

About the second issue, since the patched version checks for IPv6 address existence, it might be possible to delete the use_ipv6 check.

Due to modifications between 2.17.0 and the current git version, the previous patch is deprecated. Please review the new patch below that accounts for git modifications relative to lxc and line feed fix.

Tracy Jones (tjones-i) on 2014-08-13
tags: added: network
Emmanuel THIERRY (ethierry) wrote :

To be clearer about this bug : The root problem is that it isn't possible to generate /etc/network/interfaces for interfaces connected on IPv6-only networks.

The proposed patch cleans the file by making both IP versions independent, including when using LXC containers. So as it is possible to have either IPv4-only, IPv6-only or dual-stack networks.

Sean Dague (sdague) wrote :

Can you propose the patch via gerrit? (http://review.openstack.org)? Please find me in #openstack-nova irc if you need assistance with the contribution process.

Changed in nova:
status: New → Incomplete
importance: Undecided → Medium
Emmanuel THIERRY (ethierry) wrote :

Thanks for the proposal. We will look at it.

Sean Dague (sdague) wrote :

This mostly just needs conditionals in the template, the existing patch is a reasonable guideline on how to get there

summary: - Injected /etc/network/interfaces misses line feed and IP existence
- checks
+ Can not have IPv4 or IPv6 only interfaces injected via
+ /etc/network/interfaces
Sean Dague (sdague) wrote :

This should be a pretty easy fix using the uploaded template as a starting point.

summary: Can not have IPv4 or IPv6 only interfaces injected via
- /etc/network/interfaces
+ /etc/network/interfaces.
Changed in nova:
status: Incomplete → Triaged
tags: added: low-hanging-fruit
Changed in nova:
assignee: nobody → Chris Gacsal (chris-gacsal)
luong tuan (tuantuluong) on 2015-07-31
Changed in nova:
assignee: Chris Gacsal (chris-gacsal) → luong tuan (tuantuluong)
AMRITANSHU (amritgeo) wrote :

Sean what is the update on this ,have you all uploaded the template for the same

Changed in nova:
assignee: luong tuan (tuantuluong) → Jialiang (jialiang-song517)
Changed in nova:
status: Triaged → In Progress
Jialiang (jialiang-song517) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/264157

Fix proposed to branch: master
Review: https://review.openstack.org/265509

Change abandoned by Jialiang (jialiang_song517@163.com) on branch: master
Review: https://review.openstack.org/265509

Jialiang (jialiang-song517) wrote :

A new patch set has been submitted to fix the gate failure, CI testing is in progress.
https://review.openstack.org/#/c/264157/2

Jialiang (jialiang-song517) wrote :

CI testing is done successfully. One +1 is being put from Drew Thorstensen.

Could anybody from nova core team help to review it? Thanks.

Other reviewers are welcome.

Drew Thorstensen (thorst) wrote :

I've testing Jialiang's proposed patch. I deployed a VM with two networks. One IPv4 only. One IPv6 only. Each nic on the VM came up properly, with only its required address.

Client VM was a basic Ubuntu 14.04 VM.

I can not speak to LXC testing.

Jialiang (jialiang-song517) wrote :

Pending for the review from core reviewer.
https://review.openstack.org/#/c/264157/

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
status: Fix Committed → In Progress
Changed in nova:
assignee: Jialiang (jialiang-song517) → Drew Thorstensen (thorst)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/264157
Reason: This patch is quite old, so I am abandoning it to keep the review queue manageable. Feel free to restore the change if you're still interested in working on it.

Fix proposed to branch: master
Review: https://review.openstack.org/465891

Changed in nova:
assignee: Drew Thorstensen (thorst) → Yongfeng Du (dolpherdu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers