Code review comment for lp:~tr3buchet/nova/multi_nic

Revision history for this message
Tushar Patil (tpatil) wrote :

virtual_interfaces records are deleted for a particular instance during terminating the instance but they are still referred in the release_fixed_ip method which is called by the dhcp-bridge when the ip is released and linux_net.py->update_dhcp method.

I see following error in the nova-network.log for following test case scenario
Steps
- Launch one vm instance
- Terminate the instance
- Launch a new instance again

nova-network.log
-----------------
{{{
2011-06-16 16:17:43,293 DEBUG nova.rpc [-] unpacked context: {'timestamp': u'2011-06-16T23:19:29Z', 'msg_id': u'15a226243f8346e18afafd2358f706fd', 'remote_address': u'10.2.3.150', 'project': u'admin', 'is_admin': True, 'user': u'admin', 'request_id': u'SSNF193QVKE0-0XIGHSF', 'read_deleted': False} from (pid=16612) _unpack_context /home/tpatil/nova/nova/rpc.py:445
2011-06-16 16:17:43,469 DEBUG nova.utils [-] Attempting to grab semaphore "dnsmasq_start" for method "update_dhcp"... from (pid=16612) inner /home/tpatil/nova/nova/utils.py:570
2011-06-16 16:17:43,484 ERROR nova [-] Exception during message handling
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/home/tpatil/nova/nova/rpc.py", line 232, in _process_data
(nova): TRACE: rval = node_func(context=ctxt, **node_args)
(nova): TRACE: File "/home/tpatil/nova/nova/network/manager.py", line 152, in _rpc_allocate_fixed_ip
(nova): TRACE: self.allocate_fixed_ip(context, instance_id, network)
(nova): TRACE: File "/home/tpatil/nova/nova/network/manager.py", line 806, in allocate_fixed_ip
(nova): TRACE: self.driver.update_dhcp(context, network['id'])
(nova): TRACE: File "/home/tpatil/nova/nova/utils.py", line 583, in inner
(nova): TRACE: retval = f(*args, **kwargs)
(nova): TRACE: File "/home/tpatil/nova/nova/network/linux_net.py", line 580, in update_dhcp
(nova): TRACE: f.write(get_dhcp_hosts(context, network_id))
(nova): TRACE: File "/home/tpatil/nova/nova/network/linux_net.py", line 561, in get_dhcp_hosts
(nova): TRACE: hosts.append(_host_dhcp(fixed_ip_ref))
(nova): TRACE: File "/home/tpatil/nova/nova/network/linux_net.py", line 670, in _host_dhcp
(nova): TRACE: return '%s,%s.%s,%s' % (fixed_ip_ref['virtual_interface']['address'],
(nova): TRACE: TypeError: 'NoneType' object is unsubscriptable
(nova): TRACE:
}}}

I think the virtual interfaces records should be deleted at the time of releasing the fixed IP address and not in the deallocate_for_instance method.

review: Needs Fixing

« Back to merge proposal