bosh_aws_cpi 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/cloud/aws/cloud.rb +6 -5
- data/lib/cloud/aws/instance_manager.rb +29 -0
- data/lib/cloud/aws/spot_manager.rb +4 -0
- data/lib/cloud/aws/stemcell_creator.rb +19 -19
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51b0fde31ccef32f21fe160d8e6ae7be77368530
|
4
|
+
data.tar.gz: e3b8224c4f39a0d63b64baf7efdb6b9dcc3e8d8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73e29668c5edcb7e6c2101d040cafb22947262397e2976175b40bce7f38fe9d174deccc52a3550aa4c9a5cd2fa325881e9a84a99271cdc88217d27277566fc45
|
7
|
+
data.tar.gz: fa984ef1fa766aa9945260e513781846e71957fabcebcde03e0249e8a9582641b2bb6912f296eb81706bff5e371d15659073f8eb3b19d662111fba1bf7f19a58
|
data/README.md
CHANGED
@@ -63,6 +63,11 @@ These options are specified under `cloud_options` in the `resource_pools` sectio
|
|
63
63
|
the [AWS spot instance](http://aws.amazon.com/ec2/purchasing-options/spot-instances/) bid price to use. When specified spot instances are started rather than on demand instances. _NB: this will dramatically slow down resource pool creation._
|
64
64
|
* `iam_instance_profile` (optional)
|
65
65
|
the [IAM Instance Profile](http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-usingrole-instanceprofile.html) to use for the instance. This allows EC2 instances to use [IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) when working with AWS APIs.
|
66
|
+
* `root_disk` (optional)
|
67
|
+
* `size` (required)
|
68
|
+
the size (in MB) of the root disk if a different size is needed than the default size built into the stemcell.
|
69
|
+
* `type` (optional)
|
70
|
+
the type of the root disk if a different type is needed than 'standard'
|
66
71
|
|
67
72
|
### Network options
|
68
73
|
|
@@ -106,7 +111,9 @@ This is a sample of how AWS specific properties are used in a BOSH deployment ma
|
|
106
111
|
version: latest
|
107
112
|
cloud_properties:
|
108
113
|
instance_type: m1.small
|
109
|
-
|
114
|
+
root_disk:
|
115
|
+
size: 11_264
|
116
|
+
type: gp2
|
110
117
|
...
|
111
118
|
|
112
119
|
properties:
|
data/lib/cloud/aws/cloud.rb
CHANGED
@@ -156,10 +156,6 @@ module Bosh::AwsCloud
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
-
def default_ec2_endpoint
|
160
|
-
['ec2', aws_region, 'amazonaws.com'].compact.join('.')
|
161
|
-
end
|
162
|
-
|
163
159
|
def default_elb_endpoint
|
164
160
|
['elasticloadbalancing', aws_region, 'amazonaws.com'].compact.join('.')
|
165
161
|
end
|
@@ -563,6 +559,11 @@ module Bosh::AwsCloud
|
|
563
559
|
attr_reader :az_selector
|
564
560
|
attr_reader :region
|
565
561
|
|
562
|
+
def default_ec2_endpoint
|
563
|
+
region_suffix = (aws_region && aws_region.start_with?('cn')) ? 'cn' : nil
|
564
|
+
['ec2', aws_region, 'amazonaws.com', region_suffix].compact.join('.')
|
565
|
+
end
|
566
|
+
|
566
567
|
def agent_properties
|
567
568
|
@agent_properties ||= options.fetch('agent', {})
|
568
569
|
end
|
@@ -572,7 +573,7 @@ module Bosh::AwsCloud
|
|
572
573
|
end
|
573
574
|
|
574
575
|
def aws_region
|
575
|
-
@aws_region ||= aws_properties.fetch('region'
|
576
|
+
@aws_region ||= aws_properties.fetch('region')
|
576
577
|
end
|
577
578
|
|
578
579
|
def fast_path_delete?
|
@@ -201,6 +201,35 @@ module Bosh::AwsCloud
|
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
|
+
if(resource_pool.has_key?("root_disk"))
|
205
|
+
|
206
|
+
if resource_pool["root_disk"]["size"].nil?
|
207
|
+
raise Bosh::Clouds::CloudError, "root_disk block provided without size"
|
208
|
+
end
|
209
|
+
|
210
|
+
root_disk_size_in_mb = resource_pool["root_disk"]['size']
|
211
|
+
root_disk_type = resource_pool["root_disk"].fetch('type', 'standard')
|
212
|
+
|
213
|
+
root_device = {
|
214
|
+
:volume_size => (root_disk_size_in_mb / 1024.0).ceil,
|
215
|
+
:volume_type => root_disk_type,
|
216
|
+
:delete_on_termination => true
|
217
|
+
}
|
218
|
+
|
219
|
+
if virtualization_type == :hvm
|
220
|
+
block_device_mapping_param << {
|
221
|
+
device_name: "/dev/xvda",
|
222
|
+
ebs: root_device
|
223
|
+
}
|
224
|
+
else
|
225
|
+
block_device_mapping_param << {
|
226
|
+
device_name: "/dev/sda",
|
227
|
+
ebs: root_device
|
228
|
+
}
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
|
204
233
|
block_device_mapping_param
|
205
234
|
end
|
206
235
|
|
@@ -85,6 +85,10 @@ module Bosh::AwsCloud
|
|
85
85
|
spec[:launch_specification][:network_interfaces][0][:groups] = security_groups
|
86
86
|
end
|
87
87
|
|
88
|
+
if instance_params[:block_device_mappings]
|
89
|
+
spec[:launch_specification][:block_device_mappings] = instance_params[:block_device_mappings]
|
90
|
+
end
|
91
|
+
|
88
92
|
spec
|
89
93
|
end
|
90
94
|
|
@@ -22,7 +22,7 @@ module Bosh::AwsCloud
|
|
22
22
|
ResourceWait.for_snapshot(snapshot: snapshot, state: :completed)
|
23
23
|
|
24
24
|
params = image_params(snapshot.id)
|
25
|
-
image = region.images.
|
25
|
+
image = region.images[region.client.register_image(params).image_id]
|
26
26
|
ResourceWait.for_image(image: image, state: :available)
|
27
27
|
|
28
28
|
TagManager.tag(image, 'Name', params[:description]) if params[:description]
|
@@ -90,11 +90,14 @@ module Bosh::AwsCloud
|
|
90
90
|
:virtualization_type => virtualization_type,
|
91
91
|
:root_device_name => "/dev/xvda",
|
92
92
|
:sriov_net_support => "simple",
|
93
|
-
:block_device_mappings =>
|
94
|
-
|
95
|
-
:
|
96
|
-
|
97
|
-
|
93
|
+
:block_device_mappings => [
|
94
|
+
{
|
95
|
+
:device_name => "/dev/xvda",
|
96
|
+
:ebs => {
|
97
|
+
:snapshot_id => snapshot_id,
|
98
|
+
},
|
99
|
+
},
|
100
|
+
],
|
98
101
|
}
|
99
102
|
else
|
100
103
|
root_device_name = stemcell_properties["root_device_name"]
|
@@ -103,11 +106,14 @@ module Bosh::AwsCloud
|
|
103
106
|
{
|
104
107
|
:kernel_id => aki,
|
105
108
|
:root_device_name => root_device_name,
|
106
|
-
:block_device_mappings =>
|
107
|
-
|
108
|
-
:
|
109
|
-
|
110
|
-
|
109
|
+
:block_device_mappings => [
|
110
|
+
{
|
111
|
+
:device_name => "/dev/sda",
|
112
|
+
:ebs => {
|
113
|
+
:snapshot_id => snapshot_id,
|
114
|
+
},
|
115
|
+
},
|
116
|
+
],
|
111
117
|
}
|
112
118
|
end
|
113
119
|
|
@@ -121,7 +127,8 @@ module Bosh::AwsCloud
|
|
121
127
|
:name => "BOSH-#{SecureRandom.uuid}",
|
122
128
|
:architecture => architecture,
|
123
129
|
)
|
124
|
-
|
130
|
+
|
131
|
+
params[:block_device_mappings].push(*default_ephemeral_disk_mapping)
|
125
132
|
|
126
133
|
params
|
127
134
|
end
|
@@ -129,12 +136,5 @@ module Bosh::AwsCloud
|
|
129
136
|
def logger
|
130
137
|
Bosh::Clouds::Config.logger
|
131
138
|
end
|
132
|
-
|
133
|
-
# adapts the format of the default ephemeral mapping used by create_vm so it
|
134
|
-
# works with the create AMI, and inserts it into the given hash
|
135
|
-
def merge_default_ephemeral_mapping_for_create_disk(params)
|
136
|
-
ephemeral_mapping = default_ephemeral_disk_mapping[0]
|
137
|
-
params[:block_device_mappings][ephemeral_mapping[:device_name]] = ephemeral_mapping[:virtual_name]
|
138
|
-
end
|
139
139
|
end
|
140
140
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_aws_cpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.2.
|
150
|
+
rubygems_version: 2.2.2
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: BOSH AWS CPI
|