bosh_openstack_cpi 1.2776.0 → 1.2778.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: 6ef2c8cfeafc37da62687558b2ba755b037c0dc8
4
- data.tar.gz: 5ee7a8ea4d09a65b0c582f0f87970cb9a7b47a08
3
+ metadata.gz: 4e9175b478f8388a3f147c73c162cc92b0338596
4
+ data.tar.gz: ba24e8d2ab6a76c7acf1770f2336a3d02f5f1150
5
5
  SHA512:
6
- metadata.gz: 17ff9418b8d023c1fe0b3a062d22ecfc1a6c34ed78a17eda887fbaab0ebd26a55614bcd98fa9134c55f7958ad7e0241b06af980720f6760de0963d3ec045ba24
7
- data.tar.gz: 80fe453b3bf6f21ae945bdc6705e73a275448ae50b347484c3b110be96f32609960fef9fa6009ba1b3b7e617aa4013e22d8d97aa6dd2012eac7632a6ad419020
6
+ metadata.gz: dee6227c51b368c23b3068d07fda3b6950dba6631d38bcf7be8997cc188f0a6ce1247a69167542485ab6e45c52c4d56c29fc0604c01164f37b3212f874f221c6
7
+ data.tar.gz: 804bfdeb2b4f6607aea0ae71b716ed16c194fc70f0ffed43e16afc13e4628a318c46b345c6662b5875c0e2f9521ab5301b742ebf668a8dd00c52ecc2a7b4f2af
@@ -42,6 +42,7 @@ module Bosh::OpenStackCloud
42
42
  @stemcell_public_visibility = @openstack_properties["stemcell_public_visibility"]
43
43
  @wait_resource_poll_interval = @openstack_properties["wait_resource_poll_interval"]
44
44
  @boot_from_volume = @openstack_properties["boot_from_volume"]
45
+ @boot_volume_cloud_properties = @openstack_properties["boot_volume_cloud_properties"] || {}
45
46
 
46
47
  unless @openstack_properties['auth_url'].match(/\/tokens$/)
47
48
  @openstack_properties['auth_url'] = @openstack_properties['auth_url'] + '/tokens'
@@ -87,12 +88,12 @@ module Bosh::OpenStackCloud
87
88
 
88
89
  volume_params = {
89
90
  :provider => "OpenStack",
90
- :openstack_auth_url => @openstack_properties["auth_url"],
91
- :openstack_username => @openstack_properties["username"],
92
- :openstack_api_key => @openstack_properties["api_key"],
93
- :openstack_tenant => @openstack_properties["tenant"],
91
+ :openstack_auth_url => @openstack_properties['auth_url'],
92
+ :openstack_username => @openstack_properties['username'],
93
+ :openstack_api_key => @openstack_properties['api_key'],
94
+ :openstack_tenant => @openstack_properties['tenant'],
94
95
  :openstack_region => @openstack_properties['region'],
95
- :openstack_endpoint_type => @openstack_properties["endpoint_type"],
96
+ :openstack_endpoint_type => @openstack_properties['endpoint_type'],
96
97
  :connection_options => @openstack_properties['connection_options'].merge(extra_connection_options)
97
98
  }
98
99
  begin
@@ -249,14 +250,6 @@ module Bosh::OpenStackCloud
249
250
  cloud_error("Key-pair `#{keyname}' not found") if keypair.nil?
250
251
  @logger.debug("Using key-pair: `#{keypair.name}' (#{keypair.fingerprint})")
251
252
 
252
- if @boot_from_volume
253
- boot_vol_size = flavor.disk * 1024
254
-
255
- boot_vol_id = create_boot_disk(boot_vol_size, stemcell_id)
256
- cloud_error("Failed to create boot volume.") if boot_vol_id.nil?
257
- @logger.debug("Using boot volume: `#{boot_vol_id}'")
258
- end
259
-
260
253
  use_config_drive = !!@openstack_properties.fetch("config_drive", nil)
261
254
 
262
255
  server_params = {
@@ -274,6 +267,12 @@ module Bosh::OpenStackCloud
274
267
  server_params[:availability_zone] = availability_zone if availability_zone
275
268
 
276
269
  if @boot_from_volume
270
+ boot_vol_size = flavor.disk * 1024
271
+
272
+ boot_vol_id = create_boot_disk(boot_vol_size, stemcell_id, availability_zone, @boot_volume_cloud_properties)
273
+ cloud_error("Failed to create boot volume.") if boot_vol_id.nil?
274
+ @logger.debug("Using boot volume: `#{boot_vol_id}'")
275
+
277
276
  server_params[:block_device_mapping] = [{
278
277
  :volume_size => "",
279
278
  :volume_id => boot_vol_id,
@@ -391,17 +390,21 @@ module Bosh::OpenStackCloud
391
390
  # this disk will be attached to
392
391
  # @return [String] OpenStack volume UUID
393
392
  def create_disk(size, cloud_properties, server_id = nil)
394
- with_thread_name("create_disk(#{size}, #{server_id})") do
393
+ with_thread_name("create_disk(#{size}, #{cloud_properties}, #{server_id})") do
395
394
  raise ArgumentError, 'Disk size needs to be an integer' unless size.kind_of?(Integer)
396
395
  cloud_error('Minimum disk size is 1 GiB') if (size < 1024)
397
396
  cloud_error('Maximum disk size is 1 TiB') if (size > 1024 * 1000)
398
397
 
399
398
  volume_params = {
400
- :name => "volume-#{generate_unique_name}",
401
- :description => '',
399
+ :display_name => "volume-#{generate_unique_name}",
400
+ :display_description => '',
402
401
  :size => (size / 1024.0).ceil
403
402
  }
404
403
 
404
+ if cloud_properties.has_key?('type')
405
+ volume_params[:volume_type] = cloud_properties['type']
406
+ end
407
+
405
408
  if server_id
406
409
  server = with_openstack { @openstack.servers.get(server_id) }
407
410
  if server && server.availability_zone
@@ -410,12 +413,12 @@ module Bosh::OpenStackCloud
410
413
  end
411
414
 
412
415
  @logger.info('Creating new volume...')
413
- volume = with_openstack { @openstack.volumes.create(volume_params) }
416
+ new_volume = with_openstack { @volume.volumes.create(volume_params) }
414
417
 
415
- @logger.info("Creating new volume `#{volume.id}'...")
416
- wait_resource(volume, :available)
418
+ @logger.info("Creating new volume `#{new_volume.id}'...")
419
+ wait_resource(new_volume, :available)
417
420
 
418
- volume.id.to_s
421
+ new_volume.id.to_s
419
422
  end
420
423
  end
421
424
 
@@ -425,9 +428,11 @@ module Bosh::OpenStackCloud
425
428
  # @param [Integer] size disk size in MiB
426
429
  # @param [String] stemcell_id OpenStack image UUID that will be used to
427
430
  # populate the boot volume
431
+ # @param [optional, String] availability_zone to be passed to the volume API
432
+ # @param [optional, String] volume_type to be passed to the volume API
428
433
  # @return [String] OpenStack volume UUID
429
- def create_boot_disk(size, stemcell_id)
430
- with_thread_name("create_boot_disk(#{size}, #{stemcell_id})") do
434
+ def create_boot_disk(size, stemcell_id, availability_zone = nil, boot_volume_cloud_properties = {})
435
+ with_thread_name("create_boot_disk(#{size}, #{stemcell_id}, #{availability_zone}, #{boot_volume_cloud_properties})") do
431
436
  raise ArgumentError, "Disk size needs to be an integer" unless size.kind_of?(Integer)
432
437
  cloud_error("Minimum disk size is 1 GiB") if (size < 1024)
433
438
  cloud_error("Maximum disk size is 1 TiB") if (size > 1024 * 1000)
@@ -438,6 +443,9 @@ module Bosh::OpenStackCloud
438
443
  :imageRef => stemcell_id
439
444
  }
440
445
 
446
+ volume_params[:availability_zone] = availability_zone if availability_zone
447
+ volume_params[:volume_type] = boot_volume_cloud_properties["type"] if boot_volume_cloud_properties["type"]
448
+
441
449
  @logger.info("Creating new boot volume...")
442
450
  boot_volume = with_openstack { @volume.volumes.create(volume_params) }
443
451
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Bosh
5
5
  module OpenStackCloud
6
- VERSION = '1.2776.0'
6
+ VERSION = '1.2778.0'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_openstack_cpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2776.0
4
+ version: 1.2778.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piston Cloud Computing / VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2776.0
33
+ version: 1.2778.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.2776.0
40
+ version: 1.2778.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.2776.0
47
+ version: 1.2778.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.2776.0
54
+ version: 1.2778.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.2776.0
61
+ version: 1.2778.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.2776.0
68
+ version: 1.2778.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: httpclient
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ dependencies:
110
110
  version: 1.1.0
111
111
  description: |-
112
112
  BOSH OpenStack CPI
113
- 5aa001
113
+ 6fc63f
114
114
  email: support@cloudfoundry.com
115
115
  executables:
116
116
  - bosh_openstack_console