Cannot attach a DHCP network to VM

Bug #1596535 reported by Sridhar Venkat on 2016-06-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
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) on 2016-06-27
Changed in nova:
assignee: nobody → Sridhar Venkat (svenkat)
status: New → In Progress
Sridhar Venkat (svenkat) wrote :

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

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

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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers