server rebuild UnboundLocalError: local variable 'network_name'

Bug #1258523 reported by Attila Fazekas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned
neutron
New
Undecided
Unassigned

Bug Description

Failed to rebuild a server with neutron and floating_ip.

n-cpu error:
 Setting instance vm_state to ERROR
 Traceback (most recent call last):
   File "/opt/stack/new/nova/nova/compute/manager.py", line 5078, in _error_out_instance_on_exception
     yield
   File "/opt/stack/new/nova/nova/compute/manager.py", line 2207, in rebuild_instance
     network_info = self._get_instance_nw_info(context, instance)
   File "/opt/stack/new/nova/nova/compute/manager.py", line 896, in _get_instance_nw_info
     instance)
   File "/opt/stack/new/nova/nova/network/api.py", line 50, in wrapper
     res = f(self, context, *args, **kwargs)
   File "/opt/stack/new/nova/nova/network/neutronv2/api.py", line 445, in get_instance_nw_info
     result = self._get_instance_nw_info(context, instance, networks)
   File "/opt/stack/new/nova/nova/network/neutronv2/api.py", line 452, in _get_instance_nw_info
     nw_info = self._build_network_info_model(context, instance, networks)
   File "/opt/stack/new/nova/nova/network/neutronv2/api.py", line 1023, in _build_network_info_model
     subnets)
   File "/opt/stack/new/nova/nova/network/neutronv2/api.py", line 953, in _nw_info_build_network
     label=network_name,
 UnboundLocalError: local variable 'network_name' referenced before assignment

$ neutron port-create private
+-----------------------+---------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+---------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:capabilities | {"port_filter": false} |
| binding:host_id | |
| binding:vif_type | unbound |
| device_id | |
| device_owner | |
| fixed_ips | {"subnet_id": "5360935f-eca7-4352-b76c-bd0deafa4cf9", "ip_address": "10.1.0.4"} |
| id | d34865bc-2b99-4493-9256-b231e89e404c |
| mac_address | fa:16:3e:1d:b8:81 |
| name | |
| network_id | 03657a24-5fe9-48dc-a426-2a495c9e8052 |
| security_groups | a9aa6eda-192a-4e63-a0d8-060d41c4d928 |
| status | DOWN |
| tenant_id | a026cc3108044c60a593c9ce9dee89ab |
+-----------------------+---------------------------------------------------------------------------------+

$ neutron floatingip-create public
Created a new floatingip:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| fixed_ip_address | |
| floating_ip_address | 172.24.4.21 |
| floating_network_id | c1a7d836-0563-4023-8d8f-97c47f4b317c |
| id | 405e7839-676c-4324-828d-5bff5b5a1d3f |
| port_id | |
| router_id | |
| tenant_id | a026cc3108044c60a593c9ce9dee89ab |
+---------------------+--------------------------------------+

$ neutron floatingip-associate 405e7839-676c-4324-828d-5bff5b5a1d3f d34865bc-2b99-4493-9256-b231e89e404c
Associated floatingip 405e7839-676c-4324-828d-5bff5b5a1d3f
$ nova boot server --image cirros-0.3.1-x86_64-uec --flavor 42 --nic port-id=d34865bc-2b99-4493-9256-b231e89e404c
+--------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------+--------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-0000000c |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | None |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | uWrM2gRLXNm2 |
| config_drive | |
| created | 2013-12-06T13:20:59Z |
| flavor | m1.nano |
| hostId | |
| id | 9031bf8a-49e1-4835-bc75-86e900397136 |
| image | cirros-0.3.1-x86_64-uec |
| key_name | None |
| metadata | {} |
| name | server |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| tenant_id | a026cc3108044c60a593c9ce9dee89ab |
| updated | 2013-12-06T13:20:59Z |
| user_id | 492847cb43d34ee889a8c3b9fe1185b2 |
+--------------------------------------+--------------------------------------+

$ nova rebuild 9031bf8a-49e1-4835-bc75-86e900397136 cirros-0.3.1-x86_64-uec
+--------------------------------------+----------------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | devstack-1386328445 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | devstack-1386328445 |
| OS-EXT-SRV-ATTR:instance_name | instance-0000000c |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | rebuilding |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2013-12-06T13:21:01.000000 |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2013-12-06T13:20:59Z |
| flavor | m1.nano (42) |
| hostId | 34895965273061f4bba3219f4d31ebedf79c3526d134ad4fe0d5daca |
| id | 9031bf8a-49e1-4835-bc75-86e900397136 |
| image | cirros-0.3.1-x86_64-uec (551c23cf-15fa-44b8-ae15-f7468efd07de) |
| key_name | None |
| metadata | {} |
| name | server |
| os-extended-volumes:volumes_attached | [] |
| private network | 10.1.0.4, 172.24.4.21 |
| progress | 0 |
| security_groups | default |
| status | REBUILD |
| tenant_id | a026cc3108044c60a593c9ce9dee89ab |
| updated | 2013-12-06T13:22:58Z |
| user_id | 492847cb43d34ee889a8c3b9fe1185b2 |
+--------------------------------------+----------------------------------------------------------------+

$ nova list
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+
| 9031bf8a-49e1-4835-bc75-86e900397136 | server | ERROR | None | Running | private=10.1.0.4, 172.24.4.21 |
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+

Server in error state

description: updated
Revision history for this message
Attila Fazekas (afazekas) wrote :

May be important fact, the above operations are done as admin, but the public network belongs to the 'demo' user.

As demo user the above series are working.

If this is permission issue, maybe one of the operations needs to be denied even before the first boot,
if it ok in permission view point the rebuild needs to be successful as well.

Revision history for this message
Attila Fazekas (afazekas) wrote :

s/the public network/the private network/

May be important fact, the above operations are done as admin, but the PRIVATE network belongs to the 'demo' user.

As demo user the above series are working.

If this is permission issue, maybe one of the operations needs to be denied even before the first boot,
if it ok in permission view point the rebuild needs to be successful as well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.