auto_allocate_network is not called when external shared network exists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Yushiro FURUKAWA |
Bug Description
When I try to boot an instance with '--nic auto', a network isn't created
automatically. In neutron side, in order to automatically allocate
network/
* router:external is True(it means an external network)
* is_default is True
* subnet is associated
However, if I prepared above default network, nova doesn't call
'_can_auto_
external network.(not generated a network automatically)
[1] https:/
[Steps to reproduce]
1. Delete all network/
2. Try to create an instance
$ nova boot --flavor 1 --image 198384a2-
ERROR (BadRequest): Unable to automatically allocate a network for project c8607bb7e4334b4
In n-api.log, we can see following error message:
Error message: {"NeutronError": {"message": "Deployment error: No default router:external network.", "type": "AutoAllocation
3. I see. OK, let's create default external network(
$ neutron net-create public --is_default --router:external --shared
$ neutron subnet-create public --subnetpool a811bf33-
4. Try it again 'nova boot'
$ nova boot --flavor 1 --image 198384a2-
5. You can check the result with 'nova list'
$ nova list
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 4e83f9d0-
+------
summary: |
- auto_allocate_network doesn't call when external network exists + auto_allocate_network is not called when external network exists |
Changed in nova: | |
assignee: | nobody → Yushiro FURUKAWA (y-furukawa-2) |
You're getting the public external network because you marked it as shared=True so it's pulled in here:
https:/ /github. com/openstack/ nova/blob/ a67af1f110f1608 61f5cbbff987766 c46d60198a/ nova/network/ neutronv2/ api.py# L343
And you pass this check for the external shared network on the compute:
https:/ /github. com/openstack/ nova/blob/ a67af1f110f1608 61f5cbbff987766 c46d60198a/ nova/network/ neutronv2/ api.py# L466
So the port for the server gets created in that network. I'm not sure what else you expect to happen here.