I don't think that is the right fix. The reason this is occurring is because we are not calling validate_networks before calling to the nova-compute node. The fix was included in this patch set though was dropped for some reason:
In addition we might need to adiff --git a/nova/exception.py b/nova/exception.py
index cce9125..c5caa6d 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -624,6 +624,9 @@ class NetworkRequiresSubnet(Invalid):
msg_fmt = _("Network %(network_uuid)s requires a subnet in order to boot"
" instances on.")
+class NetworkIsExternal(Invalid):
+ msg_fmt = _("Creating ports on router:external network %(network_uuid)s "
+ "is not allowed.")
class DatastoreNotFound(NotFound):
msg_fmt = _("Could not find the datastore reference(s) which the VM uses.")
diff --git a/nova/network/neutronv2/api.py b/nova/network/neutronv2/api.py
index 17e3bed..03db13c 100644
--- a/nova/network/neutronv2/api.py
+++ b/nova/network/neutronv2/api.py
@@ -588,6 +588,7 @@ class API(base.Base):
if not requested_networks:
nets = self._get_available_networks(context, context.project_id,
@@ -634,10 +635,14 @@ class API(base.Base):
nets = self._get_available_networks(context, context.project_id, net_ids, neutron=neutron)
for net in nets:
if not net.get('subnets'): raise exception.NetworkRequiresSubnet( network_uuid=net['id'])
+ if net.get('router:external'):
+ raise exception.NetworkIsExternal(network_uuid=net['id'])
if len(nets) != len(net_ids): requsted_netid_set = set(net_ids)
dd these lines as well:
Hi Salvatore,
I don't think that is the right fix. The reason this is occurring is because we are not calling validate_networks before calling to the nova-compute node. The fix was included in this patch set though was dropped for some reason:
https:/ /review. openstack. org/#/c/ 57229/8. .9/nova/ api/openstack/ compute/ contrib/ attach_ interfaces. py
In addition we might need to adiff --git a/nova/exception.py b/nova/exception.py Subnet( Invalid) :
index cce9125..c5caa6d 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -624,6 +624,9 @@ class NetworkRequires
msg_fmt = _("Network %(network_uuid)s requires a subnet in order to boot"
" instances on.")
+class NetworkIsExtern al(Invalid) :
+ msg_fmt = _("Creating ports on router:external network %(network_uuid)s "
+ "is not allowed.")
class DatastoreNotFou nd(NotFound) : network/ neutronv2/ api.py b/nova/ network/ neutronv2/ api.py network/ neutronv2/ api.py network/ neutronv2/ api.py
msg_fmt = _("Could not find the datastore reference(s) which the VM uses.")
diff --git a/nova/
index 17e3bed..03db13c 100644
--- a/nova/
+++ b/nova/
@@ -588,6 +588,7 @@ class API(base.Base):
neutron = neutronv2. get_client( context)
ports_ needed_ per_instance = 0
if not requested_networks: available_ networks( context, context.project_id, available_ networks( context,
context. project_ id, net_ids,
neutron= neutron)
nets = self._get_
@@ -634,10 +635,14 @@ class API(base.Base):
nets = self._get_
for net in nets:
raise exception. NetworkRequires Subnet(
network_ uuid=net[ 'id']) 'router: external' ): NetworkIsExtern al(network_ uuid=net[ 'id'])
if not net.get('subnets'):
+ if net.get(
+ raise exception.
if len(nets) != len(net_ids):
requsted_ netid_set = set(net_ids)
dd these lines as well: