I was working with Openstack and trying to get simple layer-2 connectivity in Neutron using a Linux bridge. For some reason Neutron requires a layer 3 subnet to be configured on the network, or you’ll see an error message similar to this:

root@controller1:/etc/neutron# openstack server create –flavor vEOS –image vEOS –nic net-id=management –nic net-id=veos1-veos2-p1 –nic net-id=veos1-veos2-p2 vEOS1

Network f75e6d48-32d1-4383-bd41-71a1aafcc3ba requires a subnet in order to boot instances on. (HTTP 400) (Request-ID: req-f6c890ea-ccf1-41b0-afd1-1ff05f38a8d9)

After some googling, I stumbled upon this bug report which confirmed that it is indeed a matter of a check that can be disabled. I solved it by editing /usr/lib/python2.7/dist-packages/nova/network/neutronv2/api.py and disabling the check in question, which starts at line 1597:

# Now check to see if all requested networks exist
if net_ids_requested:
nets = self._get_available_networks(
context, context.project_id, net_ids_requested,
neutron=neutron)

#for net in nets:
# if not net.get(‘subnets’):
# raise exception.NetworkRequiresSubnet(
# network_uuid=net[‘id’])
#
#if len(nets) != len(net_ids_requested):
# requested_netid_set = set(net_ids_requested)
# returned_netid_set = set([net[‘id’] for net in nets])
# lostid_set = requested_netid_set – returned_netid_set
# if lostid_set:
# id_str = ”
# for _id in lostid_set:
# id_str = id_str and id_str + ‘, ‘ + _id or _id
# raise exception.NetworkNotFound(network_id=id_str)
return ports_needed_per_instance

def validate_networks(self, context, requested_networks, num_instances):

I then made sure to recompile the .pyc library:

root@controller1:/usr/lib/python2.7/dist-packages/nova/network/neutronv2# python -m compileall .
Listing . …
Compiling ./api.py …
root@controller1:/usr/lib/python2.7/dist-packages/nova/network/neutronv2# ls -l
total 200
-rw-r–r– 1 root root 114742 Nov 7 17:22 api.py
-rw-r–r– 1 root root 71693 Nov 7 17:23 api.pyc
-rw-r–r– 1 root root 848 Aug 28 02:56 constants.py
-rw-r–r– 1 root root 441 Nov 2 19:15 constants.pyc
-rw-r–r– 1 root root 0 Aug 28 02:56 __init__.py
-rw-r–r– 1 root root 154 Nov 2 19:15 __init__.pyc

After that I rebooted the controller, and no longer had the issue. I verified that my l2 link worked.

PS, don’t forget to disable port security:

neutron net-update 7b6eb439-bb05-4257-84a6-81a61118e85b –port-security-enabled=False

 

Leave a Reply