bosh_aws_cpi 1.2697.0 → 1.2707.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloud/aws/cloud.rb +23 -7
- data/lib/cloud/aws/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49712bfb2cf1a45d7b3a3c1fe0258d45229c2b81
|
4
|
+
data.tar.gz: 1386c0d88b30296aa1e6f87ba08e154c6b88b9a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c2970c3411a408e2b1ceb5acc0ea3f278ddea3ecb0868db77297317a8f083ea78250dc529ab17313584cf1617dea384df44713ccddce670c24a5b1394d3e12
|
7
|
+
data.tar.gz: 0620ce9fd27fbe8cda976d19e5d176ed72571bad6b3868e10acc7d6fce382b05f3ef75712738e5503f588284ccdbcd7152aee73f83f788316dbe948f21bbc8e0
|
data/lib/cloud/aws/cloud.rb
CHANGED
@@ -162,13 +162,23 @@ module Bosh::AwsCloud
|
|
162
162
|
# @param [optional, String] instance_id EC2 instance id
|
163
163
|
# of the VM that this disk will be attached to
|
164
164
|
# @return [String] created EBS volume id
|
165
|
-
def create_disk(size, instance_id = nil)
|
165
|
+
def create_disk(size, cloud_properties, instance_id = nil)
|
166
166
|
with_thread_name("create_disk(#{size}, #{instance_id})") do
|
167
167
|
validate_disk_size(size)
|
168
168
|
|
169
|
+
if cloud_properties.has_key?('type')
|
170
|
+
validate_disk_type(cloud_properties['type'])
|
171
|
+
volume_type = cloud_properties['type']
|
172
|
+
else
|
173
|
+
volume_type = 'standard'
|
174
|
+
end
|
175
|
+
|
169
176
|
# if the disk is created for an instance, use the same availability zone as they must match
|
170
|
-
volume = @ec2.volumes.create(
|
171
|
-
|
177
|
+
volume = @ec2.volumes.create(
|
178
|
+
size: (size / 1024.0).ceil,
|
179
|
+
availability_zone: @az_selector.select_availability_zone(instance_id),
|
180
|
+
volume_type: volume_type
|
181
|
+
)
|
172
182
|
|
173
183
|
logger.info("Creating volume '#{volume.id}'")
|
174
184
|
ResourceWait.for_volume(volume: volume, state: :available)
|
@@ -178,10 +188,16 @@ module Bosh::AwsCloud
|
|
178
188
|
end
|
179
189
|
|
180
190
|
def validate_disk_size(size)
|
181
|
-
raise ArgumentError,
|
191
|
+
raise ArgumentError, 'disk size needs to be an integer' unless size.kind_of?(Integer)
|
182
192
|
|
183
|
-
cloud_error(
|
184
|
-
cloud_error(
|
193
|
+
cloud_error('AWS CPI minimum disk size is 1 GiB') if size < 1024
|
194
|
+
cloud_error('AWS CPI maximum disk size is 1 TiB') if size > 1024 * 1000
|
195
|
+
end
|
196
|
+
|
197
|
+
def validate_disk_type(type)
|
198
|
+
unless %w[gp2 standard].include?(type)
|
199
|
+
cloud_error('AWS CPI supports only gp2 or standard disk type')
|
200
|
+
end
|
185
201
|
end
|
186
202
|
|
187
203
|
##
|
@@ -403,7 +419,7 @@ module Bosh::AwsCloud
|
|
403
419
|
|
404
420
|
# 1. Create and mount new EBS volume (2GB default)
|
405
421
|
disk_size = stemcell_properties["disk"] || 2048
|
406
|
-
volume_id = create_disk(disk_size, current_vm_id)
|
422
|
+
volume_id = create_disk(disk_size, {}, current_vm_id)
|
407
423
|
volume = @ec2.volumes[volume_id]
|
408
424
|
instance = @ec2.instances[current_vm_id]
|
409
425
|
|
data/lib/cloud/aws/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.2707.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.2707.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.2707.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bosh_cpi
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.2707.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.2707.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bosh-registry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.2707.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.2707.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: httpclient
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
version: 0.8.2
|
97
97
|
description: |-
|
98
98
|
BOSH AWS CPI
|
99
|
-
|
99
|
+
3e8bee
|
100
100
|
email: support@cloudfoundry.com
|
101
101
|
executables:
|
102
102
|
- bosh_aws_console
|