Merge branch 'master' of ssh://git.onelab.eu/git/tests
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 16 Apr 2013 13:12:27 +0000 (15:12 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 16 Apr 2013 13:12:27 +0000 (15:12 +0200)
system/LocalSubstrate.inria.py
system/lxc-driver.sh

index f0712ce..1f7538c 100755 (executable)
@@ -30,8 +30,8 @@ class OnelabSubstrate (Substrate):
    # the lxc-capable box for PLCs
    def plc_lxc_boxes_spec (self):
       return [ 
-#         ('gotan', 30),         # how many plcs max in this box 
-         ('deathvegas', 30),    
+         ('gotan', 30),         # how many plcs max in this box 
+#         ('deathvegas', 30),    
          ]  
 
    # vplc01 to 40
index 4dbb30d..36d4f98 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/bash
 
+path=/vservers
+
 function sense_all () {
     virsh -c lxc:// list | grep running | while read line; do
         pid=$(echo $line | cut -d' ' -f1)
         lxc_name=$(echo $line | cut -d' ' -f2)
-        timestamp=$(cat /var/lib/lxc/$lxc_name/$lxc_name.timestamp)
+        timestamp=$(cat $path/$lxc_name/$lxc_name.timestamp)
         echo "$lxc_name;$pid;$timestamp" 
     done  
 }
@@ -28,7 +30,7 @@ function sense_lxc () {
     lxc_name=$1; shift
     if [ "$(virsh -c lxc:// dominfo $lxc_name | grep State| cut -d' ' -f11)" == "running" ] ; then
        pid=$(virsh -c lxc:// dominfo $lxc_name| grep Id | cut -d' ' -f14)
-       timestamp=$(cat /var/lib/lxc/$lxc_name/$lxc_name.timestamp)
+       timestamp=$(cat $path/$lxc_name/$lxc_name.timestamp)
        echo "$lxc_name;$pid;$timestamp"
     fi
 }
@@ -68,7 +70,7 @@ function destroy_all () {
     virsh -c lxc:// list --all | while read line; do
         lxc_name=$(echo $line | cut -d' ' -f2)
         virsh -c lxc:// undefine $lxc_name
-        rm -fr /var/lib/lxc/$lxc_name 
+        rm -fr $path/$lxc_name 
     done
 }
 
@@ -77,7 +79,7 @@ function destroy_lxc () {
     lxc_name=$1; shift
     stop_lxc $lxc_name
     virsh -c lxc:// undefine $lxc_name
-    rm -fr /var/lib/lxc/$lxc_name
+    rm -fr $path/$lxc_name
 }
 
 function usage () {