Cannot attach a DHCP network to VM

Bug #1596535 reported by Sridhar Venkat on 2016-06-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)

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/", 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''}

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

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

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

Changed in nova:
status: New → Incomplete
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  Edit
Everyone can see this information.

Other bug subscribers