"nova boot" permits admin user to boot instances on networks belong to other tenants
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
New
|
Undecided
|
Unassigned |
Bug Description
I have deployed OpenStack using RedHat's "packstack" tool by running
"packstack --allinone", which results in the following tenants:
(keystone_
+--
| id | name | enabled |
+--
| 6b027a9f4d5e481
| 04981100ee194c9
| 8639e75e13c742c
| 0d4f0baadf91458
+--
There are two networks defined in my environment. As the admin user, I can see both of them...
(keystone_
+--
| id | name | subnets |
+--
| 9039c750-
| fdf2804f-
+--
...even though the "private" network is owned by the "demo" tenant:
(keystone_
+--
| Field | Value |
+--
| admin_state_up | True |
| id | 9039c750-
| name | private |
| provider:
| provider:
| provider:
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | 4930ef6a-
| tenant_id | 8639e75e13c742c
+--
Because this network is visible to admin, I can do this:
nova boot ... --nic net-id=
Which works great...until I reboot. At this point, attempts to
interact with the instance (e.g., using "nova reboot") result in the
following exception:
File "/usr/lib/
subnets)
File "/usr/lib/
UnboundLoca
This happens because in nova/network/
API._get_
search_opts = {'tenant_id': project_id, 'shared': False}
nets = neutron.
Here, nova is explicitly filtering on project_id, which means that
networks that do not belong to the admin tenant will not be
discovered. In _nw_info_
initial loop:
def _nw_info_
# NOTE(danms): This loop can't fail to find a network since we
# filtered ports to only the ones matching networks in our parent
for net in networks:
if port['network_id'] == net['id']:
Because port['network_id'] = '9039c750-
but that network was never discovered in _get_available_
loops exits without setting network_name, causing the above exception.
I think that the initial "nova boot" command should have failed, but
also that this situation ought to be recoverable (currently, because
of this error, the instance is effectively unmaintainable -- it can be
neither rebooted nor deleted).
Sorry, obvious typo there. This:
nova boot ... --nic net-id= 8639e75e13c742c 093746c8e70d5ce f8 test0
Should read:
nova boot ... --nic net-id= 9039c750- de15-4358- 8a38-5807a7fc5c 35