RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1536946 - cloud-init can't handle network config data version 1 for bond
Summary: cloud-init can't handle network config data version 1 for bond
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cloud-init
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Eduardo Otubo
QA Contact: Vratislav Hutsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-22 05:46 UTC by Larry Guo
Modified: 2024-11-21 02:52 UTC (History)
4 users (show)

Fixed In Version: cloud-init-18.2-1.el7_6.1.x86_64
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-27 10:25:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1682014 0 None None None 2018-01-22 05:46:11 UTC
Launchpad 1695092 0 None None None 2018-01-22 06:17:59 UTC

Description Larry Guo 2018-01-22 05:46:12 UTC
Description of problem:
I am following cloud init guide to provide Networking Config Version 1 (http://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v1.html) format data to customize my VM network interface. It works for ethernet port bug crashed with bond configuraton, log is similiar as the following:
...
Traceback (most recent call last):
  File "./tools/net-convert.py", line 82, in <module>
    main()
  File "./tools/net-convert.py", line 78, in main
    r.render_network_state(ns, target=args.directory)
  File "/home/smoser-public/src/cloud-init/cloud-init/cloudinit/net/sysconfig.py", line 397, in render_network_state
    network_state).items():
  File "/home/smoser-public/src/cloud-init/cloud-init/cloudinit/net/sysconfig.py", line 379, in _render_sysconfig
    cls._render_bond_interfaces(network_state, iface_contents)
  File "/home/smoser-public/src/cloud-init/cloud-init/cloudinit/net/sysconfig.py", line 315, in _render_bond_interfaces
    iface_master_name = iface['bond-master']
KeyError: 'bond-master'

Someone have reported the same problem: https://bugs.launchpad.net/cloud-init/+bug/1682014, But it has been fixed in https://bugs.launchpad.net/cloud-init/+bug/1695092 (Fixed in Cloud-init 17.1)
 

Version-Release number of selected component (if applicable):
cloud-init-0.7.9-9.el7_4.1.x86_64

How reproducible:
Follow Networking Config Version 1 to customize bond interface, like the following:
  version: 1
  config:
    - type: physical
      name: eth0
      mac_address: 94:18:82:6f:3b:1c
      subnets:
        - type: static
          address: 172.20.0.30/24
    - type: physical
      name: eth1
      mac_address: 94:18:82:6f:3b:1d
      subnets:
        - type: dhcp4
    - type: physical
      name: eth2
      mac_address: 94:18:82:6f:3b:1e
      subnets:
        - type: dhcp4
    - type: physical
      name: eth3
      mac_address: 94:18:82:6f:3b:1f
      subnets:
        - type: dhcp4
    - type: bond
      name: bond0
      bond_interfaces:
        - eth1
        - eth2
      params:
        miimon: 100
        mode: 1
      subnets:
        - type: static
          address: 192.168.5.100/24
    - type: route
      destination: 0.0.0.0/0
      gateway: 172.16.1.1


Steps to Reproduce:
1. Generate cidata iso which contains meta-data, user-data, network-config, network-config should have the upper contents
2. Use kvm to bring up a redhat7.4/centos7.4 cloud image with iso attached. 
3. Check /var/log/cloud-init.log after instance up. bond configuration failed with exception

Actual results:
network config failed/terminated with exception

Expected results:
Network configuration is done for bond

Additional info:
Please integrated latest version of cloud-init(this bug should have been fixed in Cloud-init 17.1)

Comment 2 Logan V 2018-06-21 22:38:26 UTC
I'm hitting the same bug.

network_data.json from config drive:
http://paste.openstack.org/raw/723775/

cloud-init log from failure:
http://paste.openstack.org/raw/723776/

This commit fixes the bug: https://github.com/cloud-init/cloud-init/commit/51febf7363692d7947fe17a4fbfcb85058168ccb

I tested with my config and confirmed the fix applies the correct network configuration.

Comment 7 Logan V 2019-01-28 22:09:26 UTC
cloud-init-18.2-1.el7.centos.1.x86_64 appears to contain the fix I mentioned in #2, so I think this is resolved now.

Comment 8 Eduardo Otubo 2019-02-25 12:38:44 UTC
(In reply to Logan V from comment #7)
> cloud-init-18.2-1.el7.centos.1.x86_64 appears to contain the fix I mentioned
> in #2, so I think this is resolved now.

Can you verify if the issue is fixed and close the bz?

Comment 9 Larry Guo 2019-02-28 06:50:02 UTC
I can confirm it working well with redhat 7.6 and cloud-init 18.2, the network-config is exactly the same as the issue description part:

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
# rpm -qa |grep cloud-init
cloud-init-18.2-1.el7_6.1.x86_64

# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth1
HWADDR=94:18:82:6f:3b:1d
MASTER=bond0
ONBOOT=yes
SLAVE=yes
TYPE=Ethernet
USERCTL=no
# cat /etc/sysconfig/network-scripts/ifcfg-eth2
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth2
HWADDR=94:18:82:6f:3b:1e
MASTER=bond0
ONBOOT=yes
SLAVE=yes
TYPE=Ethernet
USERCTL=no

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
# Created by cloud-init on instance boot automatically, do not edit.
#
BONDING_MASTER=yes
BONDING_SLAVE0=eth1
BONDING_SLAVE1=eth2
BOOTPROTO=none
DEVICE=bond0
IPADDR=192.168.5.100
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Bond
USERCTL=no


Note You need to log in before you can comment on or make changes to this bug.