use -c onelab -c onelab-vserver to turn into vserver-based config
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 21 Dec 2007 16:15:21 +0000 (16:15 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 21 Dec 2007 16:15:21 +0000 (16:15 +0000)
system/config-onelab-vserver.py [new file with mode: 0644]

diff --git a/system/config-onelab-vserver.py b/system/config-onelab-vserver.py
new file mode 100644 (file)
index 0000000..700b320
--- /dev/null
@@ -0,0 +1,21 @@
+available = [ ('vbuild1.inria.fr','138.96.250.131'),
+              ('vbuild2.inria.fr','138.96.250.132'),
+              ('vbuild3.inria.fr','138.96.250.133'),
+              ('vbuild4.inria.fr','138.96.250.134'),
+              ]
+
+def config (plcs,options):
+    available.reverse()
+    for plc in plcs:
+        # get next slot -- xxx shoud check for running ones
+        (name,ip)=available.pop()
+        plc['vservername']=name
+        plc['vserverip']=ip
+        for key in [ 'PLC_DB_HOST',
+                     'PLC_API_HOST',
+                     'PLC_WWW_HOST',
+                     'PLC_BOOT_HOST',
+                     ]:
+            plc[key] = name
+
+    return plcs