diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-02 14:30:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-02 14:30:56 +0000 |
commit | f35cd43612f7d69bddde5929d6355a12c11410d0 (patch) | |
tree | e86d6030af383483d6c2d7cc09a076f230f5387b | |
parent | 4c5e2ef5e87d07945893f7e38d00a0325870549b (diff) | |
parent | ae3bb03699a4e27b8aafe31837180ca168efab49 (diff) | |
download | nova-f35cd43612f7d69bddde5929d6355a12c11410d0.tar.gz nova-f35cd43612f7d69bddde5929d6355a12c11410d0.tar.xz nova-f35cd43612f7d69bddde5929d6355a12c11410d0.zip |
Merge "Periodic update of DNS entries."
-rw-r--r-- | etc/nova/nova.conf.sample | 9 | ||||
-rw-r--r-- | nova/network/manager.py | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/etc/nova/nova.conf.sample b/etc/nova/nova.conf.sample index 2fdd612b4..c3c10239c 100644 --- a/etc/nova/nova.conf.sample +++ b/etc/nova/nova.conf.sample @@ -920,6 +920,15 @@ # l3_lib=nova.network.l3.LinuxNetL3 #### (StrOpt) Indicates underlying L3 management library +# update_dns_entries=false +#### (BoolOpt) 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 + +# dns_update_periodic_interval=-1 +#### (IntOpt) Number of periodic scheduler ticks to wait between runs of +#### updates to DNS entries + ######## defined in nova.network.quantumv2.api ######## diff --git a/nova/network/manager.py b/nova/network/manager.py index 5189b40c7..41b665ca4 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'), @@ -1946,6 +1950,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: |