Cannot attach a DHCP network to VM

Bug #1596535 reported by Sridhar Venkat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Expired
Undecided
Unassigned

Bug Description

When a network is created and an attempt is made to attach a network interface to a VM, it fails with an error :
2016-06-27 03:26:14.857 32668 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 600, in allocate_for_instance
2016-06-27 03:26:14.857 32668 ERROR nova.api.openstack.extensions raise exception.SecurityGroupCannotBeApplied()

Debugging, the code breaking is :
            port_security_enabled = network.get('port_security_enabled', True)

and network is :
(Pdb) p network
{u'status': u'ACTIVE', u'subnets': [], u'availability_zone_hints': [], u'availability_zones': [], u'name': u'DHCP', u'provider:physical_network': u'default0', u'admin_state_up': True, u'tenant_id': u'500dc4679e6f4063a47ac3c17728085f', u'created_at': u'2016-06-27T07:25:55', u'tags': [], u'updated_at': u'2016-06-27T07:25:55', u'provider:segmentation_id': 300, u'ipv6_address_scope': None, u'router:external': False, u'ipv4_address_scope': None, u'id': u'815b219c-272e-4cb6-8711-c17df5e0894e', u'shared': False, u'provider:network_type': u'vlan', u'mtu': 1500, u'description': u''}
(Pub)

this code returns True in this context. port_security_enabled is not present in the network dictionary.

This code needs to be :
port_security_enabled = network.get('port_security_enabled')

I do not see port_security_enabled is mandatory for a network, so code should handle this scenario.

Sridhar Venkat (svenkat)
Changed in nova:
assignee: nobody → Sridhar Venkat (svenkat)
status: New → In Progress
Revision history for this message
Sridhar Venkat (svenkat) wrote :

This bug is applicable to networks with no port_security_enabled and no subnets in it. (DHCP network).

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

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

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/338408

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → New
assignee: Sridhar Venkat (svenkat) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

The code in master has moved around a bit here, and I think this is behind a try block that makes it better - https://github.com/openstack/nova/blob/50d1d382d825b21ffac3270b61a84659de824d12/nova/network/neutronv2/api.py#L760-L761

Can you confirm by putting this into Confirmed state if this is still an issue?

Changed in nova:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Compute (nova) because there has been no activity for 60 days.]

Changed in nova:
status: Incomplete → Expired
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.