Use Vagrantfile to build virtual site
[icn.git] / deploy / metal3-vm / vm-setup / library / generate_macs.py
index f304c6f..d4f09fb 100644 (file)
@@ -15,6 +15,7 @@
 # generate_baremetal_macs method ripped from
 # openstack/tripleo-incubator/scripts/configure-vm
 
+import marshal
 import math
 import random
 
@@ -50,6 +51,10 @@ def generate_baremetal_macs(nodes, networks):
         raise ValueError("The MAX num of MACS supported is %i  "
                          "(you specified %i)." % (MAX_NUM_MACS, count))
 
+    # See the random number generator with the input so that MAC
+    # generation is idempotent.
+    random.seed(marshal.dumps(nodes + networks))
+
     base_nums = [0x00,
                  random.randint(0x00, 0xff),
                  random.randint(0x00, 0xff),