bosh_aws_cpi 1.3048.0 → 1.3050.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: a895181be5fda7b597ac103cea1ab79c789642eb
4
- data.tar.gz: 411995eed5826fe564c188c58bb85d849df33d9c
3
+ metadata.gz: 91a6ffeeb7121c9fd177a2b0dd355642b695832d
4
+ data.tar.gz: f237a99b854f437513f636636249421678aefb56
5
5
  SHA512:
6
- metadata.gz: f67601a12ccff2629aa3692b10b793e2ef5dfe03ff6b89b313149513df8a45e9157f471cc103a49890b45e327818bac78693ffc6486fa5187dfe4d46207867a3
7
- data.tar.gz: bb5fb0ca52bd027c713aa6376f4ed4553b8c4e52b884b80b69041bf35be981caf3ac0ca7a6063cb9f65405925839fb9ab0c39d3468eaee877b4c7f552967cb61
6
+ metadata.gz: b26df12a6cc945d231c6c0f1d0f00af09d639a28b6142faea021a31ea1b556a4163ccda7c9d84f3941a8cb015a132386e27979190e4e9cde23bde9714db4f274
7
+ data.tar.gz: 4c1185efa9b629fe42b0bc14808666b2501a9ea77135610b5ce76bf174c6a611f7f7e4c34ce43ae80cce59c7ba4766418268bdddfc4a2b26789fc28b1587932a
data/bin/aws_cpi CHANGED
@@ -6,15 +6,20 @@ require 'bosh/cpi'
6
6
  require 'bosh/cpi/cli'
7
7
 
8
8
  cpi_config = YAML.load_file(ARGV.shift)
9
-
10
9
  cloud_config = OpenStruct.new(:logger => Logger.new(STDERR))
11
10
 
12
11
  Bosh::Clouds::Config.configure(cloud_config)
13
12
 
14
- cloud_properties = cpi_config['cloud']['properties']
15
-
16
- cpi = Bosh::Clouds::Aws.new(cloud_properties)
17
13
  cpi_log = StringIO.new # Empty on AWS
18
- cli = Bosh::Cpi::Cli.new(cpi, cpi_log, STDOUT)
19
14
 
20
- cli.run(ARGF.read)
15
+ cpi_lambda = lambda do
16
+ unless cpi_config.has_key?('cloud') && cpi_config['cloud'].has_key?('properties')
17
+ raise "Could not find cloud properties in the configuration"
18
+ end
19
+ cloud_properties = cpi_config['cloud']['properties']
20
+ Bosh::Clouds::Aws.new(cloud_properties)
21
+ end
22
+
23
+ cli = Bosh::Cpi::Cli.new(cpi_lambda, cpi_log, STDOUT)
24
+
25
+ cli.run(ARGF.read)
@@ -226,6 +226,18 @@ module Bosh::AwsCloud
226
226
  type
227
227
  end
228
228
 
229
+ ##
230
+ # Check whether an OpenStack volume exists or not
231
+ #
232
+ # @param [String] disk_id OpenStack volume UUID
233
+ # @return [bool] whether the specific disk is there or not
234
+ def has_disk?(disk_id)
235
+ with_thread_name("has_disk?(#{disk_id})") do
236
+ @logger.info("Check the presence of disk with id `#{disk_id}'...")
237
+ @ec2.volumes[disk_id].exists?
238
+ end
239
+ end
240
+
229
241
  ##
230
242
  # Delete EBS volume
231
243
  # @param [String] disk_id EBS volume id
@@ -304,14 +316,18 @@ module Bosh::AwsCloud
304
316
  instance = @ec2.instances[instance_id]
305
317
  volume = @ec2.volumes[disk_id]
306
318
 
319
+ if volume.exists?
320
+ detach_ebs_volume(instance, volume)
321
+ else
322
+ @logger.info("Disk `#{disk_id}' not found while trying to detach it from vm `#{instance_id}'...")
323
+ end
324
+
307
325
  update_agent_settings(instance) do |settings|
308
326
  settings["disks"] ||= {}
309
327
  settings["disks"]["persistent"] ||= {}
310
328
  settings["disks"]["persistent"].delete(disk_id)
311
329
  end
312
330
 
313
- detach_ebs_volume(instance, volume)
314
-
315
331
  logger.info("Detached `#{disk_id}' from `#{instance_id}'")
316
332
  end
317
333
  end
@@ -111,6 +111,8 @@ module Bosh::AwsCloud
111
111
  ephemeral_disk_options = resource_pool.fetch("ephemeral_disk", {})
112
112
  ephemeral_disk_options["instance_type"] = resource_pool["instance_type"]
113
113
  instance_params[:block_device_mappings] = block_device_mapping(ephemeral_disk_options)
114
+ instance_params[:placement_group] = resource_pool["placement_group"] if resource_pool["placement_group"]
115
+ instance_params[:dedicated_tenancy] = true if resource_pool["tenancy"] == "dedicated"
114
116
 
115
117
  set_user_data_parameter(instance_params, networks_spec)
116
118
  set_key_name_parameter(instance_params, resource_pool["key_name"], options["aws"]["default_key_name"])
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module AwsCloud
3
- VERSION = '1.3048.0'
3
+ VERSION = '1.3050.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.3048.0
4
+ version: 1.3050.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-08-18 00:00:00.000000000 Z
11
+ date: 2015-08-20 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.3048.0
33
+ version: 1.3050.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.3048.0
40
+ version: 1.3050.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.3048.0
47
+ version: 1.3050.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.3048.0
54
+ version: 1.3050.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.3048.0
61
+ version: 1.3050.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.3048.0
68
+ version: 1.3050.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
- e2c11a
141
+ b92cdc
142
142
  email: support@cloudfoundry.com
143
143
  executables:
144
144
  - aws_cpi