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

Annotation of /virt-cluster/create_vcoc_json.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download) (as text)

1 : agomez 1 #!/bin/bash
2 :    
3 :     #
4 :     # Before you use this script, you must configure restfully
5 :     #
6 :    
7 :     #
8 :     # Get the username from the restfully configuration.
9 :     #
10 :     USER=`grep user ~/.restfully/api.bonfire-project.eu.yml | cut -f2 -d:`
11 :     USER=`echo $USER`
12 :    
13 :     #
14 :     # Where the JSON file is saved
15 :     #
16 :     FILE=../examples/vcoc.json
17 :    
18 :     #
19 :     # Version
20 :     #
21 :     VERSION=0.1
22 :    
23 :    
24 :     #
25 :     # Now Create the JSON file
26 :     #
27 :     echo { > $FILE
28 :     echo \"name\": \"Virtual Cluster Demo Experiment\", >> $FILE
29 :     echo \"description\": \"Demo Virtual Cluster\", >> $FILE
30 :    
31 :     #
32 :     # Minutes for the experiment
33 :     #
34 :     echo \"duration\": 180, >> $FILE
35 :     echo \"resources\": [ >> $FILE
36 :     echo { >> $FILE
37 :    
38 :     #
39 :     # The master of the custer is defined
40 :     # It includes the master defined VM plus an additional storage
41 :     # You must create both before execute this script using:
42 :     # Master VM: build-master.rb
43 :     # Storage : build-storages.rb
44 :     #
45 :     echo " " \"compute\": { >> $FILE
46 :     echo " " \"name\": \"master\", >> $FILE
47 :     echo " " \"description\": \"Virtual Cluster Master\", >> $FILE
48 :     echo " " \"instanceType\": \"small\", >> $FILE
49 :     echo " " \"locations\": [\"fr-inria\"], >> $FILE
50 :     echo " " \"resources\": [ >> $FILE
51 :     echo " " { \"storage\": \"@VirtualClusterMaster-vcocdemo-v${VERSION}\"}, >> $FILE
52 :     echo " " { \"storage\": \"@${USER}_volume-1GB-empty\"}, >> $FILE
53 :     echo " " { \"network\": \"@BonFIRE WAN\"} >> $FILE
54 :     echo " " ], >> $FILE
55 :     echo " " \"contexts\": [ >> $FILE
56 :     echo " " { >> $FILE
57 :     echo " " } >> $FILE
58 :     echo " "] >> $FILE
59 :     echo " " } >> $FILE
60 :     echo }, >> $FILE
61 :    
62 :     #
63 :     # Now, the compute element is added
64 :     #
65 :     # Previously, you must execute the build-client.rb script, so VM image is ready.
66 :     #
67 :     echo { >> $FILE
68 :     echo " " \"compute\": { >> $FILE
69 :     echo " " \"name\": \"client\", >> $FILE
70 :     echo " " \"description\": \"Virtual Cluster Client\", >> $FILE
71 :     echo " " \"instanceType\": \"small\", >> $FILE
72 :     echo " " \"locations\": [\"fr-inria\"], >> $FILE
73 :     echo " " \"resources\": [ >> $FILE
74 :     echo " " { \"storage\": \"@VirtualClusterClient-vcocdemo-v${VERSION}\"}, >> $FILE
75 :     echo " " { \"network\": \"@BonFIRE WAN\"} >> $FILE
76 :     echo " " ], >> $FILE
77 :     echo " " \"contexts\": [ >> $FILE
78 :     echo " " { >> $FILE
79 :     echo " " } >> $FILE
80 :     echo " " ] >> $FILE
81 :     echo " " } >> $FILE
82 :     echo } >> $FILE
83 :     echo ] >> $FILE
84 :     echo } >> $FILE
85 :     echo >> $FILE
86 :    
87 :    
88 :     echo JSON file $FILE has been created

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

Powered By FusionForge