bosh_aws_cpi 1.3030.0 → 1.3031.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4965f9f0d2b381649e82fe2e57aba71dacbcbc57
4
- data.tar.gz: 5fe8aaa94e3eb5fee8aba784bbf44790935d6219
3
+ metadata.gz: 59a5f2fb7509143ceda98865419a16936d8ba3c9
4
+ data.tar.gz: 740037fcc6138ff5f1c2019ed7338071a144e5f4
5
5
  SHA512:
6
- metadata.gz: e91eeddad8d07fa2169a0ef434584835b951113d9579c84d86868fb9377727493814b855249358b9317c2012f0be90ff8cdea73b34014fce40f12beeaea83020
7
- data.tar.gz: 14874ddedfb9fe5241fc5a00b89f83ad6c9cfd4be5eb0550b34a088d891eff4cee0436f60ccf3e722967300eb8ec325ad7f5a34e1f4ba07239bf8bb922b11099
6
+ metadata.gz: abbd722afa8f46a9aa3a80d04b08d23cb490de853d461bc864accc5877d38802fbc64f6995475b492cc4d22bacaec13ec21e97bfb3026695eba8b1d7566fe1df
7
+ data.tar.gz: 41f2af399dce8af887b11c9bb697934f8ea8fffeae68061cae4fd7d959eb637c272d8849b8d6956d582e35a172c0fb33396323bc51500eb6273f5c2020ef930f
@@ -7,6 +7,19 @@ module Bosh::AwsCloud
7
7
  { '/dev/sdb' => 'ephemeral0' }
8
8
  end
9
9
 
10
+ def ebs_ephemeral_disk_mapping(volume_size_in_gb, volume_type)
11
+ [
12
+ {
13
+ device_name: '/dev/sdb',
14
+ ebs: {
15
+ volume_size: volume_size_in_gb,
16
+ volume_type: volume_type,
17
+ delete_on_termination: true,
18
+ },
19
+ },
20
+ ]
21
+ end
22
+
10
23
  ##
11
24
  # Raises CloudError exception
12
25
  #
@@ -5,6 +5,62 @@ module Bosh::AwsCloud
5
5
  class InstanceManager
6
6
  include Helpers
7
7
 
8
+ InstanceStorageMap = {
9
+ # previous generation
10
+ 'm1.small' => 160,
11
+ 'm1.medium' => 410,
12
+ 'm1.large' => 420,
13
+ 'm1.xlarge' => 420,
14
+
15
+ 'c1.medium' => 350,
16
+ 'c1.xlarge' => 420,
17
+
18
+ 'cc2.8xlarge' => 840,
19
+
20
+ 'cg1.4xlarge' => 840,
21
+
22
+ 'm2.xlarge' => 420,
23
+ 'm2.2xlarge' => 850,
24
+ 'm2.4xlarge' => 840,
25
+
26
+ 'cr1.8xlarge' => 120,
27
+
28
+ 'hi1.4xlarge' => 1024,
29
+
30
+ 'hs1.8xlarge' => 2000,
31
+
32
+ # current generation
33
+ 'm3.medium' => 4,
34
+ 'm3.large' => 32,
35
+ 'm3.xlarge' => 40,
36
+ 'm3.2xlarge' => 80,
37
+
38
+ 'c3.large' => 16,
39
+ 'c3.xlarge' => 40,
40
+ 'c3.2xlarge' => 80,
41
+ 'c3.4xlarge' => 160,
42
+ 'c3.8xlarge' => 320,
43
+
44
+ 'r3.large' => 32,
45
+ 'r3.xlarge' => 80,
46
+ 'r3.2xlarge' => 160,
47
+ 'r3.4xlarge' => 320,
48
+ 'r3.8xlarge' => 320,
49
+
50
+ 'g2.2xlarge' => 60,
51
+ 'g2.8xlarge' => 120,
52
+
53
+ 'i2.xlarge' => 800,
54
+ 'i2.2xlarge' => 800,
55
+ 'i2.4xlarge' => 800,
56
+ 'i2.8xlarge' => 800,
57
+
58
+ 'd2.xlarge' => 2000,
59
+ 'd2.2xlarge' => 2000,
60
+ 'd2.4xlarge' => 2000,
61
+ 'd2.8xlarge' => 2000
62
+ }
63
+
8
64
  def initialize(region, registry, elb, az_selector, logger)
9
65
  @region = region
10
66
  @registry = registry
@@ -53,6 +109,7 @@ module Bosh::AwsCloud
53
109
  instance_params[:instance_type] = resource_pool["instance_type"]
54
110
 
55
111
  ephemeral_disk_options = resource_pool.fetch("ephemeral_disk", {})
112
+ ephemeral_disk_options["instance_type"] = resource_pool["instance_type"]
56
113
  instance_params[:block_device_mappings] = block_device_mapping(ephemeral_disk_options)
57
114
 
58
115
  set_user_data_parameter(instance_params, networks_spec)
@@ -94,22 +151,25 @@ module Bosh::AwsCloud
94
151
  ephemeral_volume_size_in_mb = ephemeral_disk_options.fetch('size', 0)
95
152
  ephemeral_volume_size_in_gb = (ephemeral_volume_size_in_mb / 1024.0).ceil
96
153
  ephemeral_volume_type = ephemeral_disk_options.fetch('type', 'standard')
154
+ instance_type = ephemeral_disk_options.fetch('instance_type', '')
97
155
 
98
156
  if ephemeral_volume_size_in_mb > 0
99
- [
100
- {
101
- device_name: '/dev/sdb',
102
- ebs: {
103
- volume_size: ephemeral_volume_size_in_gb,
104
- volume_type: ephemeral_volume_type,
105
- delete_on_termination: true,
106
- },
107
- },
108
- ]
157
+ instance_storage_size_gb = InstanceManager::InstanceStorageMap[instance_type]
158
+
159
+ if instance_storage_size_gb != nil && instance_storage_size_gb >= ephemeral_volume_size_in_gb
160
+ # Use instance storage as it is enough for the ephemeral disk
161
+ @logger.debug('Use instance storage to create the virtual machine')
162
+ block_device_mapping_param = default_ephemeral_disk_mapping
163
+ else
164
+ @logger.debug('Use EBS storage to create the virtual machine')
165
+ block_device_mapping_param = ebs_ephemeral_disk_mapping ephemeral_volume_size_in_gb, ephemeral_volume_type
166
+ end
109
167
  else
110
168
  # m3 instances require that instance storage mappings be specified when the instance is created... [#84893804]
111
- default_ephemeral_disk_mapping
169
+ block_device_mapping_param = default_ephemeral_disk_mapping
112
170
  end
171
+
172
+ block_device_mapping_param
113
173
  end
114
174
 
115
175
  def set_key_name_parameter(instance_params, resource_pool_key_name, default_aws_key_name)
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module AwsCloud
3
- VERSION = '1.3030.0'
3
+ VERSION = '1.3031.0'
4
4
  end
5
5
  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: 1.3030.0
4
+ version: 1.3031.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-07-29 00:00:00.000000000 Z
11
+ date: 2015-07-31 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.3030.0
33
+ version: 1.3031.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.3030.0
40
+ version: 1.3031.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.3030.0
47
+ version: 1.3031.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.3030.0
54
+ version: 1.3031.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.3030.0
61
+ version: 1.3031.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.3030.0
68
+ version: 1.3031.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: httpclient
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  version: '0'
139
139
  description: |-
140
140
  BOSH AWS CPI
141
- e44674
141
+ 486f96
142
142
  email: support@cloudfoundry.com
143
143
  executables:
144
144
  - aws_cpi