[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. d307dbb3fc1ce1ed1ef76b590710d1ec6f32cc35

Steffen Moeller steffen_moeller at gmx.de
Thu Jul 9 00:35:15 UTC 2009


The following commit has been merged in the master branch:
commit d307dbb3fc1ce1ed1ef76b590710d1ec6f32cc35
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date:   Thu Jul 9 02:34:45 2009 +0200

    Correction to completely ignore existing drives.

diff --git a/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl b/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl
index 4998280..006c054 100644
--- a/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl
+++ b/VMBuilder/plugins/virtualbox/templates/vm_deploy_script.tmpl
@@ -28,28 +28,23 @@ else
 	VBoxManage createvm -name $vm_name -ostype \$os_type -register
 fi
 
+sata=""
+if ! VBoxManage --version | grep -q "_OSE"; then sata="-sata on"; fi
 
 # FIXME: test on identity needs improvement
 #set $i = 0
 #for $disk in $vm_disks
     #set $i = $i + 1
     #set $disk = os.path.basename(disk)
-if VBoxManage list hdds; egrep '^Location:.*$disk\$'; then
-	echo "Disk '$disk' is already known to the system. Skipping HD creation."
+if VBoxManage list hdds | egrep '^Location:.*$disk\$'; then
+	echo "Disk '$disk' is already known to the system. Leaving it in original state."
 else
 	VBoxManage openmedium disk \${disk_path}/$disk -type normal
-fi
-#end for
 
-sata=""
-if ! VBoxManage --version | grep -q "_OSE"; then sata="-sata on"; fi
-VBoxManage modifyvm $vm_name -memory $memory \${sata} #slurp
-#set $i = 0
-#for $disk in $vm_disks
-    #set $i = $i + 1
-    #set $disk = os.path.basename(disk)
+	VBoxManage modifyvm $vm_name -memory $memory \${sata} #slurp
+
     #if $i >= 31
-    	#break
+    	#continue
     #end if
     #if $i == 1
     	-hda \${disk_path}/$disk #slurp
@@ -61,6 +56,8 @@ VBoxManage modifyvm $vm_name -memory $memory \${sata} #slurp
         -sataport${i} \${disk_path}/$disk #slurp
     #end if
 #end for
+fi
+#end for
 
 #if $mac
 VBoxManage modifyvm $vm_name -macaddress1 $mac

-- 
Tool for creating VM images.



More information about the Pkg-escience-soc2009 mailing list