From ce3399b8220376cafef7e54534ce54096837b1fc Mon Sep 17 00:00:00 2001 From: Trey Morris Date: Fri, 24 Jun 2011 18:29:01 -0500 Subject: configure number of attempts to create unique mac address --- nova/network/manager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nova/network/manager.py b/nova/network/manager.py index a7aa49b57..36a4fa0ca 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -40,6 +40,8 @@ topologies. All of the network commands are issued to a subclass of is disassociated :fixed_ip_disassociate_timeout: Seconds after which a deallocated ip is disassociated +:create_unique_mac_address_attempts: Number of times to attempt creating + a unique mac address """ @@ -101,6 +103,8 @@ flags.DEFINE_bool('update_dhcp_on_disassociate', False, 'Whether to update dhcp when fixed_ip is disassociated') flags.DEFINE_integer('fixed_ip_disassociate_timeout', 600, 'Seconds after which a deallocated ip is disassociated') +flags.DEFINE_integer('create_unique_mac_address_atempts', 5, + 'Number of attempts to create unique mac address') flags.DEFINE_bool('use_ipv6', False, 'use the ipv6') @@ -452,8 +456,8 @@ class NetworkManager(manager.SchedulerDependentManager): vif = {'address': self.generate_mac_address(), 'instance_id': instance_id, 'network_id': network['id']} - # try 5 times to create a vif record with a unique mac_address - for i in range(5): + # try FLAG times to create a vif record with a unique mac_address + for i in range(FLAGS.create_unique_mac_address_attempts): try: self.db.virtual_interface_create(context, vif) break -- cgit