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

Bug #1355171 reported by Pierre-Antoine Haidar-Bachminska
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
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.

Revision history for this message
Pierre-Antoine Haidar-Bachminska (pierre-antoine-haidar-bachminska) wrote :

PS: I use Nova 2.17.0

Revision history for this message
Pierre-Antoine Haidar-Bachminska (pierre-antoine-haidar-bachminska) wrote :

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)
tags: added: network
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
Emmanuel THIERRY (ethierry) wrote :

Thanks for the proposal. We will look at it.

Revision history for this message
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
Revision history for this message
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)
Changed in nova:
assignee: Chris Gacsal (chris-gacsal) → luong tuan (tuantuluong)
Revision history for this message
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
Jialiang (jialiang-song517) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

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

Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: Drew Thorstensen (thorst) → Yongfeng Du (dolpherdu)
Revision history for this message
Keerthi Reddy (keerthigd) wrote :

whats the status of this bug?

Revision history for this message
Yongfeng Du (dolpherdu) wrote :

I guess we can close this bug without issues.
Although the change is harmless, new Ubuntu is not using this file any more.

Revision history for this message
liao malin (liaodalin19903) wrote :

This bug should be solve, because so many people still use not the latest version Ubuntu.

Changed in nova:
assignee: Yongfeng Du (dolpherdu) → Stephen Finucane (stephenfinucane)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Stephen Finucane (stephenfinucane) → Yongfeng Du (dolpherdu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/465891
Committed: https://opendev.org/openstack/nova/commit/8107e5ced8f3e644e49a2fd1eff51916258c40e7
Submitter: "Zuul (22348)"
Branch: master

commit 8107e5ced8f3e644e49a2fd1eff51916258c40e7
Author: Jialiang <jialiang_song517@163.com>
Date: Wed Jan 6 04:23:23 2016 -0800

    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 <email address hidden>

    Change-Id: If0843502fe0a85cbd5eff777d9260c90cea4812a
    Closes-Bug:#1355171

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 26.0.0.0rc1

This issue was fixed in the openstack/nova 26.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.