API: Proxy neutron configuration to guest instance (partial)

Registered by John Garbutt

Currently the metadata service only contains minimal network information. Like user_data and vendor_data, we should also provide network_data

Really we should provide all the information we can (from neutron) in both config drive and metadata service.

Main use case:
* cloud has no DHCP
* image has no "nova-agent" or similar
* but image is still able to setup network info
* image can have custom startup scripts to get networking config from Config Drive

Other usecase:
consider a VM with the first interface configured by DHCP, and all other interfaces on private networks where the interfaces are statically configured, but you are not using config drive, just the metadata service, and not cheating by doing file injection, presenting the data in a guest agnostic format.

More discussion from Icehouse summit is here:

* only in v3 API
* information will only be populated if neutron is enabled
* information comes from current network_info for instance
* API should be fairly similar to the neutron get port details API
* but we only really need concrete info: mac address, fixed IP address, subnet, gateway, host routes, etc
* but probably best to include at least: neutron port-id, neutron network-id, neutron subnet-id
* it should all be grouped by mac address, so guest can link it to the VIFs correctly

Sample API for getting network information from metadata service


JSON Response

               "host_routes":[{"destination":"", "nexthop":""}],

Blueprint information

John Garbutt
John Garbutt
Josh Gachnang
Series goal:
Accepted for liberty
Milestone target:
milestone icon 12.0.0
Started by
Claxton Correya
Completed by
John Garbutt

Related branches



Addressed by: https://review.openstack.org/167385
    API: Proxy neutron configuration to guest instance

Apologies, this missed the deadline for Feature Freeze. Please rebase patches as soon as Juno opens, and we will try to get this in during that period. --johnthetubaguy (5th March 2014)

Unapproved - please re-submit via nova-spec --johnthetubagy (20th March 2014)

Sorry, we have now hit the non-priority feature freeze for kilo. Please resubmit your spec for the L release. --johnthetubaguy 5th Feb 2015

Approved for liberty now. --johnthetubaguy 20th April 2015

Gerrit topic: https://review.openstack.org/#q,topic:metadata-service-network-info,n,z

Addressed by:

Gerrit topic: https://review.openstack.org/#q,topic:bp/metadata-service-network-info,n,z

Addressed by: https://review.openstack.org/153097
    Expose Neutron network data in metadata service

Addressed by: https://review.openstack.org/152703
    Add support for provider networks in network_data.json

Given this merged: https://review.openstack.org/153097 I am marking this as partially complete. The provider networks bit should probably be tracked separately anyway, but feels like its blocked on Neutron API changes, for a complete solution. --johnthetubaguy 3rd July 2015

Addressed by: https://review.openstack.org/337819
    Update metadata-service-network-info according to implementation


Work Items

Work items:
Get basic networking info from neutron into Metadata Service (list of: mac, IP, subnet, gateway, neutron-port-id, host-routes): DONE
Add above information into ConfigDrive as "network_data": DONE

This blueprint contains Public information 
Everyone can see this information.