summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorÉdouard Thuleau <edouard.thuleau@orange.com>2012-12-04 17:06:23 +0100
committerÉdouard Thuleau <edouard.thuleau@orange.com>2012-12-28 17:05:30 +0100
commitae3bb03699a4e27b8aafe31837180ca168efab49 (patch)
treef8458c6fdf847221430dfa2f6fc4a48ff4b1ea37 /nova
parent32eb83be79ff19e06b5057dce32052b98368ce40 (diff)
downloadnova-ae3bb03699a4e27b8aafe31837180ca168efab49.tar.gz
nova-ae3bb03699a4e27b8aafe31837180ca168efab49.tar.xz
nova-ae3bb03699a4e27b8aafe31837180ca168efab49.zip
Periodic update of DNS entries.
The new DNS mechanism to resolve instance names on private network with multi hosted mode doesn't scale. This patch add the possibility to update the DNS entries periodically on each network host in addition to fanout cast each time the DNS entries need to be updated. DocImpact: new config options Fixes LP bug #1086026 Change-Id: I59094a29c9f5010f5e55a6f11160263337b058b2
Diffstat (limited to 'nova')
-rw-r--r--nova/network/manager.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py
index 97d4fa10d..f4d45d8ee 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -170,6 +170,10 @@ network_opts = [
help='If True, when a DNS entry must be updated, it sends a '
'fanout cast to all network hosts to update their DNS '
'entries in multi host mode'),
+ cfg.IntOpt("dns_update_periodic_interval",
+ default=-1,
+ help='Number of periodic scheduler ticks to wait between '
+ 'runs of updates to DNS entries.'),
cfg.StrOpt('dhcp_domain',
default='novalocal',
help='domain to use for building the hostnames'),
@@ -1943,6 +1947,15 @@ class NetworkManager(manager.SchedulerDependentManager):
return self.db.virtual_interface_get_by_address(context,
mac_address)
+ @manager.periodic_task(
+ ticks_between_runs=CONF.dns_update_periodic_interval)
+ def _periodic_update_dns(self, context):
+ """Update local DNS entries of all networks on this host"""
+ networks = self.db.network_get_all_by_host(context, self.host)
+ for network in networks:
+ dev = self.driver.get_dev(network)
+ self.driver.update_dns(context, dev, network)
+
def update_dns(self, context, network_ids):
"""Called when fixed IP is allocated or deallocated"""
if CONF.fake_network: