Unable to configure IPv4 addresses via network configuration injected into config drive

Bug #1677846 reported by Alain Swanson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
New
Undecided
Unassigned

Bug Description

When I attempt to use cloud-init 0.7.9 with RHEL72, I am finding that IPv4 network configuration information is not properly configured on the eth0 interface. Instead, I end up with an ifcfg-eth0 that looks like this:

[root@projectb-fwam-rhel72 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=fa:16:3e:54:5a:77
ONBOOT=yes
TYPE=Ethernet
USERCTL=no

cloud-init.log indicates that network_data.json is being used for the network configuration information (although the network_config content file is available as well).

The config drive is attached.

Revision history for this message
Alain Swanson (alain-swanson) wrote :
Revision history for this message
Alain Swanson (alain-swanson) wrote :

cloud-init.log indicates the following:

2017-03-30 18:39:29,899 - util.py[DEBUG]: Reading from /tmp/tmpsDhtTT/openstack/2015-10-15/network_data.json (quiet=False)
2017-03-30 18:39:29,899 - util.py[DEBUG]: Read 591 bytes from /tmp/tmpsDhtTT/openstack/2015-10-15/network_data.json
2017-03-30 18:39:29,899 - util.py[DEBUG]: Reading from /tmp/tmpsDhtTT/openstack/2015-10-15/meta_data.json (quiet=False)
2017-03-30 18:39:29,900 - util.py[DEBUG]: Read 1944 bytes from /tmp/tmpsDhtTT/openstack/2015-10-15/meta_data.json
2017-03-30 18:39:29,900 - util.py[DEBUG]: Reading from /tmp/tmpsDhtTT/openstack/content/0000 (quiet=False)
2017-03-30 18:39:29,901 - util.py[DEBUG]: Read 490 bytes from /tmp/tmpsDhtTT/openstack/content/0000

....

2017-03-30 18:39:29,956 - DataSourceConfigDrive.py[DEBUG]: network config provided via network_json

....

2017-03-30 18:39:29,958 - stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'subnets': [{'type': 'dhcp'}], 'type': 'physical', 'name': 'eth0', 'mac_address': 'fa:16:3e:54:5a:77'}]}

Why is it reverting to DHCP rather than using the information contained within network_data.json?

Revision history for this message
Alain Swanson (alain-swanson) wrote :

Ok, I think I've figured out what the issue is. We are using ESXi as the underlying hypervisor for our OpenStack instances. The network_data.json that is generated by Nova looks like this:

{
 "services": [
  {"type": "dns", "address": "162.103.172.46"},
  {"type": "dns", "address": "162.102.197.46"},
  {"type": "dns", "address": "162.101.165.14"}],

 "networks": [
  { "network_id": "99c7f06a-02ab-4519-894e-81dde1761ee5",
   "type": "ipv4",
   "netmask": "255.255.255.224",
   "link": "tap60b0567b-ed",
   "routes": [
    { "netmask": "0.0.0.0",
     "network": "0.0.0.0",
     "gateway": "10.252.197.161"}],
   "ip_address": "10.252.197.173",
   "id": "network0"}],

 "links": [
  { "ethernet_mac_address": "fa:16:3e:6b:73:0b",
   "mtu": null,
   "type": "dvs",
   "id": "tap60b0567b-ed",
   "vif_id": "60b0567b-edf7-4af6-8d46-49eb885282eb"}]
}

In ./site-packages/cloudinit/sources/helpers/openstack.py, PHYSICAL_TYPES does not include "dvs" (see json above). Adding "dvs" to PHYSICAL_TYPES results in cloud-init being able to configure IPv4 addresses for this RHEL7 instance running on top of ESXi. Can you please validate this finding and make the appropriate code changes that are required?

Revision history for this message
Scott Moser (smoser) wrote :

So...
This is a dupe of https://bugs.launchpad.net/cloud-init/+bug/1674946 .
There is some more information there.

You can see the reasoning in my commit message at

 https://review.openstack.org/#/c/400883/2

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.