nova interface-attach doesn't work if port|network|fixed id is omitted

Bug #1267723 reported by shihanzhang
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
shihanzhang

Bug Description

when use 'interface-attach' to attach interface to a vm with port|network|fixed id is omitted, it will be success if there is one network in that tenant, but it will be failed if there are more than one network in that tenant, also, when nterface-attach faield, there will be residual port in neutron which will not automatically deleted , nova latest code has the same problem!

Changed in nova:
assignee: nobody → shihanzhang (shihanzhang)
Revision history for this message
Matt Riedemann (mriedem) wrote :

Using neutron or nova-network?

tags: added: network
Revision history for this message
shihanzhang (shihanzhang) wrote :

neutron

Revision history for this message
Weiwen Chen (wei-wen-chen) wrote :

This is a problem:
# nova --insecure interface-attach cirros
ERROR: Failed to attach interface (HTTP 500) (Request-ID: req-0d424f10-0974-41cc-b1a6-9c945f96997c)

https://github.com/openstack/nova/blob/master/nova/compute/manager.py file has the check:
 if len(network_info) != 1:
            LOG.error(_('allocate_port_for_instance returned %(ports)s ports')
                      % dict(ports=len(network_info)))

However, in https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py: _get_available_networks()
if no network specified, it will get all networks in the tenant.

If more than one network in the tenant, this will definitely causing the above check failed.

Revision history for this message
Racha Ben Ali (racha-ben-ali) wrote :

As part of this patch https://review.openstack.org/#/c/98488/ if more than one network in the tenant and none is requested, then NetworkAmbiguous Exception is raised, without causing the above LOG.error.

Brent Eagles (beagles)
tags: added: neutron
Revision history for this message
Sean Dague (sdague) wrote :

Assuming this is fixed based on the above patch. If not, please reopen

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-rc1 → 2014.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.