]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
DHCP agent: log when reloading allocations for a new VM port
authorNeil Jerram <Neil.Jerram@metaswitch.com>
Wed, 2 Sep 2015 14:14:30 +0000 (15:14 +0100)
committerNeil Jerram <Neil.Jerram@metaswitch.com>
Wed, 28 Oct 2015 03:17:13 +0000 (03:17 +0000)
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

neutron/agent/dhcp/agent.py
neutron/agent/linux/dhcp.py

index dead17f489160aaf8b86293e41258546780b21ce..33d45ed07abc3540ed3a032ea472fd949d9b1672 100644 (file)
@@ -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'])
index 2f3c87b6dd1be4dd20eaa0d10dbcb5c50b081f01..1ab813f66c400798586a22aabadb1a8d9b3b56b6 100644 (file)
@@ -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):