This repository was archived by the owner on Jan 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathec2-cloud.groovy
More file actions
266 lines (214 loc) · 8.99 KB
/
ec2-cloud.groovy
File metadata and controls
266 lines (214 loc) · 8.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/***************
* Cloud configuration file for the Amazon ec2 cloud. Uses the default jclouds-based cloud driver.
* See org.cloudifysource.dsl.cloud.Cloud for more details.
* @author barakme
*
*/
cloud {
// Mandatory. The name of the cloud, as it will appear in the Cloudify UI.
name = "ec2"
/********
* General configuration information about the cloud driver implementation.
*/
configuration {
// Optional. The cloud implementation class. Defaults to the build in jclouds-based provisioning driver.
className "org.cloudifysource.esc.driver.provisioning.jclouds.DefaultProvisioningDriver"
storageClassName "org.cloudifysource.esc.driver.provisioning.storage.aws.EbsStorageDriver"
// Optional. The template name for the management machines. Defaults to the first template in the templates section below.
managementMachineTemplate "SMALL_LINUX"
// Optional. Indicates whether internal cluster communications should use the machine private IP. Defaults to true.
connectToPrivateIp true
// Optional. Path to folder where management state will be written. Null indicates state will not be written.
persistentStoragePath persistencePath
}
/*************
* Provider specific information.
*/
provider {
// Mandatory. The name of the provider.
// When using the default cloud driver, maps to the Compute Service Context provider name.
provider "aws-ec2"
// Optional. The HTTP/S URL where cloudify can be downloaded from by newly started machines. Defaults to downloading the
// cloudify version matching that of the client from the cloudify CDN.
// Change this if your compute nodes do not have access to an internet connection, or if you prefer to use a
// different HTTP server instead.
// IMPORTANT: the default linux bootstrap script appends '.tar.gz' to the url whereas the default windows script appends '.zip'.
// Therefore, if setting a custom URL, make sure to leave out the suffix.
// cloudifyUrl "http://repository.cloudifysource.org/org/cloudifysource/2.6.0-5000-RELEASE/gigaspaces-cloudify-2.6.0-ga-b5000.zip"
// Mandatory. The prefix for new machines started for servies.
machineNamePrefix "cloudify-agent-"
// Optional. Defaults to true. Specifies whether cloudify should try to deploy services on the management machine.
// Do not change this unless you know EXACTLY what you are doing.
//
managementOnlyFiles ([])
// Optional. Logging level for the intenal cloud provider logger. Defaults to INFO.
sshLoggingLevel "WARNING"
// Mandatory. Name of the new machine/s started as cloudify management machines. Names are case-insensitive.
managementGroup "cloudify-manager"
// Mandatory. Number of management machines to start on bootstrap-cloud. In production, should be 2. Can be 1 for dev.
numberOfManagementMachines 1
reservedMemoryCapacityPerMachineInMB 1024
}
/*************
* Cloud authentication information
*/
user {
// Optional. Identity used to access cloud.
// When used with the default driver, maps to the identity used to create the ComputeServiceContext.
user user
// Optional. Key used to access cloud.
// When used with the default driver, maps to the credential used to create the ComputeServiceContext.
apiKey apiKey
}
cloudStorage {
templates ([
SMALL_BLOCK : storageTemplate{
deleteOnExit true
size 5
path "/storage"
namePrefix "cloudify-storage-volume"
deviceName "/dev/sdc"
fileSystemType "ext4"
custom ([:])
}
])
}
cloudCompute {
/***********
* Cloud machine templates available with this cloud.
*/
templates ([
// Mandatory. Template Name.
SMALL_LINUX : computeTemplate{
// Mandatory. Image ID.
imageId linuxImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ec2-user/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 1600
// Mandatory. Hardware ID.
hardwareId hardwareId
// Optional. Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
username "ec2-user"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroups" : ["default"]as String[],
"keyPair" : keyPair
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides (["jclouds.ec2.ami-query":"",
"jclouds.ec2.cc-ami-query":""])
// enable sudo.
privileged true
},
MEDIUM_LINUX : computeTemplate{
// Mandatory. Image ID.
imageId linuxImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ec2-user/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 3500
// Mandatory. Hardware ID.
hardwareId "m1.medium"
// Optional. Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
username "ec2-user"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroups" : ["default"]as String[],
"keyPair" : keyPair
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides (["jclouds.ec2.ami-query":"",
"jclouds.ec2.cc-ami-query":""])
// enable sudo.
privileged true
},
SMALL_UBUNTU : computeTemplate{
// Mandatory. Image ID.
imageId ubuntuImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ubuntu/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 1600
// Mandatory. Hardware ID.
hardwareId hardwareId
// Optional. Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
username "ubuntu"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroups" : ["default"]as String[],
"keyPair" : keyPair
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides (["jclouds.ec2.ami-query":"",
"jclouds.ec2.cc-ami-query":""])
// enable sudo.
privileged true
},
MEDIUM_UBUNTU : computeTemplate{
// Mandatory. Image ID.
imageId ubuntuImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ubuntu/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 3500
// Mandatory. Hardware ID.
hardwareId hardwareId
// Optional. Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
username "ubuntu"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroups" : ["default"]as String[],
"keyPair" : keyPair
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides (["jclouds.ec2.ami-query":"",
"jclouds.ec2.cc-ami-query":""])
// enable sudo.
privileged true
}
])
}
/*****************
* Optional. Custom properties used to extend existing drivers or create new ones.
*/
custom ([
"org.cloudifysource.clearRemoteDirectoryOnStart" : true
])
}