From: Neil Jerram Date: Wed, 2 Sep 2015 14:14:30 +0000 (+0100) Subject: DHCP agent: log when reloading allocations for a new VM port X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b9cebd18cfc1c4fa0a221d4d2518f7f94d6fc938;p=openstack-build%2Fneutron-build.git DHCP agent: log when reloading allocations for a new VM port This will help us to see more clearly if failing DHCP for a new VM - as seen in failures such as the following traceback from [1] - is caused by DHCP configuration being too slow, as suggested by the referenced bug. Traceback (most recent call last): File "/home/aqua/tempest/tempest/test.py", line 125, in wrapper return f(self, *func_args, **func_kwargs) File "/home/aqua/tempest/tempest/scenario/test_server_basic_ops_38.py", line 105, in test_server_basicops self.verify_ssh() File "/home/aqua/tempest/tempest/scenario/test_server_basic_ops_38.py", line 95, in verify_ssh private_key=self.keypair['private_key']) File "/home/aqua/tempest/tempest/scenario/manager.py", line 310, in get_remote_client linux_client.validate_authentication() File "/home/aqua/tempest/tempest/common/utils/linux/remote_client.py", line 55, in validate_authentication self.ssh_client.test_connection_auth() File "/home/aqua/tempest/tempest/common/ssh.py", line 150, in test_connection_auth connection = self._get_ssh_connection() File "/home/aqua/tempest/tempest/common/ssh.py", line 87, in _get_ssh_connection password=self.password) tempest.exceptions.SSHTimeout: Connection to the 172.17.205.21 via SSH timed out. User: cirros, Password: None [1] http://logs.openstack.org/39/194939/19/check/gate-grenade-dsvm-neutron/82a7e58/ Change-Id: I5d77762bf8d4caa2e6f8b3527a30bf80bac62085 Related-Bug: #1453350 --- diff --git a/neutron/agent/dhcp/agent.py b/neutron/agent/dhcp/agent.py index dead17f48..33d45ed07 100644 --- a/neutron/agent/dhcp/agent.py +++ b/neutron/agent/dhcp/agent.py @@ -328,6 +328,8 @@ class DhcpAgent(manager.Manager): updated_port = dhcp.DictModel(payload['port']) network = self.cache.get_network_by_id(updated_port.network_id) if network: + LOG.info(_LI("Trigger reload_allocations for port %s"), + updated_port) driver_action = 'reload_allocations' if self._is_port_on_this_agent(updated_port): orig = self.cache.get_port_by_id(updated_port['id']) diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py index 2f3c87b6d..1ab813f66 100644 --- a/neutron/agent/linux/dhcp.py +++ b/neutron/agent/linux/dhcp.py @@ -96,6 +96,9 @@ class DictModel(dict): def __delattr__(self, name): del self[name] + def __str__(self): + return ("id=" + self.id + ", network_id=" + self.network_id) + class NetModel(DictModel):