Log In | Get Help   
Home My Page Projects Code Snippets Project Openings BonFIRE VCOC Demonstration Kit
Summary Activity SCM Files Wiki
[bonfiredemokit] View of /virt-cluster/create_vcoc_json.sh
[bonfiredemokit] / virt-cluster / create_vcoc_json.sh Repository:
ViewVC logotype

View of /virt-cluster/create_vcoc_json.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (as text) (annotate)
Mon Aug 27 11:46:35 2012 UTC (11 years, 10 months ago) by agomez
File size: 2665 byte(s)
#!/bin/bash

#
# Before you use this script, you must configure restfully
#

#
# Get the username from the restfully configuration.
#
USER=`grep user ~/.restfully/api.bonfire-project.eu.yml | cut -f2 -d:`
USER=`echo $USER`

#
# Where the JSON file is saved
#
FILE=../examples/vcoc.json

#
# Version
#
VERSION=0.1


#
# Now Create the JSON file
#
echo { > $FILE 
echo \"name\": \"Virtual Cluster Demo Experiment\", >> $FILE
echo \"description\": \"Demo Virtual Cluster\", >> $FILE

#
# Minutes for the experiment
#
echo \"duration\": 180, >> $FILE
echo \"resources\": [ >> $FILE
echo { >> $FILE

#
# The master of the custer is defined
# It includes the master defined VM plus an additional storage
# You must create both before execute this script using:
#     Master VM: build-master.rb
#     Storage : build-storages.rb
#
echo "   " \"compute\": { >> $FILE
echo "          " \"name\": \"master\", >> $FILE
echo "          " \"description\": \"Virtual Cluster Master\", >> $FILE
echo "          " \"instanceType\": \"small\", >> $FILE
echo "          " \"locations\": [\"fr-inria\"], >> $FILE
echo "          " \"resources\": [ >> $FILE
echo "                         " { \"storage\": \"@VirtualClusterMaster-vcocdemo-v${VERSION}\"}, >> $FILE
echo "                         " { \"storage\": \"@${USER}_volume-1GB-empty\"}, >> $FILE
echo "                         " { \"network\": \"@BonFIRE WAN\"} >> $FILE
echo "                         "  ], >> $FILE
echo "          " \"contexts\": [ >> $FILE
echo "                          " { >> $FILE
echo "                          " } >> $FILE
echo "                         "] >> $FILE
echo "                " } >> $FILE
echo }, >> $FILE

#
# Now, the compute element is added
#
# Previously, you must execute the build-client.rb script, so VM image is ready.
#
echo { >> $FILE
echo "   " \"compute\": { >> $FILE
echo "          " \"name\": \"client\", >> $FILE
echo "          " \"description\": \"Virtual Cluster Client\", >> $FILE
echo "          " \"instanceType\": \"small\", >> $FILE
echo "          " \"locations\": [\"fr-inria\"], >> $FILE
echo "          " \"resources\": [ >> $FILE
echo "                        " { \"storage\": \"@VirtualClusterClient-vcocdemo-v${VERSION}\"}, >> $FILE
echo "                        " { \"network\": \"@BonFIRE WAN\"} >> $FILE
echo "                        " ], >> $FILE
echo "          " \"contexts\": [ >> $FILE
echo "                        " { >> $FILE
echo "                        " } >> $FILE
echo "                        " ] >> $FILE
echo "          " } >> $FILE
echo } >> $FILE
 echo ] >> $FILE
echo } >> $FILE
 echo >> $FILE 


echo JSON file $FILE has been created

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge