summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-06-24 18:29:01 -0500
committerTrey Morris <trey.morris@rackspace.com>2011-06-24 18:29:01 -0500
commitce3399b8220376cafef7e54534ce54096837b1fc (patch)
treebed6213ffba8c6638aaf5f4413aad6415e3ca0ed
parentcd54be394d9b0807b68579b4630bf4c48738c506 (diff)
downloadnova-ce3399b8220376cafef7e54534ce54096837b1fc.tar.gz
nova-ce3399b8220376cafef7e54534ce54096837b1fc.tar.xz
nova-ce3399b8220376cafef7e54534ce54096837b1fc.zip
configure number of attempts to create unique mac address
-rw-r--r--nova/network/manager.py8
1 files 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