incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mry...@apache.org
Subject svn commit: r736718 - /incubator/tashi/trunk/scripts/create
Date Thu, 22 Jan 2009 17:13:25 GMT
Author: mryan3
Date: Thu Jan 22 09:13:24 2009
New Revision: 736718

URL: http://svn.apache.org/viewvc?rev=736718&view=rev
Log:
Modification of create script to automatically generate MAC addresses


Modified:
    incubator/tashi/trunk/scripts/create

Modified: incubator/tashi/trunk/scripts/create
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/scripts/create?rev=736718&r1=736717&r2=736718&view=diff
==============================================================================
--- incubator/tashi/trunk/scripts/create (original)
+++ incubator/tashi/trunk/scripts/create Thu Jan 22 09:13:24 2009
@@ -18,7 +18,9 @@
 # under the License.    
 
 if [[ $# -ne 4 ]]; then
-	echo "create <type> <image> <mac_1byte> <persistent>"
+	echo "create <name> <type> <image> <persistent>"
 else
-	./bin/createVm "Instance(d={'name':'foobar','type':$1,'disks':[DiskConfiguration(d={'uri':'$2','persistent':$4})],'nics':[NetworkConfiguration(d={'network':2,'mac':'52:54:00:00:10:$3'})],
'hints':{'display':'True'}})"
+	mac=`echo $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)) | awk '{printf("%2.2x:%2.2x:%2.2x",
$1, $2, $3)}'`
+	echo ./bin/createVm "Instance(d={'name':'$1','type':$2,'disks':[DiskConfiguration(d={'uri':'$3','persistent':$4})],'nics':[NetworkConfiguration(d={'network':2,'mac':'52:54:00:$mac'})],
'hints':{'display':'True'}})"
+	./bin/createVm "Instance(d={'name':'$1','type':$2,'disks':[DiskConfiguration(d={'uri':'$3','persistent':$4})],'nics':[NetworkConfiguration(d={'network':2,'mac':'52:54:00:$mac'})],
'hints':{'display':'True'}})"
 fi



Mime
View raw message