Incorrect metada in ConfigDrive when using barematal ports under neutron

Bug #1656854 reported by George Shuklin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Undecided
Unassigned
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Newton
Fix Committed
Medium
Vasyl Saienko

Bug Description

If baremetal instance is booted with neutron network and config drive enabled, it receives incorrect network data in network_data.json, which cause trace in cloud-init: ValueError: Unknown network_data link type: unbound

All software is at Newton: ironic (1:6.2.1-0ubuntu1), nova (2:14.0.1-0ubuntu1), neutron (2:9.0.0-0ubuntu1).

network_data.json content:

{"services": [{"type": "dns", "address": "8.8.8.8"}], "networks": [{"network_id": "d22a675f-f89c-44ae-ae48-bb64e4b81a3d", "type": "ipv4", "netmask": "255.255.255.224", "link": "tap7d178b79-86", "routes": [{"netmask": "0.0.0.0", "network": "0.0.0.0", "gateway": "204.74.228.65"}], "ip_address": "204.74.228.75", "id": "network0"}], "links": [{"ethernet_mac_address": "18:66:da:5f:07:f4", "mtu": 1500, "type": "unbound", "id": "tap7d178b79-86", "vif_id": "7d178b79-86a9-4e56-824e-fe503e422960"}]}

neutron port description:
openstack port show 7d178b79-86a9-4e56-824e-fe503e422960 -f json
{
  "status": "DOWN",
  "binding_profile": "local_link_information='[{u'switch_info': u'c426s1', u'port_id': u'1/1/21', u'switch_id': u'60:9c:9f:49:a8:b4'}]'",
  "project_id": "7d450ecf00d64399aeb93bc122cb6dae",
  "binding_vnic_type": "baremetal",
  "binding_vif_details": "",
  "name": "",
  "admin_state_up": "UP",
  "network_id": "d22a675f-f89c-44ae-ae48-bb64e4b81a3d",
  "created_at": "2017-01-16T14:32:27Z",
  "updated_at": "2017-01-16T14:36:22Z",
  "id": "7d178b79-86a9-4e56-824e-fe503e422960",
  "device_owner": "baremetal:none",
  "binding_host_id": "d02c7361-5e3a-4fdf-89b5-f29b3901f0fc",
  "revision_number": 7,
  "mac_address": "18:66:da:5f:07:f4",
  "binding_vif_type": "other",
  "device_id": "9762e013-ffb9-4512-a56d-2a11694a1de8",
  "fixed_ips": "ip_address='204.74.228.75', subnet_id='f41ae071-d0d8-4192-96c3-1fd73886275b'",
  "extra_dhcp_opts": "",
  "description": ""
}

ironic is configured for multitenancy (to use neutron): default_network_interface=neutron.
neutron is configured for ML2, ML2 is configured for networking_generic_switch. Former works fine and toggle port on real switch in vlan (access) and out.

Network is configured to work with vlans.

Network description:
openstack network show client-22-vlan -f json
{
  "status": "ACTIVE",
  "router:external": "Internal",
  "availability_zone_hints": "",
  "availability_zones": "nova",
  "description": "",
  "provider:physical_network": "client",
  "admin_state_up": "UP",
  "updated_at": "2017-01-16T13:01:47Z",
  "created_at": "2017-01-16T12:59:10Z",
  "tags": [],
  "ipv6_address_scope": null,
  "provider:segmentation_id": 22,
  "mtu": 1500,
  "provider:network_type": "vlan",
  "revision_number": 5,
  "ipv4_address_scope": null,
  "subnets": "f41ae071-d0d8-4192-96c3-1fd73886275b",
  "shared": false,
  "project_id": "7d450ecf00d64399aeb93bc122cb6dae",
  "id": "d22a675f-f89c-44ae-ae48-bb64e4b81a3d",
  "name": "client-22-vlan"
}

subnet description:
openstack subnet show f41ae071-d0d8-4192-96c3-1fd73886275b -f json
{
  "service_types": [],
  "description": "",
  "enable_dhcp": false,
  "network_id": "d22a675f-f89c-44ae-ae48-bb64e4b81a3d",
  "created_at": "2017-01-16T13:01:12Z",
  "dns_nameservers": "8.8.8.8",
  "updated_at": "2017-01-16T13:01:47Z",
  "ipv6_ra_mode": null,
  "allocation_pools": "204.74.228.66-204.74.228.94",
  "gateway_ip": "204.74.228.65",
  "revision_number": 3,
  "ipv6_address_mode": null,
  "ip_version": 4,
  "host_routes": "",
  "cidr": "204.74.228.64/27",
  "project_id": "7d450ecf00d64399aeb93bc122cb6dae",
  "id": "f41ae071-d0d8-4192-96c3-1fd73886275b",
  "subnetpool_id": null,
  "name": ""
}

Boot command:

openstack server create good --config-drive true --flavor bare-1 --image ubuntu-custom-7 --key-name keybane --nic net-id=d22a675f-f89c-44ae-ae48-bb64e4b81a3d

According to vdrok from #openstack-ironic allowed types for interface for cloud-init are:
'bridge', 'ethernet', 'hw_veb', 'hyperv', 'ovs', 'phy', 'tap', 'vhostuser', 'vif', 'bond', 'vlan'

Vasyl Saienko (vsaienko)
Changed in ironic:
status: New → Invalid
Changed in nova:
assignee: nobody → Vasyl Saienko (vsaienko)
status: New → In Progress
Revision history for this message
George Shuklin (george-shuklin) wrote :

Here is an ugly and upstream-unfriendly fix, but it works for our installation (newton @ ubuntu):

https://gist.github.com/amarao/17ecbdefd12a82325dfeaf7ac4d26887

Changed in nova:
assignee: Vasyl Saienko (vsaienko) → Tuan (tuanla)
Tuan (tuanla)
Changed in nova:
assignee: Tuan (tuanla) → Vasyl Saienko (vsaienko)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/421254

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

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/421261

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

Change abandoned by Sam Betts (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/421254

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/422068

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

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/422070

Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
tags: added: ironic metadata
Changed in nova:
assignee: Vasyl Saienko (vsaienko) → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/422068
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b34809dfae862e37b1362b73fd258af8d12adae5
Submitter: Jenkins
Branch: master

commit b34809dfae862e37b1362b73fd258af8d12adae5
Author: Sam Betts <email address hidden>
Date: Tue Jan 17 12:45:21 2017 +0000

    Ensure we mark baremetal links as phy links

    In the Ironic multi-tenant case, the neutron ports will remain unbound
    until later in the deploy process. Nova generates the network_data.json
    file with all the links marked as unbound, which we need to correct as
    these links will be bound after the config drive is generated and
    written to the node. This patch updates the Ironic virt driver to
    correct the network metadata.

    Change-Id: I1881f4a9bca6a6d6a3b4e0e89a82b0765ae09eee
    Closes-Bug: #1656854

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

Reviewed: https://review.openstack.org/364413
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c7b46c4778acdb05468b6cab4f3111b298609ed4
Submitter: Jenkins
Branch: master

commit c7b46c4778acdb05468b6cab4f3111b298609ed4
Author: Sam Betts <email address hidden>
Date: Thu Sep 1 16:44:06 2016 +0100

    Support Ironic interface attach/detach in nova virt

    In order to support different Ironic network drivers that may need to
    implement vif to pif mapping in different ways, we've added new APIs
    in Ironic to abstract this behaviour. This patch switches the Ironic
    virt driver over to use this API. As part of this change the virt driver
    will no longer provide the macs_for_instance function, as Ironic will
    handle updating the Neutron ports during the provisioning process.

    Update interface mac addresses in configdrive network_metadata with
    ironic node ports values.

    Co-Authored-By: Vasyl Saienko <email address hidden>
    Implements: blueprint ironic-plug-unplug-vifs-update
    Change-Id: I4d70423ca978885a982c7eb5bd1efcc024d2b777
    Partial-Bug: #1582188
    Closes-Bug: #1656854

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

Change abandoned by Lee Yarwood (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/421261
Reason: https://review.openstack.org/#/c/422070/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b3

This issue was fixed in the openstack/nova 15.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/newton)

Reviewed: https://review.openstack.org/422070
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=28e6faecbf460f08f92d7c25876baf1709633e0c
Submitter: Jenkins
Branch: stable/newton

commit 28e6faecbf460f08f92d7c25876baf1709633e0c
Author: Sam Betts <email address hidden>
Date: Tue Jan 17 12:45:21 2017 +0000

    Ensure we mark baremetal links as phy links

    In the Ironic multi-tenant case, the neutron ports will remain unbound
    until later in the deploy process. Nova generates the network_data.json
    file with all the links marked as unbound, which we need to correct as
    these links will be bound after the config drive is generated and
    written to the node. This patch updates the Ironic virt driver to
    correct the network metadata.

    Change-Id: I1881f4a9bca6a6d6a3b4e0e89a82b0765ae09eee
    Closes-Bug: #1656854
    (cherry picked from commit b34809dfae862e37b1362b73fd258af8d12adae5)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.4

This issue was fixed in the openstack/nova 14.0.4 release.

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.