From 310ea2fe9d80e35c7c5854dc28278db786cc943d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 20 Dec 2017 10:14:07 -0800 Subject: [PATCH] Log unknown providers during quota calculation When determining quota usage for known nodes log cases where the provider config isn't known. One theory is that this can happen when launchers are restarted and that it is otherwise normal but without more information it is hard to know for sure. Log the node data when we hit this sutation so that we can dig in more and debug this. Change-Id: I466e64a999ebf867ada9462a0c00a90de4b70125 --- nodepool/driver/openstack/provider.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nodepool/driver/openstack/provider.py b/nodepool/driver/openstack/provider.py index c28e52399..7fb75f4f2 100755 --- a/nodepool/driver/openstack/provider.py +++ b/nodepool/driver/openstack/provider.py @@ -221,8 +221,16 @@ class OpenStackProvider(Provider): if node.provider == self.provider.name: if pool and not node.pool == pool.name: continue + provider_pool = self.provider.pools.get(node.pool) + if not provider_pool: + self.log.warning( + "Cannot find provider pool for node %s" % node) + # This node is in a funny state we log it for debugging + # but move on and don't account it as we can't properly + # calculate its cost without pool info. + continue node_resources = self.quotaNeededByNodeType( - node.type, self.provider.pools.get(node.pool)) + node.type, provider_pool) used_quota.add(node_resources) return used_quota