Problem bringing up multiple interfaces on VM at launch

asked 2017-09-01 03:56:49 -0500

SeanM gravatar image

We have a problem with bringing up a VM with multiple network interfaces on our Ocata cluster.

The instance is configured to have two networks at launch - the idea is that a floating IP would be attached to one and the other would be an internal network which would be connected to some other of the other VMs. At launch time, the floating IP is not assigned, obviously.

The problem is that only one of the network interfaces comes up at launch. We see this in the boot logs:

[[0;32m  OK  [0m] Started Initial cloud-init job (pre-networking).
[[0;32m  OK  [0m] Reached target Network (Pre).
[[0;32m  OK  [0m] Started ifup for ens3.
         Starting Raise network interfaces...
[[0;32m  OK  [0m] Started Raise network interfaces.
         Starting Initial cloud-init job (metadata service crawler)...
[[0;32m  OK  [0m] Reached target Network.
[   25.495249] cloud-init[945]: Cloud-init v. 0.7.9 running 'init' at Thu, 31 Aug 2017 16:28:23 +0000. Up 7.47 seconds.
[   25.496760] cloud-init[945]: ci-info: +++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
[   25.498215] cloud-init[945]: ci-info: +--------+-------+------------------------------+---------------+-------+-------------------+
[   25.504145] cloud-init[945]: ci-info: | Device |   Up  |           Address            |      Mask     | Scope |     Hw-Address    |
[   25.505605] cloud-init[945]: ci-info: +--------+-------+------------------------------+---------------+-------+-------------------+
[   25.507004] cloud-init[945]: ci-info: |  ens4  | False |              .               |       .       |   .   | fa:16:3e:b2:97:35 |
[   25.512329] cloud-init[945]: ci-info: |  ens3  |  True |           | |   .   | fa:16:3e:47:48:60 |
[   25.513748] cloud-init[945]: ci-info: |  ens3  |  True | fe80::f816:3eff:fe47:4860/64 |       .       |  link | fa:16:3e:47:48:60 |
[   25.516165] cloud-init[945]: ci-info: |   lo   |  True |           |   |   .   |         .         |
[   25.520162] cloud-init[945]: ci-info: |   lo   |  True |           ::1/128            |       .       |  host |         .         |
[   25.521604] cloud-init[945]: ci-info: +--------+-------+------------------------------+---------------+-------+-------------------+
[   25.524145] cloud-init[945]: ci-info: ++++++++++++++++++++++++++++++Route IPv4 info+++++++++++++++++++++++++++++++

ens4 is somehow visible, but does not come up.

I've checked taps, veths and linux bridges and OVS bridges and everything looks ok. I can log into the VM and bring up the second interface - add a couple of lines to the 050-cloud-init.cfg:

auto ens4
iface ens4 inet dhcp

and ifup ens4 and things work ok.

I don't know if this is by design, if it is an issue with cloud-init or an issue with the Openstack config (eg the second network interface does not appear in time). Also, there is the reasonably obvious issue that if two interfaces are brought up at launch, it's not specifically clear how routing should be configured.

Any idea what I would need to do to ensure both interfaces come up at launch?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2017-09-01 19:56:58 -0500

teju gravatar image

updated 2017-09-01 19:58:57 -0500

Most of the cloud images are configured with only 1 NIC in cloud-init. So, when a VM boots, it comes up with only 1 NIC irrespective of the number of networks you attach to the VM.

So, the common way people get around this limitation is to create a snapshot of VM with multiple NICs, upload to glance and use this to launch VMs.

Please check the below link to create snapshot of multi NIC image.


As far as default route is concerned, let's say you have 2 networks and you've set gateway for one of the networks and you attach the 2 networks to VM while launching, the VM will have the default route as the gateway set for first network.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-09-01 03:56:49 -0500

Seen: 5,015 times

Last updated: Sep 01 '17