1 |
|
# |
2 |
|
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit |
3 |
|
# |
4 |
|
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012 |
5 |
|
# |
6 |
|
# License GPL Version 3 |
7 |
|
# |
8 |
|
# The research leading to these results has received funding from |
9 |
|
# the European Community's Seventh Frameqork Programme (FP7/2007-2013) |
10 |
|
# under agreement number 257386 |
11 |
|
# |
12 |
|
# This software is provided with ABSOLUTELY NO WARRANTY |
13 |
|
# |
14 |
require 'rubygems' |
require 'rubygems' |
15 |
require 'restfully' |
require 'restfully' |
16 |
require 'restfully/addons/bonfire' |
require 'restfully/addons/bonfire' |
17 |
|
|
18 |
##Editable parameters |
##Editable parameters |
19 |
SIZES = "1,2" #Comma separated list of volume sizes in GB |
#SIZES = "1,2" #Comma separated list of volume sizes in GB |
20 |
|
SIZES = "1" #Comma separated list of volume sizes in GB |
21 |
#LOCATION = "de-hlrs" |
#LOCATION = "de-hlrs" |
22 |
LOCATION = "fr-inria" |
LOCATION = "fr-inria" |
23 |
#LOCATION = "uk-epcc" |
#LOCATION = "uk-epcc" |
55 |
def create_volume(session, location, size) |
def create_volume(session, location, size) |
56 |
session.logger.info "Deploying volume on #{location['name']}..." |
session.logger.info "Deploying volume on #{location['name']}..." |
57 |
return location.storages.find{|storage| |
return location.storages.find{|storage| |
58 |
storage['name'] == "volume-#{size}GB-empty" |
storage['name'].include?"volume-#{size}GB-empty" |
59 |
} || location.storages.submit( |
} || location.storages.submit( |
60 |
:name => "volume-#{size}GB-empty", |
:name => "volume-#{size}GB-empty", |
61 |
:size => size*1024, |
:size => size*1024, |